File manager - Edit - /home/autoph/public_html/api/asa/asa_getMyAttendance.php
Back
<?php include '../../../cfg/connhr.php'; $mykey = "6e59e008b5348b452b615a3033729daae383TITO";//$_GET['keyID']; if($mykey =="6e59e008b5348b452b615a3033729daae383TITO"){ $userID = 1274;//$_GET['userID']; $endDate = '2024-08-09';//$_GET['endDate']; $startDate = '2024-08-01';//$_GET['startDate']; $sql = "SELECT `time_keeping_id` AS timeKeepingID FROM `employees` WHERE `employee_id`='$employeeID' AND `enabled`= 1 LIMIT 1"; $result = $connhr->query($sql); if ($result->num_rows > 0) { while($rowID = $result->fetch_assoc()) { $timeKeepingID = $rowID['timeKeepingID']; } } // SQL query $sql = "SELECT * FROM timelogs WHERE time_keeping_id = $timeKeepingID AND DATE(`datetimelog`) BETWEEN '$startDate' AND '$endDate' GROUP BY datetimelog ORDER BY `id` ASC "; $result = $connhr->query($sql); if ($result->num_rows > 0) { // Array to hold the results $rows = array(); // Fetch data from each row and add it to the array while($row = $result->fetch_assoc()) { $rows[] = $row; } // Output the result in JSON format } header('Content-Type: application/json'); echo json_encode([$rows,"userID"=>"$userID",,"timeKeepingID"=>"$timeKeepingID"]); } $connhr->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings