Compare commits
6 Commits
dev1.0.0
...
b3185f966c
| Author | SHA1 | Date | |
|---|---|---|---|
| b3185f966c | |||
| 420873584e | |||
| f69ef32f84 | |||
| cc58529145 | |||
| 29180b036c | |||
| 8b2bc5229b |
@ -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");
|
||||
|
||||
2659
dbhcm_20250625.sql
2659
dbhcm_20250625.sql
File diff suppressed because one or more lines are too long
113
fixingcheckoutbydate.php
Normal file
113
fixingcheckoutbydate.php
Normal file
@ -0,0 +1,113 @@
|
||||
|
||||
<?php
|
||||
include('zklib/ZKLib.php');
|
||||
|
||||
class LogController
|
||||
{
|
||||
// $ppHCMTT#2024
|
||||
|
||||
public function fn_getconn(){
|
||||
$pdo = new PDO("mysql:host=localhost;dbname=dbhcm", "apphcm", "\$ppHCMTT#2024");
|
||||
return $pdo;
|
||||
}
|
||||
public function selectquerySP($sql){
|
||||
// $pdo = new PDO("mysql:host=".DB_HOST_NAME.";dbname=".DB_IMS, DB_USER_NAME, DB_USER_PASS);
|
||||
$pdo = $this->fn_getconn(); //new PDO("mysql:host=localhost;dbname=dbhcm", "apphcm", "\$pp");
|
||||
$q = $pdo->query($sql);
|
||||
$q->setFetchMode(PDO::FETCH_ASSOC);
|
||||
return $q;
|
||||
}
|
||||
|
||||
public function executeSP($qry){
|
||||
$rtn=false;
|
||||
$pdo = $this->fn_getconn();
|
||||
$statement = $pdo->prepare($qry);
|
||||
if($statement->execute()){
|
||||
$rtn=true;
|
||||
}
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
public function fn_getfieldvalue($fieldname,$qry){
|
||||
$rs=$this->selectquerySP($qry);
|
||||
$rtn="";
|
||||
if($rs){
|
||||
// $rw=$rs->fetch();
|
||||
// $rtn=$rw[$fieldname];
|
||||
while($rw=$rs->fetch()){
|
||||
$rtn=$rw[$fieldname];
|
||||
}
|
||||
}
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
public function fn_getfieldsvalues($fieldname,$qry){
|
||||
$rs=$this->selectquerySP($qry);
|
||||
$rtn="";
|
||||
if($rs){
|
||||
// $rw=$rs->fetch();
|
||||
// $rtn=$rw[$fieldname];
|
||||
while($rw=$rs->fetch()){
|
||||
$d=explode(",",$fieldname);
|
||||
for($i=0;$i<count($d);$i++){
|
||||
$rtn.=$rw[$d[$i]].",";
|
||||
}
|
||||
|
||||
}
|
||||
// echo $rtn;return false;
|
||||
$rtn=substr($rtn,0,strlen($rtn)-1);
|
||||
}
|
||||
return explode(",",$rtn);
|
||||
}
|
||||
|
||||
|
||||
public function index(){
|
||||
$argv=$_SERVER['argv'];
|
||||
// echo $argv[1];return false;
|
||||
$date=(isset($argv[1]) ? $argv[1] : "");
|
||||
|
||||
if(!$date){
|
||||
echo "Parameter tanggal belum dimasukkan \n";return false;
|
||||
}
|
||||
|
||||
$rtn=false;
|
||||
//$qry="select * from tbl_attendancelist where isdeleted=0 and nik in('000188','000162','000453','000737')";
|
||||
$qry="select * from tbl_attendancelist where (cast(idt as date)=cast('$date' as date) and isdeleted=0) or duration is null";
|
||||
$rs=$this->selectquerySP($qry);
|
||||
if($rs){
|
||||
while($rw=$rs->fetch()){
|
||||
$idxdept=$rw['idxdept'];
|
||||
if($idxdept==33||$idxdept==34||$idxdept==30||$idxdept==31||$idxdept==22){
|
||||
$qry="update tbl_attendancelist
|
||||
set duration=SEC_TO_TIME(TIMESTAMPDIFF(SECOND,checkin,checkout))
|
||||
where _idx='".$rw["_idx"]."'";
|
||||
}
|
||||
else{
|
||||
$qry="update tbl_attendancelist
|
||||
set duration=SEC_TO_TIME(TIMESTAMPDIFF(SECOND,checkin,R1)+TIMESTAMPDIFF(SECOND,R2,checkout))
|
||||
where _idx='".$rw["_idx"]."'";
|
||||
}
|
||||
echo $qry."\n";
|
||||
$this->executeSP($qry);
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$cl = new LogController();
|
||||
$rtn =$cl->index();
|
||||
|
||||
#if(isset($_REQUEST['isgetdata'])){
|
||||
# echo "indx";
|
||||
# $rtn = $cl->index();
|
||||
#}
|
||||
#else{
|
||||
# $rtn = $cl->fn_curl();
|
||||
#}
|
||||
|
||||
echo $rtn;
|
||||
@ -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){
|
||||
|
||||
@ -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){
|
||||
|
||||
Reference in New Issue
Block a user