


<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableBorder">
  <tr>
    <td class="mainTableTitle">

      <span>&nbsp;&nbsp;&raquo;</span> Success Calls Summary

    </td>
  </tr>


 <tr>
    <td>

 <!-- Clinets List -->

 <table class="gbTable">

   <tr class="header">
     <td width="2%"><div align="left" style="padding-left:5px;">NR</div></td>
     <td width="20%"><div align="left" style="padding-left:5px;">Date</div></td>
     <td width="10%"><div align="left" style="padding-left:5px;">Prefix</div></td>
     <td width="28%"><div align="left" style="padding-left:5px;">Route</div></td>
     <td width="10%"><div align="left" style="padding-left:5px;">Calls</div></td>
     <td width="10%"><div align="left" style="padding-left:5px;">Duration</div></td>
     <td width="10%"><div align="left" style="padding-left:5px;">ACD</div></td>
     <td width="10%"><div align="left" style="padding-left:5px;">Status</div></td>
   </tr>



<?
$i=1;
$totalNumberCall = 0;
$totalDuration  = 0;

if(is_array($callList))
{
foreach($callList as $row)
{
$passid =$i;


$totalNumberCall = $totalNumberCall + $row->totalCall;
$totalDuration = $totalDuration + $row->callDuration;

$acd = round($row->callDuration/$row->totalCall,0);

if($acd<60)
$statusMessage = "<span style ='color:#BE0000'>Need Check<span>";
else
$statusMessage = "---";


?>

      <?

	  		if($i%2==0)
	  		 {

	  		 $str = "
	  		 		 <TR id = \"$passid\" class=\"row2 \"
	  		 		               onmousedown=\"rowPointer(this, 'down', 'row2', 'rowSel', 'rowMark')\"
	  		 		               onmouseover=\"rowPointer(this, 'over', 'row2', 'rowSel', 'rowMark')\"
	  		               onmouseout=\"rowPointer(this, 'out', 'row2', 'rowSel', 'rowMark')\">";


	  		 }
	  		else
	  		 {
	  			$str = "
	  					 <TR id = \"$passid\" class=\"row1 \"
	  					               onmousedown=\"rowPointer(this, 'down', 'row1', 'rowSel', 'rowMark')\"
	  					               onmouseover=\"rowPointer(this, 'over', 'row1', 'rowSel', 'rowMark')\"
	  		               onmouseout=\"rowPointer(this, 'out', 'row1', 'rowSel', 'rowMark')\">";
	  		 }



	  echo $str;

	  ?>

 <td align=center class="tableBorderAll" style="padding-left:0px;padding-top:2px;padding-bottom:2px;"><input name="checkActive" type="checkbox"  id="checkActive" value="1" /></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->callDay?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->tariff_prefix?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->description?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->totalCall?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$this->generallib->sec_to_time($row->callDuration)?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$this->generallib->sec_to_time($acd)?></td>
 <td align=left style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$statusMessage?></td>

   </tr>

<?
$i++;
}

}

?>


 </table>

<!-- End Clients List -->

    </td>
  </tr>

  <tr>
    <td align="center" style="padding-top:5px;">

    <input type="hidden" name="callStart" id="callStart" value="<?=$callStart?>" />
    <input type="hidden" name="callEnd" id="callEnd" value="<?=$callEnd?>" />
    <input type="hidden" name="idTrunk" id="idTrunk" value="<?=$idTrunk?>" />
	<input type="hidden" name="limit" id="limit" value="<?=$limit?>" />
	<input type="hidden" name="startoffset" id="startoffset" value="<?=$startoffset?>" />
	<input type="hidden" name="calledPrefix" id="calledPrefix" value="<?=$calledPrefix?>" />



    </td>
  </tr>

  <tr>
    <td align="center" style="padding-top:0px;">

<table width="50%" border="0" cellspacing="0" cellpadding="0" class="tableBorder">
  <tr>
    <td colspan="2" class="mainTableTitle"><span>&nbsp;&nbsp;&raquo;</span> Calls Summary</td>
  </tr>

 <tr>
	<td class='formLabelRigit' width="50%" style='padding-top:10px;'> Number of Calls :  </td>
	<td class='formLabelLeft' width="50%" style='padding-top:10px;'> <?=$totalNumberCall?>	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Total Call Duration :  </td>
	<td class='formLabelLeft'><?=$this->generallib->sec_to_time($totalDuration)?>	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  ACD :  </td>
	<td class='formLabelLeft'>
	<?
	if($totalNumberCall == 0)
	$totalACD = 0;
	else
	$totalACD = round($totalDuration/$totalNumberCall,0);
	echo $this->generallib->sec_to_time($totalACD);
	?>

	</td>
</tr>


</table>


    </td>
  </tr>


</table>