<!doctype html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Task</title>
  <style type="text/css">
  body {
   padding-top: 0 !important;
   padding-bottom: 0 !important;
   padding-top: 0 !important;
   padding-bottom: 0 !important;
   margin:0 !important;
   width: 100% !important;
   -webkit-text-size-adjust: 100% !important;
   -ms-text-size-adjust: 100% !important;
   -webkit-font-smoothing: antialiased !important;
 }
 .tableContent img {
   border: 0 !important;
   display: block !important;
   outline: none !important;
 }
 a{
  color:#382F2E;
}

p, h1,h2,ul,ol,li,div{
  margin:0;
  padding:0;
}

h1,h2{
  font-weight: normal;
  background:transparent !important;
  border:none !important;
}

@media only screen and (max-width:480px)
		
{
		
table[class="MainContainer"], td[class="cell"] 
	{
		width: 100% !important;
		height:auto !important; 
	}
td[class="specbundle"] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:15px !important;
	}	
td[class="specbundle2"] 
	{
		width:80% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:10px !important;
		padding-left:10% !important;
		padding-right:10% !important;
	}
		
td[class="spechide"] 
	{
		display:none !important;
	}
	    img[class="banner"] 
	{
	          width: 100% !important;
	          height: auto !important;
	}
		td[class="left_pad"] 
	{
			padding-left:15px !important;
			padding-right:15px !important;
	}
		 
}
	
@media only screen and (max-width:540px) 

{
		
table[class="MainContainer"], td[class="cell"] 
	{
		width: 100% !important;
		height:auto !important; 
	}
td[class="specbundle"] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:15px !important;
	}	
td[class="specbundle2"] 
	{
		width:80% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:10px !important;
		padding-left:10% !important;
		padding-right:10% !important;
	}
		
td[class="spechide"] 
	{
		display:none !important;
	}
	    img[class="banner"] 
	{
	          width: 100% !important;
	          height: auto !important;
	}
		td[class="left_pad"] 
	{
			padding-left:15px !important;
			padding-right:15px !important;
	}
		
}

td,table{
  vertical-align: top;
}
td.middle{
  vertical-align: middle;
}

h2,h1{
line-height: 20px;
}
p{
  font-size: 14px;
  line-height: 21px;
  /*color:#AAAAAA;*/
}
</style>

</head>
<body paddingwidth="0" paddingheight="0" bgcolor="#EEEEEE"  style="padding-top: 0; padding-bottom: 0; padding-top: 0; padding-bottom: 0; background-repeat: repeat; width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;" offset="0" toppadding="0" leftpadding="0">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td><table width="600" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffff" style="font-family:'Lucida Console', Courier, monospace" class="MainContainer">
      <!-- =============== START HEADER =============== -->
  <tbody>
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td valign="top" width="20">&nbsp;</td>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td class="movableContentContainer">
      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td height="15"></td>
    </tr>
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td valign="top" width="60"><img src="{{ asset('public/backend/dist/img/infolink_logo.jpg') }}" alt="Logo" title="Logo" height="40" data-max-width="100"></td>
    </tr>
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table></td>
    </tr>
    <tr>
       <td height='15'></td>
    </tr>
   
  </tbody>
</table>
	  </div>
      <!-- =============== END HEADER =============== -->
