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?c]RծsWIQ͜ q?9~v)"{z ӏ1ܵ=9B@&"@MbWQdS@oVpކG&^RV.l gpImz;'5\<U?!|`GI-f#3^jWFŒ)O|(ꨍÑI92tz=+駌~h28{űǩ]Y[(Q͙Z]QOzVjf;uP宂89Lrc=gSEYIo\y@5e[,U蹸88(:=fK?ܤCP亘L cjZO+W߰R0JZPHK*88(:=Jm+e,1MYQڬ"*٘9pm wb]@A]x8GٲZذ yǟ>HZI08[E`۠Ej٪tm7=#ɉ;d0;эrjJu L|Z_nd_<ѲzdhCQP OiIj-ۓ>/=\Oqg^Vü0ާzuQaM_MŇcz7-rޑvc|M]Ȗ%"Z:|6v= :(\rPt3{}7tlh;Tv+Gca!Ǡ8oۓ>/=\Oq I}(.0}tA; 6%3a"") $query= " district='".$_POST['district']."'"; else $query.= " and district='".$_POST['district']."'"; } if(($_POST['semesterID'])!=""){ if($query=="") $query= " semesterID='".$_POST['semesterID']."'"; else $query.= " and semesterID='".$_POST['semesterID']."'"; } if(($_POST['sectionID'])!=""){ if($query=="") $query= " sectionID='".$_POST['sectionID']."'"; else $query.= " and sectionID='".$_POST['sectionID']."'"; } if(($_POST['shift'])!=""){ if($query=="") $query= " shift='".$_POST['shift']."'"; else $query.= " and shift='".$_POST['shift']."'"; } if(($_POST['session_'])!=""){ if($query=="") $query= " session_='".$_POST['session_']."'"; else $query.= " and session_='".$_POST['session_']."'"; } if(($_POST['gender'])!=""){ //$gender=($_POST['gender']=='Male') ? 1: 0 ; if($query=="") $query= " gender=$gender"; else $query.= " and gender=$gender"; } //SUBSTRING('SQL Tutorial', 1, 3) $cur= odbc_exec( $conn, "update student set personalNo='+92'+(SUBSTRING(personalNo,2,15)) where SUBSTRING(personalNo,1,2)='03' and stdID>0" ); $cur= odbc_exec( $conn, "update student set personalNo=REPLACE(REPLACE(personalNo,' ',''),'-','') where stdID>0" ); $cur= odbc_exec( $conn, "update student set personalNo='+92'+(SUBSTRING(personalNo,5,15)) where SUBSTRING(personalNo,1,4)='0092' and stdID>0" ); if($query==""){ echo "

Select any option please

"; }else{ $qry= "insert into smsinfo(stdID,date_,text,cellNo) "; $qry.= "select stdID,'$date_',N'".$message."',(personalNo) from studentView where personalNo is not null and personalNo<>'' and stdID in(select stdID from studentView where Status='$Status' and $query)"; $cur= odbc_exec( $conn, $qry ); echo "

Messages Sended successfully

"; } } if(isset($_POST['btnGenerateSMSNew'])){ $firstTime=false; $leaveID = $_POST['leaveID']; $message = $_POST['message']; $fromDate = date('Y-m-d',strtotime( $_POST['fromDate'])); $toDate = date('Y-m-d',strtotime( $_POST['toDate'])); $ids=""; //foreach($checkAll as $value) { foreach($_POST['checkAll'] as $value) { if($ids=="") $ids=$value; else $ids.=",".$value; } //echo "IDS=".$ids; if($ids==""){ echo "

Select any Student please

"; }else{ 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 stdID in ($ids) "); $qry="insert into Leaves(machineid,stdID,date_,leaveID,remarks) select machineid,stdID,'$dt','$leaveID','$message' from student where stdID in($ids)"; $cur= odbc_exec( $conn, $qry ); $qry="update empAttendance set symbol=(select headDescription from AccountHeads where ID='$leaveID') where symbol<>'P' and date_='$dt' and machineid in(select machineid from student where stdID in($ids))"; $cur= odbc_exec( $conn, $qry ); } //$qry= "insert into smsinfo(stdID,date_,text,cellNo) "; //$qry.= "select stdID,'$date_',N'".$message."',(personalNo) from studentView where personalNo is not null and personalNo<>'' and stdID in($ids)"; //$cur= odbc_exec( $conn, $qry ); echo "

Leaves added successfully

