<?php 
$submit_url = $file_name."?page=view_ess_pdf&action=$action"; 
$status_submit_url = $file_name."?page=view_ess_pdf&name=$name"; 

if(isset($_SESSION['is_consultant'])){
	if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit'){
		$update_button = "none";
	}
}
if($_REQUEST['from'] == 'view_enquiry_progress'){
	$update_button = "none";
}
$id=$_REQUEST['id'];
$label_box_1 = "PACKAGE CONTENT";
$label_box_2 = "EXTRA INFORMATION";
$label_box_3 = "TRAVEL";
$label_box_4 = "YOUR ROLE AS HOST PRIOR TO THE EVENT";
$label_time_details = "EVENT ITINERARY";
?>
<style>
@font-face {
font-family: 'Trebuchet MS';
font-style: normal;
font-weight: normal;
src: local('font/Trebuchet MS'), url('font/trebuc.woff') format('woff');
}

label{
	margin: 5px 0;
	/* font-family: 'Trebuchet MS'; */
	font-size:13px;
}
p{
	/* font-family: 'Roboto Condensed', sans-serif; */
	color: #444 !important;
}

.forgrybgatprint p{
	font-size:15px;
	padding-top:1%;
}
.at_print_hide{
	border-top: 1px solid #666 !important; margin-top: 2px !important;
}
.fleetdivposition{
	position: absolute;
    top: 65px;
    right: 0;
}
.headingtextview{
	/* font-family: 'Trebuchet MS'; */
	font-weight:700;
	font-size: 21px;
	color: #444 !important;
}
.headbelowtext{
	background: #000 !important;
}
.fleetno_text{
	font-size: 21px;
    position: relative;
    top: 11px;
}
.fleetno_form{
	border-top: 0;
    border-bottom: 1px solid #444 !important;
    border-left: 0;
    border-right: 0;
}
.forgraybgatprint{
	font-size: 18px !important;
}
.forgraybgatprint span{
	font-size: 13px !important;
    font-weight: normal !important;
}
.forgraybgatprint b{
	font-size: 15px !important;
}

.quotation_heading{
	color:#EA7B2E;
}

.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
        float: left;
   }
   .col-sm-12 {
        width: 100%;
   }
   .col-sm-11 {
        width: 91.66666667%;
   }
   .col-sm-10 {
        width: 83.33333333%;
   }
   .col-sm-9 {
        width: 75%;
   }
   .col-sm-8 {
        width: 66.66666667%;
   }
   .col-sm-7 {
        width: 58.33333333%;
   }
   .col-sm-6 {
        width: 50%;
   }
   .col-sm-5 {
        width: 41.66666667%;
   }
   .col-sm-4 {
        width: 33.33333333%;
   }
   .col-sm-3 {
        width: 25%;
   }
   .col-sm-2 {
        width: 16.66666667%;
   }
   .col-sm-1 {
        width: 8.33333333%;
   }

@page {
   margin: 0;
   size: landscape;
}

