<?
//$this->load->view('cpanel/header');
?>
<script>

function addBalance(amount)
{
document.getElementById("amount").value = amount;

}



</script>


<div align="center">
<table width="600" border="0" cellspacing="0" cellpadding="0" class="tableBorder">

  <tr>
    <td class="mainTableTitle">

      <span>&nbsp;&nbsp;&raquo;</span> Reseller IV Payment History

    </td>
  </tr>


  <tr>
    <td>
 <div style="height: 75px;overflow: auto;">

<table class="gbTable" width="100%">
<tr class="header">
        <td width="2%">Nr</td>
        <td width="25%"><div align="left" style="padding-left:5px;">Date</div></td>
        <td width="20%"><div align="left" style="padding-left:5px;">Amount</div></td>
        <td width="10%"><div align="left" style="padding-left:5px;">Type</div></td>
        <td width="43%"><div align="left" style="padding-left:5px;">Description</div></td>
        </tr>

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


if($row->type==PREPAID)
$type = "Paid";
else
$type = "Return";

?>

      <?

	  		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-top:2px;padding-bottom:2px;"><input name="cehckRate" type="checkbox"  id="cehckRate" value="<?=$passid?>" /></td>
         <td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->creationdate?></td>
         <td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;">
         <a href="#" onclick="return addBalance(<?=$row->amount?>);" title="Amount" >
         <?=$row->amount?></a></td>
         <td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$type?></td>
         <td align=left style="padding-left:10px;"><?=$row->description?></td>
        </tr>





        <?
        $i++;
        }

        }
        ?>


    </table>
 </div>

    </td>
  </tr>


  <tr>
    <td>
<form id="formID"  method="post" action="<?=site_url('reseller/addReseller4Payment')?>">
<input type='hidden' name='id_reseller' id='id_reseller' value='<?= $id_reseller; ?>' >
<input type='hidden' name='lastBalance' id='lastBalance' value='<?= $lastBalance; ?>' >

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border-bottom:1px solid #99BBE8; border-top:1px solid #99BBE8">

  <tr>
    <td colspan="2" class="mainTableTitle" style="padding-top:0px;">

      <span>&nbsp;&nbsp;&raquo;</span> Reseller IV Payment Form

    </td>
  </tr>


<tr>
	<td class='formLabelRigit' width='30%' style='padding-top:10px;padding-bottom:3px;padding-left:5px;'>  Amount :  </td>
	<td class='formLabelLeft' width='70%' style='padding-top:10px;padding-bottom:3px;padding-left:5px;'><input type='text' class='formInput' name='amount' id='amount' style='width:100px;' value='<?= $amount; ?>' /></td>
</tr>

<tr>
	<td class='formLabelRigit' style="padding-top:3px;padding-bottom:3px;">  Type :  </td>
	<td class='formLabelLeft' style="padding-top:3px;padding-bottom:3px;padding-left:5px;">
<select name="type" id="type" class = 'selectFrom'>
    <option value="1">PrePaid</option>
    <option value="3">Return</option>
  </select>
	</td>
</tr>

<tr>
<td class='formLabelRigit' style="padding-top:3px;padding-bottom:3px;"> Date : </td>
<td class='formLabelLeft' style="padding-top:3px;padding-bottom:3px;padding-left:5px;">
<input type='text'  class = 'formInput' name='creationdate' id='creationdate' style='width:150px;' value='<?=$creationdate?>'  disabled="disabled" />
</td>
</tr>


<tr>
	<td class='formLabelRigit' style="padding-top:3px;padding-bottom:3px;">  Description :  </td>
	<td class='formLabelLeft' style="padding-top:3px;padding-bottom:3px;padding-left:5px;"><input type='text' class='formInput' name='description' id='description' style='width:250px;' value='<?= $description; ?>' /></td>
</tr>


  <tr>
    <td colspan="2" align="center" style="padding:15px;"><input type="submit" name="submit" value="Add Payment" class="input-submit" /></td>
  </tr>



</table>

</form>
    </td>
  </tr>
</table>
</div>

<?
//$this->load->view('cpanel/footer');
?>


