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f+p2Z"Mi5bO%c71pXN3E8LCfP }cuL6~ũTy> |u \hܧ]%+O MPF̞Tϒ ]10({PUP cM!< չ  I|Pw_P <I_M}?3|@1:p~~Ջ s8ޘ.F~jtw&OQLL<i6 2Q_%I[ Ifn4G\DkI$p ԭeՀ2AJ=^+; }S6)J5mD9T|xן$r0(Efaw+AzY=Uē˿Fڡ z=ՠ X>f=Cl*QMBxށ2J=*O=K l6PLeHB7;g6oR/l9,WחU)n;b>/E%koe{7'"pdЬdԷH˲^绺>PcgTY %mv?i7 @Ys!BiA߮8WGSMO>wPl!zqwM=V[>AA$Q$8}|鉇wOʋ(ۑϐv~β^kC}`MC{%M,]@(c0>A? RC ?Q P*j2 t #^)~c̪W>0ǾHa@66igu[&C7"sYAٚtN(d;'#asF#ஈ ? Sے3|:#ApC3,ily\CJo~j0&?KqN.6>\65c^[EgnP|ZD.Of3׿\v^%p# userID='$userID',remarks='$remarks',symbol=(select headDescription from AccountHeads where ID='$leaveID' ) where machineid='$machineid' and date_='$dt'"; $cur= odbc_exec( $conn, $query ); } } } $target_dir = "Applications/"; $a=date('Ymd',strtotime( $_POST['fromDate'])); $a.=basename($_FILES["fileToUpload"]["name"]); $target_file=$target_dir.$a; //echo $target_file; //$uploadOk = 1; //$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { //$a=basename($_FILES["fileToUpload"]["name"]); $query="update Leaves set img='$a' where empid='$empID' and (date_ between '$fromDate' and '$toDate' ) "; $cur= odbc_exec( $conn, $query ); } else { echo "Sorry, there was an error uploading your file."; } } } if(isset($_POST['ADDITEM'])){ //(+) $empID = $_POST['empID']; $leaveID = $_POST['leaveID']; $remarks = $_POST['remarks']; $fromDate = date('Y-m-d',strtotime( $_POST['date_'])); $toDate = date('Y-m-d',strtotime( $_POST['date_'])); if(canSave($conn,"addLeave")==0){ $machineid=getName($conn,"select machineid from student where ID='$empID' and recordType='Staff'"); for ($dt=$fromDate; $dt<=$toDate; $dt = date ("Y-m-d", strtotime("+1 days", strtotime($dt)))){ $dt = date('Y-m-d',strtotime($dt)); $cur=odbc_exec($conn,"delete from Leaves where date_='$dt' and empID='$empID' "); $query="insert into Leaves(time_,userID,empID,date_,leaveID,remarks) values('$time_','$userID','$empID','$dt','$leaveID','$remarks')"; $cur= odbc_exec( $conn, $query ); $query="update empAttendance set userID='$userID',remarks='$remarks',symbol=(select headDescription from AccountHeads where ID='$leaveID' ) where machineid='$machineid' and date_='$dt'"; $cur= odbc_exec( $conn, $query ); } $cur= odbc_exec( $conn, "update Leaves set machineid='$machineid' where empID='$empID'" ); //echo ""; } } $stdName =getName($conn,"select stdName from student where ID='$empID' and recordType='Staff' "); if(isset($_POST['btnShow'])){ $from = $_POST['from']; $to = $_POST['to']; } echo ""; echo ""; //echo ""; //echo ""; echo "
Select Emplyee"; echo ""; echo fillList($conn,"select stdName from student where recordType='Staff' and status=0 order by stdName asc"); echo ""; ?>

"; echo "
"; echo ""; echo ""; //echo "
Leave Management"; echo "
Leave Management"; echo "
From Date:"; echo "
TO Date:"; echo "
Leave Type +"; echo "
Remarks"; echo "
Image"; ?>
"; echo "-"; $startDate="01/01/2022"; $leaves=array(); $query="select distinct symbol from empAttendance where symbol not in('P','OF','D','DO','RD') and machineid=(select machineid from student where ID='$empID' and recordType='Staff') and (date_ BETWEEN '$startDate' AND '$date_') order by symbol"; $cur= odbc_exec( $conn, $query ); $cnt=1; echo ""; while( odbc_fetch_row( $cur ) ) { $leaves[$cnt++]= odbc_result($cur, 1 ); echo ""; for($x = 1; $x <= count($leaves); $x++) { $leave=getName($conn,"select count(*) from empAttendance where machineid=(select machineid from student where ID='$empID' and recordType='Staff') and symbol='".$leaves[$x]."' and (date_ BETWEEN '$startDate' AND '$date_')" ); if($leave=="0") $leave=""; echo "
".odbc_result($cur, 1 ); } echo "
".$leave; //if ($x==count($leaves)) $pdf->Cell(5,9,$leave,1,1,'C'); else $pdf->Cell(5,9,$leave,1,0,'C'); } echo "
"; $fromDate = date ("Y-m-d", strtotime("-1 days", strtotime($fromDate))); $toDate = date ("Y-m-d", strtotime("+1 days", strtotime($toDate))); $query="select checktime from zkteco.dbo.checkInOut where (checktime between '$fromDate' and '$toDate') and machineid=(select machineid from student where empID='$empID') order by checktime"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
SerialCheck Time4"; $checktime= odbc_result( $cur, "checktime"); echo "
". $cnt++ . "$checktime" ; } echo "
"; echo "
"; echo "
"; $query="select * from empAttendanceView where empID='$empID' and symbol='A' and year(date_)='".date('Y',time())."' order by date_ desc"; //$query="select * from empAttendanceView where empID='$empID' and symbol='A' and (year(date_)='".date('Y',time())."' or year(date_)='".(date('Y',time())-1)."') order by date_ desc"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
Absentees
SerialDateStatusLeave Type"; $symbol= odbc_result( $cur, "symbol"); $date_= date('d-m-Y', strtotime(odbc_result( $cur, 'date_' ))); echo "
"; echo ""; echo ""; echo ""; echo "
". $cnt++ . ""; echo "$date_" ; echo "".odbc_result( $cur, "symbol").""; echo ""; echo "
"; echo "
"; //echo "Edit" ; } echo "
"; echo "
"; $year_ = date('Y',time()); echo "
"; $query="select * from LeavesView where empID='$empID' and year(date_)='$year_' order by date_ desc"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
Leaves
#DateDescriptionSymbolDeladd_On"; $empID= odbc_result( $cur, "empID" ); $leaveID= odbc_result( $cur, "leaveID" ); $date_= date('d-m-Y', strtotime(odbc_result( $cur, 'date_' ))); $empName= odbc_result( $cur, "stdName" ); $leaveName= odbc_result( $cur, 'leaveName' ); $remarks= odbc_result( $cur, "remarks" ); $symbol= odbc_result( $cur, "symbol"); echo "
".$cnt++; //echo "".odbc_result( $cur, "userID"); echo "$date_$remarks$symbol"; //echo "del" ; echo ""; echo "".date('d-m-Y H:i:s', strtotime(odbc_result($cur,'time_' )))." | ".odbc_result( $cur, "userID"); } echo "
"; echo "
"; odbc_close($conn); /* CREATE VIEW dbo.empLeaveView AS SELECT dbo.Leaves.machineid, dbo.Leaves.empID, dbo.Leaves.date_, dbo.Leaves.leaveID, dbo.Leaves.remarks, dbo.AccountHeads.headName, dbo.AccountHeads.headDescription AS symbol, dbo.student.stdName FROM dbo.Leaves INNER JOIN dbo.AccountHeads ON dbo.Leaves.leaveID = dbo.AccountHeads.ID INNER JOIN dbo.student ON dbo.Leaves.empID = dbo.student.ID */ ?>