@media print{
.box{
	border-top:0;
}
.row_p_lr10, .box-header{
	padding:0;
}
label{
	/* font-size: 12px; */
}
.at_print_hide{
	visibility: hidden;
	margin-bottom:0 !important;
}
.forgraybgatprint{
	background: #D1D3D4 !important;
    padding: 5px !important;
    width: 100% !important;
	font-size: 18px !important;
	line-height: 1 !important;
}
.forgraybgatprint span{
	font-size: 13px !important;
    font-weight: normal !important;
	color: #333 !important;
}
.forgraybgatprint b{
	font-size: 15px !important;
	color: #333 !important;
}
.form-control {
    border-top: 0;
    border-bottom: 1px solid #444 !important;
    border-left: 0;
    border-right: 0;
}
.fleetno_text {
    font-size: 19px;
}
input[type=checkbox], input[type=radio] {
	opacity: 1 !important;
}

.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
        float: left;
   }
   .col-sm-12 {
        width: 100%;
   }
   .col-sm-11 {
        width: 91.66666667%;
   }
   .col-sm-10 {
        width: 83.33333333%;
   }
   .col-sm-9 {
        width: 75%;
   }
   .col-sm-8 {
        width: 66.66666667%;
   }
   .col-sm-7 {
        width: 58.33333333%;
   }
   .col-sm-6 {
        width: 50%;
   }
   .col-sm-5 {
        width: 41.66666667%;
   }
   .col-sm-4 {
        width: 33.33333333%;
   }
   .col-sm-3 {
        width: 25%;
   }
   .col-sm-2 {
        width: 16.66666667%;
   }
   .col-sm-1 {
        width: 8.33333333%;
   }
   
   .printspace{height:68px;}

}
.footerimg{
	width:100%;
	margin-top: 15px !important;
}
.pagetitle{
	font-size:25px;
	font-weight:bold;
	padding-top:1%;
	/* text-align:center; */
}
</style>
<div class="box-header">
	<form action="<?php echo $submit_url;?>" method="post" name="search_form" id="search_form">
		
		<!------------------- Start -------------------->
		<br/>
		<div class="col-lg-12 col-md-12 col-sm-12">
			<img class="footerimg" src="<?php echo $siteURL ?>/images/ess_pdf_header.png"><br>
			<div class="box-header with-border hide"  style="background: #696969;">
				<h3 class="box-title hide" style="color:#FFFFFF;"><span style="font-size:18px;" >EVENT SUMMARY SHEET</span></h3>
				
			</div>
		</div>
		<div class="col-lg-12 col-md-12 col-sm-12">
			<?
				$ess_row = utility::getTableRowByField("ess","id",$id);
				$iti_query = "SELECT * FROM ess_event_itinerary_mapping WHERE ess_id = ".$_REQUEST['id']." ORDER BY id ASC ";
				$iti_sql=mysqli_query($conn,$iti_query);
				$ess_image_1 = $enq_row['ess_image_1'];
				$ess_image_2 = $enq_row['ess_image_2'];
				$ess_image_3 = $enq_row['ess_image_3'];
				$ess_image_4 = $enq_row['ess_image_4'];
			?>
		</div>
		<!--<div class="col-lg-12 col-md-12 col-sm-12 hide">
			<div class="col-sm-12">	
				<hr style="border-top: 2px solid #313EDD;" />
			</div>
		</div>-->
		
		<?
			$dir = "../ess_images/";
			 if (is_file($dir.$ess_row['ess_image_1'])) {						 
				$image_path_1 ='<img style="width:200px;" src="../'.$dir.$ess_row['ess_image_1'].'">';
			}else{
				$image_path_1 ='<img style="width:200px;" src="../'.$dir.'blank_imag.png">';	
			}
			if (is_file($dir.$ess_row['ess_image_2'])) {						 
				$image_path_2 ='<img style="width:200px;" src="../'.$dir.$ess_row['ess_image_2'].'">';
			}else{
				$image_path_2 ='<img style="width:200px;" src="../'.$dir.'blank_imag.png">';	
			}
			if (is_file($dir.$ess_row['ess_image_3'])) {						 
				$image_path_3 ='<img style="width:200px;" src="../'.$dir.$ess_row['ess_image_3'].'">';
			}else{
				$image_path_3 ='<img style="width:200px;" src="../'.$dir.'blank_imag.png">';	
			}
			if (is_file($dir.$ess_row['ess_image_4'])) {						 
				$image_path_4 ='<img style="width:200px;" src="../'.$dir.$ess_row['ess_image_4'].'">';
			}else{
				$image_path_4 ='<img style="width:200px;" src="../'.$dir.'blank_imag.png">';	
			}		
			$date = $ess_row['event_duration_from'];
			$dayOfWeek = date("l", strtotime($date));
		?>
		<div class="col-lg-12 col-md-12 col-sm-12">
			<div class="col-sm-12 pagetitle">	
				<? echo ucwords($ess_row['page_title']);?><br/>
				<?= $dayOfWeek; ?> <?= date("d M y", strtotime($date));;?>
			</div>
			<br/>
			<div class="col-sm-12 text-center">
				<div class="col-sm-3">
					<? echo $image_path_1;?>
				</div>
				<div class="col-sm-3">
					<? echo $image_path_2;?>
				</div>
				<div class="col-sm-3">
					<? echo $image_path_3;?>
				</div>
				<div class="col-sm-3">
					<? echo $image_path_4;?>
				</div>
			</div>
			<div class="col-sm-12">	
				<p><? echo ucwords($ess_row['description']);?></p>
			</div>
		</div>
		<div class="col-lg-12 col-md-12 col-sm-12">
		  <div class="box-body">
			<div class="row">
				<div class="col-md-6">
					<b><? echo $ess_row['sample_and_provisional_1'];?></b>
					<div class="box-header with-border headbelowtext">
						<h3 class="box-title" style="color:#FFFFFF;"><span class="forgraybgatprint"><? echo $ess_row['label_box_1'];?></span></h3>
					</div>
					<div class="form-group">
						<p class="forgrybgatprint"><? echo ucwords($ess_row['detail_box_1']);?></p>
					</div>
					
					<div class="box-header with-border headbelowtext">
						<h3 class="box-title" style="color:#FFFFFF;"><span class="forgraybgatprint"><? echo $ess_row['label_box_2'];?></span></h3>
					</div>
					<div class="form-group">
						<p class="forgrybgatprint"><? echo ucwords($ess_row['detail_box_2']);?></p>
					</div>
				</div>
				<div class="col-md-6">
					<b><? echo $ess_row['sample_and_provisional_2'];?></b>
					<div class="box-header with-border headbelowtext">
						<h3 class="box-title" style="color:#FFFFFF;"><span class="forgraybgatprint"><? echo $ess_row['label_time_details'];?></span></h3>
					</div>
					<div class="form-group">
					  <? 
					    while($iti_row = mysqli_fetch_assoc($iti_sql)){ 
					  ?>
						  <div class="col-sm-2" >
							<? echo '<b>'.$iti_row["time"].'</b>'; ?>
						  </div>
						  <div class="col-sm-10">
							<? echo $iti_row["details"]; ?>
						  </div>
						  
					  <? }?>
					</div>
				</div>
			</div>
		  </div>
		</div>
		<div class="col-lg-12 col-md-12 col-sm-12">
		  <div class="box-body">
			<div class="row">
				<div class="col-md-6">
					<div class="box-header with-border headbelowtext">
						<h3 class="box-title" style="color:#FFFFFF;"><span class="forgraybgatprint"><? echo $ess_row['label_box_3'];?></span></h3>
					</div>
					<div class="form-group">
						<p class="forgrybgatprint"><? echo ucwords($ess_row['detail_box_3']);?></p>
					</div>
				</div>
				<div class="col-md-6">
					<div class="box-header with-border headbelowtext">
						<h3 class="box-title" style="color:#FFFFFF;"><span class="forgraybgatprint"><? echo $ess_row['label_box_4'];?></span></h3>
					</div>
					<div class="form-group">
						<p class="forgrybgatprint"><? echo ucwords($ess_row['detail_box_4']);?></p>
					</div>
				</div>
			</div>
		  </div>
		</div>
	
		<div class="col-sm-12">
			<hr class="at_print_hide" style="">
		</div>
		</div>
		<div style="clear:both;"></div>
		<hr />
	</form>
