<style type="text/css">
<!--
body { margin:0px; }
.style20 {
	font-family: Verdana;
	font-size: 14px;
}
.style21 {
	font-family: Verdana;
	font-size: 18px;
}
.style22 {
	font-family: Verdana;
	font-size: 12px;
}
.style51 {
	font-size: 16px;
	font-weight: bold;
}
.style52 {color:#063}
.style55 {font-size: 12px}
.style56 {font-size: 12}

-->
</style>
<script>
/************* Print Function ******************************/
function winprint(){
	window.print();
	window.history.back();
	//window.close();
}
window.onload = function() { window.print(); }
</script>
<?php 
include("../../include/db.php"); 
error_reporting(0);

ob_start();
session_start();
$session_branch=$_SESSION['branch'];
$session_user_type=$_SESSION['user_type'];

function get_categ_branch_id($branch_name)
{
$sql_query11="select * from branch_creation where branch_id='$branch_name' and delete_status!='1'";
$rs11=mysql_query($sql_query11);
 while($rsdata11=mysql_fetch_object($rs11))
 {
 $id=$rsdata11->branch_name;
 } 
	return $id;
 }
 function get_categ_place_name($place_name)
{
$sql_query11="select * from place_creation where id='$place_name' ";
$rs11=mysql_query($sql_query11);
 while($rsdata11=mysql_fetch_object($rs11))
 {
 $location=$rsdata11->location;
 } 
	return $location;
 }
$query="select * from booking_main_list where booking_no='$_GET[book_no]' ";
		
		$rs=mysql_query($query);						 
                                                $i=0;
                                                while($list=mysql_fetch_array($rs))
                                                {
                                                $i=$i+1;
												$from_party_name=$list['from_party_name'];
												$from_party_address=$list['from_party_address'];
                                                $from_party_mob=$list['from_party_mob'];
											    $to_party_name=$list['to_party_name'];
												$to_party_addrs=$list['to_party_addrs'];
												$to_party_mob=$list['to_party_mob'];
												$pay_type=$list['pay_type'];
												$booking_no=$list['booking_no'];
												$book_date=$list['book_date'];
												$remarks=$list['remarks'];
												$place_name=$list['book_place'];
												$book_place=get_categ_place_name($place_name);
												$branch_name=$list['book_branch'];
												$book_branch=get_categ_branch_id($branch_name);
												$unloading_st_charge=$list['unloading_st_charge'];
												}
if($session_user_type!=1)
{
$query="select * from branch_creation  WHERE branch_id='$session_branch'";
}
$rs=mysql_query($query);						 
                                                $i=0;
                                                while($list=mysql_fetch_array($rs))
                                                {
                                                $i=$i+1;
												$branch_address=$list['branch_address'];
												$head_off=$list['head_off'];
												$branch_off=$list['branch_off'];
												$branch_ph=$list['branch_ph'];
												$delivery_ph=$list['delivery_ph'];
												$delivery_off=$list['delivery_off'];
											    }
 ?>				
<table border="0" width="850"  align="center" cellpadding="0" cellspacing="0" >
   <tr>
     <td colspan="6" align="center"><table width="100%" cellpadding="0" cellspacing="0" align="center">
     <tr>
       <td height="21" colspan="4" align="center" class="style22" >Erode H.O.Ph:(0424) 2240645 B.Off:Ph:2211969,Cell:98429-93222</td>
     </tr>
     <tr>
       <td height="21" colspan="4" align="center" class="style22" >Delivery Off:Ph:25247888 Cell:98429-93224</td>
     </tr>
     <tr>
    
     <td width="79%" height="21" colspan="4" align="center" class="style21" ><span class="style51">RAJA TRANSPORT LORRY BOOKING SERVICE</span></td>
  </tr>
     <tr>
       <td height="21" colspan="4" align="center" class="style20" >(GOODS CONSIGNMENT RECEIPT)</td>
     </tr>
     <?php if($session_user_type!=1)
{
?>
     <tr> 
    <td colspan="4" align="center" class="style20" >&nbsp;</td>
  </tr>
  <?php } ?>
  </table>
 <tr>
     <td colspan="6"><table width="100%" height="56" cellpadding="0" cellspacing="0"> 
     <tr>
       <td width="119" height="26"  align="left" class="style20">Booking.No</td>
          <td width="241"  align="left" class="style20">:<strong>&nbsp;&nbsp;<?php echo $booking_no;?></strong></td>
          <td width="184"  align="center" class="style20" style="font-size:21px; color:#063;"><strong><span class="style52"><?php echo strtoupper($pay_type); ?></span></strong><span class="style52">&nbsp;</span></td>
              <td colspan="2"  align="right" class="style20">&nbsp;&nbsp;Date&nbsp;&nbsp;</td>
       <td width="34"  align="right" class="style20">:&nbsp;&nbsp;</td>
       <td width="101"  align="right" class="style20"><strong>
         <?php if($book_date!='') { echo date("d-m-Y",strtotime($book_date)); } else { echo date('d-m-Y'); }?>
       </strong></td>
     </tr>
     <tr> 
    <td height="28"  align="left" class="style20" >Place</td>
     <td colspan="3"  align="left" class="style20">:&nbsp;<strong>&nbsp;<?php echo ucfirst($book_place);?></strong></td>
        <td width="168"  align="right" class="style20" >&nbsp;&nbsp;Branch Name</td>
  <td width="34"  align="right" class="style20">:&nbsp;&nbsp;</td>
  <td width="101"  align="right" class="style20"><strong><?php echo ucfirst($book_branch);?></strong></td>
     </tr>
  </table></td></tr>
  <tr>
       <td colspan="3" align="left" class="style20">&nbsp;</td>
       <td  colspan="3" align="right" class="style20">&nbsp;</td>
     </tr> 
   <tr>
      <td width="180" height="29"  align="right" class="style20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Consignor M/s</td>
     <td width="39" height="29"  align="center" class="style20" >:&nbsp;</td>
     <td width="249"  align="left" class="style20" ><?php echo ucfirst($from_party_name);?></td>
     <td width="111" height="29"  align="left" class="style20" >Consignee M/s</td>
     <td width="34" height="29"  align="center" class="style20" >:&nbsp;&nbsp;&nbsp;</td>
     <td width="237"  align="left" class="style20" ><?php echo ucfirst($to_party_name);?></td>
  </tr>
      <tr>
      <td height="27"  align="right" class="style20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address</td>
       <td height="27"  align="center" class="style20" >:&nbsp;</td>
       <td height="27"  align="left" class="style20" ><?php echo ucfirst($from_party_address);?></td>
       <td height="27"  align="left" class="style20" >Address</td>
      <td height="27"  align="center" class="style20" >:&nbsp;&nbsp;&nbsp;</td>
      <td height="27"  align="left" class="style20" ><?php echo ucfirst($to_party_addrs);?></td>
  </tr>
     <tr>
      <td height="32" align="right" class="style20" scope="col" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mob.No</td>
    <td height="32"  align="center" class="style20" scope="col" >:&nbsp;</td>
      <td height="32"  align="left" class="style20" scope="col" ><?php echo $from_party_mob;?></td>
      <td  align="left" class="style20" scope="col"  >Mob.No</td>
      
      <td  align="center" class="style20" scope="col">:&nbsp;&nbsp;&nbsp;</td>
      <td  align="left" class="style20" scope="col"><?php echo $to_party_mob;?></td>
    </tr>
   </table>
<table border="0" width="847"  align="center" cellpadding="0" cellspacing="0"  style="border:1px solid;border-color:#999;" >
  <thead>
    <tr>
      <td width="68" height="28" align="center" style="border-bottom:1px solid;border-bottom-color:#999;  border-right:1px solid;border-right-color:#999; font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;"  scope="col"><strong>S.No</strong></td>
      <td width="522" height="28" align="left" style="border-bottom:1px solid;border-bottom-color:#999;  border-right:1px solid;border-right-color:#999; font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;"  scope="col"><strong>&nbsp;&nbsp;PARTICULARS SAID TO CONTAIN</strong></td>
      <td width="132" align="right" style="border-bottom:1px solid;border-bottom-color:#999;  border-right:1px solid;border-right-color:#999; font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;" scope="col" ><span class="style4"><strong>Weight/No's&nbsp;</strong></span></td>
     <td width="106" align="right" style="border-bottom:1px solid;border-bottom-color:#999; font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;" scope="col"><strong>Freight Rs&nbsp;</strong></td>
   </tr>
  </thead>
<?php	
				$query="select * from booking_sub_list where book_no='$_GET[book_no]' ";
		        $rs=mysql_query($query);						 
                                                $i=0;
                                                while($list=mysql_fetch_array($rs))
                                                {
                                                $i=$i+1;
												$particulars=$list['particulars'];
												$weight_kg=$list['weight_kg'];
												
												if($weight_kg=="0.00")
				                                {
					                               $weight_kg_res='';
				                                }
				                                else
				                                {
				                                 	$weight_kg_res=$weight_kg;
				                                  }
												
                                                $kg_rate=$list['kg_rate'];
											    $frieght_charge=$list['frieght_charge'];
												
												?>
													<tr>
										 <td height="28" align="center" style=" border-right:1px solid;border-right-color:#999;font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px; border-bottom:1px solid; border-bottom-color:#999;"><?php echo $i;?></td>
                                                      <td height="28" width="522" align="left" style=" border-right:1px solid;border-right-color:#999;padding-left:5px; border-bottom:1px solid; border-bottom-color:#999;" class="style20">&nbsp;<?php echo ucfirst($particulars);?> <?php if($remarks!='') { ?> (<?php echo $remarks; ?>) <?php } ?>                                                          </td>
                                                      <td height="28" align="right" style=" border-right:1px solid;border-right-color:#999;font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px; border-bottom:1px solid; border-bottom-color:#999;"><?php echo $weight_kg_res;?>&nbsp;</td>
													  <td align="right" style="font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px;border-bottom:1px solid;border-bottom-color:#999; "><?php echo $frieght_charge;?>&nbsp;</td>
													</tr> 
                                                     <?php $tot_frie+=$frieght_charge;} ?>
                                                    <tr>  <td  colspan="2" rowspan="2" align="center" valign="top" style="font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px;border-right:1px solid;border-right-color:#999; height:26px;" scope="col">
                                                     <p> Unloading Charges to be Paid by Party to Pay</p>                                                      </td>
          

            <td width="132" height="32" align="center" style="font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px;border-right:1px solid;border-right-color:#999; border-bottom:1px solid;border-bottom-color:#999;"  scope="col">
             S.T. Charges            </td>
            <td width="106"  align="right" scope="col" style="font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px; border-bottom:1px solid;border-bottom-color:#999;"><strong><?php echo number_format($unloading_st_charge,2);?>&nbsp;&nbsp;</strong> </td>
</tr>
<tr> 
            <td width="132" height="35" align="center" style="font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px;" >
              Total Amt : </td>
            <td width="106"  align="right" scope="col" style="font-size:14px; font-family:Verdana, Arial, Helvetica, sans-serif;padding-left:5px;"><strong><?php echo number_format($_GET[tot_amt],2);?>&nbsp;&nbsp;</strong> </td>
</tr>
</table>
<table border="0" width="847"  align="center" cellpadding="0" cellspacing="0"   >
  <thead>
    <tr>
      <td height="28" align="left" style="font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif;"  scope="col">&nbsp;&nbsp;Goods we booked according to the company's regulation only</td>
      <td align="right" style="font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif;" scope="col" ><strong>For R.T.L.B.S</strong>&nbsp;&nbsp;</td>
    </tr>
  </thead>
  <?php	
				$query="select * from booking_sub_list where book_no='$_GET[book_no]' ";
		        $rs=mysql_query($query);						 
                                                $i=0;
                                                while($list=mysql_fetch_array($rs))
                                                {
                                                $i=$i+1;
												$particulars=$list['particulars'];
												$weight_kg=$list['weight_kg'];
												
                                               $kg_rate=$list['kg_rate'];
											    $frieght_charge=$list['frieght_charge'];
												
												?>
  <?php $tot_frie+=$frieght_charge;} ?>
</table>
