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



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

<input type='hidden' name='id_trunk' id='id_trunk' value='<?= $id_trunk; ?>' >
<input type='hidden' name='action' id='action' value='<?= $action; ?>' >
<div align="center">
<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> <?=$titleMessage?>  <?=$titleErrorMessage?>  </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"><?=TITLE038?></td>
  </tr>

<tr>
	<td class='formLabelRigit' width='30%' style='padding-top:10px;'>  Description :  </td>
	<td class='formLabelLeft' width='70%' style='padding-top:10px;'><input type='text' class='validate[required,length[5,15]] formInput' name='description' id='trunkcode' style='width:150px;' value='<?= $description; ?>' />
    <span style="padding:5px;font-size:11px;color:#FF0000">	*	</span>
	</td>
</tr>




<tr>
	<td class='formLabelRigit'>  Provider IP :  </td>
	<td class='formLabelLeft'><input type='text' class='validate[required] formInput' name='providerip' id='providerip' style='width:150px;' value='<?= $providerip; ?>' />
	<span style="padding:5px;font-size:11px;color:#FF0000">	*	</span>
	</td>
</tr>


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



<tr>
	<td class='formLabelRigit'> Disallow loss?  :  </td>
	<td class='formLabelLeft'>

	<?
		if($disallow_loss ==1)
		$checkLoss = "checked='checked'";
		else
		$checkLoss = "";
	?>
		<input name="disallow_loss"  type="checkbox" id="disallow_loss" value="1" <?=$checkLoss?> />
</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 -->



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


		<tr>
			<td class='formLabelRigit' width='30%' style='padding-top:10px;'>  Protocal :  </td>
			<td class='formLabelLeft' width='70%' style='padding-top:10px;'>
			    <select name="providertech" id="providertech" class = "selectFrom" style='width:100px;'>
			    <?=$protocalList?>
    			</select>
			<span style="padding:5px;font-size:11px;color:#FF0000">	*	</span>
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Current Connection :  </td>
			<td class='formLabelLeft'><input type='text' name='inuse' id='inuse' class='validate[required] formInput' style='width:50px;' readonly value='<?= $inuse; ?>' />
			<span style="padding:5px;font-size:11px;color:#FF0000">	* Currently Used Channel 	</span>
			</td>
		</tr>

		<tr>
			<td class='formLabelRigit'>  Max Connection :  </td>
			<td class='formLabelLeft'><input type='text' name='maxuse' id='maxuse' class='validate[required] formInput' style='width:50px;' value='<?= $maxuse; ?>' />
			<span style="padding:5px;font-size:11px;color:#FF0000">	* 	</span>
			</td>
		</tr>




		<tr>
			<td class='formLabelRigit'> Active :  </td>
			<td class='formLabelLeft'>

		<?
		if($status ==1)
		$checkDisable = "checked='checked'";
		else
		$checkDisable = "";
		?>
		<input name="status"  type="checkbox" id="status" value="1" <?=$checkDisable?> />

		</td>
		</tr>



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


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


  <tr>
    <td colspan="2" align="center" style="padding:15px;"><input type="submit" name="submit" value="<?= $action == 'Add' ? " Submit Now " : "Edit Now" ?>" class="input-submit" /></td>
  </tr>


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



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