$form = Subscriber::with('Form')->where('subscriber_id',$subscriber_id)->first(); | $form = Subscriber::with('Form')->where('subscriber_id',$subscriber_id)->first(); | ||||
$package = PackageDetail::where('_id',$form->_id)->first(); | $package = PackageDetail::where('_id',$form->_id)->first(); | ||||
$dateSubmittion = date('d/m/Y', strtotime($form->created_at)); | $dateSubmittion = date('d/m/Y', strtotime($form->created_at)); | ||||
$created = $form->Form->created_at->toDateString(); | |||||
$ext1 = pathinfo(public_path().$form->front_ic, PATHINFO_EXTENSION); | $ext1 = pathinfo(public_path().$form->front_ic, PATHINFO_EXTENSION); | ||||
$ext2 = pathinfo(public_path().$form->back_ic, PATHINFO_EXTENSION); | $ext2 = pathinfo(public_path().$form->back_ic, PATHINFO_EXTENSION); | ||||
// $pdf = PDF::loadView('pdf.business-pdf', compact('form','package','product','ext1','ext2','ext3','ext4','ext5','ext6','dateSubmittion')); | // $pdf = PDF::loadView('pdf.business-pdf', compact('form','package','product','ext1','ext2','ext3','ext4','ext5','ext6','dateSubmittion')); | ||||
if(strtotime($form->created_at) >= 1580774399){ | if(strtotime($form->created_at) >= 1580774399){ | ||||
$pdf = PDF::loadView('pdf.newBusiness-pdf', compact('form','package','product','ext1','ext2','ext3','ext4','ext5','dateSubmittion')); | |||||
$pdf = PDF::loadView('pdf.newBusiness-pdf', compact('form','package','product','ext1','ext2','ext3','ext4','ext5','dateSubmittion', 'created')); | |||||
}else { | }else { | ||||
$pdf = PDF::loadView('pdf.oldBusiness-pdf', compact('form','package','product','ext1','ext2','ext3','ext4','ext5','ext6','dateSubmittion')); | $pdf = PDF::loadView('pdf.oldBusiness-pdf', compact('form','package','product','ext1','ext2','ext3','ext4','ext5','ext6','dateSubmittion')); | ||||
} | } |
} | } | ||||
foreach ($dataOctoberR as $key => $d) { | foreach ($dataOctoberR as $key => $d) { | ||||
if(((date('m/Y', strtotime($d['submission'])) == '08/2020') && (date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020')) || (date('m/Y', strtotime($d['submission'])) == $month.'/'.$year)){ | |||||
if(((date('m/Y', strtotime($d['submission'])) == '08/2020') && (date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020')) || (date('m/Y', strtotime($d['submission'])) == $month.'/'.$year) || (date('m/Y', strtotime($d['submission'])) == '09/2020')){ | |||||
if($d['contract'] == '24'){ | if($d['contract'] == '24'){ | ||||
if ($d['package']== 50){ | if ($d['package']== 50){ | ||||
$d['retail_price'] = 69; | $d['retail_price'] = 69; | ||||
} | } | ||||
foreach ($dataOctoberB as $key => $d) { | foreach ($dataOctoberB as $key => $d) { | ||||
if(((date('m/Y', strtotime($d['submission'])) == '08/2020') && (date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020')) || (date('m/Y', strtotime($d['submission'])) == $month.'/'.$year)){ | |||||
if(((date('m/Y', strtotime($d['submission'])) == '08/2020') && (date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020')) || (date('m/Y', strtotime($d['submission'])) == $month.'/'.$year) || (date('m/Y', strtotime($d['submission'])) == '09/2020')){ | |||||
if($d['contract'] == '24'){ | if($d['contract'] == '24'){ | ||||
if ($d['package']== 50){ | if ($d['package']== 50){ | ||||
$d['retail_price'] = 89; | $d['retail_price'] = 89; |
<body> | <body> | ||||
<!-- Address --> | <!-- Address --> | ||||
<table width="100%"> | <table width="100%"> | ||||
@if($package->name != '1' && $package->contract == '24' && (($dateSubmittion >= '12/08/2020' && $dateSubmittion < '01/11/2020') || ($dateSubmittion >= '01/10/2020' && $dateSubmittion < '01/11/2020')) ) | |||||
@if($package->name != '1' && $package->contract == '24' && ($created >= '2020-08-12' && $created < '2020-11-01')) | |||||
<tr> | <tr> | ||||
<td align="left" style="font-size: 10px"> | <td align="left" style="font-size: 10px"> | ||||
<b style="color: red">PROMOTION (RM 10 off for 24 months)</b> | <b style="color: red">PROMOTION (RM 10 off for 24 months)</b> | ||||
<tr> | <tr> | ||||
<td> | <td> | ||||
<table border="0" cellpadding="0" cellspacing="0"> | <table border="0" cellpadding="0" cellspacing="0"> | ||||
@if (($dateSubmittion >= '12/08/2020' && $dateSubmittion < '01/11/2020') || ($dateSubmittion >= '01/10/2020' && $dateSubmittion < '01/11/2020')) | |||||
@if($created >= '2020-08-12' && $created < '2020-11-01') | |||||
@foreach($product as $p) | @foreach($product as $p) | ||||
@if($p->speed != '10' && $p->speed != '30') | @if($p->speed != '10' && $p->speed != '30') | ||||
<tr> | <tr> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr><td height="4"></td></tr> | <tr><td height="4"></td></tr> | ||||
@if ($package->name != '1' && $package->contract == '24' && (($dateSubmittion >= '12/08/2020' && $dateSubmittion < '01/11/2020') || ($dateSubmittion >= '01/10/2020' && $dateSubmittion < '01/11/2020'))) | |||||
@if($package->name != '1' && $package->contract == '24' && ($created >= '2020-08-12' && $created < '2020-11-01')) | |||||
<tr> | <tr> | ||||
<td style="font-size: 11px;"> | <td style="font-size: 11px;"> | ||||
<img src="{{ url('/assets/tick.png') }}" style="width:14px; height:auto"> RM 10 off for 24 months | <img src="{{ url('/assets/tick.png') }}" style="width:14px; height:auto"> RM 10 off for 24 months |