<html lang="en">
	<head>
		
		<style type="text/css">
			body {
         margin: 0px;
         color: #000;
         font-family:Arial, Helvetica, sans-serif;
         font-size:13px;
         padding:10px;
         }
			.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
			    padding: 8px;
			     line-height: 1; 
			    vertical-align: top;
			     border-top: 1px solid white; 
			}
			table {
			    border-collapse: collapse;
			}
/*
			table, th, td {
			    border: 1px solid black;
			}*/
		</style>
	</head>
	<body style="font-family:;"> 
		<div class="container" style="color: #000; font-size:13px; font-family:Arial, Helvetica, sans-serif;">
		<table class="table" width="100%" style="font-size: 12px;" >
			<tr >
				
			<td style="border-color:white;width: 350px; height: 10px;text-align: left">
				@if($product_details->id == Config::get('constant.STANDARD_INCOME'))
                     <div style="padding: 5px;font-size: 16px;background-color:#366092;color: white">
                        <b>APPLICATION</b>
                     </div>

                    @elseif($product_details->id == Config::get('constant.SIMPLE_INCOME_INSURANCE_COVEA'))
                     <div style="padding: 5px;font-size: 16px;background-color:#0070c0;color: white">
                        <b>APPLICATION</b>
                     </div>

                   @else
                     <div style="padding: 5px;font-size: 16px;background-color:#12a1a5;color: white">
                        <b>APPLICATION</b>
                     </div>
                   @endif
                  
                  <br>

                  
                   @if($product_details->id == Config::get('constant.BEST_INSURANCE_COVEA') || $product_details->id == Config::get('constant.BEST_INSURANCE_ULTRA_COVEA'))

                     <div style="padding: 5px;font-size: 16px;background-color: #f49542;color: white;">
                        <b>INCOME PROTECTION POLICY</b>
                     </div>
                 
                  @elseif($product_details->id == Config::get('constant.SIMPLE_INCOME_INSURANCE_COVEA'))

                     <div style="padding: 5px;font-size: 16px;background-color: #00b050;color: white;">
                        <b>INCOME PROTECTION POLICY</b>
                     </div>


                  @elseif($product_details->id == Config::get('constant.STANDARD_INCOME'))
                     <div style="padding: 5px;font-size: 16px;background-color: #FF0000;color: white;">
                        <b>{{$product_details->product_name}}</b>
                     </div>
                  @else
                     <div style="padding: 5px;font-size: 16px;background-color: #f49542;color: white;">
                        <b>{{$product_details->product_name}}</b>
                     </div>
                  @endif
			</td>
			<td style="border-color:white" align="center">
			
				<img src="{{public_path().'/assets/images/'}}/{{$product_details->trade_logo_link}}" width="180px" height="80px" >
			</td>
			</tr>
		</table>
		<br>
		<div class="col-md-12">
	      <div class="box box-solid">
	       
	        <!-- /.box-header -->
	        <div class="box-body">
	       
	          	<table cellpadding="10" style="color: #000; font-size:13px; font-family:Arial, Helvetica, sans-serif;">
	 					<tr >
						<td style="color:#00a0af; width:80px; font-weight:bold;">Date</td>
						<td>:</td>
						<td>{{date('d/m/Y')}}</td>
					</tr>
					<tr>
						<td style="color:#00a0af; width:80px; font-weight:bold;">Prepared by</td>
						<td>:</td>
						<td>{{$affiliatename}}</td>
					</tr>
					<tr>
						<td style="color:#00a0af; width:80px; font-weight:bold;">Prepared for</td>
						<td>:</td>
						<td>{{$personal_data->title.' '.$personal_data->fname . ' '.$personal_data->lname }}</td>
					</tr>
					<tr>
                        <td colspan="3" height="5"></td>
                     </tr>
				</table>
				
	            <hr style="border:1px solid #f39c12">
	        </div>
	        <!-- /.box-body -->
	      </div>
	      <!-- /.box -->
	    </div>
        <div class="col-md-12">
          <div class="box box-warning">
            <h3 align="center" style="color: #30bbbb !important ;font-size: 14px"><b>YOUR DETAILS</b></h3>
            <!-- /.box-header -->
            <div class="box-body"  >
             	<table class="table" style="font-size: 12px; width: 100%" >
					<tr >
						<th style="border-color:white;text-align: left ;color: #30bbbb">Title</th>
						<td style="border-color:white;text-align: left "><b>{{$personal_data->title}} </b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">First Name</th>
						<td style="border-color:white;text-align: left "> <b>{{$personal_data->fname}}</b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Last Name</th>
						<td style="border-color:white;text-align: left "><b>{{$personal_data->lname}}</b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Date of birth</th>
						<td style="border-color:white;text-align: left "><b>{{$personal_data->dob}}</b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Employment status</th>
						<td style="border-color:white;text-align: left "><b>{{$personal_data->emp_status}}</b> </td>
					</tr>
					<tr >
						<th style="border-color:white;text-align: left;color: #30bbbb ">Occupation</th>
						<td style="border-color:white;text-align: left "><b>{{$personal_data->occupation}} </b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Name of employer</th>
						<td style="border-color:white;text-align: left "><b> {{$personal_data->employer_name}}</b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Home address</th>
						<td style="border-color:white;text-align: left "><b>{{$add}}</b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Email</th>
						<td style="border-color:white "><b>{{$personal_data->email}} </b></td>
					</tr>
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Contact number</th>
						<td style="border-color:white;text-align: left "><b>{{$personal_data->telephone}}</b> </td>
					</tr>
					
					<tr>
						<th style="border-color:white;text-align: left;color: #30bbbb ">Gross monthly income</th>
						<td style="border-color:white;text-align: left "><b>&pound;{{$quote_details['monthly_gross_income']}} </b></td>
					</tr>
				</table>
                
				<hr style="border:1px solid #f39c12">	      
				        <!-- </dl> -->
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <div class="col-md-12">
          <div class="box box-warning">
          <h3 align="center" style="color: #30bbbb;padding: 5;font-size: 14px">ELIGIBILITY</h3>
            <!-- <h2>ELIGIBILITY</h2> -->
            <!-- /.box-header -->
             <table class="table" style="font-size: 12px;line-height: 10; " >
             	@foreach ($questions as $key=>$value)
		            @if(isset($value) && $value != '')
		            <tr >
						<th style="border-color:white;color: #30bbbb;padding: 5px;text-align: left; line-height: 2;">{!! $value !!}</th>
						<td style="border-color:white ;text-align: left;">{{$underwriting_questions->$key}}  </td>
					</tr>
		            @endif
		        @endforeach
			</table>
          <hr style="border:1px solid #f39c12">
          </div>
        </div>
        <div class="col-md-12">
          	<div class="box box-warning">
          	<p align="center" style="color: #30bbbb;padding: 5px;font-size: 14px">BENEFIT DETAILS <br> 
        	<span align="center" style="color: black;padding: 3px;font-size: 12px">{{$product_details->pdf_underwritten_txt}}</span> </p>
            <div class="box-body">
              <div class="panel">
				    <div class="panel-heading"></div>
				    <div class="panel-body">
				    	<table class="table" style="font-size: 12px">
							<tr class="success">
								<th style="border: 1px solid #f39c12;color: #30bbbb">Cover Type</th>
								<th style="border: 1px solid #f39c12;color: #30bbbb">Monthly benefit</th>
								<th style="border: 1px solid #f39c12;color: #30bbbb">Deferred Period</th>
								<th style="border: 1px solid #f39c12;color: #30bbbb">Policy Transfer</th>
								<th style="border: 1px solid #f39c12;color: #30bbbb">Initial Exclusion Period</th>
								<th style="border: 1px solid #f39c12;color: #30bbbb">Benefit Period</th>
								<th style="border: 1px solid #f39c12;color: #30bbbb">Payment Option</th>
							</tr>
							<tr>


								<td style="border: 1px solid #f39c12">{{$policy}} </td>
								<td style="border: 1px solid #f39c12">£{{$personal_data->monthlybenefit}}</td>
								<td style="border: 1px solid #f39c12"> {{$excess_period}}</td>
								<td style="border: 1px solid #f39c12">{{$personal_data->transfer}}</td>

								@if($personal_data->typeofcover == 'AS')

								<td style="border: 1px solid #f39c12">N/A </td>
								@else
								<td style="border: 1px solid #f39c12">{{$product_details->inital_exclusion_period}}</td>
								@endif


								
								<td style="border: 1px solid #f39c12">{{$product_details->benifit_period}} Months</td>
								<td  style="border: 1px solid #f39c12">{{'Monthly Direct Debit'}}</td>
							</tr>
						</table>
				    </div>
			  </div>
			   <br><br>
				<div class="col-md-12" >
			        <div class="col-md-9">
			          <div class="box box-solid">
			            <div class="box-body">
			              <div class="panel">
							    <div class="panel-heading"></div>
							    <div class="panel-body">
							    	<table align="center" style="width: 50%;color: #30bbbb;padding: 5px; margin-bottom: 20px; font-size: 12px;border: 1px solid #f39c12" class="table" >
									<tr style="border: 1px solid #f39c12">
									<td style="border: 1px solid #f39c12;" >Policy Start Date</td>
									<td style="border: 1px solid #f39c12">{{date('d/m/Y',strtotime($personal_data->insurance_startdate))}}</td>
									</tr>
									<tr>
									<td style="border: 1px solid #f39c12">Monthly Premium </td>
									<td style="border: 1px solid #f39c12">&pound;{{$monthly_cost}}</td>
									</tr>
									</table>
									
							    </div>
						  </div>
			            </div>
			          </div>
			        </div>
	       		</div>
            </div>
          </div>
	         	<br>
	         	<div class="col-md-8">
                     @if($personal_data->transfer == 'Yes')
                        <P ALIGN='left'>     Notes (Applicable when transferring your policy)</p>
                        <P ALIGN='left'>     *Initial Exclusion is waived on a like for like basis</p>
                        <P ALIGN='left'>     **Any increase to your existing benefit amount will be subject to a {{$product_details->inital_exclusion_period}} initial exclusion period</p>
                     @endif
                  </div><br>
          <hr style="border:1px solid #f49542">
          <br><br><br>
          <div class="col-md-12">
          	<div class="box box-warning">
	            <div class="box-body">
		            <div class="col-md-12" style="color:  #d2d6dc;padding: 5px;font-size: 12px;margin-top: 380px;">
	            	{{$product_details->product_name.' '.$message}} 
	            	</div>
            	</div>
        	</div>
           </div>
	    </div>
	          
	  </div>
		
	</body>
</html>