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

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

<?php
	ini_set('display_errors', 0);
if(empty($_SESSION['LOGINID']) && empty($_SESSION['LOGINNM']) ){

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


include("user.php");
	$ev_id = intval($_GET["id"]);
	
	
?>


						  
	<?php
$bookingtSQL = mysqli_query($connection, "SELECT t1.*,t2.booking_id,t2.booking_name,t2.groom_name,t2.bride_name FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id where t1.id='$ev_id' ");
$list= mysqli_fetch_object($bookingtSQL);
									
                                    $idn = $list->id;
									 $diary_of = $list->diary_of;
									$videoincluded = $list->videoincluded;
									if($videoincluded=="checked") {$videoincluded='yes';}
									$trailer = $list->trailer_song;
									$video_songs = $list->video_songs;
									$photo_selection = $list->photo_selection;
									 $ev_notes = $list->ev_notes;
									
										 $groom_name= $list->groom_name;  
										  
											   $bride_name= $list->bride_name;  
											    
                               
                                                $booking_id = $list->booking_id;
                                                    $booking_name = $list->booking_name;

												  

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

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

								   
?>	

<html>

<style>
table {
  table-layout: fixed;
}

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

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



</style>

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

<table style="width:100%" cellpadding='1' height='' cellspacing='0' >
	<tr align="center" >
	   <td style=""> <font size="5"> <b> Client's Requirement </b> </font>
       </td> 
	  
    </tr>
</table>

</br>






<table style="width:100%;border: 1px solid black;" cellpadding='0' height='' cellspacing='0'  >
 
  <tr align="center" >
    <td  style="width:30%; "  > <img src="assets/images/logo_wd.png" width="50%" /> </br>
<?php echo "$address"; ?> </br>
<?php echo "$our_email"; ?> </br>
<?php echo "$our_mobile"; ?> 
	</td>
    <td style="width:60%;;border-left: 1px solid black;">  
	
	<table style="width:100%" cellpadding='1' height='' cellspacing='0' >
	<tr align="center" >
	<td style="border-bottom: 1px solid black;">
	</br>
 </br>
    <img src='barcode.php?size=20&text=<?php echo $booking_id;  ?>&print=true' alt='Trolltunga Norway' width='' height=''>
  
	
	</td>
	</tr>
	
	<tr align="left" >
	<td style="border-bottom: 1px solid black;">
	
	&nbsp; Event ID:   <?php echo $ev_id;  ?> 
	
	</td>
	</tr>
	<tr align="left" >
	<td style="border-bottom: 1px solid black;">
	
	&nbsp; Event:  <?php echo $diary_of;  ?> 
	
	</td>
	</tr>
	<tr align="left" >
	<td style="">
	
	&nbsp; Video:  <?php echo $videoincluded;  ?>
	
	</td>
	</tr>
	
	
	
	
	</table>
	
	</td> 
  </tr>
</table>

</br></br>
<table style="width:100%" cellpadding='1' height='' cellspacing='0' >
	<tr align="right" >
	   <td style="width:30%"> Diary of &nbsp;&nbsp;
       </td> 
	   <td style="width:70%;border: 1px solid black;" align="left">
	   <?php echo $booking_name;  ?>   
       </td> 
    </tr>
</table>
</br></br>


<table style="width:100%;border: 1px solid black;" cellpadding='1' height='' cellspacing='0' border='0' >
	<tr align="left" >
	   <td style="width:50%;border-right: 1px solid black;"> 
	   Groom's Name:    <?php echo $groom_name;  ?>    
       </td> 
	   <td style="width:50%"> 
	   Bride's Name:    <?php echo $bride_name;  ?>    
       </td> 
    </tr>
</table>

</br></br>
<table style="width:100%;border: 1px solid black;" cellpadding='1' height='' cellspacing='0' border='0' >

<?php
                   
					if ($user_type==2 OR $user_type==1){  ?>
    <tr align="left" >
	   <td style="width:30%;border-right: 1px solid black;border-bottom: 1px solid black;"> 
	   Photo No's By comma (,)     
       </td> 
	   <td style="width:70%;border-bottom: 1px solid black;"> 
	    <?php $photo_selection=str_replace(".",",",$photo_selection) ;  ?>  
        <?php echo str_replace(",",", ",$photo_selection) ;  ?>   		
       </td> 
    </tr>
	
		<?php } ?>
		
	<?php
                   
					if ($user_type==3 OR $user_type==1){  ?>
					
	<tr align="left" >
	   <td style="width:30%;border-right: 1px solid black;border-bottom: 1px solid black;"> 
	   Trailer Song     
       </td> 
	   <td style="width:70%;border-bottom: 1px solid black;"> 
	     <?php echo $trailer;  ?>    
       </td> 
    </tr>
	
				
	<tr align="left" >
	   <td style="width:30%;border-right: 1px solid black;border-bottom: 1px solid black;"> 
	   Video Songs     
       </td> 
	   <td style="width:70%;border-bottom: 1px solid black;"> 
	  <table style="table-layout: fixed; width: 100%">
	   <tr>
	   <td style="word-wrap: break-word;width:100%;white-space: pre-line;">
	  
         		
	   <?php echo $video_songs ;  ?> 

  
	   </td>
	  
	   </tr>
	   </table>
	   
	     
       </td> 
    </tr>
	
		<?php } ?>
	<tr align="left" >
	   <td style="width:30%;border-right: 1px solid black;"> 
	   Notes     
       </td> 
	   <td style="width:70%"> 
	      <?php echo $ev_notes;  ?>   
       </td> 
    </tr>
	
</table>




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