Browse Source

add Ayer Keroh

ifah
Siti Hajar Ibrahim 5 years ago
parent
commit
188a1012f7
1 changed files with 75 additions and 1 deletions
  1. 75
    1
      app/Http/Controllers/DS/DealerController.php

+ 75
- 1
app/Http/Controllers/DS/DealerController.php View File



if($year!='null' && $month!='null' && $app=='null'){ if($year!='null' && $month!='null' && $app=='null'){


$count_cyberjaya = array(); $count_jasin = array();
$count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array();
$extra = 0; $basic_total = 0; $totals = 0; $extra = 0; $basic_total = 0; $totals = 0;


// if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){
if (strpos($d['address'], 'Jasin') !== false) { if (strpos($d['address'], 'Jasin') !== false) {
$count_jasin[] = $d; $count_jasin[] = $d;
} }
if (strpos($d['address'], 'Ayer Keroh') !== false) {
$count_ayerKeroh[] = $d;
}


} }
else { else {
if (strpos($d['address'], 'Jasin') !== false) { if (strpos($d['address'], 'Jasin') !== false) {
$count_jasin[] = $d; $count_jasin[] = $d;
} }
if (strpos($d['address'], 'Ayer Keroh') !== false) {
$count_ayerKeroh[] = $d;
}
} }


foreach ($dataJune as $key => $d) { foreach ($dataJune as $key => $d) {
if (strpos($d['address'], 'Jasin') !== false) { if (strpos($d['address'], 'Jasin') !== false) {
$count_jasin[] = $d; $count_jasin[] = $d;
} }
if (strpos($d['address'], 'Ayer Keroh') !== false) {
$count_ayerKeroh[] = $d;
}
} }


foreach ($dataJuly as $key => $d) { foreach ($dataJuly as $key => $d) {
if (strpos($d['address'], 'Jasin') !== false) { if (strpos($d['address'], 'Jasin') !== false) {
$count_jasin[] = $d; $count_jasin[] = $d;
} }
if (strpos($d['address'], 'Ayer Keroh') !== false) {
$count_ayerKeroh[] = $d;
}
} }


// Store to combineData New Incentives Cyberjaya // Store to combineData New Incentives Cyberjaya
} }
} }


// Store to combineData New Incentives Ayer Keroh
foreach ($count_ayerKeroh as $key => $d) {
if(count($count_ayerKeroh) > 20){

if($d['contract'] == '12'){

array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => $d['retail_price'],
'incentives1' => $d['incentives1'],
'incentives2' => $d['incentives2'],
'total' => $d['total'],
'claim' => $d['claim'],
));

}else {

if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){
$total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.3, 2);
array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => $d['retail_price'],
'incentives1' => '230%',
'incentives2' => $d['incentives2'],
'total' => 'RM '.$total,
'claim' => $d['claim'],
));
}

}

}else if(count($count_ayerKeroh) < 20){
if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){
array_push($combineData, array(
'index' => $d['index'],
'contract' => $d['contract'],
'wo' => $d['wo'],
'activation' => $d['activation'],
'name' => $d['name'],
'address' => $d['address'],
'package' => $d['package'],
'retail_price' => $d['retail_price'],
'incentives1' => $d['incentives1'],
'incentives2' => $d['incentives2'],
'total' => $d['total'],
'claim' => $d['claim'],
));
}
}
}
// Store to combineData New Incentives Jasin // Store to combineData New Incentives Jasin
foreach ($count_jasin as $key => $d) { foreach ($count_jasin as $key => $d) {
if(count($count_jasin) > 20){ if(count($count_jasin) > 20){

Loading…
Cancel
Save