Login report - duration mismatch error
Showing
1 changed file
with
7 additions
and
2 deletions
| ... | @@ -21,7 +21,7 @@ $logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logt | ... | @@ -21,7 +21,7 @@ $logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logt |
| 21 | $campaign =(isset($_GET['campaign'])) ? $_GET['campaign'] : "All"; | 21 | $campaign =(isset($_GET['campaign'])) ? $_GET['campaign'] : "All"; |
| 22 | 22 | ||
| 23 | // testing input | 23 | // testing input |
| 24 | //$logtime = 9;$logtimeto = 20;$logdate = strtotime("2017-10-03 ".$logtime.":00:00");$logdateto = strtotime("2017-10-03 ".$logtimeto.":00:00");$campaign = 'All'; | 24 | //$logtime = 9;$logtimeto = 20;$logdate = strtotime("2017-10-26 ".$logtime.":00:00");$logdateto = strtotime("2017-10-26 ".$logtimeto.":00:00");$campaign = 'All'; |
| 25 | // testing input | 25 | // testing input |
| 26 | 26 | ||
| 27 | $alist=CRMCallArchive::where('user_id','!=',0)->where('created_at','>=',date("Y-m-d H:i:s",$logdate+$timeoffset))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto+$timeoffset)); | 27 | $alist=CRMCallArchive::where('user_id','!=',0)->where('created_at','>=',date("Y-m-d H:i:s",$logdate+$timeoffset))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto+$timeoffset)); |
| ... | @@ -103,7 +103,7 @@ foreach($alist as $aline) | ... | @@ -103,7 +103,7 @@ foreach($alist as $aline) |
| 103 | $totaltime=$aline->callSec+$talktime+$aline->dispoSec; | 103 | $totaltime=$aline->callSec+$talktime+$aline->dispoSec; |
| 104 | 104 | ||
| 105 | $reportarray[$userid]["oncall"]+=$totaltime/1000; | 105 | $reportarray[$userid]["oncall"]+=$totaltime/1000; |
| 106 | //$reportarray[$userid]["Wait"]+=$aline->waitSec/1000; | 106 | // $reportarray[$userid]["Wait"]+=$aline->waitSec/1000; |
| 107 | $reportarray[$userid]["Call"]+=$aline->callSec/1000; | 107 | $reportarray[$userid]["Call"]+=$aline->callSec/1000; |
| 108 | $reportarray[$userid]["Talk"]+=$talktime/1000; | 108 | $reportarray[$userid]["Talk"]+=$talktime/1000; |
| 109 | $reportarray[$userid]["Dispo"]+=$aline->dispoSec/1000; | 109 | $reportarray[$userid]["Dispo"]+=$aline->dispoSec/1000; |
| ... | @@ -201,6 +201,11 @@ if(count($userLogin)) foreach ($userLogin as $userid => $value) | ... | @@ -201,6 +201,11 @@ if(count($userLogin)) foreach ($userLogin as $userid => $value) |
| 201 | $reportarray[$userid]["SessionTotal"]=$value['duration']; | 201 | $reportarray[$userid]["SessionTotal"]=$value['duration']; |
| 202 | $reportarray[$userid]["Total"]=$value['duration']-$break_time; | 202 | $reportarray[$userid]["Total"]=$value['duration']-$break_time; |
| 203 | $reportarray[$userid]["Wait"]=$reportarray[$userid]["Total"]-$reportarray[$userid]['oncall']; | 203 | $reportarray[$userid]["Wait"]=$reportarray[$userid]["Total"]-$reportarray[$userid]['oncall']; |
| 204 | if($reportarray[$userid]["Wait"] < 0){ | ||
| 205 | $reportarray[$userid]["Total"] += abs($reportarray[$userid]["Wait"]); | ||
| 206 | $reportarray[$userid]["SessionTotal"] += abs($reportarray[$userid]["Wait"]); | ||
| 207 | $reportarray[$userid]["Wait"] = 0; | ||
| 208 | } | ||
| 204 | } | 209 | } |
| 205 | 210 | ||
| 206 | $highestColumn = sizeof($reporthead); | 211 | $highestColumn = sizeof($reporthead); | ... | ... |
-
Please register or sign in to post a comment