<?php session_start();



if($_SESSION[invcox] == ""){



header("location:login.php?action=need");



}else{

include("config.php");


		  $dresult=mysql_query("select * from income WHERE id='$_GET[id]' limit 1");
          $drow=mysql_fetch_array($dresult);
	
		 
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Invoice - ARNIM RESORT</title>
<style>
    body {
        font-family: 'Segoe UI', Arial, sans-serif;
        margin: 0;
        padding: 0;
        background: #e9eef3;
    }

    .invoice-container {
        width: 820px;
        margin: 40px auto;
        background: #ffffff;
        padding: 40px 45px;
        border: 2px solid #000;
        box-shadow: 0 0 12px rgba(0,0,0,0.15);
    }

    .logo {
        text-align: center;
        margin-bottom: 10px;
    }

    .logo img {
        
        height: auto;
    }

    .heading {
        text-align: center;
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 2px;
        margin-bottom: 25px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .section-title {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #333;
        text-transform: uppercase;
    }

    .section {
        margin-bottom: 25px;
        padding-bottom: 10px;
        border-bottom: 1px dashed #aaa;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 12px;
        font-size: 15px;
    }

    table, th, td {
        border: 1px solid #000;
    }

    th {
        padding: 12px;
        text-align: center;
        background: #f0f0f0;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    td {
        padding: 12px;
    }
.bill td {
        padding: 8px;
    }
    .right {
        text-align: right;
        font-weight: 600;
    }

    .summary-table td:first-child {
        text-align: right;
        width: 70%;
    }

    .grand-total {
        background: #f6f6f6;
        font-size: 17px;
        font-weight: 700;
    }

    .footer {
        margin-top: 35px;
        text-align: center;
        font-size: 14px;
        padding-top: 15px;
        border-top: 1px solid #aaa;
    }

    
	
	
	@media print {
  body {
    background: #fff !important;
  }

  .invoice-container {
    border: 2px solid #000 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  table, th, td, .section, .heading, .footer, div {
    border-color: #000 !important;
  }

  * {
    color-adjust: exact !important;
  }
}

</style>
</head>
<body>

<div class="invoice-container">

<div class="section" style="display:flex; justify-content:space-between; align-items:flex-start;">
    <div class="logo">
        <img src="images/wlogo.png" alt="Hotel Logo">
    </div>

   <div><strong>--------</strong>|<strong> ARNIM RESORT - COX'S BAZAR </strong>|<strong>-------<br>
      Address :</strong> 492, Marine Drive Road, Kolatoli, Cox's Bazar.<br>
      <strong>Phone :</strong> 01758-383938, 01866-000640, 0197-2288-526<br>
      <strong>E-mail : </strong>rsv@arnimresort.com, <strong>Web:</strong> arnimresort.com</div>
</div>
	
   

    <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; border-bottom:2px solid #000; padding-bottom:10px;">
    <div class="heading" style="margin:0; border:none; padding:0;">MONEY RECEIPT </div>
  </div>

    <div class="section" style="display:flex; justify-content:space-between; align-items:flex-start;">
    <div>  
        <strong>Serial No : </strong>M-<?php echo $drow[id];?>  </div>

    <div style="text-align:right; font-size:15px; line-height:1.5;">
      
        <strong>Date:</strong> <?php echo mydate1($drow[cdate]);?>
    </div>
</div>
     

    <div class="section">
        <strong> Details:</strong>
        <table>
            <tr>
                <th>Service / Type </th>
                <th>Description</th>
                <th>Total</th>
            </tr>

 
<tr>
    <td>
      <?php 

		  $aresult=mysql_query("select * from income_type WHERE id='$drow[cost_type]' limit 1");
		  $arow=mysql_fetch_array($aresult);

			

			echo $arow[cost]; ?>
   </td>
    <td><?php echo $drow[pt];?></td>
    <td align="right"><?php $tota=$drow[amount]; echo number_format($tota);   ?> BDT</td>
</tr>
 
   </table>
    </div>

    <div class="section">
      <table class="bill">
        
        <tr>
          <td class="right"><?php echo mydate2($drow[cdate]);?> (<?php echo $drow[pay_methode];?> Payment):</td>
          <td class="right"><?php  echo number_format($drow[amount]);?>
            BDT</td>
        </tr>
  
      </table>
		
		<?php echo $drow[comments];?>
    </div>

    
		 <div class="section" style="display:flex; justify-content:space-between; align-items:flex-start;">
    <div style="margin-top:5px; text-align:left;">
        <strong> Signature:</strong><br><br>
        <div style="width:250px; height:60px; border:1px solid #000;"></div>
		
    </div>
			 
			 <div style="margin-top:20px; text-align:right;">
        <span style="display:inline-block; padding:10px 25px; border:2px solid #000; font-size:20px; font-weight:700; letter-spacing:2px;">
			<?php if($due>'0'){echo 'DUE';}else{echo 'PAID';};?></span>
    </div>
</div>

<div class="footer">
        Thank you for choosing ARNIM RESORT. We wish you a pleasant stay.
</div>

</div>

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