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

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

  <tr>
    <td width="45%" valign="top" style="padding-right:10px;">
    <!-- Todays Hourly Call Summary Calls -->
    <!-- End Todays Hourly Call Summary Calls -->

    </td>
    <td width="45%" valign="top" style="padding-left:10px;">
    <!-- Last 7 Days Call Summary Calls -->

    <!-- End Last 7 Days Call Summary Calls -->
    </td>
  </tr>



  <tr>
    <td valign="top" style="padding-right:10px;">

    	<!-- Active Calls -->
		<table class="gbTable" width="100%">
		<tr>
	    	<td colspan="4" class="mainTableTitle">
	      		<span>&nbsp;&nbsp;&raquo;</span> Active Calls (<?=$totalActiveCalls?>)
	   		</td>
  		</tr>

		<tr>
	    	<td colspan="4">
			<div style="height: 140px;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;">Dial Number</div></td>
				        <td width="25%"><div align="left" style="padding-left:5px;">Client</div></td>
				        <td width="35%"><div align="left" style="padding-left:5px;">Duration</div></td>
				     </tr>

					<?
					$ac=1;
					if(is_array($activeCallList))
					{
						foreach($activeCallList as $row)
						{

							$callDuration  = $this->generallib->sec_to_time($row->duration);
							$passid =$ac;

							if($ac%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->dialnumber?></td>
         				<td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->login?></td>
         				<td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$callDuration?></td>
        					</tr>
					<?

							$ac=$ac+1;
						}
					}
					else
					{
					?>
				 	<tr>
				    	<td colspan="15" align="center" style = "padding:50px;"><b>No Active Call Found</b></td>
				  	</tr>
					<?
					}
					?>
				 </table>
			</div>
	   		</td>
  		</tr>

     </table>
	<!-- End Active Calls -->


    </td>
    <td valign="top" style="padding-left:10px;">
    <!-- Active Register Users -->

		<table class="gbTable" width="100%">
		<tr>
	    	<td colspan="4" class="mainTableTitle">
	      		<span>&nbsp;&nbsp;&raquo;</span> Register Users (<?=$totalActiveUser?>)
	   		</td>
  		</tr>

		<tr>
	    	<td colspan="4">
			<div style="height: 140px;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;">Login</div></td>
						<td width="25%"><div align="left" style="padding-left:5px;">IP Address</div></td>
						<td width="35%"><div align="left" style="padding-left:5px;">Time</div></td>
					</tr>


					<?
					$au=1;
					if(is_array($activeUserList))
					{
						foreach($activeUserList as $row)
						{
							$passid =$au;
							if($au%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->accountcode?></td>
         				<td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->ipaddr?></td>
         				<td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->regseconds?></td>
        					</tr>
					<?

							$au=$au+1;
						}
					}
					else
					{
					?>
				 	<tr>
				    	<td colspan="15" align="center" style = "padding:50px;"><b>No Register User Found</b></td>
				  	</tr>
					<?
					}
					?>

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

    <!-- End Active Register Users -->
    </td>
  </tr>




  <tr>
    <td valign="top" style="padding-right:10px;">
    	<!-- Active Calls -->
		<table class="gbTable" width="100%">
		<tr>
	    	<td colspan="4" class="mainTableTitle">
	      		<span>&nbsp;&nbsp;&raquo;</span> Inernal Failed Calls
	   		</td>
  		</tr>

		<tr>
	    	<td colspan="4">
			<div style="height: 140px;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;">Dial Number</div></td>
					<td width="25%"><div align="left" style="padding-left:5px;">IP/Client</div></td>
					<td width="35%"><div align="left" style="padding-left:5px;">Failed Reason</div></td>
				</tr>


					<?
					$aec=1;
					if(is_array($errorCallList))
					{
						foreach($errorCallList as $row)
						{

							$passid =$aec;
							if($aec%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->called_number?></td>
         				<td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->login?></td>
         				<td align=left class="tableBorderAll" style="padding-top:2px;padding-bottom:2px;padding-left:5px;"><?=$row->description?></td>
        					</tr>
					<?

							$aec=$aec+1;
						}
					}
					else
					{
					?>
				 	<tr>
				    	<td colspan="15" align="center" style = "padding:50px;"><b>No Records Found</b></td>
				  	</tr>
					<?
					}
					?>
				</table>
			</div>
	   		</td>
  		</tr>
     </table>

	<!-- End Active Calls -->
    </td>
    <td valign="top" style="padding-left:10px;">
    <!-- Active Register Users -->

		<table class="gbTable" width="100%">
		<tr>
	    	<td colspan="4" class="mainTableTitle">
	      		<span>&nbsp;&nbsp;&raquo;</span> Critical Alam
	   		</td>
  		</tr>

		<tr class="header">
        	<td width="5%">NR</td>
        	<td width="95%"><div align="left" style="padding-left:5px;">Description</div></td>
     	</tr>

 		<tr>
    		<td colspan="15" align="center" style = "padding:50px;"><b>No Records Found</b></td>
  		</tr>
     </table>

    <!-- End Active Register Users -->
    </td>
  </tr>



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


	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableBorder">
	  <tr>
	    <td class="mainTableTitle">

	      <span>&nbsp;&nbsp;&raquo;</span>Sucess Call Summary on Date <?=$callStart?> to <?=$callEnd?>

	    </td>
	  </tr>


	 <tr>
	    <td>

	 <!-- Clinets List -->

	 <table class="gbTable">

	   <tr class="header">
	     <td width="2%"><div align="left" style="padding-left:5px;">NR</div></td>
	     <td width="31%"><div align="left" style="padding-left:5px;">Date</div></td>
	     <td width="7%"><div align="center" style="padding-left:5px;">ASR/ACD</div></td>
	     <td width="15%"><div align="left" style="padding-left:5px;">NumCall</div></td>
	     <td width="15%"><div align="left" style="padding-left:5px;">Duration(H)</div></td>
	     <td width="15%"><div align="left" style="padding-left:5px;">Duration(M)</div></td>
	     <td width="15%"><div align="left" style="padding-left:5px;">ACD</div></td>
	   </tr>



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


	$callDuration  = $this->generallib->sec_to_time($row->totalDuration);
	$durationMin = round($row->totalDuration/60);

	$ACD = ceil($row->totalDuration/$row->totalCall);
	$acdMin = $this->generallib->sec_to_time($ACD);



	?>

	      <?

		  		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;padding-top:2px;padding-bottom:2px;"><input name="checkActive" type="checkbox"  id="checkActive" value="1" /></td>
	 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->callDate?></td>
	 <td align=center class="tableBorderAll" style="padding-left:0px;padding-top:2px;padding-bottom:2px;">
	 <a href="<?=site_url('admin/cpanel/asrSummary/'.$row->callDate)?>" rel='facebox' title="View">
	 <b>View</b>
	 </a>
	 </td>
	 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$row->totalCall?></td>
	 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$callDuration?></td>
	  <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$durationMin?></td>
	 <td align=left class="tableBorderAll" style="padding-left:5px;padding-top:2px;padding-bottom:2px;"><?=$acdMin?></td>
	   </tr>

	<?
	$i++;
	}

	}

	?>

	 </table>

	<!-- End Clients List -->

	    </td>
	  </tr>

</table>

    	</td>
  	</tr>

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





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