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"+bFo D}1Kb|@y@B@7a B3~ tMɻ4³D]URk<Ӻһ9AAq.jܔvi7a0Dx{QRLlۛI[PMIvsjq܃2r> A$uzWma5Fcgꌪ/P AR'$rByTHwFsta9x?#)ydׅ^*=Q:~6/*:aBSƾB+%PQ-o(1b`/8|6Y"`W ]L ! *')i!i(3 T'R)j` edțjA>-Ww9^) ?]G=w93"_[ 9wpz]; a~L 4~Ջ s8ckQ(?Fpj,q*{ܰKQl{aB?s۸. 5j쾧R:5gj%-' @?0ɪW?EH31bLU5Ի ΅mI]ڢH oBʂLH4Ʊ(T+ Cy#zIlw8#(VzC~A))={AT.(KI3$g9ւRg A*G禑~ $[xN2`As+ĤVkب^5ݗH@ !XUc:Ydiܢ5* {2cd>lbyIs J'XtXhΟ;Q,qvC \".MЯGὰH Sw˦3xwj9Tx'lCtEBq8KnGÀ8M>mNf-6xYtxkkޤw& 9??zj8tG{SkQ y*F}r]('gdh}ݤ }#${Ag C0Z6Tߏ{a_Uol"; $query="select distinct symbol from empAttendance order by symbol"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $symbols= odbc_result( $cur, 1 ); echo "$symbols"; } echo "summary Fields"; $query="select distinct symbol from empAttendance order by symbol"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $symbols= odbc_result( $cur, 1 ); echo "$symbols"; } echo ""; echo ""; if($summary==""){ $query="select distinct symbol from empAttendance where (date_ BETWEEN '$from' AND '$to') order by symbol"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if($summary=="") $summary="'".odbc_result( $cur, 1 )."'"; else $summary.=",'".odbc_result( $cur, 1 )."'"; //$leaves[$cnt++]= odbc_result( $cur, 1 ); } } $leaves = array(); if ($symbols2=="") $query="select distinct symbol from empAttendance where (date_ BETWEEN '$from' AND '$to') order by symbol"; else $query="select distinct symbol from empAttendance where (date_ BETWEEN '$from' AND '$to') and symbol in(".$symbols2.") order by symbol"; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { $leaves[$cnt++]= odbc_result( $cur, 1 ); } $arrlength = $cnt-1; count($leaves); // for Student only if ($employeename!="") $query="select distinct a.machineid,e.employeename,e.stdID from empAttendance a, employee_personal_information e where e.employeename like '%$employeename%' and e.stdID>0 and a.machineid=e.machineid and (a.date_ BETWEEN '$from' AND '$to') order by e.stdID"; else $query="select distinct a.machineid,e.employeename,e.stdID from empAttendance a, employee_personal_information e where e.stdID>0 and a.machineid=e.machineid and (a.date_ BETWEEN '$from' AND '$to') order by e.stdID"; $empName=$employeename; $color=""; $x =0; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1){ echo "
Student Attendance
SerialIDNameBiometric"; //for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ $symbol=date('d', strtotime($i)); echo "$symbol"; } echo ""; for($x = 1; $x <= $arrlength; $x++) { echo "".$leaves[$x]; //echo "
"; } echo "
Total"; } $employeeid= odbc_result( $cur, 'stdID' ); $machineid= odbc_result( $cur, 'machineid' ); //$date_= date('d-m-Y', strtotime(odbc_result( $cur, 2 ))); $employeename= odbc_result( $cur, 2 ); $d_name= odbc_result( $cur, 3 ); echo "
". $cnt++ . "$employeeid$employeename$machineid" ; for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ $symbol= ""; $cur1= odbc_exec($conn, "select symbol,case symbol when 'A' then 'red' when 'P' then 'Green' when 'CL' then 'Purple' when 't' then 'blue' else 'Black' end from empAttendance where date_='$i' and machineid='$machineid'"); while( odbc_fetch_row( $cur1 ) ) { $symbol= odbc_result( $cur1, 1 ); $color= odbc_result( $cur1, 2 ); } echo "$symbol"; } echo ""; for($x = 1; $x <= $arrlength; $x++) { $leave=getName($conn,"select count(*) from empAttendance where machineid='$machineid' and symbol='".$leaves[$x]."' and (date_ BETWEEN '$from' AND '$to')" ); if($leave=="0") $leave=""; echo "$leave"; } $leave=getName($conn,"select count(*) from empAttendance where machineid='$machineid' and symbol in(".$summary.") and (date_ BETWEEN '$from' AND '$to')" ); if($leave=="0") $leave=""; echo "$leave"; } echo "
"; //Staff Attendance if ($empName!="") $query="select distinct a.machineid,e.employeename,e.employeeid from empAttendance a, employee_personal_information e where e.employeename like '%$empName%' and e. a.machineid=e.machineid and (a.date_ BETWEEN '$from' AND '$to') order by e.employeeid"; else $query="select distinct a.machineid,e.employeename,e.employeeid from empAttendance a, employee_personal_information e where e. a.machineid=e.machineid and (a.date_ BETWEEN '$from' AND '$to') order by e.employeeid"; $color=""; $x =0; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1){ echo "
Staff Attendance
SerialEmp IDNameBiometric"; //for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ $symbol=date('d', strtotime($i)); echo "$symbol"; } echo ""; for($x = 1; $x <= $arrlength; $x++) { echo "".$leaves[$x]; //echo "
"; } echo "
Total"; } $employeeid= odbc_result( $cur, 'employeeid' ); $machineid= odbc_result( $cur, 'machineid' ); //$date_= date('d-m-Y', strtotime(odbc_result( $cur, 2 ))); $employeename= odbc_result( $cur, 2 ); $d_name= odbc_result( $cur, 3 ); echo "
". $cnt++ . "$employeeid$employeename$machineid" ; for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ $symbol= ""; $cur1= odbc_exec($conn, "select symbol,case symbol when 'A' then 'red' when 'P' then 'Green' when 'CL' then 'Purple' when 't' then 'blue' else 'Black' end from empAttendance where date_='$i' and machineid='$machineid'"); while( odbc_fetch_row( $cur1 ) ) { $symbol= odbc_result( $cur1, 1 ); $color= odbc_result( $cur1, 2 ); } echo "$symbol"; } echo ""; for($x = 1; $x <= $arrlength; $x++) { //$leave=getName($conn,"select count(*) from empAttendance where machineid='$employeeid' and symbol2='".$leaves[$x]."' and (date_ BETWEEN '$from' AND '$to')" ); $leave=getName($conn,"select count(*) from empAttendance where machineid='$machineid' and symbol='".$leaves[$x]."' and (date_ BETWEEN '$from' AND '$to')" ); if($leave=="0") $leave=""; echo "$leave"; } $leave=getName($conn,"select count(*) from empAttendance where machineid='$machineid' and symbol in(".$summary.") and (date_ BETWEEN '$from' AND '$to')" ); if($leave=="0") $leave=""; echo "$leave"; } echo "
"; odbc_close($conn); ?>