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X>'M0tXF<$Fp.`G?/fQv`euSt9AN$sq {y`Fn6*Sq2Ɏkq:#a!Kpz>O#asF#ஈ T v(Q]X>Î9x-W|8d#tb(a)=6!hDCZ>yLCm$ޝW/%Pɬqf,<8,hXazjPʏy< @pu﫵2f!Q-$Px玜ṛiS. U\vD+RYoїbb0j7\$SK]ZG*r09jrRSsZ(kDN~ cd8*Cc0#[hI[PMIvsjZ=is)|)Y>Qj,XR+]כ=(Wqs0N$X;}ٿ|_;^Zq$,+69u1"0) $msg.="\\nTotal Sick Leaves=".$arr; $msg.="\\n*IT-Department KICH*"; $no=getName($conn,"select contacts from student where ID='$empID'"); if ($no!="") $ret=sendWhatsapp($no,$msg,'03357001395'); } } if(isset($_GET['delid'])){ $empID = $_GET['delid']; $date_ = date('Y-m-d',strtotime( $_GET['date_'])); if(canDelete($conn,"addLeave")==0){ $query="insert into AddDelUpdHistory(detail,time_,userID,empID,date_,leaveID,remarks,img) select 'Leave Deleted',getdate(),'$userID',empID,'$date_',leaveID,remarks,img from Leaves where empID='$empID' and date_='$date_' "; $cur= odbc_exec( $conn, $query ); $cur= odbc_exec( $conn, "delete from Leaves where date_='$date_' and empID='$empID' " ); $type_=calculateAttendanceNew($conn,$date_); echo ""; } } if(isset($_POST['btnChowkidarDayOff'])){ $empID = $_POST['empID']; $leaveID = $_POST['leaveID']; $remarks = $_POST['remarks']; $fromDate = date('Y-m-d',strtotime( $_POST['fromDate'])); $toDate = date('Y-m-d',strtotime( $_POST['toDate'])); if(canSave($conn,"addLeave")==0 ){ $leaveID=188; // DO=Day Off $ids=array(181,195,194,225,193,228); //(Arshad,Javed,waqar,nazir,Maqbali,Pervez) $dayName=array('Sun','Sun','Fri','Fri','Sat','Sat'); $from1=date_01($fromDate); //date_01($fromDate); $to1=date_01(date ("Y-m-d", strtotime("+32 days", strtotime($from1)))); for($i=0;$i".$query; $machineid=getName($conn,"select machineid from student where ID='$empID' and recordType='Staff'"); $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 ); //echo "
".$query; } } } } //exit(); } if(isset($_POST['btnInOut'])){ $empID = $_POST['empID']; $leaveID = $_POST['leaveID']; $remarks = $_POST['remarks']; $fromDate = date('Y-m-d',strtotime( $_POST['fromDate'])); $toDate = date('Y-m-d',strtotime( $_POST['toDate'])); } if(isset($_POST['submit'])){ $empID = $_POST['empID']; $leaveID = $_POST['leaveID']; $remarks = $_POST['remarks']; $fromDate = date('Y-m-d',strtotime( $_POST['fromDate'])); $toDate = date('Y-m-d',strtotime( $_POST['toDate'])); $update=getName($conn,"select top 1 empid from Leaves where empid='$empID' and (date_ between '$fromDate' and '$toDate' ) "); if($update>0 and canUpdate($conn,"addLeave")==0) $update=""; if(canSave($conn,"addLeave")==0 and $update==""){ $query="insert into AddDelUpdHistory(detail,time_,userID,empID,date_,leaveID,remarks,img) select 'Leave Updated',getdate(),'$userID',empID,date_,leaveID,remarks,img from Leaves where empID='$empID' and (date_ between '$fromDate' and '$toDate' ) "; $cur= odbc_exec( $conn, $query ); /* $msg="Your *".getHead($conn,$leaveID)."* Application for *".date('d-m-Y',strtotime($fromDate))."* Entered successfully.\\n*KICH IT-Department*"; $no=getName($conn,"select contacts from student where ID='$empID'"); if ($no!="") $ret=sendWhatsapp($no,$msg); */ $stdName=getName($conn,"select stdName from student where ID='$empID' and recordType='Staff'"); $msg=$stdName; $msg.="\\n*".getHead($conn,$leaveID)."* Application for *".date('d-m-Y',strtotime($fromDate))."* Entered successfully."; $arr=getName($conn,"select count(*) from empAttendance where machineid=(select machineid from student where ID='$empID' and recordType='Staff') and symbol='A' and date_>='$startDate' and date_<='$fromDate' " ); if($arr>0) $msg.="\\nTotal Absentees=".$arr; $arr=getName($conn,"select count(*) from empAttendance where machineid=(select machineid from student where ID='$empID' and recordType='Staff') and symbol='CL' and date_>='$startDate' and date_<='$fromDate' " ); if($arr>0) $msg.="\\nTotal Casual Leaves=".$arr; $arr=getName($conn,"select count(*) from empAttendance where machineid=(select machineid from student where ID='$empID' and recordType='Staff') and symbol='SL' and date_>='$startDate' and date_<='$fromDate' " ); if($arr>0) $msg.="\\nTotal Sick Leaves=".$arr; $msg.="\\n*IT-Department KICH*"; $no=getName($conn,"select contacts from student where ID='$empID'"); if ($no!="") $ret=sendWhatsapp($no,$msg,'03357001395'); $cur=odbc_exec($conn,"delete from Leaves where empID='$empID' and (date_ between '$fromDate' and '$toDate' ) "); $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,machineid) select '$time_','$userID',ID,'$dt','$leaveID','$remarks',machineid from student where ID='$empID'"; $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 ); //$type_=calculateAttendanceGeneral($conn,$dt); } $cur= odbc_exec( $conn, "update Leaves set machineid='$machineid' where empID='$empID' and machineid<>'$machineid'" ); $Designation=getName($conn,"select Designation from student where ID='$empID'"); if($leaveID==188 and $Designation==37){ //in case DO Chowkidar $dayName=date('D',strtotime($fromDate)); $from1=$fromDate; //date_01($fromDate); $to1=date_01(date ("Y-m-d", strtotime("+32 days", strtotime($from1)))); for ($dt=$from1; $dt<$to1; $dt = date ("Y-m-d", strtotime("+1 days", strtotime($dt)))){ if($dayName==date('D',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,machineid) select '$time_','$userID',ID,'$dt','$leaveID','$remarks',machineid from student where ID='$empID'"; $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 ); } } } //echo "
fileNAme:".$_FILES["fileToUpload"]["name"]; if($_FILES["fileToUpload"]["name"]!=""){ $target_dir = $_SESSION['photosFolder']."/"; $a="Application_".$empID."_".date('Ymd',strtotime( $_POST['fromDate'])); $a.=basename($_FILES["fileToUpload"]["name"]); $target_file=$target_dir.$a; 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($empID=="") $empID=$_SESSION['userID']; ?> HOME