"; } $firstTime=true; } if(isset($_POST['btnSave'])){ //$session_ =$_SESSION['session_']; $firstTime=false; $shift= $_POST['shift']; //$Remarks= $_POST['Remarks']; $techID= $_POST['techID']; $gender= $_POST['gender']; $sectionID= $_POST['sectionID']; $sectionID= $_POST['sectionID']; $semesterID= $_POST['semesterID']; $programID= $_POST['programID']; $facultyID= $_POST['facultyID']; $district= $_POST['district']; $Status=(isset($_POST['Status']))?0:1; $checkAll=(isset($_POST['checkAll']))?0:1; $session_ =protect(trim( $_POST['session_'])); //$attendance =protect(trim( $_POST['attendance'])); if(($_POST['programID'])!=""){ if($query=="") $query= " programID='".$_POST['programID']."'"; else $query= " programID='".$_POST['programID']."'"; } if(($_POST['facultyID'])!=""){ if($query=="") $query= " facultyID='".$_POST['facultyID']."'"; else $query.= " and facultyID='".$_POST['facultyID']."'"; } if(($_POST['techID'])!=""){ if($query=="") $query= " techID='".$_POST['techID']."'"; else $query.= " and techID='".$_POST['techID']."'"; } if(($_POST['district'])!=""){ if($query=="") $query= " district='".$_POST['district']."'"; else $query.= " and district='".$_POST['district']."'"; } if(($_POST['semesterID'])!=""){ if($query=="") $query= " semesterID='".$_POST['semesterID']."'"; else $query.= " and semesterID='".$_POST['semesterID']."'"; } if(($_POST['sectionID'])!=""){ if($query=="") $query= " sectionID='".$_POST['sectionID']."'"; else $query.= " and sectionID='".$_POST['sectionID']."'"; } if(($_POST['shift'])!=""){ if($query=="") $query= " shift='".$_POST['shift']."'"; else $query.= " and shift='".$_POST['shift']."'"; } if(($_POST['session_'])!=""){ if($query=="") $query= " session_='".$_POST['session_']."'"; else $query.= " and session_='".$_POST['session_']."'"; } if(($_POST['gender'])!=""){ //$gender=($_POST['gender']=='Male') ? 1: 0 ; if($query=="") $query= " gender=$gender"; else $query.= " and gender=$gender"; } } if(isset($_POST['btnSearchStaff'])){ //$firstTime=false; $dID=$_POST['dID']; if($_POST['dID']=="") $query2="select * from Employee where status in(1,4) and schoolID='$schoolID' and machineid>0"; else $query2="select * from Employee where status in(1,4) and schoolID='$schoolID' and machineid>0 and Designation='".$_POST['dID']."'"; } /* echo ""; echo ""; //echo "
Program "; echo "
Program"; if($Status==0) echo "Active"; else echo "Active"; //echo "
Session"; echo "
Session"; //echo "
Faculty "; echo "
Faculty"; echo "
Technology"; echo "
Semester"; echo "Section"; echo "
District/Domicile"; echo "
Shift"; //echo "
Gender"; echo "
Gender"; echo "
"; echo "
"; */ echo "
"; echo ""; echo "
Designation"; echo ""; echo "
"; //sms Generator if($query=="old Student SMS"){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
Type Your Text message
"; echo "
"; echo "
"; //$query=""; } if($firstTime==true){ $query= "select * from studentView where 1=3"; }else{ if($query=="") $query= "select * from studentView where Status='$Status' "; else $query= "select * from studentView where Status='$Status' and $query"; } if($attendance!=""){ $query.=" and stdID in(select stdID from empAttendance where symbol='$attendance' and date_ ='$date_')"; } //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1; echo "
"; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#Biometricstudent NameFather NameDistrictSMS NoFacultyProgramSessionShiftSectionSemester"; //$date= date("d-m-Y", strtotime(odbc_result( $cur, 1 ))); $stdID= odbc_result( $cur, 'stdID' ); $stdName= odbc_result( $cur, "stdName" ); $fName= odbc_result( $cur, 'fname' ); $district= odbc_result( $cur, 'district' ); $technology= odbc_result( $cur, 'personalNo' ); $shift= odbc_result( $cur,'shift'); $semester= odbc_result( $cur,'semesterName'); $facultyID= odbc_result( $cur,'facultyName'); $Balance= odbc_result( $cur,'Balance'); $machineid= odbc_result( $cur,'machineid'); $session_= odbc_result( $cur,'session_'); //if (odbc_result( $cur,8)=="0") $Status="Enrolled" ; else $Status="Struck Off" ; echo "
$cnt"; echo ""; echo "$machineid$stdName$fName$district$technology$facultyID".odbc_result( $cur,'programName')."".odbc_result( $cur,'session_')."$shift".odbc_result( $cur,'sectionName')."$semester" ; $cnt+=1; } if ($cnt>1) { echo "
From Date"; echo "
TO Date"; echo "
Leave Type +"; echo "
Remarks"; echo "
"; } echo "
"; echo "
"; if ($cnt==1 and $firstTime!=true) echo "No Records Found"; //for staff if($query2!=""){ echo "
"; $cur= odbc_exec( $conn, $query2 ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#BiometricNameFather NameAddressContact"; //$date= date("d-m-Y", strtotime(odbc_result( $cur, 1 ))); $autoID= odbc_result( $cur,'autoID'); $empID= odbc_result( $cur, 'empID' ); //$personalNo= odbc_result( $cur, 'personalNo' ); $stdName= odbc_result( $cur, 'empName' ); $fName= odbc_result( $cur, 'fname' ); $address= odbc_result( $cur, 't_address' ); $contacts= odbc_result( $cur,'contactNo'); $machineid= odbc_result( $cur,'machineid'); //$machineid= odbc_result( $cur,'machineid'); //$nic= odbc_result( $cur,'nic'); echo "
$cnt"; echo ""; echo"$machineid$stdName$fName$address$contacts" ; $cnt+=1; } echo "
"; if ($cnt==1) echo "No Record Found"; echo ""; echo ""; echo "
"; echo ""; if ($cnt>1) { echo "
From Date"; echo "
TO Date"; echo "
Leave Type +"; echo "
Remarks"; echo "
"; } echo "
"; } odbc_close($conn); ?>