<?php session_start(); ob_start(); ?>

<?php  include 'header.php'; ?>

<?php
	
if(empty($_SESSION['LOGINID']) && empty($_SESSION['LOGINNM']) ){

	header("Location:index.php");
}


include("user.php");
	$payment_id = intval($_GET["id"]);
	$paymentSQL = mysqli_query($connection, "SELECT * FROM `transactions` WHERE `id` = '$payment_id' ");
$paymentSQL = mysqli_fetch_object($paymentSQL);
	
$temp_id = $paymentSQL->temp_booking_id;	
$mr_no = $paymentSQL->mr_no;
$amount = $paymentSQL->amount;
$method = $paymentSQL->method;
$details = $paymentSQL->details;
$date = $paymentSQL->date;
$date = date("d M, Y", strtotime($date));
$payment=IND_money_format($amount);
$number = $amount;
   $no = round($number);
   $point = round($number - $no, 2) * 100;
   $hundred = null;
   $digits_1 = strlen($no);
   $i = 0;
   $str = array();
   $words = array('0' => '', '1' => 'One', '2' => 'Two',
    '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
    '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
    '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
    '13' => 'Thirteen', '14' => 'Fourteen',
    '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
    '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
    '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
    '60' => 'sixty', '70' => 'seventy',
    '80' => 'Eighty', '90' => 'Ninety');
   $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
   while ($i < $digits_1) {
     $divider = ($i == 2) ? 10 : 100;
     $number = floor($no % $divider);
     $no = floor($no / $divider);
     $i += ($divider == 10) ? 1 : 2;
     if ($number) {
        $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
        $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
        $str [] = ($number < 21) ? $words[$number] .
            " " . $digits[$counter] . $plural . " " . $hundred
            :
            $words[floor($number / 10) * 10]
            . " " . $words[$number % 10] . " "
            . $digits[$counter] . $plural . " " . $hundred;
     } else $str[] = null;
  }
  $str = array_reverse($str);
  $result = implode('', $str);
  $points = ($point) ?
    "." . $words[$point / 10] . " " . 
          $words[$point = $point % 10] : '';
  $wtotal = $result . "Taka Only";	
?>


						  
	<?php
$bookingtSQL = mysqli_query($connection, "SELECT v1.*,v2.title as ref_name from (SELECT t1.*,t2.name ev_type FROM `bookings` as t1 left join booking_types as t2 on t1.event_type=t2.id where t1.id='$temp_id') as v1 left join ref as v2 on v1.ref=v2.id ");
$list= mysqli_fetch_object($bookingtSQL);
									
                                    $idn = $list->id;
									 $name = $list->name;
									$cell_1 = $list->cell_1;
									$cell_2 = $list->cell_2;
									 $email = $list->email;
									 $ev_type = $list->ev_type;
									 
								    
									 
									 
									  $fb= $list->fb;  
									    $ref= $list->ref_name;  
										 $groom_name= $list->groom_name;  
										  $groom_fb= $list->groom_fb;  
										   $groom_email= $list->groom_email;  
										   $groom_mobile= $list->groom_mobile;
										   
										    $groom_father= $list->groom_father;  if($groom_father=="checked"){$groom_father="yes";}
											 $groom_mother= $list->groom_mother;  if($groom_mother=="checked"){$groom_mother="yes";}
											  $groom_brother= $list->groom_brother;  if($groom_brother=="checked"){$groom_brother="yes";}
											   $groom_sister= $list->groom_sister;  if($groom_sister=="checked"){$groom_sister="yes";}
											   
											   $bride_name= $list->bride_name;  
											    $bride_fb= $list->bride_fb;  
										   $bride_email= $list->bride_email;
										    $bride_mobile= $list->bride_mobile;
										    $bride_father= $list->bride_father;  if($bride_father=="checked"){$bride_father="yes";}
											 $bride_mother= $list->bride_mother;  if($bride_mother=="checked"){$bride_mother="yes";}
											  $bride_brother= $list->bride_brother;  if($bride_brother=="checked"){$bride_brother="yes";}
											  $bride_sister= $list->bride_sister; if($bride_sister=="checked"){$bride_sister="yes";}


                               
$booking_id = $list->booking_id;
$booking_name = $list->booking_name;
$booking_type=$list->event_type;
$additional_notes = $list->additional_notes;
$vas = $list->vas;
$pkg_charge = $list->pkg_charge;
$discount = $list->discount;
$total_charge = $list->total_charge;		
$advance = $list->advance;								 
$due = $list->due;	
$added_at = $list->added_at;	
$updated_at = $list->updated_at;													  

$settingsSQL = mysqli_query($connection, "SELECT * FROM `settings` where name='address' ");
$settingsSQL = mysqli_fetch_object($settingsSQL);
									
