0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.88.104


Current Path : /var/www/html/oums/api/
Upload File :
Current File : /var/www/html/oums/api/getMyAttendanceList.php

<?php

include("sys_connect.php");

if(!isset($_GET["emplcode"]) || !isset($_GET["month"]) || !isset($_GET["year"]) 
|| $_GET["emplcode"] == "" || $_GET["month"] == "" || $_GET["year"] == "" ){
    echo json_encode(array("msg" => "Invalid Params", "error_code" => -1));
    die();    
}
$emplcode = $_GET["emplcode"];
$month = $_GET["month"];
$year = $_GET["year"];

$query = "select date_format(fattndate,'%d/%m/%Y') as fattndate, flogitime, flogotime, fattnstat 
from attendance where femplcode = '{$emplcode}'
and year(fattndate) = '{$year}' and month(fattndate) = '{$month}'
order by fattndate desc";
$myres = mysqli_query($mycon, $query);
$mycnt = mysqli_num_rows($myres);
if($mycnt > 0) {
    $res = [];
    $i = 0;
    while($row = mysqli_fetch_assoc($myres)){
        $res[$i] = $row;
        $i++;
    }
    echo json_encode(array("error_code" => 0, 'data' => $res ));
}
else {
    echo json_encode(array("error_code" => -1, 'data'=> [], 'msg' => "Data Not found!!!" ));
}