<?php 
include('config.php');
$id=$_GET['id'];
$data1 = mysql_query("SELECT * FROM `memberinfo` where id=$id");
  while($info = mysql_fetch_array($data1)) 
	{ 
	$a="";
	$b="";
	$c=$info['chargeforsms'] ;
	$d=$info['totalsms'];
	 $charge=($c * $d);
	 //echo $charge;
	 $clientname=$info['clientname'] ;
	 $undelivered=$info['undelivered'] ;
	  $country=$info['country'] ;
	
	$a.='<td>'.date("F j, Y, g:i a",strtotime($info['senddate'])).'</td>
	<td>'.$info['senderid'].'</td>
	<td>'.$info['smstext'].'</td>
	<td>'.$info['smstype'].'</td>
	';
	$delivered=$info['delivered'];
	$subtooperator=$info['subtooperator'];
	$chargeforsms=$info['chargeforsms'];
	$totalsms=$info['totalsms'];
	$pdf=$info['pdf'];
	 $price_state=$info['price_type'];
	$chargeforsms="AED ".$chargeforsms;
	$charge="AED ".$charge;
	$img_path = _BASE_PATH."images/bar.jpg";
	
	$in_queue = $d - ($delivered + $subtooperator + $undelivered);
	
	}



?>
<link href="css/style.css" rel="stylesheet"/>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
window.print();
})
</script>
<div class="title" style="font-size: 22px;color: #666;display: table;">
DLR Details : <?php echo $clientname; ?>
</div>
<div style="width:100%;">
<div style="float:left; width:45%;">
<h3 class="newline"> Progress </h3>
<div style="margin:10px 0px; clear:both;">
<div class="bar"></div>
<span style="float:left; margin-left:10px; font-size:12px;">Total SMS : <?php echo $totalsms; ?> </span>
</div>
<div style="margin:10px 0px; padding:10px 0px; clear:both;">
<?php if($in_queue != 0){ ?>
<div class="green"></div>
<?php }else { ?>
<div style="width:500px; background:#f1f1f1; float:left;">&nbsp;</div>
<?php } ?>
<span style="float:left; margin-left:10px; font-size:12px;">In Queue : <?php echo $in_queue; ?></span>
</div>
<table class="sidebrd" style="margin-top:50px;" width="500" border="0" cellspacing="0" cellpadding="0">
  <tr class="bgrey">
   <td class="sdate">Send Date </td>
	<td class="sdate">Sender Id </td>
	<td class="stext">SMS Text </td>
	<td class="stype">SMS Type </td>
	 </tr>
	  <tr>
   <?php
   echo $a;
 ?>
	  </tr>
 


</table>
</div>
<div style="float:right; width:45%;">
<h3 class="newline"> SMS Summary </h3>

<table class="sidebrdright" border="0" width="500" cellpadding="0" cellspacing="0">
   <tr class="bgrey">
	 <td>Total SMS Submitted</td>
	  <td> <span class="smsund"><?php echo $totalsms; ?> </span></td>
	  </tr>
  <tr>
  
	<td>Delivered</td>
	  <td><span class="smsd"><?php echo $delivered; ?> </span> </td>
	
	  </tr>
	  
	   <tr class="bgrey">
  
	<td>Undelivered</td>
	  <td><span class="smssub"><?php echo $undelivered; ?> </span> </td>
	
	  </tr>
	    <td>Submitted to operator  </td>
	  <td><span class="smsdww"><?php echo $subtooperator; ?> </span></td>
	  <tr>
	  
	  
	    </tr>
	<?php if($price_state == 1) { ?>		
	  <tr class="bgrey">
	  <td>Charges per SMS:  </td>
	  <td> <span class="chargesms"><?php if($price_state == 1){ echo $chargeforsms; } else{ echo "NA"; } ?> </span> </td>
	  </tr>
	  

	 
	   <tr>
	 <td>Credits deducted:</td>
	  <td><span class="chargesms"><?php if($price_state == 1){ echo $charge; } else { echo "NA"; } ?> </span> </td>
	  </tr>
	  <?php } ?>
	    <!--<tr class="bgrey">
	 <td>Downlond Pdf</td>
	  <td>
	  <a href="pdf/<?php echo $pdf; ?>" download><?php echo $pdf; ?></a>
	   </td>
	  </tr>-->
 <tr class="bgrey">
	 <td>Country </td>
	  <td><?php echo $country; ?> </td>
	  </tr>

</table>
</div>