$address = $settingsSQL->value;


								   
?>	

<html>

<style>
body {
  background: rgb(204,204,204); 
}
page {
  background: white;
  display: block;
  padding-top: 0cm;
  padding-left: 1cm;
  padding-right: 1cm;
  margin: auto;
  margin-bottom: 2.0cm;
}
page[size="A4"] {  
  width: 21cm;
  height: auto; 
}
page[size="A4"][layout="landscape"] {
  width: 29.7cm;
  height: 21cm;  
}

@media print {
  body, page {
    margin: 0;
    box-shadow: 0;
  }
}

@media print
{
    #pager,
    form,
    .no-print
    {
        display: none !important;
        height: 0;
    }


    .no-print, .no-print *{
        display: none !important;
        height: 0;
    }
}
.verticalTableHeader {
    text-align:center;
    white-space:nowrap;
    transform: rotate(90deg);
    width:;

}
.verticalTableHeader p {
    margin:0 -100% ;
    display:inline-block;
}
.verticalTableHeader p:before{
    content:'';
    width:0;
    padding-top:0%;/* takes width as reference, + 10% for faking some extra padding */
	padding-bottom:50%;/* takes width as reference, + 10% for faking some extra padding */
    display:inline-block;
    vertical-align:middle;
}




</style>

  <head>
    <title>MR Print</title>
	<meta http-equiv='content-type' content='text/html;charset=utf-8' />
  </head>
  
  <page size="A4">
  
  <body>
<center>
<?php

print"



<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'></br> </br>
<tr bgcolor='white'>
 <td height='15' bgcolor='' width='100' align='center'> <b> <img src='assets/images/logo_wd.png' width='60' /> </b> </td>
</tr>
<tr bgcolor='white'>
 <td height='15' bgcolor='' width='100' align='center'>  $address </td>
</tr>

</table>









<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='15' bgcolor='' width='30%' align='left'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Receipt No: <b> $mr_no </b> </td>  
<td height='15' bgcolor='' width='40%' align='center'> 



<table align='center' width='' cellpadding='0' cellspacing='1' bgcolor='white' style='border: 1px solid black;'>
<tr bgcolor='white'>
<td height='25' width='100%' bgcolor='' align='center'>
&nbsp;&nbsp;&nbsp; <font size='3'> <b> MONEY RECEIPT </b> </font> &nbsp;&nbsp;&nbsp; 
</td> </tr></table>

 </td>
<td height='25' bgcolor='' width='30%' align='right'> &nbsp;&nbsp;&nbsp; Date 

: $date &nbsp;&nbsp;&nbsp; </td>
</tr>

</table>

<table align='center' width='' cellpadding='0' cellspacing='1' bgcolor=''  >
<tr bgcolor=''>
<td height='25' width='90%' bgcolor='' align='left' style='border: 1px solid black;'>







<table align='center' width='770' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='25' bgcolor='' width='40%' align='left'> &nbsp;&nbsp;&nbsp; Received with thanks from Mr/Mrs :  </td> 
<td height='25' bgcolor='' width='40%' align='left'> &nbsp; $name </td>
<td height='25' bgcolor='' width='15%' align='left'> Booking ID : </td>
<td height='25' bgcolor='' width='5%' align='left'> $booking_id </td>
</tr>

</table>







<table align='left' width='770' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='25' bgcolor='' width='20%' align='left'> &nbsp;&nbsp;&nbsp; The sum of taka : </td>  
<td height='25' bgcolor='' width='45%' align='left'>$wtotal</td>
<td height='25' bgcolor='' width='10%' align='left'>By $method</td>
<td height='25' bgcolor='' width='25%' align='left'>$details</td>
</tr>

</table>


</td> 

<td  class='verticalTableHeader' valign='bottom' >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> Customer Copy </b> 
</td> 

</tr></table>



<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'> </br>
<tr bgcolor='white'>

<td height='15' bgcolor='' width='10%' align='left'>  &nbsp;&nbsp;&nbsp; <font size='4'> <b> TK </b> </font> </td>


<td height='15' bgcolor='' width='20%' align='left'> 

<table align='left' width='' cellpadding='0' cellspacing='1' bgcolor='white' border='1'>
<tr bgcolor='white'>
<td height='15' width='100%' bgcolor='' align='left'>
&nbsp;&nbsp;&nbsp; <font size='3'> <b> $payment.00 </b> </font> &nbsp;&nbsp;&nbsp;
</td> </tr></table>

</td>  <td height='15' bgcolor='' width='70%' align='left'> &nbsp;&nbsp;&nbsp;  </td>
</tr>

</table>




<table align='center' width='780' cellpadding='0' cellspacing='0'>


