| @@ -2084,7 +2084,7 @@ class DealerController extends Controller | |||
| 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; | |||
| // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ | |||
| @@ -2117,6 +2117,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Jasin') !== false) { | |||
| $count_jasin[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| } | |||
| else { | |||
| @@ -2134,6 +2137,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Jasin') !== false) { | |||
| $count_jasin[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| } | |||
| foreach ($dataJune as $key => $d) { | |||
| @@ -2144,6 +2150,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Jasin') !== false) { | |||
| $count_jasin[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| } | |||
| foreach ($dataJuly as $key => $d) { | |||
| @@ -2154,6 +2163,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Jasin') !== false) { | |||
| $count_jasin[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| } | |||
| // Store to combineData New Incentives Cyberjaya | |||
| @@ -2217,6 +2229,68 @@ class DealerController extends Controller | |||
| } | |||
| } | |||
| // 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 | |||
| foreach ($count_jasin as $key => $d) { | |||
| if(count($count_jasin) > 20){ | |||