<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Due 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:10px solid #27A1E5;
border-bottom:10px solid #27A1E5;
border-left:18px solid #27A1E5;
border-right:18px solid #27A1E5;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
background:#27A1E5;
}

.link3{
color:#555555;
border:1px solid #cccccc;
padding:10px 18px;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
background:#ffffff;
}

.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;
}

</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;">
				<?php
				$client = DB::table('client')->where('client_id',$client_id)->first();
				?>
				<p>Dear <b><?php echo $client->contact_person.' (IL-C'.$client->client_id.')';?></b></p><br/>
				<p>Greetings from InfoLink.</p><br/>

<p>This email containt your Dues with InfoLink.</p><br/>

<p><b>Please note that if you think there is any error please feel free to contact our billing department Immediately email: billing@infolinkbd.com </b><br/>
or Simply call: +8801952200110 <br/>
<b>Visit our website https://www.infolinkbd.com for exiting services and information.</b>
				</p><br/>
				<?php
				$due_payments = DB::select("SELECT client_id,invoice_id,admin_id,status,bill_period,invoice_created_date,vat_status,discount FROM invoice WHERE client_id='$client_id' AND (status = 1 OR status = 6)");
		      
				$font_family = 'font-family:Segue UI, Roboto, Tahoma, sans-serif;';
				$table_style = 'style="border:1px solid #ccc;border-collapse:collapse;width:100%;'.$font_family.'"';
				$th_style = 'style="padding:3px 5px;font-size:12px;border:1px solid #ccc;font-weight:bold;'.$font_family.'"';
				$td_style = 'style="padding:3px 5px;font-size:12px;border:1px solid #ccc;'.$font_family.'"';
				$h3_style = 'style="padding:3px 5px;font-size:14px;font-weight:bold;margin-bottom:10px;'.$font_family.'"';
				$p_style = 'style="padding:3px 5px;font-size:12px;margin-bottom:10px;'.$font_family.'"';
				?>
				  <h4>Due Invoice List</h4>
					  <table cellpadding="0" cellspacing="0" <?php echo $table_style; ?>>
						  <tr>
							<th <?php echo $th_style; ?>>SL</th>
							<th <?php echo $th_style; ?>>Date</th>
							<th <?php echo $th_style; ?>>Bill Period</th>
							<th <?php echo $th_style; ?>>Invoice No</th>
							<th <?php echo $th_style; ?>>Bill Amount</th>
							<th <?php echo $th_style; ?>>Status</th>
							<th <?php echo $th_style; ?>>Action</th>
						  </tr>
						
						  <?php
							if(!empty($due_payments))
							{
								$i = 0;
								$invoice_total = 0;
			                    $in = 0;
								foreach($due_payments as $lists)
								{
						?>
						<tr>
							<td <?php echo $td_style; ?>><?php echo $i+1;?></td>
							<td <?php echo $td_style; ?>><?php echo date("d-m-Y",strtotime($lists->invoice_created_date));?></td>
							<td <?php echo $td_style; ?>><?php echo $lists->bill_period; ?></td>
							<td <?php echo $td_style; ?>>
								<?php 
									echo 'IL '.$lists->invoice_id;
								?>
							</td>
							
							<td <?php echo $td_style; ?>>
								<?php 
								    $array2 = DB::table('invoice_details')->where('invoice_id',$lists->invoice_id)->get();
								    
        			                $total_amount = 0;
        			                $record_bill = 0;
                    				if($lists->vat_status==1)
                    				{
                    					$vat = 0;
                    					$amount = 0;
                    					foreach($array2 as $array3)
                    					{
                    						$amount += ((float)$array3->price * (float)$array3->quantity);
                    						$vat += ((float)$array3->price * (float)$array3->quantity * $array3->vat*.01);
                    					}
                    					$total_amount = $amount+$vat;
                    					$record_bill = $total_amount - $lists->discount;
                    				}else{
                    					$vat = 0;
                    					$amount = 0;
                    					foreach($array2 as $array3)
                    					{
                    						$amount += ((float)$array3->price * (float)$array3->quantity);
                    						$vat += ((float)$array3->price * (float)$array3->quantity * $array3->vat*.01);
                    					}
                    					$total_amount = $amount;
                    					$record_bill = $total_amount - $lists->discount;
                    				}
									echo number_format($record_bill,2);
									$invoice_total += $record_bill;
								?>
							</td>
							
							<td <?php echo $td_style; ?>>
								<?php
									if($lists->status == 1)
									{
										echo "<span style='color:red;'>Due</span>";
									}elseif($lists->status == 3){
										echo "<span style='color:green;'>Paid</span>";
									}elseif($lists->status == 2){
										echo "<span style='color:blue;'>Partialy Paid</span>";
									}elseif($lists->status == 0){
										echo "<span style='color:blue;'>Processing</span>";
									}elseif($lists->status == 4){
										echo "Cancel";
									}elseif($lists->status == 5){
										echo "Deleted";
									}elseif($lists->status == 6){
										//echo "Bad Debt";
										echo "<span style='color:red;'>Due</span>";
									}else{ 
									    
									}
								
								?>
							</td>
							<td <?php echo $td_style; ?>>
							<?php 
						    if($lists->status == 1 OR $lists->status == 6)
							{
							?>
							<a href=""><button> Pay Now</button></a>
							<?php
							}
							?>
							<a href=""><button> Print</button></a>
							
							</td>
						</tr>  
						
						<?php
								$i++;
								}
							
							}else{
						?>
						<tr>
							<td colspan="7" <?php echo $td_style; ?>>No result Found</td>
						</tr>
						<?php 
							}
						?>
						
						
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<th <?php echo $td_style; ?>>Total</th>
							<th <?php echo $td_style; ?>><?php if(!empty($invoice_total)){echo number_format($invoice_total,2);}?></th>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							
						</tr>
					</table>
			
			  <br/>
			  <br/>
			  <h3>We Accept</h3>
			  <p><img src="" height="50"></p><br/><br/>
			  <!-- <p><a class="link2" href="https://www.infolinkbd.com/pay">Pay Now</a></p><br/><br/> -->
			  <p>If you have any overdue please clear your due within running month for seamless connectivity.</p>
			  <p>
			  We Accept: Online Payment, bKash, Bank Deposit, Check and Bank Transfer. For Payment details visit <a href="https://www.infolinkbd.com/pay">https://www.infolinkbd.com/pay</a> <br/>
				You can login to your client area to view and pay the invoice at  <a href="https://care.infolinkbd.com">https://care.infolinkbd.com </a><br/><br/><br/>
				 
				<b>Bank Information:</b>
                <br/>
                Bank Name: City Bank Limited <br/>
                Account Title: Info Link Ltd. <br/>
                Account Number:140 180 6772001 <br/>
                Swift Code: CIBLBDDHXXX <br/>
                Routing Number: 225260333 <br/>
                City: Dhaka <br/>
                Country: Bangladesh <br/><br/>
                
                
                You can send through <b>bKash</b>: <br/>
                From Personal Number: <b>01952200111</b> <br/>
                
                To send bill payment: <b>(Only from personal bKash)</b> <br/>
                
                Go to your bKash Mobile Menu by dialling <b>*247#</b> <br/>
                Choose <b>“Payment”</b> <br/>
                Enter the Merchant bKash Account Number <b>01952200111</b> <br/>
                Enter the bill amount <br/>
                Enter a reference your invoice ID: [[invoice_id]] <br/>
                Enter Counter Number 1 <br/>
                Now enter your bKash Mobile Menu PIN to confirm <br/>
                Done! You will receive a confirmation message from bKash <br/>
                Send an email to billing@infolinkbd.com with your transaction id and Invoice Number. (***Required) <br/>
                Please note, you can send bKash to our Merchant account from agent number. You need a personal bkash number to do that. <br/><br/>
                
                For limit details please visit BKash Official Website. <br/><br/>
                
                Please send us an email to billing@infolinkbd.com after successful payment. Please also attach your bank deposit slip. <br/><br/>
                
                If you feel there is an error, please contact us immediately.<br/><br/>
                
                With Regards, <br/><br/>
                
                InfoLink Billing Department <br/>
                56, Pragati Sharani, Block J, Baridhara, <br/>
                Dhaka 1212, Bangladesh <br/>
                billing@infolinkbd.com <br/>
                Hotline: 16673,  +8809610121121 or +8801952200110 <br/>
                <a href="https://www.infolinkbd.com">https://www.infolinkbd.com</a>
			  </p>
			  </div>
			  
			  </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>