<tr bgcolor='white'> 

<td width='33%' bgcolor='' height='30' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; 
</td>





<td width='33%' bgcolor='' align='left' valign='bottom'> 
&nbsp;&nbsp;&nbsp; ...............................
</td>


<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; ....................................
</td>
</tr>

<tr bgcolor='white'> 




<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; 
</td>


<td width='33%' bgcolor='' align='left' valign='bottom'> 
&nbsp;&nbsp;&nbsp; Client's Signature 
</td>


<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; Authorized Signature
</td>
</tr>



</table>

";
?>














<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'></br> </br>

<tr bgcolor='white'>


 <td height='5' bgcolor='' width='50%' align='right'>  -------------------------------------------------------------------- </td>

 <td height='5' bgcolor='' width='50%' align='left'>  -------------------------------------------------------------------- </td>

</tr>

</table>



<?php

print"



<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'></br> </br>
<tr bgcolor='white'>
 <td height='15' bgcolor='' width='100' align='center'> <b> <img src='assets/images/logo_wd.png' width='60' /> </b> </td>
</tr>
<tr bgcolor='white'>
 <td height='15' bgcolor='' width='100' align='center'>  $address </td>
</tr>

</table>









<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='15' bgcolor='' width='30%' align='left'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Receipt No: <b> $mr_no </b>  </td>  
<td height='15' bgcolor='' width='40%' align='center'> 



<table align='center' width='' cellpadding='0' cellspacing='1' bgcolor='white' style='border: 1px solid black;'>
<tr bgcolor='white'>
<td height='25' width='100%' bgcolor='' align='center'>
&nbsp;&nbsp;&nbsp; <font size='3'> <b> MONEY RECEIPT </b> </font> &nbsp;&nbsp;&nbsp; 
</td> </tr></table>

 </td>
<td height='25' bgcolor='' width='30%' align='right'> &nbsp;&nbsp;&nbsp; Date 

: $date &nbsp;&nbsp;&nbsp;</td>
</tr>

</table>

<table align='center' width='' cellpadding='0' cellspacing='1' bgcolor=''  >
<tr bgcolor=''>
<td height='25' width='90%' bgcolor='' align='left' style='border: 1px solid black;'>



<table align='center' width='770' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='25' bgcolor='' width='40%' align='left'> &nbsp;&nbsp;&nbsp; Received with thanks from Mr/Mrs :  </td> 
<td height='25' bgcolor='' width='40%' align='left'> &nbsp; $name </td>
<td height='25' bgcolor='' width='15%' align='left'> Booking ID : </td>
<td height='25' bgcolor='' width='5%' align='left'> $booking_id </td>
</tr>

</table>







<table align='left' width='770' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='25' bgcolor='' width='20%' align='left'> &nbsp;&nbsp;&nbsp; The sum of taka : </td>  
<td height='25' bgcolor='' width='45%' align='left'>$wtotal</td>
<td height='25' bgcolor='' width='10%' align='left'>By $method</td>
<td height='25' bgcolor='' width='25%' align='left'>$details</td>
</tr>

</table>


</td> 

<td  class='verticalTableHeader' valign='bottom' >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> Accounts Copy </b> 
</td> 

</tr></table>



<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'> </br>
<tr bgcolor='white'>

<td height='15' bgcolor='' width='10%' align='left'>  &nbsp;&nbsp;&nbsp; <font size='4'> <b> TK </b> </font> </td>


<td height='15' bgcolor='' width='20%' align='left'> 

<table align='left' width='' cellpadding='0' cellspacing='1' bgcolor='white' border='1'>
<tr bgcolor='white'>
<td height='15' width='100%' bgcolor='' align='left'>
&nbsp;&nbsp;&nbsp; <font size='3'> <b> $payment.00 </b> </font> &nbsp;&nbsp;&nbsp;
</td> </tr></table>

</td>  <td height='15' bgcolor='' width='70%' align='left'> &nbsp;&nbsp;&nbsp;  </td>
</tr>

</table>




<table align='center' width='780' cellpadding='0' cellspacing='0'>


<tr bgcolor='white'> 

<td width='33%' bgcolor='' height='30' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; 
</td>





<td width='33%' bgcolor='' align='left' valign='bottom'> 
&nbsp;&nbsp;&nbsp; ...............................
</td>


<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; ....................................
</td>
</tr>

<tr bgcolor='white'> 




<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; 
</td>


<td width='33%' bgcolor='' align='left' valign='bottom'> 
&nbsp;&nbsp;&nbsp; Client's Signature 
</td>


<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; Authorized Signature
</td>
</tr>



</table>

";
?>




<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'></br> </br>

