| foreach($subDetail as $a) | foreach($subDetail as $a) | ||||
| { | { | ||||
| $var1=""; | $var1=""; | ||||
| $contractor_name=""; | |||||
| if(empty($a->WorkOrder)){} | if(empty($a->WorkOrder)){} | ||||
| else | else | ||||
| { | { | ||||
| if(!empty($staff)) | if(!empty($staff)) | ||||
| { | { | ||||
| $var1 =$staff->name; | $var1 =$staff->name; | ||||
| } | |||||
| } | |||||
| if(!empty($contractor)){ | |||||
| $contractor_name = $contractor->name; | |||||
| } | |||||
| $reg_time = $a->created_at; | $reg_time = $a->created_at; | ||||
| $expiry_date = $reg_time->addDays(3); | $expiry_date = $reg_time->addDays(3); | ||||
| $expiry_date = $expiry_date->getTimestamp(); | $expiry_date = $expiry_date->getTimestamp(); | ||||
| $n1 = ''; | |||||
| if($curr < $expiry_date) { | if($curr < $expiry_date) { | ||||
| $n1 = "New/"; | $n1 = "New/"; | ||||
| } | } | ||||
| 'customer_building' => $building, | 'customer_building' => $building, | ||||
| 'customer_postcode' => $a->Subscriber->postcode, | 'customer_postcode' => $a->Subscriber->postcode, | ||||
| 'customer_city' => $a->Subscriber->city, | 'customer_city' => $a->Subscriber->city, | ||||
| 'contractor_id' => $contractor->name, | |||||
| 'contractor_id' => $contractor_name, | |||||
| 'installer_id' => $var1, | 'installer_id' => $var1, | ||||
| 'dateTimeEnd' => $a->WorkOrder->dateTimeEnd, | 'dateTimeEnd' => $a->WorkOrder->dateTimeEnd, | ||||
| 'status' => $a->WorkOrder->status, | 'status' => $a->WorkOrder->status, |