<!-- =============== START BODY =============== -->
      <?php 
	  $task_result = DB::table('task_list')->where('task_list_id', $task_list_id)->first();
	  if($task_result->client_id != 0){
		  $client = DB::table('client')->where('client_id',$task_result->client_id)->first();
		  $task_for = $client->client_title.' (IL-C'.$client->client_id.')';
		  if($client->client_phone2){
			  $phone2 = ' ,'.$client->client_phone2;
		  }else{
			  $phone2 = '';
		  }
		  if($client->client_email2){
			  $email2 = ' ,'.$client->client_email2;
		  }else{
			  $email2 = '';
		  }
		  
		  $phone = $client->client_phone1.$phone2;
		  $email = $client->client_email1.$email2;
	  }else{
		  $task_for = $task_result->task_for_name;
		  $phone = $task_result->task_for_number;
		  $email = $task_result->task_for_email;
	  }
	  if($task_result->task_for == 1){		
			if($task_result->connection_id != 0){
				$conn = DB::table('connection_list')->select('connection_address','client_address_id')->where('connection_id',$task_result->connection_id)->first();
				if($conn->client_address_id){
			    	$row = DB::table('client_address')->where('client_address_id',$conn->client_address_id)->first();
    				if($row){
    				       $address = $row->house.','.$row->road.','.$row->district.','.$row->police_station.','.$row->post_office.','.$row->post_code;
    				    
    				}else{
    				    $address = "Address Not Found";
    				}
				}else{
				    $address = "Address Not Found";
				}
			}else{ 
			    $client = DB::table('client')->where('client_id',$task_result->client_id)->first();
				$address = "Address Not Found";
			}								
		}else{
			$address = $task_result->task_location;
		}
	  ?>
      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td style="border: 1px solid #EEEEEE; border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td valign="top" width="20">&nbsp;</td>
      <td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
			  <tr><td height='25'></td></tr>
			  <tr>
				<td>
				  <div class='contentEditableContainer contentTextEditable'>
					<div class='contentEditable'>
					  <h2 style="font-size: 18px;">Dear <?php echo $task_for;?>,</h2>
					  <br>
					  <p style="font-size:16px;">We received a Task Request. Task request ID : <?php echo $task_list_id;?></p>
					  <br/>
					  <table width="100%" border="0" cellspacing="3" cellpadding="0" align="center" font-size="14">
						<tr>
							<td>Title</td>
							<td>:</td>
							<td><?php echo $task_result->task_title;?></td>
						</tr>
						<tr>
							<td>Schedule</td>
							<td>:</td>
							<td><?php echo $task_result->task_start.' (Estimated)'; ?></td>
						</tr>
						<tr>
							<td>Description</td>
							<td>:</td>
							<td><?php echo $task_result->task_description;?></td>
						</tr>
						<tr>
							<td>Phone</td>
							<td>:</td>
							<td><?php echo $phone;?></td>
						</tr>
						<tr>
							<td>Email</td>
							<td>:</td>
							<td><?php echo $email;?></td>
						</tr>
						<tr>
							<td>Location</td>
							<td>:</td>
							<td><?php echo $address;?></td>
						</tr>
					  </table>
					  <!-- <p>
						Task Title:  <br/>
						Schedule Time:  2017-10-31 17:00:00 to 2017-10-31 18:30:00 (Estimated) <br/>
						Location :  Basundhara RA ,Block#C, H#210, R#8
					  </p> -->
					</div>
				  </div>
				</td>
			  </tr>
			  <tr><td height='24'></td></tr>
			</table>
	  </td>
      <td valign="top" width="20">&nbsp;</td>
    </tr>
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table>

      
      
      </div>
      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td height="20"></td>
    </tr>
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
	  <td class="specbundle">
			<div class='contentEditableContainer contentTextEditable'>
				<div class='contentEditable' style='text-align: left;'>
				  <h2 style="font-size: 20px;">Assigned Employee</h2>
				  <br>
				  <p>
				   <?php 
				   $task_assign = DB::table('task_assigned_admin')->where('task_list_id',$task_list_id)->get();
					if(!empty($task_assign)){
						$i = 0;
						foreach($task_assign as $row){
							$i++;
							$result = DB::table('admin')->where('admin_id',$row->admin_id)->first();
							if($result){
								echo $result->user_name.'&nbsp;('.$result->user_phone.')<br/>';
								echo $result->user_email.'<br/>';
							}
						}
					}else{
						echo '';
					}
				   ?>
				  </p>
				</div>
			  </div>
	  </td>
      <td class="specbundle">
		<div class='contentEditableContainer contentTextEditable'>
			<div class='contentEditable' style='text-align: left;'>
			  <h2 style="font-size: 20px;">Created By</h2>
			  <br/>
			  <p>
			  <?php 
			  $admin = DB::table('admin')->where('admin_id',$task_result->task_added_by_admin_id)->first();
			  if($admin){
    			  echo $admin->user_name.'<br/>';
    			  echo $admin->user_phone.'<br/>';
    			  echo $admin->user_email;
			  }
			  ?>
			  </p>

			</div>
		  </div>
	  </td>
    </tr>
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table>

      
      
      </div>
     
      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td height="20"></td>
    </tr>
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
   
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table>

      
      
      </div>
   
      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
                <tr><td colspan="3"><hr style='height:1px;background:#DDDDDD;border:none;'></td></tr>
  </tbody>
</table>
      </div>
      
      <!-- =============== END BODY =============== -->
<!-- =============== START FOOTER =============== -->

      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td valign="top" width="90" class="spechide">&nbsp;</td>
      <td><table width="100%" cellpadding="0" cellspacing="0" align="center">
                      <tr>
                        <td>
                          <div class='contentEditableContainer contentTextEditable'>
                            <div class='contentEditable' style='text-align: center;'>
                              <p>
								InfoLink Limited <br/>
								56 Pragati Sharani, Block J, Baridhara, <br/>
								Dhaka 1212, Bangladesh <br/>
								+8809610121121 <br/>
								https://www.infolinkbd.com
                              </p>
                            </div>
                          </div>
                        </td>
                      </tr>
                    </table></td>
      <td valign="top" width="90" class="spechide">&nbsp;</td>
    </tr>
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table>
      
      
      </div>
      <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
      
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td height="40"></td>
    </tr>
    
  </tbody>
</table>

     <!-- =============== END FOOTER =============== --> 
      </div>
      </td>
    </tr>
  </tbody>
</table>
</td>
      <td valign="top" width="20">&nbsp;</td>
    </tr>
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table>
</td>
    </tr>
  </tbody>
</table>

    <!--Default Zone End-->

  </body>
  </html>