</div>
<script type="text/javascript">		
$(document).ready(function() {

	$('#search_form').submit(function(){
		$("#add_master_data").attr("disabled", true);
		$('#page_load_div').show();
	});
	$("#revisit").on('ifChecked', function(){
		if($(this).attr("alt") == "revisit"){
			$(this).attr("alt","revisit");
			$('#revisit_div').show();
		}
	});
	$("#revisit").on('ifUnchecked', function(){
		if($(this).attr("alt") == "revisit"){
			$(this).attr("alt","revisit");
			$('#revisit_div').hide();
			$('#revisit_div').find('input:radio').val('');
			$('#parts_required_text_div').find('input:text').val('');
			$('#revisit_text_div').hide();
			$('#revisit_text').find('input:text').val('');
		}
	});
	$("#parts_used").on('ifChecked', function(){
		if($(this).attr("alt") == "parts_used"){
			$(this).attr("alt","parts_used");
			$('#parts_used_text_div').show();
		}
	});
	$("#parts_used").on('ifUnchecked', function(){
		if($(this).attr("alt") == "parts_used"){
			$(this).attr("alt","parts_used");
			$('#parts_used_text_div').hide();
			$('#parts_used_text_div').find('input:text').val('');
		}
	});
	$("#proof_vehicle_inspection").on('ifChecked', function(){
		if($(this).attr("alt") == "vehicle_inspection"){
			$(this).attr("alt","vehicle_inspection");
			$('#other_emissions_text_div').show();
		}
	});
	$("#proof_vehicle_inspection").on('ifUnchecked', function(){
		if($(this).attr("alt") == "vehicle_inspection"){
			$(this).attr("alt","vehicle_inspection");
			$('#other_emissions_text_div').hide();
			$('#other_emissions_text_div').find('input:text').val('');
		}
	});
});
</script>