public function get_data_form(Request $request){ | public function get_data_form(Request $request){ | ||||
$dateS = Carbon::createFromFormat('Y-m-d', '2020-12-01'); | |||||
$dateS = Carbon::createFromFormat('Y-m-d', '2020-01-01'); | |||||
$start = $dateS->copy()->startOfDay(); | $start = $dateS->copy()->startOfDay(); | ||||
$dateE = Carbon::createFromFormat('Y-m-d', '2021-12-31'); | $dateE = Carbon::createFromFormat('Y-m-d', '2021-12-31'); | ||||
$end = $dateE->copy()->endOfDay(); | $end = $dateE->copy()->endOfDay(); | ||||
} | } | ||||
array_push($result,array( | array_push($result,array( | ||||
'type_application' => $f->type_application, | |||||
"type_service" => $f->type_service, | |||||
'type_application' => $f->type_application, | |||||
'customer_category' => $f->customer_category, | |||||
"type_service" => $f->type_service, | |||||
"customer_name"=> $name, | "customer_name"=> $name, | ||||
"ic" => $ic, | "ic" => $ic, | ||||
//"company_reg" => $company_reg, | //"company_reg" => $company_reg, |
public function deleteInstaller(Request $request){ | public function deleteInstaller(Request $request){ | ||||
$staff = Staff::where('_id',$request->id)->first(); | $staff = Staff::where('_id',$request->id)->first(); | ||||
info("delete installer" . $request->id); | |||||
if(!empty($staff)){ | if(!empty($staff)){ | ||||
$st = StaffDetail::where('email',$staff->email)->first(); | $st = StaffDetail::where('email',$staff->email)->first(); | ||||
if(!empty($st)){ | |||||
$st->delete(); | |||||
$staff->delete(); | |||||
} | |||||
$wo = WorkOrder::where('installer_id',$request->id)->where('status','like','%Pending%')->get(); | |||||
foreach ($wo as $w){ | |||||
$wo = WorkOrder::where('installer_id', $request->id)->where('status', 'like', '%Pending%')->get(); | |||||
foreach ($wo as $w) { | |||||
$w->status = "Pending Contractor"; | $w->status = "Pending Contractor"; | ||||
$w->installer_id = ""; | $w->installer_id = ""; | ||||
$w->save(); | $w->save(); | ||||
} | } | ||||
if(!empty($st)){ | |||||
$st->delete(); | |||||
$staff->delete(); | |||||
} | |||||
return 'true'; | return 'true'; | ||||
}else { | }else { |
public function getDatabase(Request $request) | public function getDatabase(Request $request) | ||||
{ | { | ||||
$subscriber = Subscriber::where('name',$request->name)->first(); | |||||
// $form = Form::where('_id',$subscriber->_id)->withTrashed()->first(); | |||||
// $work_order = WorkOrder::where('_id',$subscriber->_id)->withTrashed()->first(); | |||||
$formHistory = FormStatus::where('form_id',$subscriber->_id)->get(); | |||||
return $formHistory; | |||||
$staff = Staff::with('staffdetail')->where('email', 'dealer@test.my')->first(); | |||||
$company = Company::where('name', 'TNBX Sdn Bhd')->first(); | |||||
$staff->company_id = $company->_id; | |||||
$staff->save(); | |||||
$staffD = StaffDetail::where('_id',$staff->_id)->first(); | |||||
$staffD->company_id = $company->_id; | |||||
$staffD->save(); | |||||
return $company . $staff . $staffD; | |||||
} | } | ||||
public function adjustInstaller(){ | |||||
$wo = WorkOrder::where('installer_id', '5f606ed1a1f29b50e429a422')->where('status', 'like', '%Pending%')->get(); | |||||
public function adjustInstaller(Request $request){ | |||||
$wo = WorkOrder::where('installer_id', $request->id)->where('status', 'like', '%Pending%')->get(); | |||||
foreach ($wo as $w) { | foreach ($wo as $w) { | ||||
$w->status = "Pending Contractor"; | $w->status = "Pending Contractor"; | ||||
$w->installer_id = ""; | $w->installer_id = ""; |
<table width="100%"> | <table width="100%"> | ||||
<tr> | <tr> | ||||
<td align="left" style="width: 50%;"><h3>{{ $com->name }}</h3></td> | <td align="left" style="width: 50%;"><h3>{{ $com->name }}</h3></td> | ||||
<td align="right" style="width: 50%;"><h3>Allo Sdn. Bhd</h3></td> | |||||
<td align="right" style="width: 50%;"><h3>Allo Technology Sdn. Bhd.</h3></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="left" style="width: 50%;"> | <td align="left" style="width: 50%;"> | ||||
<tr> | <tr> | ||||
<th width="33%">Submitted By</th> | <th width="33%">Submitted By</th> | ||||
<th width="33%">Verified By</th> | <th width="33%">Verified By</th> | ||||
<th width="33%">Approved By</th> | |||||
<th width="33%">Acknowledged By</th> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td height="50"></td> | <td height="50"></td> | ||||
<table width="100%"> | <table width="100%"> | ||||
<tr style="width: 100%;"> | <tr style="width: 100%;"> | ||||
<td align="left" style="width: 100%;"> | <td align="left" style="width: 100%;"> | ||||
© Allo Sdn Bhd - All rights reserved. | |||||
© Allo Technology Sdn. Bhd. - All rights reserved. | |||||
</td> | </td> | ||||
<!-- <td align="right" style="width: 50%;"> | <!-- <td align="right" style="width: 50%;"> | ||||
Company Slogan | Company Slogan | ||||
</table> | </table> | ||||
</div> | </div> | ||||
</body> | </body> | ||||
</html> | |||||
</html> |