<?php                                                                        
    // Check if delete button active, start this
    if(isset($_POST['check'])){
        
        $del_id=$_POST['check'];

        if(!$sqli = mysql_query("UPDATE gate_pass SET secretary = '$staffID',reported=NOW() WHERE gatepassID='$del_id'")){
            echo'<div class="alert alert-danger absolue center text-center" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <span class="text-danger">'.mysql_error().'</span>
                </div>';
        }else
        {           
            $_SESSION["check_success"]='True';
            header('Location:pass.php');
            echo "<script type='text/javascript'> document.location = 'pass.php'; </script>";
            exit();
        }
    } 
    
    // Check if delete button active, start this
    if(isset($_POST['check_in'])){
        
        $del_id=$_POST['check_in'];

        if(!$sqli = mysql_query("UPDATE gate_pass SET secretary = '$staffID',reported=NOW() WHERE gatepassID='$del_id'")){
            echo'<div class="alert alert-danger absolue center text-center" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <span class="text-danger">'.mysql_error().'</span>
                </div>';
        }else
        {           
            $_SESSION["check_success"]='True';
            header('Location:expired-pass.php');
            echo "<script type='text/javascript'> document.location = 'expired-pass.php'; </script>";
            exit();
        }
    } 
?>                                                             