ok

Mini Shell

Direktori : /home2/selectio/public_html/tnpsctestbatch.com/admin/old/api/backups/
Upload File :
Current File : /home2/selectio/public_html/tnpsctestbatch.com/admin/old/api/backups/api-leave-requesting.php

<?php 
ob_start();
session_start();
include"../config/config.php"; 
date_default_timezone_set("Asia/Kolkata");   //India time (GMT+5:30)
    $checkin_time= date('H:i:s');
    $date = date('Y-m-d');
    $emp_id=0;
    if(isset($_SESSION['hrm'])){
        $emp_id=$_SESSION['hrm']['id'];
    }
    
    if($emp_id==''){
        $emp_id=0;
    }
    
$statement = $pdo->prepare("select * from tbl_leave_request where status=0 order by id asc");
        $statement->execute();
		$query = $statement->fetchAll(PDO::FETCH_ASSOC);
        $totalFiltered = $statement->rowCount();

$response=array();
	if($totalFiltered>0)
	{
	    $response=$query;
	}
//	$f="SELECT * FROM `tbl_attendance` where empid=".$emp_id." and att_date='".$date."'";
//	error_log('ATT :'.$f);
	    $statement = $pdo->prepare("SELECT * FROM `tbl_attendance` where empid=".$emp_id." and att_date='".$date."'");
		$statement->execute(); 
		$result = $statement->fetchAll(PDO::FETCH_ASSOC);
		if($result){
		if($result[0]['check_out']!='00:00:00'){
		    $total_rows=0;
		}else{
		    $total_rows=1;
		}
		}else{
		    $total_rows=0;
		}
	
	  $datas[] = array('status'=>$response,'count'=>$totalFiltered,'counts'=>$total_rows);
	  
    echo json_encode($datas);

?>

Zerion Mini Shell 1.0