| public function get_data_form(Request $request){ | public function get_data_form(Request $request){ | ||||
| $dateS = Carbon::createFromFormat('Y-m-d', '2020-01-01'); | |||||
| $dateS = Carbon::createFromFormat('Y-m-d', '2017-01-01'); | |||||
| $start = $dateS->copy()->startOfDay(); | $start = $dateS->copy()->startOfDay(); | ||||
| $dateE = Carbon::createFromFormat('Y-m-d', '2020-12-31'); | $dateE = Carbon::createFromFormat('Y-m-d', '2020-12-31'); | ||||
| $end = $dateE->copy()->endOfDay(); | $end = $dateE->copy()->endOfDay(); | ||||
| // if(!empty($f->Subscriber->DealerClaim)){ | // if(!empty($f->Subscriber->DealerClaim)){ | ||||
| // $amount_claim = $f->Subscriber->DealerClaim->total_claim; | // $amount_claim = $f->Subscriber->DealerClaim->total_claim; | ||||
| // } | // } | ||||
| $subscriber_id=''; | |||||
| $subscriber_id=''; $ic=''; $company_reg=''; | |||||
| if(!empty($f->Subscriber) && !empty($f->PackageDetail)){ | if(!empty($f->Subscriber) && !empty($f->PackageDetail)){ | ||||
| if($f->type_application == 'R'){ | if($f->type_application == 'R'){ | ||||
| $name = $f->Subscriber->name; | $name = $f->Subscriber->name; | ||||
| $ic = $f->Subscriber->ic; | |||||
| $subscriber_id = $f->Subscriber->subscriber_id; | $subscriber_id = $f->Subscriber->subscriber_id; | ||||
| $contact_no = $f->Subscriber->phone1; | $contact_no = $f->Subscriber->phone1; | ||||
| $building = $f->Subscriber->building_name; | $building = $f->Subscriber->building_name; | ||||
| } | } | ||||
| }else if($f->type_application == 'B'){ | }else if($f->type_application == 'B'){ | ||||
| $name = $f->Subscriber->company_name; | $name = $f->Subscriber->company_name; | ||||
| $ic = $f->Subscriber->ic; | |||||
| $company_reg = $f->Subscriber->company_reg; | |||||
| $subscriber_id = $f->Subscriber->subscriber_id; | $subscriber_id = $f->Subscriber->subscriber_id; | ||||
| $contact_no = $f->Subscriber->company_num; | $contact_no = $f->Subscriber->company_num; | ||||
| $building = $f->Subscriber->street; | $building = $f->Subscriber->street; | ||||
| 'type_application' => $f->type_application, | 'type_application' => $f->type_application, | ||||
| "type_service" => $f->type_service, | "type_service" => $f->type_service, | ||||
| "customer_name"=> $name, | "customer_name"=> $name, | ||||
| "subscriber_id" => $subscriber_id, | |||||
| "contact_no"=> $contact_no, | |||||
| "unit_no"=>$f->Subscriber->unit_no, | |||||
| "building"=>$building, | |||||
| "street"=>$address, | |||||
| "submitted_date" => $f->created_at->toDateTimeString(), | |||||
| "package_contract" => $f->PackageDetail->contract, | |||||
| "package_name" => $f->PackageDetail->name, | |||||
| 'dealer' => $labelD, | |||||
| 'wo' => $woId, | |||||
| 'activated_date' => $woD, | |||||
| 'installer_name' => $installer_name, | |||||
| 'contractor_name' => $contractor_name, | |||||
| "ic" => $ic, | |||||
| "company_reg" => $company_reg, | |||||
| // "subscriber_id" => $subscriber_id, | |||||
| // "contact_no"=> $contact_no, | |||||
| // "unit_no"=>$f->Subscriber->unit_no, | |||||
| // "building"=>$building, | |||||
| // "street"=>$address, | |||||
| // "submitted_date" => $f->created_at->toDateTimeString(), | |||||
| // "package_contract" => $f->PackageDetail->contract, | |||||
| // "package_name" => $f->PackageDetail->name, | |||||
| // 'dealer' => $labelD, | |||||
| // 'wo' => $woId, | |||||
| // 'activated_date' => $woD, | |||||
| // 'installer_name' => $installer_name, | |||||
| // 'contractor_name' => $contractor_name, | |||||
| )); | )); | ||||
| // array_push($result,array( | // array_push($result,array( | ||||
| // // 'Installer' => $installerId, | // // 'Installer' => $installerId, |