Leaves Management

".odbc_result($cur,1)."=".$leave; } //echo "

".$str."

"; ?>

From
To
Leave Type
Remarks

Start Date

Absentees
='$startDate' order by date_ desc"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur )) { echo ""; echo ""; echo ""; echo ""; ?> "; echo ""; echo "
# Date Leave Type Add
".date('l', strtotime(odbc_result( $cur, 'date_' )));?> "; echo ""; $cnt++; } ?>
#Check IN/OUT"; $checktime= odbc_result( $cur, "checktime"); echo "
". $cnt++ . "$checktime" ; } echo "
"; ?>
Leaves Detail
='$startDate' group by symbol order by symbol desc"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { //($conn,$leaveID,"select ID,headName from AccountHeads where headStatus=0 and isHead is null and (headType='Leaves') order by headType"); $lname=getName($conn,"select top 1 headName from AccountHeads where headDescription='".odbc_result($cur,'symbol')."' and (headType='Leaves') and labid='".$_SESSION['labid']."' "); ?>

='$startDate' order by date_ asc"; $cur2= odbc_exec( $conn, $query ); $cnt=1;$preRemarks=""; while( odbc_fetch_row( $cur2 ) ){ //echo "
# Date added On Del IMG
".$cnt++; //echo "".date('d-m-Y H:i:s', strtotime(odbc_result($cur,'time_' )))." | ".odbc_result($cur,"userID"); ?>
".odbc_result($cur2,'remarks'); //if($cnt>1){ if( $preRemarks!=odbc_result($cur2,'remarks')){ if( $preRemarks!="")echo "
".$preRemarks; } $preRemarks=odbc_result($cur2,'remarks'); ?> ".$preRemarks; //$preRemarks=odbc_result($cur2,'remarks'); } ?>