| @@ -2084,7 +2084,7 @@ class DealerController extends Controller | |||
| if($year!='null' && $month!='null' && $app=='null'){ | |||
| $count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); | |||
| $count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); | |||
| $extra = 0; $basic_total = 0; $totals = 0; | |||
| // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ | |||
| @@ -2120,6 +2120,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Alor Gajah') !== false) { | |||
| $count_alorGajah[] = $d; | |||
| } | |||
| } | |||
| else { | |||
| @@ -2140,6 +2143,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Alor Gajah') !== false) { | |||
| $count_alorGajah[] = $d; | |||
| } | |||
| } | |||
| foreach ($dataJune as $key => $d) { | |||
| @@ -2153,6 +2159,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Alor Gajah') !== false) { | |||
| $count_alorGajah[] = $d; | |||
| } | |||
| } | |||
| foreach ($dataJuly as $key => $d) { | |||
| @@ -2166,6 +2175,9 @@ class DealerController extends Controller | |||
| if (strpos($d['address'], 'Ayer Keroh') !== false) { | |||
| $count_ayerKeroh[] = $d; | |||
| } | |||
| if (strpos($d['address'], 'Alor Gajah') !== false) { | |||
| $count_alorGajah[] = $d; | |||
| } | |||
| } | |||
| // Store to combineData New Incentives Cyberjaya | |||
| @@ -2291,6 +2303,68 @@ class DealerController extends Controller | |||
| } | |||
| } | |||
| } | |||
| // Store to combineData New Incentives Alor Gajah | |||
| foreach ($count_alorGajah as $key => $d) { | |||
| if(count($count_alorGajah) > 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_alorGajah) < 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){ | |||