
<?php
require_once("setting.php");
	
    require_once(connection);

$c_id=$_POST['c_id'];


$sql2="SELECT * FROM customer where c_id=$c_id";
if ($result2=mysqli_query($con,$sql2)){
	while($row2 = $result2->fetch_assoc()) { 
$name = $row2['c_name'];
$fname = $row2['c_fname'];
$address = $row2['c_address'];
$pkg = $row2['c_pkg'];
$mobile = $row2['c_phone1'];

$sqle="SELECT * FROM pkg where pkg_id=$pkg";
if ($resulte=mysqli_query($con,$sqle)){
	while($rowe = $resulte->fetch_assoc()) { 
$pkg_name = $rowe['pkg_name'];

	
	}}
}}
?>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <script src="js/jquery.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
</head>
<div class="d-print-none">
        <br>
        <button style="background-color: floralwhite" onclick="window.print()">Print Bill</button>
        <button style="background-color: floralwhite" onclick="history.go(-1);">Back</button>
        <br>
        <br>
    </div>
<body>
<div class="container" class="printableArea">
<div class="row">
<!-- logo -->
<div class="col-xs-6"><img src="<?php echo logo;?>" width="55px"/></div>
<h2>City Link Internet Network</h2> 
</div>
<!-- customer detail -->

<div class="row">
<div class="col-md-4">
<table class="table table-sm">
<tbody>
<tr >
<td class="border-0">Issue Date:</td>
<td class="border-0"><?php echo date('d-m-Y');?></td>
</tr><tr>
<td class="border-0">Account ID</td>
<td class="border-0"><?php echo $c_id;?></td>
</tr><tr>
<td class="border-0">Name </td>
<td class="border-0"><?php echo $name;?></td>
</tr><tr>
<td class="border-0">Address</td>
<td class="border-0"><?php echo $address;?></td>
</tr>
<tbody>
</table>

</div>
</div>
<!-- services detail -->
<div class="row text_center" >
<h4> Customer Annual Statement</h4>
</div>

<div class="col-md-9">
<table class="table table-sm" border="0">
<tbody>
<tr>
<th>Month</th>
<th>Due Date</th>
<th>Pkg Plan</th>
<th>Bill Amount</th>
<th>Paid Amount</th>
</tr>
<?php
	$sqli="SELECT * FROM c_bill where c_id=$c_id AND YEAR(due_date) = '2018'";
if ($resulti=mysqli_query($con,$sqli)){
while($rowi = $resulti->fetch_assoc()) { 
$c_inv =$rowi['c_inv'];
$c_id =$rowi['c_id'];
$pkg_id =$rowi['pkg_id'];
$arear =$rowi['arear'];
$bill_amount =$rowi['bill_amount'];
$total_amount =$rowi['total_amount'];
$due_date =$rowi['due_date'];
$bill_month =$rowi['bill_month'];
$paid =$rowi['paid'];
  $month = date('F', mktime(0,0,0,$bill_month, 1, date('Y')));



echo '<tr><td>'.$month.'</td><td>'.$due_date.'</td><td>'.$pkg_name.'</td><td>'.$total_amount.'</td><td>'.$paid.'</td></tr>';



}}
?>
</tbody>
</table>
</div>
</div >
<!-- bill history -->
</body>
</html>




