| if($year!='null' && $month!='null' && $app=='null'){ | if($year!='null' && $month!='null' && $app=='null'){ | ||||
| $count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); $count_menglembu = array(); $count_ipoh = array(); | $count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); $count_menglembu = array(); $count_ipoh = array(); | ||||
| $extra = 0; $basic_total = 0; $countAugustR = array(); $countAugustB = array();$countSeptemberR = array(); $countSeptemberB = array(); $finalprice = 0; | |||||
| $extra = 0; $basic_total = 0; $countAugustR = array(); $countAugustB = array(); | |||||
| // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ | // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ | ||||
| // $dataDis = $this->returnDataR($company,'2019','12'); | // $dataDis = $this->returnDataR($company,'2019','12'); | ||||
| $dataAugustB = $this->returnDataB($company,'2020','8'); | $dataAugustB = $this->returnDataB($company,'2020','8'); | ||||
| $dataSeptemberR = $this->returnDataR($company,'2020','9'); | $dataSeptemberR = $this->returnDataR($company,'2020','9'); | ||||
| $dataSeptemberB = $this->returnDataB($company,'2020','9'); | $dataSeptemberB = $this->returnDataB($company,'2020','9'); | ||||
| $dataOctober = $this->returnDataR($company,'2020','10'); | |||||
| $dataOctoberR = $this->returnDataR($company,'2020','10'); | |||||
| $dataOctoberB = $this->returnDataB($company,'2020','10'); | |||||
| foreach ($dataAugustR as $key => $d) { | foreach ($dataAugustR as $key => $d) { | ||||
| if((date('m/Y', strtotime($d['submission'])) == $month.'/'.$year) && date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020'){ | if((date('m/Y', strtotime($d['submission'])) == $month.'/'.$year) && date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020'){ | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| 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($d['contract'] == '24'){ | |||||
| if ($d['package']== 50){ | |||||
| $d['retail_price'] = 69; | |||||
| } elseif ($d['package']== 100){ | |||||
| $d['retail_price'] = 89; | |||||
| } elseif ($d['package']== 500){ | |||||
| $d['retail_price'] = 129; | |||||
| } | |||||
| } | |||||
| } | |||||
| if(count($dataOctoberR) >= 50){ | |||||
| if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){ | |||||
| 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 { | |||||
| $total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5 + 50, 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' => '250% + RM50', | |||||
| 'incentives2' => $d['incentives2'], | |||||
| 'total' => 'RM '.$total, | |||||
| 'claim' => $d['claim'], | |||||
| )); | |||||
| } | |||||
| } | |||||
| }else if(count($dataOctoberR) < 50){ | |||||
| if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){ | |||||
| 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 { | |||||
| $total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5, 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' => '250%', | |||||
| 'incentives2' => $d['incentives2'], | |||||
| 'total' => 'RM '.$total, | |||||
| 'claim' => $d['claim'], | |||||
| )); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| 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($d['contract'] == '24'){ | |||||
| if ($d['package']== 50){ | |||||
| $d['retail_price'] = 89; | |||||
| } elseif ($d['package']== 100){ | |||||
| $d['retail_price'] = 119; | |||||
| } elseif ($d['package']== 300){ | |||||
| $d['retail_price'] = 179; | |||||
| } elseif ($d['package']== 500){ | |||||
| $d['retail_price'] = 249; | |||||
| } | |||||
| } | |||||
| } | |||||
| if(count($dataOctoberB) >= 50){ | |||||
| if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){ | |||||
| 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 ($d['package']== 1){ | |||||
| $total = 1500; | |||||
| } else{ | |||||
| $total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5 + 50, 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' => '250% + RM50', | |||||
| 'incentives2' => '', | |||||
| 'total' => 'RM '.$total, | |||||
| 'claim' => $d['claim'], | |||||
| )); | |||||
| } | |||||
| } | |||||
| }else if(count($dataOctoberB) < 50){ | |||||
| if(date('m/Y', strtotime($d['activation'])) == $month.'/'.$year){ | |||||
| 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 ($d['package']== 1){ | |||||
| $total = 1500; | |||||
| } else{ | |||||
| $total = number_format(floatval(str_replace("RM ", "" , $d['retail_price'])) * 2.5, 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' => '250%', | |||||
| 'incentives2' => '', | |||||
| 'total' => 'RM '.$total, | |||||
| 'claim' => $d['claim'], | |||||
| )); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| }else{ | }else{ |