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.17.78.184


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

<?php
include("sys_connect.php");

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

$emplcode = $_GET["emplcode"];

$query = "select fdeptcode, fattndate, femplcode, fattnstat, flogitime,flocation, 
fdistance, ftype from attenddet where fattndate = date(now())
and femplcode = '{$emplcode}' 
order by flogitime desc";

$myres = mysqli_query($mycon, $query);
$det = array();
$i = 0;
while($row = mysqli_fetch_assoc($myres)){
    $det[$i] = $row;
    $i++;
}
$res['det'] = $det;

$query = "select * from attendance where fattndate = date(now())
and femplcode = '{$emplcode}'";

$myres = mysqli_query($mycon, $query);
$row = mysqli_fetch_assoc($myres);
if($i===0){
    $row['ftype'] = 'O';
}
$res['head'] = $row;


$query = "select concat('Is your salary of Rs. ', famount, ' for the month ', 
fmonth, ' credited to your bank account ?') as fmessage, fmonth
from saldet where fcrdate <= date(now()) and ifnull(fcredited,'') <> 'T' 
and femplcode = '{$emplcode}'";

$myres = mysqli_query($mycon, $query);
$row = mysqli_fetch_assoc($myres);

$res['sal'] = $row;

echo json_encode(array("error_code" => 0, 'data'=> $res ));