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

		<script src="<?=base_url()?>js/jquery.validationEngine-en.js" type="text/javascript"></script>
		<script src="<?=base_url()?>js/jquery.validationEngine.js" type="text/javascript"></script>



		<script>
		$(document).ready(function() {


			$("#formID").validationEngine()


			//$.validationEngine.loadValidation("#date")
			//alert($("#formID").validationEngine({returnIsValid:true}))
			//$.validationEngine.buildPrompt("#date","This is an example","error")	 		 // Exterior prompt build example
			//$.validationEngine.closePrompt(".formError",true) 							// CLOSE ALL OPEN PROMPTS
		});

	</script>






<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td colspan="2" valign="top" style="padding-top:20px;">

      <img src="<?=base_url()?>images/s.gif" width="600" height="1" border="0" alt="" />
      <div id="module_info">

                  <span>&nbsp;&nbsp;&raquo;</span> <?=FROMMESSAGE034?>  <span style='color:#BF0000'><?=$titleErrorMessage?> <span>  </div>

    </td>
  </tr>

  <tr>
    <td width="40%" valign="top" style="padding-top:10px;padding-right:5px;">
    <!-- Account Information -->

<table width="100%" class="tableBorder" border="0"  cellpadding="2" cellspacing="2">
  <tr>
    <td colspan="2" class="mainTableTitle"><?=$titleAccountMessage?></td>
  </tr>

<tr>
	<td class='formLabelRigit' width='30%' style='padding-top:10px;'>  Login :  </td>
	<td class='formLabelLeft' width='70%' style='padding-top:10px;'><input type='text' class='formInput' name='login' id='login' readonly style='width:120px;' value='<?= $login; ?>' />
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Password :  </td>
	<td class='formLabelLeft'><input type='password' class='validate[required,custom[onlyCaracters],length[6,15]] formInput' name='password' id='password' style='width:120px;' value='<?= $password; ?>' />
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Parent :  </td>
	<td class='formLabelLeft'>
	  <select name="id_reseller" id="id_reseller" class="selectFrom">
	    <?=$resellerLevel1List?>
    </select>
	</td>
</tr>


<tr>
	<td class='formLabelRigit'> Balacne :  </td>
	<td class='formLabelLeft'>
	<input type='text' class='formInput' name='balance' id='balance' readonly style='width:80px;' value='<?= $balance; ?>' />
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Tariff Name :  </td>
	<td class='formLabelLeft'>
	  <select name="id_rate" id="id_rate" class="validate[required] selectFrom">
	    <?=$rateList?>
    </select>
	</td>
</tr>


<tr>
	<td class='formLabelRigit'>  Call Limit :  </td>
	<td class='formLabelLeft'><input type='text' class='formInput' name='calllimit' id='calllimit' style='width:50px;' value='<?= $calllimit; ?>' />
	<span style="padding:5px;font-size:11px;color:#FF0000">	*</span>
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Dial Prefix :  </td>
	<td class='formLabelLeft'><input type='text' class='formInput' name='tech_prefix' id='tech_prefix' style='width:100px;' value='<?= $tech_prefix; ?>' />
	</td>
</tr>

<!--
<tr>
	<td class='formLabelRigit'>  Billing Prefix :  </td>
	<td class='formLabelLeft'><input type='text' class='formInput' name='billing_prefix' id='billing_prefix' style='width:100px;' value='<?= $billing_prefix; ?>' />
	</td>
</tr>
-->




  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>



    <!-- End Account Information -->

    </td>
    <td width="40%" valign="top" style="padding-top:10px;padding-left:5px;">
    <!-- Personal Information -->

	<form id="formID"  method="post" action="<?=site_url('client/addClientsIPAddress')?>">

	<input type='hidden' name='id' id='id' value='<?= $id; ?>' >
	<input type='hidden' name='action' id='action' value='<?= $action; ?>' >


		<table width="100%" class="tableBorder" border="0"  cellpadding="2" cellspacing="2">
		  <tr>
			<td colspan="2" class="mainTableTitle"><?=$titlePersonalMessage?></td>
		  </tr>

		  <tr>
			<td colspan="2">
			<!-- Start IP Address Info -->

 <table class="gbTable">

   <tr class="header">
     <td width="5%"><div align="left" style="padding-left:5px;">NR</div></td>
     <td width="58%"><div align="left" style="padding-left:5px;">IP Address</div></td>
     <td width="15%"><div align="left" style="padding-left:5px;">Port</div></td>
     <td width="15%"><div align="left" style="padding-left:5px;">Type</div></td>
 	 <td width="8%"><div align="center" style="padding-left:0px;">Del</div></td>
   </tr>

<?
$i=1;
if(is_array($ipAddressInfo))
{
foreach($ipAddressInfo as $row)
{
$passid =$i;

if($row->context==ANI_CONTEXT)
$type = "ANI";
elseif($row->context==WHOLESALE_CONTEXT)
$type = "Wholesale";
elseif($row->context==SIP_CONTEXT)
$type = "SIP";
else
$type = "None";

?>

      <?

	  		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->ipaddr?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$row->port?></td>
 <td align=left class="tableBorderAll" style="padding-left:5px;"><?=$type?></td>
 <td align=center  style="padding-left:0px;">
  <a href="<?=site_url('client/deleteClientsIPAddress/'.$row->id_client.'/'.$row->id)?>"  onclick="return confirm('Do you really want to remove this IP Address:<?=$row->ipaddr?> ?')" title="Delete" >
  <img src="<?=base_url()?>images/remove.png" border="0" height="16">
  </a>
 </td>

<?
$i++;
}
}
?>


  </table>

			<!-- End IP Address Info -->
			</td>
		  </tr>

		<tr>
			<td class='formLabelRigit' style="padding-top:10px;" width='22%'>  IP, Port & Type :  </td>
			<td class='formLabelLeft' style="padding-top:10px;" width='78%'>
			<div style="padding-top:0px; float:left">
			<input type='text' name='ipAddress' id='ipAddress' class='validate[required,custom[onlyIPAddress]] formInput' style='width:120px;' maxlength='15' value='' />
			</div>
			<div style="padding-top:0px;padding-left:3px; float:left">
			<input type='text' name='port' id='port' class='validate[required,custom[onlyNumber]] formInput' style='width:40px;' maxlength='4' value='' />
			</div>
			<div style="padding-top:0px;padding-left:3px; float:left">
	  		<select name="ipType" id="ipType" class="selectFrom" style="width:100px;">
	    	<option value="<?=WHOLESALE_CONTEXT?>">Wholesale</option>
	    	<option value="<?=ANI_CONTEXT?>">ANI</option>
    		</select>
			</div>
			<div style="padding-top:1px;padding-left:3px; float:left">
			<input type="image" name="imageField" src="<?=base_url()?>/images/add_now.png" />
			</div>
			</td>
		</tr>


		  <tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		  </tr>
		</table>
</form>

    <!-- End Personal Information -->
    </td>
  </tr>





  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>




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