<tr bgcolor='white'>


 <td height='5' bgcolor='' width='50%' align='right'>  -------------------------------------------------------------------- </td>

 <td height='5' bgcolor='' width='50%' align='left'>  -------------------------------------------------------------------- </td>

</tr>

</table>





<?php

print"



<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'></br> </br>
<tr bgcolor='white'>
 <td height='15' bgcolor='' width='100' align='center'> <b> <img src='assets/images/logo_wd.png' width='60' /> </b> </td>
</tr>
<tr bgcolor='white'>
 <td height='15' bgcolor='' width='100' align='center'>  $address </td>
</tr>

</table>









<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='15' bgcolor='' width='30%' align='left'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Receipt No: <b> $mr_no </b> </td>  
<td height='15' bgcolor='' width='40%' align='center'> 



<table align='center' width='' cellpadding='0' cellspacing='1' bgcolor='white' style='border: 1px solid black;'>
<tr bgcolor='white'>
<td height='25' width='100%' bgcolor='' align='center'>
&nbsp;&nbsp;&nbsp; <font size='3'> <b> MONEY RECEIPT </b> </font> &nbsp;&nbsp;&nbsp; 
</td> </tr></table>

 </td>
<td height='25' bgcolor='' width='30%' align='right'> &nbsp;&nbsp;&nbsp; Date 

: $date &nbsp;&nbsp;&nbsp; </td>
</tr>

</table>

<table align='center' width='' cellpadding='0' cellspacing='1' bgcolor=''  >
<tr bgcolor=''>
<td height='25' width='90%' bgcolor='' align='left' style='border: 1px solid black;'>


<table align='center' width='770' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='25' bgcolor='' width='40%' align='left'> &nbsp;&nbsp;&nbsp; Received with thanks from Mr/Mrs :  </td> 
<td height='25' bgcolor='' width='40%' align='left'> &nbsp; $name </td>
<td height='25' bgcolor='' width='15%' align='left'> Booking ID : </td>
<td height='25' bgcolor='' width='5%' align='left'> $booking_id </td>
</tr>

</table>







<table align='left' width='770' cellpadding='0' cellspacing='1' bgcolor='white'>
<tr bgcolor='white'>
<td height='25' bgcolor='' width='20%' align='left'> &nbsp;&nbsp;&nbsp; The sum of taka : </td>  
<td height='25' bgcolor='' width='45%' align='left'>$wtotal</td>
<td height='25' bgcolor='' width='10%' align='left'>By $method</td>
<td height='25' bgcolor='' width='25%' align='left'>$details</td>
</tr>

</table>


</td> 

<td  class='verticalTableHeader' valign='bottom' >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> CRM Copy </b> 
</td> 

</tr></table>



<table align='center' width='780' cellpadding='0' cellspacing='1' bgcolor='white'> </br>
<tr bgcolor='white'>

<td height='15' bgcolor='' width='10%' align='left'>  &nbsp;&nbsp;&nbsp; <font size='4'> <b> TK </b> </font> </td>


<td height='15' bgcolor='' width='20%' align='left'> 

<table align='left' width='' cellpadding='0' cellspacing='1' bgcolor='white' border='1'>
<tr bgcolor='white'>
<td height='15' width='100%' bgcolor='' align='left'>
&nbsp;&nbsp;&nbsp; <font size='3'> <b> $payment.00 </b> </font> &nbsp;&nbsp;&nbsp;
</td> </tr></table>

</td>  <td height='15' bgcolor='' width='70%' align='left'> &nbsp;&nbsp;&nbsp;  </td>
</tr>

</table>




<table align='center' width='780' cellpadding='0' cellspacing='0'>


<tr bgcolor='white'> 

<td width='33%' bgcolor='' height='30' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; 
</td>





<td width='33%' bgcolor='' align='left' valign='bottom'> 
&nbsp;&nbsp;&nbsp; ...............................
</td>


<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; ....................................
</td>
</tr>

<tr bgcolor='white'> 




<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; 
</td>


<td width='33%' bgcolor='' align='left' valign='bottom'> 
&nbsp;&nbsp;&nbsp; Client's Signature 
</td>


<td width='33%' bgcolor='' align='center' valign='bottom'> 
&nbsp;&nbsp;&nbsp; Authorized Signature
</td>
</tr>



</table>

";
?>



  
<div class="no-print">
      
<table align='center' width='800' cellpadding='0' cellspacing='1' bgcolor='' >  
<tr bgcolor='' >
<td align='center' width='10%' height='100' valign='bottom' >       
<font color='white' > <a href='dashboard.php'> Back to Dashboard </a></font>
  </tr> </td> 
</table> 

</div> 
 
 </center> 
 
 
  </body>
  
  </page>
  
</html>