<?php
ini_set('max_execution_time', '300');
$cccount=mysqli_query($connect ,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm'  ORDER BY L.startTime ,L.EndTime;");
$c1 = mysqli_fetch_array($cccount);
$A= $c1['COUNT'];
 
$precc=mysqli_query($connect,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm' AND L.PROCESS='PRETRANS' ORDER BY L.startTime ,L.EndTime;");
$pcc=mysqli_fetch_array($precc);
$A1=$pcc['COUNT'];

$tracc=mysqli_query($connect,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm' AND L.PROCESS='TRANS' ORDER BY L.startTime ,L.EndTime;");
$tcc=mysqli_fetch_array($tracc);
$A2=$tcc['COUNT'];

$D1cc=mysqli_query($connect,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm' AND L.PROCESS='DATAENTRY' AND L.PASS='PASS1' ORDER BY L.startTime ,L.EndTime;");
$Dcc=mysqli_fetch_array($D1cc);
$A3=$Dcc['COUNT'];

$D2cc=mysqli_query($connect,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm' AND L.PROCESS='DATAENTRY' AND L.PASS='PASS2' ORDER BY L.startTime ,L.EndTime;");
$D2cc=mysqli_fetch_array($D2cc);
$A4=$D2cc['COUNT'];
                             
$COMcc=mysqli_query($connect,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm' AND L.PROCESS='COMPARE' ORDER BY L.startTime ,L.EndTime;");
$Ccc=mysqli_fetch_array($COMcc);
$A5=$Ccc['COUNT'];

$QCcc=mysqli_query($connect,"SELECT COUNT(*) AS COUNT, L.EMPNO,EM.EMPNAME,B.IMAGENAME as IMAGENAME,L.PROCESS as PROCESS ,L.PASS as PASS, L.startTime as startTime, L.EndTime EndTime, 
LEFT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)),8) as TDif,LEFT(SEC_TO_TIME(BM.BTD),8) as BTD , IF(BM.BTD < TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime), 'NO', 'YES') AS FinalStatus ,IF(BM.BTD < TIMESTAMPDIFF(SECOND,L.startTime, L.EndTime), LEFT(SEC_TO_TIME((TIMESTAMPDIFF(SECOND, L.startTime, L.EndTime)-BM.BTD)),8), LEFT(SEC_TO_TIME('0'),8)) AS TIMEEXCEED  from LOGIN_FINAL  L left JOIN BATCHES B ON B.BATCHNO = L.BATCHNO left JOIN MASTER_BENCHMARK BM ON BM.PROCESS = CONCAT(L.PROCESS,L.PASS) left JOIN empmaster EM ON EM.EMPNO = L.EMPNO Where left(starttime,10) = CURDATE() AND L.EMPNO = '$nm' AND L.PROCESS='QC' ORDER BY L.startTime ,L.EndTime;");
$Qcc=mysqli_fetch_array($QCcc);
$A6=$Qcc['COUNT'];
?>
                                    <div class="container-fluid" style="margin-top:-40px;margin-left :190px;"> 
                                             <label for=""><b>Total:</b></label>
                                             <input type="text" value="<?php echo $A;?>" style="width:7%;border-radius:25px;padding-left:10px; color: #660000; font-weight:800;background-color:#f0e7bd">
                                             <label for=""><b>Pre:</b></label>
                                             <input type="text" value="<?php echo $A1;?>" style="width:7%;border-radius:25px;padding-left:10px;color: #660000; font-weight:800;background-color:#c2c3f2">
                                             <label for=""><b>Trans:</b></label>
                                             <input type="text" value="<?php echo $A2;?>"style="width:7%;border-radius:25px;padding-left:10px;color: #660000; font-weight:800;background-color:#f2dae9">
                                             <label for=""><b>D1:</b></label>
                                             <input type="text" value="<?php echo $A3;?>"  style="width:7%;border-radius:25px;padding-left:10px;color: #660000; font-weight:800;background-color:#d5eef7">
                                             <label for=""><b>D2:</b></label>
                                             <input type="text" value="<?php echo $A4;?>"  style="width:7%;border-radius:25px;padding-left:10px;color: #660000; font-weight:800;background-color:#d3ebcc">
                                             <label for=""><b>Comp:</b></label>
                                             <input type="text" value="<?php echo $A5;?>"  style="width:7%;border-radius:25px;padding-left:10px;color: #660000; font-weight:800;background-color:#ffccff">
                                             <label for=""><b>QC:</b></label>
                                             <input type="text" value="<?php echo $A6;?>"  style="width:7%;border-radius:25px;padding-left:10px;color: #660000; font-weight:800;background-color:#f0c4bb">
                                    </div>
                                         