Compare commits

19 Commits

Author SHA1 Message Date
aa2e02beac fixing idxdept 2025-08-28 13:09:05 +07:00
a74010325f Remove unnecessary condition from attendance log query 2025-07-07 13:46:17 +07:00
e9e2b81cf0 Merge branch 'dev1.0.0' into main 2025-07-01 07:38:29 +07:00
b3ae073d01 Update file permissions for multiple PHP scripts 2025-06-30 15:07:28 +07:00
92c069d852 Merge branch 'dev1.0.0' 2025-06-30 15:06:47 +07:00
4b1b65b38b Merge branch 'dev1.0.0' 2025-06-30 14:59:13 +07:00
5d9fe2757d Merge branch 'dev1.0.0' 2025-06-30 14:54:05 +07:00
f9648cd682 Merge branch 'dev1.0.0' 2025-06-30 07:18:04 +07:00
6893788bd2 Merge branch 'dev1.0.0' 2025-06-30 06:36:29 +07:00
e96358d652 Merge branch 'dev1.0.0' 2025-06-27 15:59:40 +07:00
ca530ec17c Merge branch 'dev1.0.0' 2025-06-27 15:51:12 +07:00
0923f5e0e0 Merge branch 'dev1.0.0' 2025-06-27 08:07:03 +07:00
c830d3f90c Merge branch 'dev1.0.0' 2025-06-27 08:03:07 +07:00
b3185f966c Implement LogController for attendance checkout processing and duration calculation 2025-06-27 08:01:39 +07:00
420873584e Merge branch 'dev1.0.0' 2025-06-25 21:19:54 +07:00
f69ef32f84 Update database connection to use localhost for consistency 2025-06-25 20:59:37 +07:00
cc58529145 Merge branch 'dev1.0.0' 2025-06-25 20:47:22 +07:00
29180b036c Implement new feature for user authentication and improve error handling 2025-06-25 19:56:26 +07:00
8b2bc5229b Update database host configuration to use localhost 2025-06-25 19:52:25 +07:00
15 changed files with 22 additions and 2669 deletions

View File

@ -2,8 +2,8 @@
if(preg_match("/libdefine.php/i", $_SERVER['PHP_SELF'])){header("location: index.php");die;}
// ==== My SERVER CONFIG
DEFINE("DB_HCM","dbhcm");
// DEFINE("DB_HOST_NAME","localhost");
DEFINE("DB_HOST_NAME","192.168.1.4");
DEFINE("DB_HOST_NAME","localhost");
// DEFINE("DB_HOST_NAME","192.168.1.4");
// DEFINE("DB_USER_NAME","antrian");
// DEFINE("DB_USER_NAME","appproject");
DEFINE("DB_USER_NAME","apphcm");

File diff suppressed because one or more lines are too long

0
fixingcheckinlate.php Normal file → Executable file
View File

0
fixingcheckout.php Normal file → Executable file
View File

0
fixingcheckoutbydate.php Normal file → Executable file
View File

0
fixingr2late.php Normal file → Executable file
View File

0
getattsync.php Normal file → Executable file
View File

0
getattsync2.php Normal file → Executable file
View File

0
getattsyncbydate.php Normal file → Executable file
View File

0
getdatadevices.php Normal file → Executable file
View File

0
getdatadevices2.php Normal file → Executable file
View File

0
getdatadevicesbydate.php Normal file → Executable file
View File

10
getdatadevicesbyip.php Normal file → Executable file
View File

@ -82,8 +82,8 @@ class LogController
public function index()
{
$ip = "192.168.100.76"; //$row['deviceip'];
$qry="select * from tbl_deviceinfo where _idx=36 and isdeleted=0 order by _idx asc";
$ip = "172.16.116.5"; //$row['deviceip'];
$qry="select * from tbl_deviceinfo where isreprocess=1 and isdeleted=0 order by _idx asc";
#echo $qry;
$rs=$this->selectquerySP($qry);
if($rs){
@ -107,7 +107,7 @@ class LogController
$data = [];
foreach ($getData as $att) {
// echo date("Y-m-d", strtotime($att['timestamp']));
if (date("Y-m-d", strtotime($att['timestamp'])) == date("Y-m-d")) {
if (date("Y-m-d", strtotime($att['timestamp'])) == date("Y-m-d",strtotime($rw['reprocessdate']))) {
// $data[] = [
// "idUser" => $att['id'],
// "name" => isset($users[$att['id']]) ? $users[$att['id']]['name'] : $att['id'],
@ -117,12 +117,12 @@ class LogController
// "deviceIP" => $ip
// ];
// echo json_encode($att)."\n";
$res=$this->fn_setattendance($att, $ip);
// $res=$this->fn_setattendance($att, $ip);
$reslog=$this->fn_setattendancelogs($att, $ip);
$data[] = [
"fingerid" => $att['id'],
"time" => date("Y-m-d H:i:s", strtotime($att['timestamp'])),
"status" => $res
"status" => $reslog
];
}
}

14
getdatadevicesbylogs.php Normal file → Executable file
View File

@ -7,7 +7,7 @@ class LogController
// $ppHCMTT#2024
public function fn_getconn(){
$pdo = new PDO("mysql:host=192.168.1.4;dbname=dbhcm", "apphcm", "\$ppHCMTT#2024");
$pdo = new PDO("mysql:host=localhost;dbname=dbhcm", "apphcm", "\$ppHCMTT#2024");
return $pdo;
}
public function selectquerySP($sql){
@ -719,10 +719,22 @@ class LogController
$rtn=true;
return $rtn;
}
public function fn_idxdept(){
$qry="update tbl_attendanceemployee a, tbl_employee e set a.idxdept = e.idxdept
where e._idx=a.idxemployee and a.idxdept=0";
$this->executeSP($qry);
$qry="update tbl_attendancelist a, tbl_employee e set a.idxdept = e.idxdept
where e._idx=a.idxemployee and a.idxdept=0";
$this->executeSP($qry);
return true;
}
}
$cl = new LogController();
$rtn =$cl->index();
$rtn =$cl->fn_idxdept();
#if(isset($_REQUEST['isgetdata'])){
# echo "indx";

4
getdatadevicesbylogsbydates.php Normal file → Executable file
View File

@ -7,7 +7,7 @@ class LogController
// $ppHCMTT#2024
public function fn_getconn(){
$pdo = new PDO("mysql:host=192.168.1.4;dbname=dbhcm", "apphcm", "\$ppHCMTT#2024");
$pdo = new PDO("mysql:host=localhost;dbname=dbhcm", "apphcm", "\$ppHCMTT#2024");
return $pdo;
}
public function selectquerySP($sql){
@ -78,7 +78,7 @@ class LogController
$argv=$_SERVER['argv'];
// echo $argv[1];return false;
$qry="select * from tbl_attendancelogs
where cast(dates as date)=cast('".$argv[1]."' as date) and isprocess=0
where cast(dates as date)=cast('".$argv[1]."' as date)
order by _idx asc";
$rs=$this->selectquerySP($qry);
if($rs){