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


<script>

var xmlhttp;



function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}




function dopagination(pageNumber)
{
xmlhttp=GetXmlHttpObject();
 if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }


 document.getElementById("loading").style.display = "block";
 document.getElementById("loading").style.visibility = "visible";

var description=document.getElementById("description").value;
var rateType=document.getElementById("rateType").value;
var limit=document.getElementById("limit").value;


if(description=="")
description = "NULL";

if(rateType=="")
rateType = "0";



var url = "<?=site_url("rate/rateListPagination")?>";

var myRandom = parseInt(Math.random()*99999999); // cache buster


xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET", url + "/" + escape(pageNumber) + "/"  + escape(limit) + "/" + escape(description) + "/" + escape(rateType) + "/" + myRandom, true);
xmlhttp.send(null);
}




function searchRate()
{

xmlhttp=GetXmlHttpObject();
 if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }



var description=document.getElementById("description").value;
var limit=document.getElementById("limit").value;
var startoffset=0;
var rateType=document.getElementById("rateType").value;

if(description=="")
description = "NULL";

if(rateType=="")
rateType = "0";


 document.getElementById("loading").style.display = "block";
 document.getElementById("loading").style.visibility = "visible";

var url = "<?=site_url("rate/rateListPagination")?>";
var myRandom = parseInt(Math.random()*99999999); // cache buster


xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET", url + "/" + escape(startoffset) + "/"  + escape(limit) + "/" + escape(description) + "/" + escape(rateType) + "/" + myRandom, true);
xmlhttp.send(null);



}




function stateChanged()
{
if (xmlhttp.readyState==4)
{
rowID = "pagination";
document.getElementById("loading").style.visibility = "hidden";
document.getElementById(rowID).innerHTML=xmlhttp.responseText;
}
}





</script>



<div id = "loading" style="position:absolute;top:200px;left:530px;width;100px;height:100px; bgcolor:#f2f2f2; border:0px solid #99BBE8;zindex:250;display:none;">
<img src="<?=base_url()?>images/indicator2.gif?>" border="0" />
</div>


<?
//$accessTariff = unserialize ($this->session->userdata('accessLevel'));
//$tariffNameAccess = $accessTariff['tariff']['tariff_list'];
?>



<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
    <?=$titleErrorMessage?>
  	</td>
  </tr>

  <tr>
    <td id="right">
      <div id="module_info">

                  <div class="quickmenu">
                      <a href="<?=site_url('setup/newAccount')?>"><i class="fa fa-upload"></i><b>New Accounts</b></a>
                  </div>

                  <i class="fa fa-camera-retro"></i> Users Account List </div>


   <!-- Search Information -->

<fieldset class="search_box" id="advancedSearch" style="margin-bottom:0px;"><legend>Advanced Search</legend>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right">Account Name :</td>
    <td align="left"><input type="text" class = "formInput" name="accountName" id="accountName" value="" style="width:200px"/></td>


<td align="left">

	<a href="#">
	<img src="<?=base_url()?>images/apply.gif" height="22" border="0" />
	</a>

</td>

  </tr>
</table>



</fieldset>

   <!-- End Search Information -->

    </td>
  </tr>

  <tr>
    <td>

<div id = "pagination">

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableBorder">
  <tr>
    <td class="mainTableTitle">
      <i class="fa fa-caret-square-o-down"></i> Users Account List
    </td>
  </tr>


 <tr>
    <td>

 <!-- Clinets List -->

 <table class="gbTable">

   <tr class="header">
     <td width="2%"><div align="center" style="padding-left:0px;">NR</div></td>
     <td width="30%"><div align="left" style="padding-left:5px;">User Name</div></td>
     <td width="30%"><div align="left" style="padding-left:5px;">Account Name</div></td>
     <td width="30%"><div align="left" style="padding-left:5px;">Last Login</div></td>
     <td width="8%" colspan="2"><div align="center" style="padding-left:0px;">Action</div></td>
   </tr>



<?
$i=1;
if(is_array($accountList))
{
foreach($accountList 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 class="gbTableTDCenter"><input name="checkActive" type="checkbox"  id="checkActive" value="1" /></td>
 <td class="gbTableTD"><?=$row->login?></td>
 <td class="gbTableTD"><?=$row->full_name?></td>
 <td class="gbTableTD"><?=$row->last_login?></td>
 <td class="gbTableTDCenter" colspan="2">

	 <a href="<?=site_url('setup/editAccount/'.$row->id.'/0')?>" title="Edit Tariff " >
		<i class="fa fa-edit"></i>
	 </a>

	 <a href="<?=site_url('setup/deleteAccount/'.$row->id)?>" onclick="return confirm('Do you really want to remove this Account Information')" title="Delete" >
		<i class="fa fa-trash-o"></i>
	 </a>

 </td>
</tr>

<?
$i++;
}

}
else
{

?>

 <tr>
    <td colspan="10" align="center" style = "padding:100px;">


        <b>No Records Found</b>

    </td>
  </tr>


<?
}
?>

 </table>

<!-- End Clients List -->

    </td>
  </tr>

  <tr>
    <td align="center" style="padding-top:5px;">

    </td>
  </tr>

</table>

</div>



    </td>
  </tr>

</table>


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