<?php
 require_once("setting.php");
	
    require_once(connection);
$id2=$_POST['c_id'];
	$sqli="SELECT * FROM c_bill where c_id=$id2 ORDER BY c_inv DESC LIMIT 1";
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'];
  $month = date('F', mktime(0,0,0,$bill_month, 1, date('Y')));
$sqle="SELECT * FROM pkg where pkg_id=$pkg_id";
if ($resulte=mysqli_query($con,$sqle)){
	while($rowe = $resulte->fetch_assoc()) { 
$pkg_name = $rowe['pkg_name'];

	
	}}

$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'];
?>



	
	
	
<!DOCTYPE html>
<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>
<body>

<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>
<div class="container" style="page-break-before: always;">
<div class="row">
<!-- logo -->
<div class="col-sm-2"><img src="<?php echo logo;?>" width="50px"/></div><div class="col-xs-6">
<h2>City Link Internet Network</h2> 
</div>
<div class="col-xs-3 col-sm-7 col-md-10 text-right">
<h3>INVOICE # <?php echo $c_inv;?></h3></div>

</div>

<!-- customer detail -->
<div class="row">
<div class="col-xs-8 col-sm-6 col-md-8" ><b><?php echo $name;?></b></br>
<?php echo $address;?>
</div>
<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">Billing Month </td>
<td class="border-0"><?php echo $month."/".date('Y');?></td>
</tr><tr>
<td class="border-0">Amount Due </td>
<td class="border-0">Rs.<?php echo $total_amount;?></td>
</tr><tr>
<td class="border-0">Due Date </td>
<td class="border-0"><?php echo $due_date;?></td>
</tr>
<tbody>
</table>

</div>
</div>
<!-- services detail -->
<div class="row">
<div class="col-xm-4 col-sm-4 text-center">
Services Detail
</div><div class="col-xm-4 col-sm-4 text-center">
Packages Detail
</div><div class="col-xm-4 col-sm-4 text-center">
Bill Summery
</div>
</div>
<div class="row">
<div class="col-md-4"">
<table class="table table-sm" border="0">
<tbody>
<tr>
<td ><?php echo $pkg_name;?></td>
<td>Rs:<?php echo $bill_amount;?></td>
</tr>
</table></div>
<div class="col-md-4">
<table class="table table-sm" border="0">
<tbody>
<?php
$sqle="SELECT * FROM pkg";
if ($resulte=mysqli_query($con,$sqle)){
	while($rowe = $resulte->fetch_assoc()) { 
$pkg_name = $rowe['pkg_name'];
echo '<tr><td>'.$rowe['pkg_name'].':</td><td>Rs: '.$rowe['pkg_price'].'</td></tr>';
	
	}}
?>

</tbody>
</table>
</div>
<div class="col-md-4" >
<table class="table table-sm" border="0">
<tbody>
<tr>
<td class="border-0">Fix Brodband</td>
<td class="border-0">Rs:<?php echo $bill_amount;?></td>
</tr><tr>
<td class="border-0">Value Add Services</td>
<td class="border-0">Rs: 0</td>
</tr><tr>
<td class="border-0">Arear</td>
<td class="border-0">Rs: 0</td>
</tr><tr>
<td class="border-0">Discount</td>
<td class="border-0">Rs. 0</td>
</tr><tr>
<td class="border-0">Grand Total</td>
<td class="border-1">Rs.<?php echo $total_amount;?></td>
</tr>
<tbody>
</table></div>
</div >
<!-- bill history -->
<div class="row text-center">
Bill History
<div class="col-sm-12 col-md-12 text-right">
<table class="table table-sm" border="0">
<tbody>
<tr>
<td class="border-0">Jan/18&nbsp;</td>
<td class="border-0">Rs: 1000 &nbsp;</td>
<td class="border-0">Feb/18&nbsp;</td>
<td class="border-0">Rs: 1000&nbsp;</td>
<td class="border-0">Mar/18&nbsp;</td>
<td class="border-0">Rs: 1000&nbsp;</td>
</tr><tr>
<td class="border-0">Apr/&nbsp;</td>
<td class="border-0">Rs: 0</td>
<td class="border-0">May/</td>
<td class="border-0">Rs: 0</td>
<td class="border-0">Jun/</td>
<td class="border-0">Rs: 0</td>
</tr><tr>
<td class="border-0">Jul/</td>
<td class="border-0">Rs: 0</td>
<td class="border-0">Aug/</td>
<td class="border-0">Rs: 0</td>
<td class="border-0">Sep/</td>
<td class="border-0">Rs: 0</td>
</tr><tr>
<td class="border-0">Oct/</td>
<td class="border-0">Rs. 0</td>
<td class="border-0">Nov/</td>
<td class="border-0">Rs. 0</td>
<td class="border-0">Dec/</td>
<td class="border-0">Rs. 0</td>
</tr></tbody></table>

</div >
</div >
<!-- payment history -->
<div class="row">
<div class="col-sm-12 col-md-12">
<hr> 
DEAR CUSTOMER, KINDLY PAY THE BILL IMMEDIATELY TO CONTINUE ENJOYINGUN-INTERRUPTED SERVICES.
<hr>
</div >
</div>
<div class="row">
<div class="col-sm-12 col-md-12 text-center"> 
<h4>FOR PAYMENT USE....</h4>
<hr>
</div >
</div>
<div class="row">
<div class="col-sm-4 col-md-4">
<table class="table table-sm">
<tbody>
<tr>
<td class="border-0">Customer ID:</td>
<td class="border-0"><?php echo $c_id;?></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">Phone #</td>
<td class="border-0">0462540927</td>
</tr></tbody>
</table>
</div >
<div class="col-sm-4 col-md-4">

</div >
<div class="col-sm-4 col-md-4" >

<table class="table table-sm">
<tbody>
<tr>
<td class="border-0">Invoice #:</td>
<td class="border-0"><?php echo $c_inv;?></td>
</tr><tr>
<td class="border-0">Billing Month</td>
<td class="border-0"><?php echo $month."/".date('Y');?></td>
</tr><tr>
<td class="border-0">Due Date</td>
<td class="border-0"><?php echo $due_date;?></td>
</tr>
<tr>
<td class="border-0">Amount Due</td>
<td class="border-0">Rs:<?php echo $bill_amount;?></td>
</tr></tbody>
</table>

</div >
</div >
<!-- logo -->









</div>
</body>
</html>
	
	
	
	
	
	
	
	
	
	
	<?php
	}}






	}}
//  $month = date('F', mktime(0,0,0,$bill_month, 1, date('Y')));


?>



