<?php 
require("php_con.php");
$rd_bill_no=$_GET['rd_bill_no'];
$ret_qury=mysqli_query($connation,"SELECT rd.rd_add_date,rd.rd_add_time,rd.rd_bill_no,SUM(rl.rl_price*rl.rl_qty) AS amount
FROM return_details rd RIGHT JOIN return_list rl ON rd.rd_bill_no=rl.rl_bill_no
WHERE rd.rd_bill_no='$rd_bill_no'");
$ret_resalt=mysqli_fetch_assoc($ret_qury);
?>

<table width="100%">
  <tbody>
    <tr>
      <td colspan="2" align="center" valign="top"><strong>Return Receipt</strong></td>
    </tr>
    <tr>
      <td align="right">Return Date</td>
      <td align="left"><?php echo date("Y-m-d",strtotime($ret_resalt['rd_add_date'])); ?></td>
    </tr>
    <tr>
      <td align="right">Return Time</td>
      <td align="left"><?php echo date("h:i:s A",strtotime($ret_resalt['rd_add_time'])); ?></td>
    </tr>
    <tr>
      <td align="right">Return ID</td>
      <td align="left"><?php echo $ret_resalt['rd_bill_no']; ?></td>
    </tr>
    <tr>
      <td align="right">Amount</td>
      <td align="left"><?php echo number_format((float)$ret_resalt['amount'],2); ?></td>
    </tr>
    <tr>
      <td colspan="2" align="center" valign="top" style="padding-top: 10px;">
		<img src="barcode.php?text=<?php echo $ret_resalt['rd_bill_no']; ?>" alt="<?php echo $ret_resalt['rd_bill_no']; ?>" style="width: 100%;">
		</td>
    </tr>
  </tbody>
</table>


<script>
	window.print();
</script>