

	<?php
	$start = $startoffset * $limit + 1;
	$end = ($startoffset +1 )* $limit ;

	if($total<$start)
	$start = $total;

	if($total<=$end)
	$end = $total;
	?>


<?
if($callType == 0)
$callTypeStr = "Fialed Call List";
else
$callTypeStr = "Success Call List";
?>


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

      <span>&nbsp;&nbsp;&raquo;</span> <?=$callTypeStr?> Total : <?=$total?> Showing <?=$start?> to <?=$end?>

    </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="7%"><div align="left" style="padding-left:5px;">Client</div></td>
     <td width="6%"><div align="left" style="padding-left:5px;">R-I</div></td>
     <td width="9%"><div align="left" style="padding-left:5px;">Number</div></td>
     <td width="5%"><div align="left" style="padding-left:5px;">Prefix</div></td>
     <td width="11%"><div align="left" style="padding-left:5px;">Call Start</div></td>
     <td width="11%"><div align="left" style="padding-left:5px;">Call End</div></td>
     <td width="5%"><div align="left" style="padding-left:5px;">Duration</div></td>
     <td width="12%"><div align="left" style="padding-left:5px;">Rate</div></td>
 	 <td width="7%"><div align="left" style="padding-left:5px;">Route</div></td>
 	 <td width="4%"><div align="center" style="padding-left:0px;">CostD</div></td>
 	 <td width="4%"><div align="center" style="padding-left:0px;">CostR1</div></td>
 	 <td width="4%"><div align="center" style="padding-left:0px;">CostR2</div></td>
 	 <td width="4%"><div align="center" style="padding-left:0px;">CostR3</div></td>
 	 <td width="4%"><div align="center" style="padding-left:0px;">CostR4</div></td>
 	 <td width="5%"><div align="left" style="padding-left:5px;">Status</div></td>
   </tr>



<?
$i=1;
if(is_array($callList))
{
foreach($callList as $row)
{
$passid =$row->id;



if($row->id_reseller==-1)
$reseller1Login = "--";
else
$reseller1Login = $this->generallib->getResellerLogin($row->id_reseller,1);


$callDuration  = $this->generallib->sec_to_time($row->real_sessiontime);


?>

      <?

	  		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->src?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$reseller1Login?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->dnid?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->billing_prefix?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->starttime?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->stoptime?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$callDuration?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->rateName?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->trunkName?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->client_cost?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->costr1?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->costr2?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->costr3?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->costr4?></td>
 <td align=left  style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->call_status?></td>
   </tr>

<?
$i++;
}

}

?>


 </table>

<!-- End Clients List -->

    </td>
  </tr>

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

    <input type="hidden" name="starttime" id="starttime" value="<?=$starttime?>" />
	<input type="hidden" name="stoptime" id="stoptime" value="<?=$stoptime?>" />
	<input type="hidden" name="id_trunk" id="id_trunk" value="<?=$id_trunk?>" />
	<input type="hidden" name="limit" id="limit" value="<?=$limit?>" />
	<input type="hidden" name="startoffset" id="startoffset" value="<?=$startoffset?>" />
	<input type="hidden" name="id_rate" id="id_rate" value="<?=$id_rate?>" />
	<input type="hidden" name="calledNumnber" id="calledNumnber" value="<?=$calledNumnber?>" />
	<input type="hidden" name="clientName" id="clientName" value="<?=$clientName?>" />
	<input type="hidden" name="callType" id="callType" value="<?=$callType?>" />


<?


      $p = new paginationClass;
      $p->Items($total);

      if($startoffset==0)
      $startoffset = 1;

      $p->limit($limit);
      $p->target("paginator.php");
      $p->currentPage($startoffset);
      $p->adjacents(3);
      $p->show();



?>


    </td>
  </tr>

</table>
