<?php include 'inc_classes.php'; 
include "admin_authentication.php";
$action = $_POST['action']; 
if($action=='admin_attendance') 
{
    $status = $_POST['status']; 
    $current_timestamp = time();
    $added_dates=date('Y-m-d H:i:s');
    $years=date('Y');
    $months=date('m');
    $days=date('t');
    
	$sel_staf="select attendence_id,cm_id from site_setting where 1 and admin_id='".$_SESSION['admin_id']."' ";
    $ptr_staff=mysql_query($sel_staf);
    $data_staff=mysql_fetch_array($ptr_staff);

    // $online_status=$data_staff['online_status'];
    $attendence_id=$data_staff['attendence_id'];
    $cm_ids=$data_staff['cm_id'];
    if($status=='CheckIn'){
        $ins_checkin="insert into pr_pune_biometric_attendance(`ServiceTagId`,`UserID`,`AttendanceTime`,`AttendanceType`,`Operation`,`InputType`,`PunchTime`,`year`,`month`,`days`,`cm_id`) values('BKU7194660063','".$attendence_id."','".$current_timestamp."','".$status."','RealTimePunchLog','Fingerprint','".$added_dates."','".$years."','".$months."','".$days."','".$cm_ids."')";
        $ptr_checkin=mysql_query($ins_checkin);  
    }
    if($status=='CheckOut'){
        $ins_checkout="insert into pr_pune_biometric_attendance(`ServiceTagId`,`UserID`,`AttendanceTime`,`AttendanceType`,`Operation`,`InputType`,`PunchTime`,`year`,`month`,`days`,`cm_id`) values('BKU7194660063','".$attendence_id."','".$current_timestamp."','".$status."','RealTimePunchLog','Fingerprint','".$added_dates."','".$years."','".$months."','".$days."','".$cm_ids."')";
            $ptr_checkout=mysql_query($ins_checkout); 
    }      
}
?>