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TVaS ]U(2%N%wѱr)%1(Z5wZehiF _~YHa@³DV鋊WD4: Z2M> GJ00>ތ:HݖE;R>? 0{nr~)"=i\GT 1k3S^r;bjs32^TיnWZwvO)=0UZuA/oh vm1(Ө)ln[e]zv ˶W{ ˂sWwGM=N*WPRk!=++C▹XZEWW~]u +kOOnPϻvOML~* c3G֎O˫r;~-\lPfoWGh.ⲱS;@ =-HفI&Ӥ05f&~w}=eցUF!lT\-ȟnlPyhetName($conn,"select e_subject from employee where autoID='$empID'"); if ($oldImg!="" and file_exists("ClassPhotos/$oldImg")) unlink("ClassPhotos/$oldImg"); //$file=base64_encode(file_get_contents($imgPath)); $query = "update employee set e_subject='$a' where autoID='$empID' "; //echo $query ; $cur= odbc_exec($conn,$query); // to Database $imgPath="C:/xampp/htdocs/web/ClassPhotos/$a"; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); $image_base64 = base64_encode(file_get_contents($target_file) ); //$image_base64 = addslashes(file_get_contents($_FILES['fileToUpload']['tmp_name'])); $image_base64 = addslashes(file_get_contents($imgPath)); echo ''; $image = 'data:image/'.$imageFileType.';base64,'.$image_base64; // Insert record $query = "update employee set img2='".$image."' where autoID='$empID' "; $cur= odbc_exec( $conn, $query ); echo $query ; } else { echo "Sorry, there was an error uploading your file."; } } } if(isset($_POST['btnSave'])){ $userID =$_SESSION['UserID']; $autoID= $_POST['autoID']; $empID= $_POST['empID']; $empName= $_POST['empName']; $fname= $_POST['fname']; $ContactNo= $_POST['ContactNo']; $T_Address= $_POST['T_Address']; $Designation= $_POST['Designation']; $EmpAge = date('Y-m-d',strtotime($_POST['EmpAge'])); $date_ = date('Y-m-d',strtotime($_POST['date_'])); if (isset($_POST['Status'])) $Status= 1; else $Status= 0; $Gender= $_POST['Gender']; $Part_Post= $_POST['Part_Post']; $actNo= $_POST['actNo']; $branchNo= $_POST['branchNo']; $machineid= $_POST['machineid']; //$entry1= $_POST['entry1']; $shiftID= $_POST['shiftID']; $isAllowed=false; $curRecord=$empName."".$T_Address."".$Designation."".$EmpAge."".$date_."".$Gender; //if(getName($conn,"select 1 from Employee where autoID='$autoID'")==""){ if($autoID==""){ if(canSave($conn,"addStaff")=="0"){ if(!isset($_SESSION['preRecord']) or $_SESSION['preRecord']!=$curRecord){ $empID=getName($conn,"select isNULL(max(empID),0)+1 from Employee where schoolID='$schoolID' "); $query="insert into Employee (schoolID,entry1,shiftID,machineid,branchNo,actNo,Part_Post,Part_Address,Gender,Block,Status,empID,T_Address,ContactNo,empName,fname "; $query.=",Designation,EmpAge,date_,Religion,Country)"; $query.=" values('$schoolID','$entry1','$shiftID','$machineid','$branchNo','$actNo','$Part_Post','123','$Gender','A','$Status','$empID','$T_Address','$ContactNo','$empName','$fname','$Designation'"; $query.=",'$EmpAge','$date_',0,2)"; $cur= odbc_exec( $conn, $query ); $isAllowed=true; $_SESSION['preRecord']=$empName."".$T_Address."".$Designation."".$EmpAge."".$date_."".$Gender; } } }else{ if(canUpdate($conn,"addStaff")=="0"){ $query="update Employee set entry1='$entry1',shiftID='$shiftID',machineid='$machineid',T_Address='$T_Address',ContactNo='$ContactNo',empName='$empName',fname='$fname' "; $query.=",Part_Post='$Part_Post',Status='$Status',Designation='$Designation'"; $query.=",branchNo='$branchNo',actNo='$actNo',Gender='$Gender',EmpAge='$EmpAge',date_='$date_' where empID='$empID'"; $cur= odbc_exec( $conn, $query ); $isAllowed=true; } } if($shiftID!="") odbc_exec( $conn,"update Employee set shiftID='$shiftID' where shiftID is null "); //if (isset($_POST['setAllTimings'])) $Status= 1; else $Status= 0; if($isAllowed==true and $machineid>0){ $machineid2=getName($conn,"select empName from Employee where machineid='$machineid' and status=0 and empID<>'$empID'"); if($machineid2=="") $machineid2=getName($conn,"select Name from student where machineid='$machineid' and status=0"); if($machineid2!=""){ $machineid=null; echo ""; }else{ $cur= odbc_exec( $conn, "update Leaves set machineid='$machineid' where empID='$empID'" ); } $cur= odbc_exec( $conn, "delete from empTimings where empID='$empID'" ); $cur= odbc_exec( $conn, "delete from empTimings where machineid='$machineid'" ); if($machineid!="" or $machineid!="0"){ //$query="insert into empTimings (empID,machineid,entry1,exit1) values ('$empID','$machineid','$entry1','$exit1') "; //echo $query; //$cur= odbc_exec( $conn, $query ); } //echo ""; } echo "Record Updated Successfully"; } $imgPath=$empID= "";$ContactNo= "";$fname= "";$T_Address= ""; $empName= ""; $fName= ""; $Designation=null;// $_POST['Designation']; $cClass= null;//$_POST['cClass']; $Gender=null;$Status=null;$Part_Post=null;$Part_Post=null;$NIC2=null;$actNo=null;$branchNo=null; if(isset($_POST['find'])) { $empName= $_POST['empName']; } if(isset($_POST['find'])){ $empName= $_POST['empName']; if ($empName!="") { if($_POST['searchType']=='Name') $query= "select * from Employee where empName like'%$empName%' order by empName"; else $query= "select * from Employee where ".$_POST['searchType']."='$empName' order by empName"; } $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#empIDemployee NameFather NameContactStatusRightsCardSalary"; //$date= date("d-m-Y", strtotime(odbc_result( $cur, 1 ))); $autoID= odbc_result( $cur, 'empID'); $empID= odbc_result( $cur, 'empID'); $name= odbc_result( $cur, 'empName' ); $fname= odbc_result( $cur, 'fname' ); //$d_Name= odbc_result( $cur,'D_Name' ); //$section_= odbc_result( $cur, 5 ); $address= odbc_result( $cur, 6 ); $resphone= odbc_result( $cur,'contactNo'); $Balance= odbc_result( $cur,9); if (odbc_result( $cur,'Status')=="1") $Status="Active" ; else $Status="Left-Off" ; echo "
$cnt"; echo "$autoID$name$fname$resphone$Statusrightscard" ; echo "Salary"; /* echo "
"; echo ""; echo "
"; echo "".odbc_result( $cur,'e_subject').""; */ $cnt+=1; } echo "
"; if ($cnt==1) echo "No Record Found"; exit(); } $date = date('Y-m-d',time()); $date_ = date('Y-m-d',time()); $EmpAge = date('Y-m-d',time()); if (isset($_GET['showid'])) { $autoID = $_GET['showid']; $isImage=getName($conn,"select e_subject from Employee where empID='$autoID'"); if(file_exists("ClassPhotos/$isImage")){ }else{ $isImage=getName($conn,"select 1 from Employee where empID='$autoID' and img is null "); if($isImage==""){ $isImage=getName($conn,"select isnull(max(ID),0)+1 from feeHeads "); $query="insert into feeHeads (ID,headID,headType) values('$isImage','$autoID','showEmployeeImage')"; $cur= odbc_exec( $conn,$query); //echo $query; sleep(2); } } $query = "select * from Employee where empID='$autoID' "; //echo $query; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $empID= odbc_result( $cur, 'empID' ); $empName= odbc_result( $cur, 'empName' ); $fname= odbc_result( $cur, 'fname' ); $EmpAge = date('Y-m-d',strtotime(odbc_result( $cur, 'EmpAge'))); //$cClass= odbc_result( $cur, 'fitclass' ); $Designation= odbc_result( $cur, 'Designation' ); $date_= date('Y-m-d',strtotime(odbc_result( $cur, 'date_'))); //$admissionDate= date('Y-m-d',strtotime(odbc_result( $cur, 'admissionDate'))); //$section_= odbc_result( $cur, 'section_' ); $ContactNo= odbc_result( $cur, 'ContactNo' ); $T_Address= odbc_result( $cur, 'T_Address' ); $Status= odbc_result( $cur, 'Status' ); $Gender= odbc_result( $cur, "Gender" ); $Part_Post= odbc_result( $cur, "Part_Post" ); $actNo= odbc_result( $cur, "actNo" ); $branchNo= odbc_result( $cur, "branchNo" ); $machineid= odbc_result( $cur, "machineid" ); $entry1= odbc_result( $cur, "entry1" ); $shiftID= odbc_result( $cur, "shiftID" ); $imgPath= odbc_result( $cur, "e_subject" ); //$img2= odbc_result( $cur, "img2" ); } } echo "
"; //if($empID=="") $empID=getName($conn,"select max(empID)+1 from Employee"); echo ""; echo ""; echo ""; echo ""; //echo "
Employee ID"; echo "
Biometric No."; if($Status=="0") echo "Active"; else echo "Active"; echo "
Hiring Date"; echo "
Employee Name"; if($Gender=='1') echo "MaleFemale"; else echo "MaleFemale"; echo "
Father Name"; echo "
Contacts"; echo "
Address"; echo "
Birth Date"; //echo "
Class"; echo "
Designation +"; echo "
E-mail"; echo "
Account No."; //echo "
Entry"; //echo "
Exit"; echo "
Shift +"; echo "
"; echo "
"; echo "
"; echo "
"; echo ""; echo "
Search : "; echo " "; echo ""; echo "
"; //if($empID=="") $empID=getName($conn,"select max(empID)+1 from Employee"); //echo ""; //echo ''; if($autoID!=""){ echo "".$imgPath.""; echo "
"; echo "
"; echo "
"; echo ""; echo "
"; echo ""; echo ""; echo "
"; echo ""; echo "
"; echo "
"; //$img2=base64_decode($img2); //echo "$img2"; } echo "
"; $empID= ""; $empName= ""; if(isset($_POST['find'])){ $empName= $_POST['empName']; } //$query= "select top 100 * from Employeeview where schoolID='".$_SESSION['schoolID']."' order by empID desc"; //$query= "select top 100 * from Employee where schoolID='".$_SESSION['schoolID']."' order by empID desc"; $query= "select top 100 * from Employee order by empID desc"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#empIDemployee NameFather NameContactStatusRightsCardSalary"; //$date= date("d-m-Y", strtotime(odbc_result( $cur, 1 ))); $autoID= odbc_result( $cur, 'empID'); $empID= odbc_result( $cur, 'empID'); $name= odbc_result( $cur, 'empName' ); $fname= odbc_result( $cur, 'fname' ); //$d_Name= odbc_result( $cur,'D_Name' ); //$section_= odbc_result( $cur, 5 ); $address= odbc_result( $cur, 6 ); $resphone= odbc_result( $cur,'contactNo'); $Balance= odbc_result( $cur,9); if (odbc_result( $cur,'Status')=="1") $Status="Active" ; else $Status="Left-Off" ; echo "
$cnt"; echo "$empID$name$fname$resphone$Statusrightscard" ; echo "Salary"; /* echo "
"; echo ""; echo ""; echo "
"; echo "".odbc_result( $cur,'e_subject').""; */ $cnt+=1; } echo "
"; if ($cnt==1) echo "No Record Found"; odbc_close($conn); ?>