

	<?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 Reseller I 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;">Full Name</div></td>
     <td width="10%"><div align="left" style="padding-left:5px;">Parent</div></td>
     <td width="9%"><div align="left" style="padding-left:5px;">Balance</div></td>
 	 <td width="9%"><div align="left" style="padding-left:5px;">Balance Limit</div></td>
     <td width="18%"><div align="left" style="padding-left:5px;">Tariff Name</div></td>
     <td width="7%"><div align="left" style="padding-left:5px;">U-R Limit</div></td>
 	 <td width="5%"><div align="center" style="padding-left:0px;">Accounts</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($resellerList))
{
foreach($resellerList as $row)
{
$passid =$row->id;


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

$parent = $this->generallib->getResellerLogin($row->id_reseller,2);

if($row->sipuser == 1)
$sipUser = "Yes";
else
$sipUser = "No";


if($row->aniuser == 1)
$aniUser = "Yes";
else
$aniUser = "No";

$rateName = $this->generallib->getReteName($row->id_rate);

if($row->balance > BALANCE_ALERT_LIMIT)
$textColor = "#000000";
else
$textColor = "#BF0000";


?>

      <?

	  		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;"><?=$row->full_name?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$parent?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;color:<?=$textColor?>"><b><?=$row->balance?></b></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->limit_balance?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><a href="#"  onClick="window.open('<?=site_url('rate/rateChartListPOPup/'.$row->id_rate)?>','mywindow','resizable=yes,scrollbars=yes,width=950,height=650')" title="Rate Chart" ><?=$rateName?></a></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->limit_user?> - <?=$row->limit_rate?></td>

 <td align=center class="tableBorderAll" style="padding-left:5px;">
   <a href="<?=site_url('reseller/editFormReseller1/'.$row->id)?>"  title="Add Payment" >
   <img src="<?=base_url()?>images/add_payment.gif" border="0" height="18">
   </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:5px;">
   <a href="<?=site_url('reseller/editFormReseller1/'.$row->id)?>" title="Edit Reseller" >
   <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('reseller/deleteReseller1/'.$row->id)?>" onclick="return confirm('Do you really want to remove this reseller, 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="login" id="login" value="<?=$login?>" />
	<input type="hidden" name="password" id="password" value="<?=$password?>" />
	<input type="hidden" name="full_name" id="full_name" value="<?=$full_name?>" />
	<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?>" />
	<input type="hidden" name="type" id="type" value="<?=$type?>" />
	<input type="hidden" name="typeValue" id="typeValue" value="<?=$typeValue?>" />



<?


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