<?
$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('client/addEditAni')?>">

<input type='hidden' name='id' id='id' value='<?= $id; ?>' >
<input type='hidden' name='idAddress' id='idAddress' value='<?= $idAddress; ?>' >
<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">

				<div class="quickmenu" style='padding-left:10px;'>
					<!--
					<a href="<?=site_url('client/showAniNumberForm/'.$id.'/'.ANI_USER)?>" rel='facebox' title="Add Payment">
					<img src="<?=base_url()?>/images/add_phone.png" border="0" height="18">
				    </a>
				    -->
					<img src="<?=base_url()?>images/qb_remove.gif" align="baseline" width="9" height="9" border="0" alt="" />
					<a href="<?=site_url('client/showAniNumberForm/'.$id.'/'.ANI_USER)?>" rel='facebox'><b>Add Phone Number</b></a>
				</div>

				<div class="quickmenu">
					<img src="<?=base_url()?>images/qb_remove.gif" align="baseline" width="9" height="9" border="0" alt="" />
					<a href="<?=site_url('client/showSpeedDialForm/'.$id.'/'.ANI_USER)?>" rel='facebox' ><b>Add Speed Dial</b></a>
				</div>


                  <span>&nbsp;&nbsp;&raquo;</span> <?=TITLE051?>  <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' style='width:130px;' readonly value='<?= $login; ?>' />
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Password :  </td>
	<td class='formLabelLeft'><input type='text' class='validate[required,length[6,15],custom[noSpecialCaracters]] formInput' name='password' id='password' style='width:130px;' value='<?= $password; ?>' />
	<span style="padding:5px;font-size:11px;color:#FF0000">	*</span>
	</td>
</tr>

<tr>
	<td class='formLabelRigit'> Register Phone/PIN :  </td>
	<td class='formLabelLeft'><input type='text' class='formInput' name='pinnumber' id='pinnumber' style='width:130px;' readonly value='<?= $pinnumber; ?>' />
	</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'>
	<div style="padding-top:0px; float:left">
	<input type='text' class='validate[required] formInput' name='balance' id='balance' style='width:120px;' readonly value='<?= $balance; ?>' />
	</div>
	<div style="padding-top:2px;padding-left:5px; float:left">
	<a href="<?=site_url('client/showPaymentForm/'.$id.'/'.ANI_USER.'/'.$balance.'/'.$id_reseller)?>" rel='facebox' title="Add Payment">
	<img src="<?=base_url()?>/images/add_payment.gif" border="0" height="18">
    </a>
	</div>
	</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>
    <span style="padding:5px;font-size:11px;color:#FF0000">	*	</span>
	</td>
</tr>
<!--
<tr>
	<td class='formLabelRigit'>  Call Limit :  </td>
	<td class='formLabelLeft'><input type='text' class='formInput' name='calllimit' id='calllimit' style='width:100px;' value='<?= $calllimit; ?>' />
	</td>
</tr>


<tr>
	<td class='formLabelRigit'>  Billing Plan :  </td>
	<td class='formLabelLeft'>
	  <select name="plan_id" id="plan_id" class="selectFrom">
	    <?=$planList?>
    </select>
	</td>
</tr>
-->



<!--
<tr>
	<td class='formLabelRigit'>  Lot Name :  </td>
	<td class='formLabelLeft'>
	  <select name="lot_id" id="lot_id" class="selectFrom">
	    <?=$lotsList?>
    </select>
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  Plan Name :  </td>
	<td class='formLabelLeft'>
	  <select name="plan_id" id="plan_id" class="selectFrom">
	    <?=$planList?>
    </select>
	</td>
</tr>


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


<tr>
	<td class='formLabelRigit'>  Valid Days :  </td>
	<td class='formLabelLeft'><input type='text' class='validate[required,custom[onlyNumberFormate]] formInput' name='validdays' id='validdays' style='width:40px;' readonly value='<?= $validdays; ?>' />
	</td>
</tr>

<tr>
	<td class='formLabelRigit'>  New Valid Days :  </td>
	<td class='formLabelLeft'><input type='text' class='validate[required,custom[onlyNumberFormate]] formInput' name='newValiddays' id='newValiddays' style='width:40px;' value='<?= $validdays; ?>' />
	<span style="padding:5px;font-size:11px;color:#FF0000">	* 0 for Unlimit Days	</span>
	</td>
</tr>


<tr>
	<td class='formLabelRigit'> After First Use ? :  </td>
	<td class='formLabelLeft'>

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

