<!doctype html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Payment Email</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;
	}
		
}

.contentEditable h2.big,.contentEditable h1.big{
  font-size: 26px !important;
}

 .contentEditable h2.bigger,.contentEditable h1.bigger{
  font-size: 37px !important;
}

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

a.link1{
  font-size:13px;
  color:#27A1E5;
  line-height: 24px;
  text-decoration:none;
}
a{
  text-decoration: none;
}

.link2{
color:#ffffff;
border-top:5px solid #27A1E5;
border-bottom:5px solid #27A1E5;
border-left:18px solid #27A1E5;
border-right:18px solid #27A1E5;
border-radius:3px;
background:#27a1e5;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}

.link3{
color:#ffffff;
border:1px solid #cccccc;
padding:15px 50px;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
background:#4CAF50;
font-size:18px;
}

.link4{
color:#27A1E5;
line-height: 24px;
}

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

.contentEditable li{
 
}

.appart p{
 
}
.bgItem{
background: #ffffff;
}
.bgBody{
background: #3B5998;
}

img { 
  outline:none; 
  text-decoration:none; 
  -ms-interpolation-mode: bicubic;
  width: auto;
  max-width: 100%; 
  clear: both; 
  display: block;
  float: none;
}

</style>


<script type="colorScheme" class="swatch active">
{
    "name":"Default",
    "bgBody":"#3B5998",
    "link":"27A1E5",
    "color":"AAAAAA",
    "bgItem":"ffffff",
    "title":"444444"
}
</script>


</head>
<body paddingwidth="0" paddingheight="0" 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" bgcolor="#3B5998">
  <tbody>
      <tr>
	  <td height="15"></td>
	  </tr>
    <tr> <!-- tr1 Start -->
      <td>
		<table width="700" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffff" style="font-family:helvetica, sans-serif;" 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="5"></td>
					</tr>
					<tr>
					  <td>
					  <table width="100%" border="0" cellspacing="0" cellpadding="0">
						  <tbody>
							<tr>
							  <td valign="top">
								
							  </td>
							  <td valign="top" width="90" class="spechide">&nbsp;</td>
							  <td valign="middle" style='vertical-align: middle;' width='150'>
								  <img src="{{ asset('public/backend/dist/img/infolink_logo.jpg') }}" alt="Logo" title="Logo" data-max-width="100">
								</td>
							</tr>
						  </tbody>
						</table>
					</td>
					</tr>
					
					<tr>
					   <td><hr style='height:1px;background:#82BEFA;border:none;'></td>
					</tr>
				  </tbody>
				</table>
			  </div>
			  <!-- =============== END HEADER =============== -->
			  
			<!-- =============== START BODY =============== -->
			  
			  <div class="movableContent" style="border: 0px; padding-top: 0px; position: relative;">
			  <table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tbody>
				<tr>
				  <td class="specbundle">
				      <div class='contentEditableContainer contentTextEditable'>
                            <div class='contentEditable'>
							
					<?php
					$payment_info = DB::table('payment')->where('id',$payment_id)->first();
					
					$client_id = $payment_info->client_id;
				
					$invoice_id = $payment_info->invoice_id;
					
					$payment = $payment_info->payment_type;
					
					$bank_name = $payment_info->bank_name;
					
					//payment_slip($client_id = 0, $id=0)
					
					//$payment_slip_link = base_url()."index.php/invoice/payment_slip/".base64_encode($client_id)."/".base64_encode($payment_id);
					$payment_slip_link = '<a href="https://infolinkbd.com/download_slip/'.base64_encode($payment_id).'" class="link2">Download Payment Slip</a>';
					
					$invoice_bill_period = DB::table('invoice')->where("invoice_id",$invoice_id)->first();
					
					$reference_number ="";
					
					$cheque_no = "";
					
					if($payment == 0)
					{
						$payment_type = "Cash";
						
						$bank_name = "";
						
						$reference_number ="";
						
						$cheque_no = "";
					}elseif($payment == 1)
					{
						$payment_type = "Cheque";
						
						$bank_name = $payment_info->bank_name;
						
						$reference_number = $payment_info->reference_number;
						
						$cheque_no = $payment_info->cheque_po_number;
					}elseif($payment == 2)
					{
						$payment_type = "Payorder";
						
						$bank_name = $payment_info->bank_name;
						
						$reference_number = $payment_info->reference_number;
						
						$cheque_no = $payment_info->cheque_po_number;
					}elseif($payment == 3)
					{
						$payment_type = "Online Payment";
						$reference_number ="";
					    $cheque_no = "";
					}elseif($payment == 4)
					{
						$payment_type = "bKash";
						$reference_number ="";
					    $cheque_no = "";
					}elseif($payment == 5)
					{
						$payment_type = "Bank Grantee";
						$reference_number ="";
					    $cheque_no = "";
					}elseif($payment == 6)
					{
						$payment_type = "Card";
						$reference_number ="";
					    $cheque_no = "";
					}elseif($payment == 7)
					{
						$payment_type = "Bank Transfer";
						$reference_number ="";
					    $cheque_no = "";
					}elseif($payment == 8)
					{
						$payment_type = "Other";
						$reference_number ="";
					    $cheque_no = "";
					}
					
					$amount = $payment_info->amount;
					
					
					$payment_date = date("Y-m-d");
					
					$client_info = DB::table('client')->where('client_id',$client_id)->first();
					
					$invoice_link 	= '<a href="https://infolinkbd.com/download_invoice_tt/'.base64_encode($invoice_id).'" class="link2">Download Invoice</a>';
					
					$notification 	= DB::table('notification')->where('id',5)->first();
					
					$m = str_replace('[[contact_person]]',$client_info->contact_person,$notification->message);
							
					$m1 = str_replace('[[invoice_id]]',$invoice_id,$m);
					
					$m2 = str_replace('[[Payment_amount]]',"BDT ".number_format($amount)." /-",$m1);
					
					$m3 = str_replace('[[payment_type]]',$payment_type,$m2);
					
					$m4 = str_replace('[[payment_date]]',$payment_date,$m3);
					
					$m5 = str_replace('[[bank_name]]',$bank_name,$m4);
					
					$m6 = str_replace('[[reference_number]]',$reference_number,$m5);
					
					$m7 = str_replace('[[payment_number]]',$cheque_no,$m6);
					
					$m8 = str_replace('[[payment_slip_link]]',$payment_slip_link,$m7);
					
					$m9 = str_replace('[[invoice_link]]',$invoice_link,$m8);
					
					$m10 = str_replace('[[invoice_bill_period]]',$invoice_bill_period->bill_period,$m9);
					
					$m11 = str_replace('[[client_id]]',$client_id,$m10);
					
					echo $m11;
					?>
					</div>
					</div>
				  </td>
				</tr>
				<!-- <tr><td height='5' colspan="3"></td></tr>
				<tr><td colspan="3"><hr style='height:1px;background:#82BEFA;border:none;'></td></tr> -->
			  </tbody>
			</table>
			  </div>
			  
			  <!-- =============== END BODY =============== -->
		<!-- =============== START FOOTER =============== -->
			  
			  </td>
			</tr>
		  </tbody>
		</table>
		</td>
			  <td valign="top" width="20">&nbsp;</td>
			</tr>
		  </tbody>
		</table>
		</td>
			</tr>
		  </tbody>
		</table>
		</td>
    </tr> <!-- tr1 End -->
    <tr>
					  <td height="15"></td>
					</tr>
  </tbody>
</table>

  </body>
  </html>



