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

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

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


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

      <span>&nbsp;&nbsp;&raquo;</span> All Wholesale Client List 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="9%"><div align="left" style="padding-left:5px;">Login</div></td>
     <td width="9%"><div align="left" style="padding-left:5px;">Password</div></td>
     <td width="12%"><div align="left" style="padding-left:5px;">Parent</div></td>
     <td width="15%"><div align="left" style="padding-left:5px;">Provider Name</div></td>
     <td width="8%"><div align="left" style="padding-left:5px;">Balance</div></td>
     <td width="16%"><div align="left" style="padding-left:5px;">Tariff Name</div></td>
     <td width="6%"><div align="left" style="padding-left:5px;">CallLimit</div></td>
 	 <td width="8%"><div align="center" style="padding-left:0px;">DialPrefix</div></td>
 	 <td width="8%"><div align="left" style="padding-left:5px;">IP Address</div></td>
 	 <td width="4%"><div align="center" style="padding-left:0px;">Active?</div></td>
 	 <td width="3%"><div align="center" style="padding-left:0px;">Edit</div></td>
 	 <td width="3%"><div align="center" style="padding-left:0px;">Del</div></td>

   </tr>



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


if($row->status == 1)
$checkActive = "checked='checked'";
else
$checkActive = "";

$parent = $this->generallib->getResellerLogin($row->id_reseller,1);
$rateName = $this->generallib->getReteName($row->id_rate);


?>

      <?

	  		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;"><input name="checkActive" type="checkbox"  id="checkActive" value="1" /></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->login?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->password?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$parent?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->full_name?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><b><?=$row->balance?></b></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><a href="<?=site_url('rate/rateChartList/'.$row->id_rate)?>" target="_blank" title="Rate Chart" ><?=$rateName?></a></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->calllimit?></td>

 <td align=left class="tableBorderAll" style="padding-left:5px;">
   <?=$row->tech_prefix?>
 </td>

 <td align=left class="tableBorderAll" style="padding-left:0px;">
    <a href="<?=site_url('client/ipAddressFromClientsIP/'.$row->id)?>"  title="IP Address" >
    <img src="<?=base_url()?>images/ip_address.png" border="0" height="17">
   </a>
 </td>




 <td align=center class="tableBorderAll" style="padding-left:0px;"><input name="checkActive" type="checkbox"  disabled="disabled" id="checkActive" value="1"  <?=$checkActive?> /></td>

 <td align=center class="tableBorderAll" style="padding-left:0px;">
   <a href="<?=site_url('client/editFormClientsIP/'.$row->id)?>" title="Edit Client" >
   <img src="<?=base_url()?>images/contact_blue_edit.png" border="0" height="16">
   </a>
 </td>

 <td align=center  style="padding-left:5px;">
  <a href="<?=site_url('client/deleteClientsIP/'.$row->id)?>"  onclick="return confirm('Do you really want to remove this Wholesale Client, Name:<?=$row->full_name?> ?')" title="Delete" >
  <img src="<?=base_url()?>images/remove.png" border="0" height="16">
  </a>
 </td>

   </tr>

<?
$i++;
}

}

?>


 </table>

<!-- End Clients List -->

    </td>
  </tr>

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

    <input type="hidden" name="full_name" id="full_name" value="<?=$full_name?>" />
	<input type="hidden" name="login" id="login" value="<?=$login?>" />
	<input type="hidden" name="password" id="password" value="<?=$password?>" />
	<input type="hidden" name="phone" id="phone" value="<?=$phone?>" />
	<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="id_reseller" id="id_reseller" value="<?=$id_reseller?>" />



<?


      $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>