</td>
</tr>



		<tr>
			<td class='formLabelRigit'>  First Used :  </td>
			<td class='formLabelLeft'><input type='text' class='formInput' name='firstuse' id='firstuse' style='width:70px;' readonly value='<?= $firstuse; ?>' />
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Expire Date :  </td>
			<td class='formLabelLeft'><input type='text' class='validate[required,custom[date]] formInput' name='expiredate' id='expiredate' style='width:70px;' readonly value='<?= $expiredate; ?>' />
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Last Used :  </td>
			<td class='formLabelLeft'><input type='text' class='formInput' name='lastuse' id='lastuse' style='width:70px;' readonly value='<?= $lastuse; ?>' />
			</td>
		</tr>

-->



<tr>
	<td class='formLabelRigit'> Auto ANI? :  </td>
	<td class='formLabelLeft'>

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

</td>
</tr>


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

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

</td>
</tr>


  <tr>
    <td colspan="2" class="mainTableTitle"><?=TITLE069?></td>
  </tr>



  <tr>
    <td colspan="2">

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

<table class="gbTable" width="100%">
<tr class="header">
        <td width="5%">Nr</td>
        <td width="38%"><div align="left" style="padding-left:5px;">Name</div></td>
        <td width="40%"><div align="left" style="padding-left:5px;">Phone Number</div></td>
        <td width="10%"><div align="left" style="padding-left:5px;">Dial Key</div></td>
        <td width="7%"><div align="center" style="padding-left:5px;">Del</div></td>
        </tr>

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


?>

      <?

	  		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->name?></td>
         <td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->phone?></td>
         <td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->speeddial?></td>
		 <td align=center  style="padding-left:5px;">
		  <a href="<?=site_url('client/deleteSpeedDial/'.$row->id.'/'.$id)?>" onclick="return confirm('Do you really want to remove this Speed Dial?')" title="Delete" >
		  <img src="<?=base_url()?>images/remove.png" border="0" height="16">
		  </a>
		 </td>
        </tr>

        <?
        $i++;
        }

        }
        ?>


    </table>
 </div>
    </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"><?=$titlePersonalMessage?></td>
		  </tr>

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

		<tr>
			<td class='formLabelRigit'>  Email :  </td>
			<td class='formLabelLeft'><input type='text' name='email' id='email' class='formInput' style='width:150px;' value='<?= $email; ?>' /></td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Phone No. :  </td>
			<td class='formLabelLeft'><input type='text' name='phone' id='phone' class='formInput' style='width:150px;' value='<?= $phone; ?>' /></td>
		</tr>

		<tr>
			<td class='formLabelRigit'>  City :  </td>
			<td class='formLabelLeft'><input type='text' name='city' id='city' class='formInput' style='width:150px;' value='<?= $city; ?>' /></td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Country :  </td>
			<td class='formLabelLeft'>
				  <select name="country" id="country" class="selectFrom">
				    <?=$countryList?>
				    </select>
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  State :  </td>
			<td class='formLabelLeft'><input type='text' name='state' id='state' class='formInput' style='width:150px;' value='<?= $state; ?>' /></td>
		</tr>


		<tr>
			<td class='formLabelRigit' valign='top'>  Address :  </td>
			<td class='formLabelLeft'><textarea class='formInputTextArea' NAME='address' id='address' ><?= $address; ?></textarea></td>
		</tr>


  <tr>
    <td colspan="2" class="mainTableTitle"><?=TITLE053?></td>
  </tr>


  <tr>
    <td colspan="2">

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

<table class="gbTable" width="100%">
<tr class="header">
        <td width="5%">Nr</td>
        <td width="35%"><div align="left" style="padding-left:5px;">Date</div></td>
        <td width="53%"><div align="left" style="padding-left:5px;">ANI Number</div></td>
        <td width="7%"><div align="center" style="padding-left:5px;">Del</div></td>
        </tr>

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


?>

      <?

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

        <?
        $i++;
        }

        }
        ?>


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

    <!--
	<tr>
		<td class='formLabelRigit'>  Commission :  </td>
		<td class='formLabelLeft'><input type='text' class='validate[required,custom[onlyNumber]] formInput' name='commission' id='commission' style='width:40px;' value='<?= $commission; ?>' /> %
		</td>
	</tr>

		<tr>
			<td class='formLabelRigit'>  Free Mins :  </td>
			<td class='formLabelLeft'><input type='text' class='validate[required,custom[onlyNumberFormate]] formInput' name='additionalmins' id='additionalmins' style='width:40px;' value='<?= $additionalmins; ?>' />
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Dialy Charge :  </td>
			<td class='formLabelLeft'><input type='text' class='formInput' name='dailycharge' id='dailycharge' style='width:70px;' value='<?= $dailycharge; ?>' />
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'>  Per Call Charge :  </td>
			<td class='formLabelLeft'><input type='text' class='formInput' name='percallcharge' id='percallcharge' style='width:70px;' value='<?= $percallcharge; ?>' />
			</td>
		</tr>


		<tr>
			<td class='formLabelRigit'> Recognize by ANI :  </td>
			<td class='formLabelLeft'>

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

		</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');
?>
