| @@ -24,7 +24,7 @@ class ClaimedController extends BaseController | |||
| $id = Auth::guard('cs')->id(); | |||
| $user = Staff::with('StaffDetail')->find($id); | |||
| $dateS = Carbon::createFromFormat('Y-m-d', '2019-01-01'); | |||
| $dateS = Carbon::createFromFormat('Y-m-d', '2020-01-01'); | |||
| $start = $dateS->copy()->startOfDay(); | |||
| $dateE = Carbon::createFromFormat('Y-m-d', '2020-12-31'); | |||
| $end = $dateE->copy()->endOfDay(); | |||
| @@ -30,16 +30,22 @@ class DocketMobile extends BaseController | |||
| } | |||
| function createDocketID($limit){ | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| $numberOnly = str_replace('DO-','',Docket::select('id','docket_id')->orderBy('created_at','DESC')->first()->docket_id); | |||
| info('before3'.$numberOnly); | |||
| $numberOnly++; | |||
| info('after3'.$numberOnly); | |||
| return $numberOnly; | |||
| // $allowedNumbers = range(0, 9); | |||
| // shuffle($allowedNumbers); | |||
| // $digits = array_rand($allowedNumbers, $limit); | |||
| // $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| // foreach($digits as $d){ | |||
| // $number .= $allowedNumbers[$d]; | |||
| // } | |||
| // $unique_id = $number; | |||
| // return $unique_id; | |||
| } | |||
| public function createDocket(Request $request){ | |||
| @@ -92,9 +92,9 @@ class FormController extends BaseController | |||
| public function get_data_form(Request $request){ | |||
| $dateS = Carbon::createFromFormat('Y-m-d', '2019-01-01'); | |||
| $dateS = Carbon::createFromFormat('Y-m-d', '2020-01-01'); | |||
| $start = $dateS->copy()->startOfDay(); | |||
| $dateE = Carbon::createFromFormat('Y-m-d', '2020-08-31'); | |||
| $dateE = Carbon::createFromFormat('Y-m-d', '2020-12-31'); | |||
| $end = $dateE->copy()->endOfDay(); | |||
| $result = array(); | |||
| @@ -115,7 +115,9 @@ class FormController extends BaseController | |||
| if(!empty($f->dealer_id)){ | |||
| $c = Company::find($f->company_id); | |||
| if(!empty($c->name)){ | |||
| $labelD = $c->name; | |||
| } | |||
| }else{ | |||
| $labelD = ""; | |||
| } | |||
| @@ -124,9 +126,11 @@ class FormController extends BaseController | |||
| // if(!empty($f->Subscriber->DealerClaim)){ | |||
| // $amount_claim = $f->Subscriber->DealerClaim->total_claim; | |||
| // } | |||
| $subscriber_id=''; $ic=''; $company_reg=''; | |||
| if(!empty($f->Subscriber) && !empty($f->PackageDetail)){ | |||
| if($f->type_application == 'R'){ | |||
| $name = $f->Subscriber->name; | |||
| $ic = $f->Subscriber->ic; | |||
| $subscriber_id = $f->Subscriber->subscriber_id; | |||
| $contact_no = $f->Subscriber->phone1; | |||
| $building = $f->Subscriber->building_name; | |||
| @@ -137,6 +141,9 @@ class FormController extends BaseController | |||
| } | |||
| }else if($f->type_application == 'B'){ | |||
| $name = $f->Subscriber->company_name; | |||
| $ic = $f->Subscriber->ic; | |||
| $company_reg = $f->Subscriber->company_reg; | |||
| $subscriber_id = $f->Subscriber->subscriber_id; | |||
| $contact_no = $f->Subscriber->company_num; | |||
| $building = $f->Subscriber->street; | |||
| $address = $f->Subscriber->postcode. ' , '.$f->Subscriber->city. ' , '.$f->Subscriber->state; | |||
| @@ -162,22 +169,24 @@ class FormController extends BaseController | |||
| } | |||
| array_push($result,array( | |||
| 'type_application' => $f->type_application, | |||
| "type_service" => $f->type_service, | |||
| 'type_application' => $f->type_application, | |||
| "type_service" => $f->type_service, | |||
| "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( | |||
| // // 'Installer' => $installerId, | |||
| @@ -29,18 +29,23 @@ class WorkOrderController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| // function createWorkID($limit){ | |||
| // $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first(); | |||
| // $numberOnly = str_replace('WO-','',$number->wo); | |||
| // $numberOnly++; | |||
| // return $numberOnly; | |||
| // $allowedNumbers = range(0, 9); | |||
| // shuffle($allowedNumbers); | |||
| // $digits = array_rand($allowedNumbers, $limit); | |||
| // $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| } | |||
| // foreach($digits as $d){ | |||
| // $number .= $allowedNumbers[$d]; | |||
| // } | |||
| // $unique_id = $number; | |||
| // return $unique_id; | |||
| // } | |||
| public function viewContractorWork() | |||
| { | |||
| @@ -701,7 +706,11 @@ class WorkOrderController extends Controller | |||
| $data = array(); | |||
| $wod = WorkOrder::where('wo',$request->wo)->first(); | |||
| $form = Form::where('_id',$wod->_id)->first(); | |||
| $installer = Staff::with('StaffDetail')->where('_id',$wod->installer_id)->first(); | |||
| $installer = Staff::with('StaffDetail')->where('_id',$wod->installer_id)->first(); | |||
| $name = ''; | |||
| if (!empty($installer)){ | |||
| $name = $installer->StaffDetail->name; | |||
| } | |||
| if(!empty($wod)){ | |||
| @@ -710,13 +719,13 @@ class WorkOrderController extends Controller | |||
| $wod->status = $request->type_work; | |||
| $wod->installer_id = $request->installer; | |||
| $wod->save(); | |||
| $formH = new FormStatus; | |||
| $formH->form_id = $form->_id; | |||
| $formH->status_id = 6; | |||
| $formH->date = new \MongoDB\BSON\UTCDateTime(time()*1000); | |||
| $formH->status = 'Pending Installer'; | |||
| $formH->desc = 'This work order been assigned to particular installer ('.$installer->name.')'; | |||
| $formH->desc = 'This work order been assigned to particular installer ('.$name.')'; | |||
| $form->formstatus()->save($formH); | |||
| array_push($data, array( | |||
| @@ -762,4 +771,4 @@ class WorkOrderController extends Controller | |||
| return redirect('/contractor/work-order/list'); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -29,18 +29,23 @@ class CoverageController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| // function createWorkID($limit) { | |||
| // $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first(); | |||
| // $numberOnly = str_replace('WO-','',$number->wo); | |||
| // $numberOnly++; | |||
| // return $numberOnly; | |||
| // $allowedNumbers = range(0, 9); | |||
| // shuffle($allowedNumbers); | |||
| // $digits = array_rand($allowedNumbers, $limit); | |||
| // $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| } | |||
| // foreach($digits as $d){ | |||
| // $number .= $allowedNumbers[$d]; | |||
| // } | |||
| // $unique_id = $number; | |||
| // return $unique_id; | |||
| // } | |||
| public function viewCoverageR() | |||
| { | |||
| @@ -207,4 +212,4 @@ class CoverageController extends Controller | |||
| return 'false'; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -29,22 +29,13 @@ class CustomerController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| function createWorkID(){ | |||
| $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first(); | |||
| $numberOnly = str_replace('WO-','',$number->wo); | |||
| info('before WO'.$numberOnly); | |||
| $numberOnly++; | |||
| info('after WO'.$numberOnly); | |||
| return $numberOnly; | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| } | |||
| public function viewCustomer() | |||
| @@ -64,7 +55,34 @@ class CustomerController extends Controller | |||
| return view('customer-service.view_customer',compact('user','pp','sp','rs','ss','cm','coverage','company')); | |||
| } | |||
| public function getAllNewCustomer($type,$building,$dealer){ | |||
| public function getAllNewCustomer(Request $request, $type,$building,$dealer){ | |||
| ## Read value | |||
| $draw = $request->get('draw'); | |||
| $start = $request->get("start"); | |||
| $rowperpage = $request->get("length"); // Rows display per page | |||
| // $columnIndex_arr = $request->get('order'); | |||
| // $columnName_arr = $request->get('columns'); | |||
| // $order_arr = $request->get('order'); | |||
| $search_arr = $request->get('search'); | |||
| // $columnIndex = $columnIndex_arr[0]['column']; // Column index | |||
| // $columnName = $columnName_arr[$columnIndex]['data']; // Column name | |||
| // $columnSortOrder = $order_arr[0]['dir']; // asc or desc | |||
| $searchValue = $search_arr['value']; // Search value | |||
| // Total records | |||
| $totalRecords = Form::with('Subscriber','PackageDetail','WorkOrder')->select('count(*) as allcount')->count(); | |||
| if ($searchValue==!null){ | |||
| $totalRecordswithFilter = Form::whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->select('count(*) as allcount')->count(); | |||
| }else{ | |||
| $totalRecordswithFilter = Form::with('Subscriber','PackageDetail','WorkOrder')->select('count(*) as allcount')->count(); | |||
| } | |||
| $id = Auth::guard('cs')->id(); | |||
| $user = Staff::with('StaffDetail')->find($id); | |||
| @@ -74,7 +92,17 @@ class CustomerController extends Controller | |||
| $nested_data = array(); | |||
| if($type == 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->take(500)->get(); | |||
| if ($searchValue==!null){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| }else{ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| } | |||
| }else if($type != 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); | |||
| }else if($type != 'null' && $building != 'null' && $dealer == 'null'){ | |||
| @@ -109,7 +137,7 @@ class CustomerController extends Controller | |||
| } | |||
| if(!empty($form)){ | |||
| foreach ($form as $key => $f) { | |||
| if(empty($f->WorkOrder)){ | |||
| if(empty($f->WorkOrder->nature_work)){ | |||
| $i++; | |||
| $n1 = ''; | |||
| @@ -138,9 +166,14 @@ class CustomerController extends Controller | |||
| if($f->status_email == 'verified'){ | |||
| $work_order = ''; | |||
| if($f->type_application == 'R'){ | |||
| do { | |||
| $work_order = 'WO-'.$this->createWorkID(4); | |||
| } while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder); | |||
| if(!empty($f->WorkOrder->wo)){ | |||
| $work_order = $f->WorkOrder->wo; | |||
| }else{ | |||
| do { | |||
| $work_order = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder); | |||
| } | |||
| $wo = $work_order.'/'.$f->Subscriber->subscriber_id; | |||
| $cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','R')->first(); | |||
| @@ -151,9 +184,14 @@ class CustomerController extends Controller | |||
| } | |||
| }else if($f->type_application == 'B'){ | |||
| do { | |||
| $work_order = 'WO-'.$this->createWorkID(4); | |||
| } while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder); | |||
| if(!empty($f->WorkOrder->wo)){ | |||
| $work_order = $f->WorkOrder->wo; | |||
| }else{ | |||
| do { | |||
| $work_order = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder); | |||
| } | |||
| $wo = $work_order.'/'.$f->Subscriber->subscriber_id; | |||
| $cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','B')->first(); | |||
| if(!empty($cov)){ | |||
| @@ -216,7 +254,14 @@ class CustomerController extends Controller | |||
| } | |||
| } | |||
| return \DataTables::of($nested_data)->make(true); | |||
| $response = array( | |||
| "draw" => intval($draw), | |||
| "recordsTotal" => $totalRecords, | |||
| "recordsFiltered" => $totalRecordswithFilter, | |||
| "data" => $nested_data | |||
| ); | |||
| return json_encode($response); | |||
| } | |||
| public function getAllNewCustomerss($type,$building,$dealer){ | |||
| @@ -618,7 +663,39 @@ class CustomerController extends Controller | |||
| return view('customer-service.view_subscriber', compact('user','pp','sp','rs','ss','cm','rec','re','bu','coverage','company')); | |||
| } | |||
| public function getAllRectification($type,$building,$dealer){ | |||
| public function getAllRectification(Request $request,$type,$building,$dealer){ | |||
| ## Read value | |||
| $draw = $request->get('draw'); | |||
| $start = $request->get("start"); | |||
| $rowperpage = $request->get("length"); // Rows display per page | |||
| // $columnIndex_arr = $request->get('order'); | |||
| // $columnName_arr = $request->get('columns'); | |||
| // $order_arr = $request->get('order'); | |||
| $search_arr = $request->get('search'); | |||
| // $columnIndex = $columnIndex_arr[0]['column']; // Column index | |||
| // $columnName = $columnName_arr[$columnIndex]['data']; // Column name | |||
| // $columnSortOrder = $order_arr[0]['dir']; // asc or desc | |||
| $searchValue = $search_arr['value']; // Search value | |||
| // Total records | |||
| $totalRecords = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('workorder',function($q){ | |||
| $q->where('nature_work','Rectification'); | |||
| })->select('count(*) as allcount')->count(); | |||
| if ($searchValue==!null){ | |||
| $totalRecordswithFilter = Form::whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->whereHas('workorder',function($q){ | |||
| $q->where('nature_work','Rectification'); | |||
| })->select('count(*) as allcount')->count(); | |||
| }else{ | |||
| $totalRecordswithFilter = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('workorder',function($q){ | |||
| $q->where('nature_work','Rectification'); | |||
| })->select('count(*) as allcount')->count(); | |||
| } | |||
| $id = Auth::guard('cs')->id(); | |||
| $user = Staff::with('StaffDetail')->find($id); | |||
| @@ -628,7 +705,19 @@ class CustomerController extends Controller | |||
| $nested_data = array(); | |||
| if($type == 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->get(); | |||
| if ($searchValue==!null){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->whereHas('workorder',function($q){ | |||
| $q->where('nature_work','Rectification'); | |||
| })->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| }else{ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('workorder',function($q){ | |||
| $q->where('nature_work','Rectification'); | |||
| })->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| } | |||
| }else if($type != 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); | |||
| }else if($type != 'null' && $building != 'null' && $dealer == 'null'){ | |||
| @@ -730,10 +819,44 @@ class CustomerController extends Controller | |||
| } | |||
| } | |||
| return \DataTables::of($nested_data)->make(true); | |||
| $response = array( | |||
| "draw" => intval($draw), | |||
| "recordsTotal" => $totalRecords, | |||
| "recordsFiltered" => $totalRecordswithFilter, | |||
| "data" => $nested_data | |||
| ); | |||
| return json_encode($response); | |||
| } | |||
| public function getAllResidential($type,$building,$dealer){ | |||
| public function getAllResidential(Request $request,$type,$building,$dealer){ | |||
| ## Read value | |||
| $draw = $request->get('draw'); | |||
| $start = $request->get("start"); | |||
| $rowperpage = $request->get("length"); // Rows display per page | |||
| // $columnIndex_arr = $request->get('order'); | |||
| // $columnName_arr = $request->get('columns'); | |||
| // $order_arr = $request->get('order'); | |||
| $search_arr = $request->get('search'); | |||
| // $columnIndex = $columnIndex_arr[0]['column']; // Column index | |||
| // $columnName = $columnName_arr[$columnIndex]['data']; // Column name | |||
| // $columnSortOrder = $order_arr[0]['dir']; // asc or desc | |||
| $searchValue = $search_arr['value']; // Search value | |||
| // Total records | |||
| $totalRecords = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_application','R')->select('count(*) as allcount')->count(); | |||
| if ($searchValue==!null){ | |||
| $totalRecordswithFilter = Form::whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->where('type_application','R')->select('count(*) as allcount')->count(); | |||
| }else{ | |||
| $totalRecordswithFilter = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_application','R')->select('count(*) as allcount')->count(); | |||
| } | |||
| $id = Auth::guard('cs')->id(); | |||
| $user = Staff::with('StaffDetail')->find($id); | |||
| @@ -743,7 +866,15 @@ class CustomerController extends Controller | |||
| $nested_data = array(); | |||
| if($type == 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->get(); | |||
| if ($searchValue==!null){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->where('type_application','R')->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| }else{ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_application','R')->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| } | |||
| }else if($type != 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); | |||
| }else if($type != 'null' && $building != 'null' && $dealer == 'null'){ | |||
| @@ -847,10 +978,44 @@ class CustomerController extends Controller | |||
| } | |||
| } | |||
| return \DataTables::of($nested_data)->make(true); | |||
| $response = array( | |||
| "draw" => intval($draw), | |||
| "recordsTotal" => $totalRecords, | |||
| "recordsFiltered" => $totalRecordswithFilter, | |||
| "data" => $nested_data | |||
| ); | |||
| return json_encode($response); | |||
| } | |||
| public function getAllBusiness($type,$building,$dealer){ | |||
| public function getAllBusiness(Request $request, $type,$building,$dealer){ | |||
| ## Read value | |||
| $draw = $request->get('draw'); | |||
| $start = $request->get("start"); | |||
| $rowperpage = $request->get("length"); // Rows display per page | |||
| // $columnIndex_arr = $request->get('order'); | |||
| // $columnName_arr = $request->get('columns'); | |||
| // $order_arr = $request->get('order'); | |||
| $search_arr = $request->get('search'); | |||
| // $columnIndex = $columnIndex_arr[0]['column']; // Column index | |||
| // $columnName = $columnName_arr[$columnIndex]['data']; // Column name | |||
| // $columnSortOrder = $order_arr[0]['dir']; // asc or desc | |||
| $searchValue = $search_arr['value']; // Search value | |||
| // Total records | |||
| $totalRecords = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_application','B')->select('count(*) as allcount')->count(); | |||
| if ($searchValue==!null){ | |||
| $totalRecordswithFilter = Form::whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->where('type_application','B')->select('count(*) as allcount')->count(); | |||
| }else{ | |||
| $totalRecordswithFilter = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_application','B')->select('count(*) as allcount')->count(); | |||
| } | |||
| $id = Auth::guard('cs')->id(); | |||
| $user = Staff::with('StaffDetail')->find($id); | |||
| @@ -860,7 +1025,15 @@ class CustomerController extends Controller | |||
| $nested_data = array(); | |||
| if($type == 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->get(); | |||
| if ($searchValue==!null){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->whereHas('subscriber',function($q) use($searchValue){ | |||
| $q->where('name', 'like', '%' .$searchValue . '%')->orWhere('company_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('unit_no', 'like', '%' .$searchValue . '%')->orWhere('building_name', 'like', '%' .$searchValue . '%') | |||
| ->orWhere('street', 'like', '%' .$searchValue . '%')->orWhere('city', 'like', '%' .$searchValue . '%'); | |||
| })->where('type_application','B')->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| }else{ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_application','B')->orderBy('created_at', 'desc')->skip(intval($start))->take(intval($rowperpage))->get(); | |||
| } | |||
| }else if($type != 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); | |||
| }else if($type != 'null' && $building != 'null' && $dealer == 'null'){ | |||
| @@ -961,7 +1134,14 @@ class CustomerController extends Controller | |||
| } | |||
| } | |||
| return \DataTables::of($nested_data)->make(true); | |||
| $response = array( | |||
| "draw" => intval($draw), | |||
| "recordsTotal" => $totalRecords, | |||
| "recordsFiltered" => $totalRecordswithFilter, | |||
| "data" => $nested_data | |||
| ); | |||
| return json_encode($response); | |||
| } | |||
| @@ -29,18 +29,18 @@ class DocketController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| // function createWorkID($limit){ | |||
| // $allowedNumbers = range(0, 9); | |||
| // shuffle($allowedNumbers); | |||
| // $digits = array_rand($allowedNumbers, $limit); | |||
| // $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| } | |||
| // foreach($digits as $d){ | |||
| // $number .= $allowedNumbers[$d]; | |||
| // } | |||
| // $unique_id = $number; | |||
| // return $unique_id; | |||
| // } | |||
| public function viewDocket() | |||
| { | |||
| @@ -29,18 +29,18 @@ class TeamController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| // function createWorkID($limit){ | |||
| // $allowedNumbers = range(0, 9); | |||
| // shuffle($allowedNumbers); | |||
| // $digits = array_rand($allowedNumbers, $limit); | |||
| // $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| } | |||
| // foreach($digits as $d){ | |||
| // $number .= $allowedNumbers[$d]; | |||
| // } | |||
| // $unique_id = $number; | |||
| // return $unique_id; | |||
| // } | |||
| public function encryptPassword($action, $string) { | |||
| $output = false; | |||
| @@ -32,17 +32,13 @@ class WorkOrderController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| $allowedNumbers = range(0, 9); | |||
| shuffle($allowedNumbers); | |||
| $digits = array_rand($allowedNumbers, $limit); | |||
| $number = ''; | |||
| foreach($digits as $d){ | |||
| $number .= $allowedNumbers[$d]; | |||
| } | |||
| $unique_id = $number; | |||
| return $unique_id; | |||
| function createWorkID(){ | |||
| $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first(); | |||
| $numberOnly = str_replace('WO-','',$number->wo); | |||
| info('before WO'.$numberOnly); | |||
| $numberOnly++; | |||
| info('after WO'.$numberOnly); | |||
| return $numberOnly; | |||
| } | |||
| public function viewWorkOrder() | |||
| @@ -96,6 +92,43 @@ class WorkOrderController extends Controller | |||
| $company = Company::where('team','CBB')->get(); | |||
| $today = Carbon::today(); | |||
| $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first(); | |||
| if(!empty($subscriber)){ | |||
| $form = Form::with('WorkOrder')->where('_id',$subscriber->_id)->first(); | |||
| if(empty($form->WorkOrder->wo)){ | |||
| do { | |||
| $woID = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $woID)->first() instanceof WorkOrder); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $woID; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = ''; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| if($status=="non-prelaid"){ | |||
| $work_order->status = 'Pending Non Prelaid'; | |||
| }else { | |||
| $work_order->status = 'Pending Contractor'; | |||
| } | |||
| $work_order->created_by = ''; | |||
| $form->workorder()->save($work_order); | |||
| } | |||
| } | |||
| return view('customer-service.view_add_new_schedule', compact('user','pp','sp','rs','ss','cm','company','wo','today','subscriber_id','status')); | |||
| } | |||
| @@ -241,6 +274,20 @@ class WorkOrderController extends Controller | |||
| $product = 'R Mbps'; | |||
| }else { | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| @@ -253,10 +300,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -339,6 +386,20 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$w->Form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -349,10 +410,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -435,6 +496,20 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$w->Form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -445,10 +520,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -534,6 +609,20 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$w->Form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -544,10 +633,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -630,6 +719,20 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$w->Form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -640,10 +743,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -726,6 +829,20 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$w->Form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -736,10 +853,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -822,6 +939,20 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| if(empty($w->dateTimeStart)){ | |||
| $date = ''; | |||
| $time = ''; | |||
| } else { | |||
| $date = date("d/m/Y", strtotime($w->dateTimeStart)); | |||
| $time = date("h:i A", strtotime($w->dateTimeStart)); | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$w->Form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -832,10 +963,10 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->dateTimeStart)), | |||
| 'time' => date("h:i A", strtotime($w->dateTimeStart)), | |||
| 'date' => $date, | |||
| 'time' => $time, | |||
| 'status' => $w->status, | |||
| 'action' => $w->wo, | |||
| )); | |||
| @@ -919,6 +1050,12 @@ class WorkOrderController extends Controller | |||
| $product = $product->package_name; | |||
| } | |||
| if(empty($company)){ | |||
| $company = ' '; | |||
| }else { | |||
| $company = $company->name; | |||
| } | |||
| array_push($nested_data, array( | |||
| 'formT' => $n1.$i.$form->type_application, | |||
| 'service' => $w->nature_work, | |||
| @@ -929,7 +1066,7 @@ class WorkOrderController extends Controller | |||
| 'building' => $building, | |||
| 'city' => $form->Subscriber->city, | |||
| 'package' => $product, | |||
| 'contractor' => $company->name, | |||
| 'contractor' => $company, | |||
| 'installer' => $installer, | |||
| 'date' => date("d/m/Y", strtotime($w->end_job)), | |||
| 'time' => date("h:i A", strtotime($w->end_job)), | |||
| @@ -1166,43 +1303,36 @@ class WorkOrderController extends Controller | |||
| { | |||
| $data = array(); | |||
| $wod = WorkOrder::where('wo',$request->wo)->first(); | |||
| if(!empty($wod)){ | |||
| if(($wod->status == 'Pending Contractor')){ | |||
| array_push($data, array( | |||
| 'result' => 'yes', | |||
| )); | |||
| }else{ | |||
| $subscriber = Subscriber::where('subscriber_id',$request->subscriber_id)->first(); | |||
| if(!empty($subscriber)){ | |||
| $form = Form::where('_id',$subscriber->_id)->first(); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $request->wo; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = $request->vendor; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| $work_order->status = 'Pending Non Prelaid'; | |||
| $form->workorder()->save($work_order); | |||
| $wod->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $wod->wo = $request->wo; | |||
| $wod->nature_work = ''; | |||
| $wod->sub_category = ''; | |||
| $wod->dateTimeStart = ''; | |||
| $wod->dateTimeEnd = ''; | |||
| $wod->contractor_id = $request->vendor; | |||
| $wod->installer_id = ''; | |||
| $wod->onu = ''; | |||
| $wod->router = ''; | |||
| $wod->need_phone = ''; | |||
| $wod->no_phone = ''; | |||
| $wod->pppoe_username = ''; | |||
| $wod->pppoe_password = ''; | |||
| $wod->docket_id = ''; | |||
| $wod->remarks_custservice = ''; | |||
| $wod->remarks_installer = ''; | |||
| $wod->status = 'Pending Non Prelaid'; | |||
| $wod->save(); | |||
| array_push($data, array( | |||
| 'result' => 'yes', | |||
| )); | |||
| } | |||
| } | |||
| return response()->json($data); | |||
| @@ -1300,12 +1430,34 @@ class WorkOrderController extends Controller | |||
| $formH->desc = 'Rectification form been submitted'; | |||
| $form->formstatus()->save($formH); | |||
| $wo = ''; | |||
| do { | |||
| $wo = 'WO-'.$this->createWorkID(4); | |||
| } while (WorkOrder::where("wo", "=", $wo)->first() instanceof WorkOrder); | |||
| return redirect()->to('/customer-service/work-order/add/schedule/rectification/'.$wo.'/'. $su_id); | |||
| $woID = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $woID)->first() instanceof WorkOrder); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $woID; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = ''; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| $work_order->status = 'Pending Contractor'; | |||
| $work_order->created_by = ''; | |||
| $form->workorder()->save($work_order); | |||
| return redirect()->to('/customer-service/work-order/add/schedule/rectification/'.$woID.'/'. $su_id); | |||
| }else if($request->formT == 'B'){ | |||
| @@ -1357,12 +1509,34 @@ class WorkOrderController extends Controller | |||
| $formH->desc = 'Rectification form been submitted'; | |||
| $form->formstatus()->save($formH); | |||
| $wo = ''; | |||
| do { | |||
| $wo = 'WO-'.$this->createWorkID(4); | |||
| } while (WorkOrder::where("wo", "=", $wo)->first() instanceof WorkOrder); | |||
| return redirect()->to('/customer-service/work-order/add/schedule/rectification/'.$wo.'/'. $su_id); | |||
| $woID = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $woID)->first() instanceof WorkOrder); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $woID; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = ''; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| $work_order->status = 'Pending Contractor'; | |||
| $work_order->created_by = ''; | |||
| $form->workorder()->save($work_order); | |||
| return redirect()->to('/customer-service/work-order/add/schedule/rectification/'.$woID.'/'. $su_id); | |||
| } | |||
| } | |||
| @@ -1438,12 +1612,34 @@ class WorkOrderController extends Controller | |||
| $formH->desc = 'Secured development form been submitted'; | |||
| $form->formstatus()->save($formH); | |||
| $wo = ''; | |||
| do { | |||
| $wo = 'WO-'.$this->createWorkID(4); | |||
| } while (WorkOrder::where("wo", "=", $wo)->first() instanceof WorkOrder); | |||
| return redirect()->to('/customer-service/work-order/add/schedule/secured/'.$wo.'/'. $su_id); | |||
| $woID = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $woID)->first() instanceof WorkOrder); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $woID; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = ''; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| $work_order->status = 'Pending Contractor'; | |||
| $work_order->created_by = ''; | |||
| $form->workorder()->save($work_order); | |||
| return redirect()->to('/customer-service/work-order/add/schedule/secured/'.$woID.'/'. $su_id); | |||
| } | |||
| } | |||
| } | |||
| @@ -1060,6 +1060,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1097,6 +1098,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1136,6 +1138,7 @@ class DealerController extends Controller | |||
| 'index' => $c['formT'], | |||
| 'contract' => $c['contract'], | |||
| 'wo' => $c['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $c['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1531,6 +1534,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1575,6 +1579,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1620,6 +1625,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1664,6 +1670,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1709,6 +1716,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1754,6 +1762,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1799,6 +1808,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1843,6 +1853,7 @@ class DealerController extends Controller | |||
| 'index' => $d['formT'], | |||
| 'contract' => $d['contract'], | |||
| 'wo' => $d['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $d['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -1883,6 +1894,7 @@ class DealerController extends Controller | |||
| 'index' => $c['formT'], | |||
| 'contract' => $c['contract'], | |||
| 'wo' => $c['wo'], | |||
| 'submission' => $d['submission_dt'], | |||
| 'activation' => $c['activated_dt'], | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| @@ -2259,7 +2271,7 @@ class DealerController extends Controller | |||
| 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(); | |||
| $extra = 0; $basic_total = 0; $totals = 0; | |||
| $extra = 0; $basic_total = 0; $countAugustR = array(); $countAugustB = array();$countSeptemberR = array(); $countSeptemberB = array(); $finalprice = 0; | |||
| // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){ | |||
| // $dataDis = $this->returnDataR($company,'2019','12'); | |||
| @@ -2763,47 +2775,431 @@ class DealerController extends Controller | |||
| } | |||
| } | |||
| } | |||
| }else if($year == '2020' && ($month == '08' || $month == '09' || $month == '10')){ | |||
| $dataAugustR = $this->returnDataR($company,'2020','8'); | |||
| $dataAugustB = $this->returnDataB($company,'2020','8'); | |||
| $dataSeptemberR = $this->returnDataR($company,'2020','9'); | |||
| $dataSeptemberB = $this->returnDataB($company,'2020','9'); | |||
| $dataOctober = $this->returnDataR($company,'2020','10'); | |||
| 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($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; | |||
| } | |||
| } | |||
| // $dataR = $this->returnDataR($company,$year,$month); | |||
| // foreach($dataR as $r){ | |||
| // $combineData[] = $r; | |||
| // } | |||
| if(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){ | |||
| $countAugustR[] = $d; | |||
| } | |||
| }else { | |||
| if(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){ | |||
| $countAugustR[] = $d; | |||
| }else { | |||
| $combineData[] = $d; | |||
| } | |||
| } | |||
| } | |||
| // Store to combineData New Incentive August | |||
| foreach ($countAugustR as $key => $d) { | |||
| if(count($dataAugustR) >= 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($dataAugustR) < 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 ($dataAugustB as $key => $d) { | |||
| if((date('m/Y', strtotime($d['submission'])) == $month.'/'.$year) && date('d/m/Y', strtotime($d['submission'])) >= '11/8/2020'){ | |||
| 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(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){ | |||
| $countAugustB[] = $d; | |||
| } | |||
| }else { | |||
| if(date('d/m/Y', strtotime($d['activation'])) >= '11/8/2020'){ | |||
| $countAugustB[] = $d; | |||
| }else { | |||
| $combineData[] = $d; | |||
| } | |||
| } | |||
| } | |||
| // Store to combineData New Incentive August | |||
| foreach ($countAugustB as $key => $d) { | |||
| if(count($dataAugustB) >= 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($dataAugustB) < 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'], | |||
| )); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| $dataB = $this->returnDataB($company,$year,$month); | |||
| foreach ($dataSeptemberR 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($dataSeptemberR) >= 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'], | |||
| )); | |||
| foreach($dataB as $b){ | |||
| $combineData[] = $b; | |||
| }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($dataSeptemberR) < 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 ($dataSeptemberB 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($dataSeptemberB) >= 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($dataSeptemberB) < 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{ | |||
| $dataR = $this->returnDataR($company,$year,$month); | |||
| foreach($dataR as $r){ | |||
| $combineData[] = $r; | |||
| } | |||
| $dataB = $this->returnDataB($company,$year,$month); | |||
| foreach($dataB as $b){ | |||
| $combineData[] = $b; | |||
| } | |||
| } | |||
| $i = 0; | |||
| $nested_data = array(); | |||
| if(!empty($combineData)){ | |||
| foreach ($combineData as $c){ | |||
| $update_dealer = DealerClaim::where('wo',$c['wo'])->first(); | |||
| if(!empty($update_dealer)){ | |||
| $update_dealer->incentives1 = $c['incentives1']; | |||
| $update_dealer->incentives2 = $c['incentives2']; | |||
| $update_dealer->retail_price = $c['retail_price']; | |||
| $update_dealer->total_claim = $c['total']; | |||
| $update_dealer->save(); | |||
| } | |||
| // $i++; | |||
| // array_push($final, array( | |||
| // 'index' => $c['index'], | |||
| // 'contract' => $c['contract'], | |||
| // 'wo' => $c['wo'], | |||
| // 'activated_dt' => $c['activation'], | |||
| // 'name' => $c['name'], | |||
| // 'address' => $c['address'], | |||
| // 'package' => $c['package'], | |||
| // 'retail_price' => $c['retail_price'], | |||
| // 'incentives1' => $c['incentives1'], | |||
| // 'incentives2' => $c['incentives2'], | |||
| // 'total' => $c['total'], | |||
| // 'claimed' => $c['claim'], | |||
| // )); | |||
| } | |||
| } | |||
| @@ -2845,7 +3241,7 @@ class DealerController extends Controller | |||
| 'name' => $name, | |||
| 'address' => $address, | |||
| 'package' => $c->package, | |||
| 'retail_price' => 'RM '.$c->retail_price, | |||
| 'retail_price' => $c->retail_price, | |||
| 'incentives1' => $c->incentives1, | |||
| 'incentives2' => $c->incentives2, | |||
| 'total' => $c->total_claim, | |||
| @@ -3123,7 +3519,9 @@ class DealerController extends Controller | |||
| foreach ($dealer as $key => $d) { | |||
| $claim = str_replace("RM ","",$d->total_claim); | |||
| $price = str_replace("RM ","",$d->retail_price); | |||
| $d->total_claim = floatval($claim); | |||
| $d->retail_price = floatval($price); | |||
| $d->save(); | |||
| } | |||
| } | |||
| @@ -204,6 +204,7 @@ class BusinessController extends Controller | |||
| $destinationPath = 'document/'.$su_id; | |||
| // create folder/dir if not exist | |||
| if(!File::exists(public_path().'/'.$destinationPath)){ | |||
| File::makeDirectory(public_path().'/'.$destinationPath,0777,true); | |||
| } | |||
| @@ -599,4 +600,4 @@ class BusinessController extends Controller | |||
| } | |||
| return view('email.invoiceb', compact ('form', 'product')); | |||
| } | |||
| } | |||
| } | |||
| @@ -16,12 +16,22 @@ use App\Model\Coverage; | |||
| use App\Model\Product; | |||
| use App\Model\Form; | |||
| use App\Model\WorkOrder; | |||
| use App\Model\Subscriber; | |||
| use App\Model\PackageDetail; | |||
| use App\Model\FormStatus; | |||
| class FormController extends Controller | |||
| { | |||
| function createWorkID(){ | |||
| $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first(); | |||
| $numberOnly = str_replace('WO-','',$number->wo); | |||
| info('before WO'.$numberOnly); | |||
| $numberOnly++; | |||
| info('after WO'.$numberOnly); | |||
| return $numberOnly; | |||
| } | |||
| public function updateStatus($f_id){ | |||
| $fm = Form::where('_id',$f_id)->first(); | |||
| if(!empty($fm)){ | |||
| @@ -36,6 +46,33 @@ class FormController extends Controller | |||
| $formH->desc = 'Email already been verified by Customer Service'; | |||
| $fm->formstatus()->save($formH); | |||
| do { | |||
| $woID = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $woID)->first() instanceof WorkOrder); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $woID; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = ''; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| $work_order->status = 'Pending Contractor'; | |||
| $work_order->created_by = ''; | |||
| $fm->workorder()->save($work_order); | |||
| return redirect('/customer-service/new/customer/list'); | |||
| } | |||
| } | |||
| @@ -16,6 +16,7 @@ use App\Model\Coverage; | |||
| use App\Model\Product; | |||
| use App\Model\Form; | |||
| use App\Model\WorkOrder; | |||
| use App\Model\Subscriber; | |||
| use App\Model\PackageDetail; | |||
| use App\Model\FormStatus; | |||
| @@ -207,6 +208,7 @@ class ResidentialController extends Controller | |||
| $destinationPath = 'document/'.$su_id; | |||
| // create folder/dir if not exist | |||
| if(!File::exists(public_path().'/'.$destinationPath)){ | |||
| File::makeDirectory(public_path().'/'.$destinationPath,0777,true); | |||
| } | |||
| @@ -321,7 +323,11 @@ class ResidentialController extends Controller | |||
| public function viewFormAddressD($package,$dealer_id) { | |||
| $coverage = Coverage::where('Type','R')->orderBy('building_name')->get(); | |||
| return view('sales.form.dealer.residential_address', compact('coverage','package','dealer_id')); | |||
| $exclusiveBuilding = Coverage::where('Type','Ex')->first(); | |||
| $dealer = Staff::where('_id',$dealer_id)->first(); | |||
| $company = $dealer->company_id; | |||
| return view('sales.form.dealer.residential_address', compact('coverage','package','dealer_id','exclusiveBuilding', 'company')); | |||
| } | |||
| public function viewFormApplicationD(Request $request) { | |||
| @@ -601,6 +607,14 @@ class ResidentialController extends Controller | |||
| } | |||
| } | |||
| } | |||
| function createWorkID(){ | |||
| $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first(); | |||
| $numberOnly = str_replace('WO-','',$number->wo); | |||
| info('before WO'.$numberOnly); | |||
| $numberOnly++; | |||
| info('after WO'.$numberOnly); | |||
| return $numberOnly; | |||
| } | |||
| public function verifyEmail($subscriber_id){ | |||
| $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first(); | |||
| @@ -619,6 +633,33 @@ class ResidentialController extends Controller | |||
| $stat->desc = 'Email already been verified by customer'; | |||
| $form->formstatus()->save($stat); | |||
| do { | |||
| $woID = 'WO-'.$this->createWorkID(); | |||
| } while (WorkOrder::where("wo", "=", $woID)->first() instanceof WorkOrder); | |||
| $work_order = new WorkOrder; | |||
| $work_order->img_url = '/assets/img/activation_icon_nRead1.png'; | |||
| $work_order->wo = $woID; | |||
| $work_order->nature_work = ''; | |||
| $work_order->sub_category = ''; | |||
| $work_order->dateTimeStart = ''; | |||
| $work_order->dateTimeEnd = ''; | |||
| $work_order->contractor_id = ''; | |||
| $work_order->installer_id = ''; | |||
| $work_order->onu = ''; | |||
| $work_order->router = ''; | |||
| $work_order->need_phone = ''; | |||
| $work_order->no_phone = ''; | |||
| $work_order->pppoe_username = ''; | |||
| $work_order->pppoe_password = ''; | |||
| $work_order->docket_id = ''; | |||
| $work_order->remarks_custservice = ''; | |||
| $work_order->remarks_installer = ''; | |||
| $work_order->status = ''; | |||
| $work_order->created_by = ''; | |||
| $form->workorder()->save($work_order); | |||
| return redirect('http://db.citybroadband.my/residential/application-form/success-verified'); | |||
| } | |||
| } | |||
| @@ -50,8 +50,12 @@ class StoreDocket implements ShouldQueue | |||
| public function handle(Docket $docket) | |||
| { | |||
| $note = ''; | |||
| if(isset($this->request['Note'])){ | |||
| $mac_router =''; | |||
| $type_testing =''; | |||
| if(isset($this->request['Note']) || ($this->request['mac_router']) || ($this->request['type_testing'])){ | |||
| $note = $this->request['Note']; | |||
| $mac_router = $this->request['mac_router']; | |||
| $type_testing = $this->request['type_testing']; | |||
| } | |||
| $docket->work_order_id = $this->request['wo']; | |||
| @@ -60,15 +64,15 @@ class StoreDocket implements ShouldQueue | |||
| $docket->installer_id = $this->staff; | |||
| $docket->end_job = Carbon::now()->toDateTimeString(); | |||
| $docket->router_serial_number = $this->request['router_serial_number']; | |||
| $docket->mac_router = $this->request['mac_router']; | |||
| $docket->mac_router = $mac_router; | |||
| $docket->cable_read = $this->request['cable_read']; | |||
| $docket->condition = $this->request['condition']; | |||
| $docket->type_testing = $type_testing; | |||
| $docket->Note = $note; | |||
| $docket->Rating1 = $this->request['Rating1']; | |||
| $docket->Rating2 = $this->request['Rating2']; | |||
| $docket->Rating3 = $this->request['Rating3']; | |||
| $docket->moden_sn = $this->request['modem_sn']; | |||
| $docket->type_testing = $this->request['type_testing']; | |||
| $docket->modem_sn = $this->request['modem_sn']; | |||
| $docket->customer_signature = $this->signature; | |||
| $work_order = WorkOrder::where('wo',$this->request['wo'])->first(); | |||
| @@ -22,7 +22,7 @@ | |||
| <thead> | |||
| <tr> | |||
| <th>#</th> | |||
| <th>Type App.</th> | |||
| <th>Type Application</th> | |||
| <th>Customer Name</th> | |||
| <th>Contact No.</th> | |||
| <th>Unit No.</th> | |||
| @@ -41,7 +41,7 @@ | |||
| <thead> | |||
| <tr> | |||
| <th>#</th> | |||
| <th>Type App.</th> | |||
| <th>Type Application</th> | |||
| <th>Customer Name</th> | |||
| <th>Contact No.</th> | |||
| <th>Unit No.</th> | |||
| @@ -75,7 +75,6 @@ | |||
| }; | |||
| $(document).ready(function(){ | |||
| var origin = window.location.origin; | |||
| //===== Dynamic table toolbars =====// | |||
| @@ -185,7 +184,7 @@ | |||
| ], | |||
| }); | |||
| var table = $('#view_customer').DataTable({ | |||
| var table3 = $('#view_customer').DataTable({ | |||
| "bJQueryUI": false, | |||
| "bAutoWidth": true, | |||
| "bSort": false, | |||
| @@ -277,12 +276,12 @@ | |||
| }); | |||
| $('.tipS').tipsy({gravity: 's',fade: true, html:true}); | |||
| /*** Filter ***/ | |||
| $('#fbtype,#fbbuilding,#fbdealer').on('change', function() { | |||
| var link = "{{ url('/customer-service/get-all-new-customer') }}" +"/"+$('#fbtype').val()+"/"+$('#fbbuilding').val()+"/"+$('#fbdealer').val(); | |||
| table.ajax.url( link ).load(); | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||
| @endsection | |||
| @@ -60,9 +60,9 @@ | |||
| <thead> | |||
| <tr> | |||
| <th>#</th> | |||
| <th>Submittion</th> | |||
| <th>Type App.</th> | |||
| <th>Cust.Name</th> | |||
| <th>Submission</th> | |||
| <th>Type Application</th> | |||
| <th>Customer Name</th> | |||
| <th>Contact No.</th> | |||
| <th>Unit No.</th> | |||
| <th>Building</th> | |||
| @@ -81,9 +81,9 @@ | |||
| <thead> | |||
| <tr> | |||
| <th>#</th> | |||
| <th>Submittion</th> | |||
| <th>Type App.</th> | |||
| <th>Cust.Name</th> | |||
| <th>Submission</th> | |||
| <th>Type Application</th> | |||
| <th>Customer Name</th> | |||
| <th>Contact No.</th> | |||
| <th>Unit No.</th> | |||
| <th>Building</th> | |||
| @@ -102,9 +102,9 @@ | |||
| <thead> | |||
| <tr> | |||
| <th>#</th> | |||
| <th>Submittion</th> | |||
| <th>Type App.</th> | |||
| <th>Cust.Name</th> | |||
| <th>Submission</th> | |||
| <th>Type Application</th> | |||
| <th>Customer Name</th> | |||
| <th>Contact No.</th> | |||
| <th>Unit No.</th> | |||
| <th>Building</th> | |||
| @@ -515,81 +515,11 @@ | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @if($form->back_ic != "" && $form->front_ic != "") | |||
| @if(($ext1 == "jpeg" && $ext2 == "jpeg") || ($ext1 == "jpg" && $ext2 == "jpg") || ($ext1 == "JPG" && $ext2 == "JPG")) | |||
| @if($ext3 == "pdf" && $ext4 == "pdf") | |||
| @if(($ext5 == "jpeg" && $ext6 == "jpeg") || ($ext5 == "jpg" && $ext6 == "jpg") || ($ext5 == "JPG" && $ext6 == "JPG")) | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| <tr><td height="10"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaF) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaB) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @elseif($ext5 == "pdf" && $ext6 == "pdf") | |||
| @else | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <div class="page-break"></div> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| @if($form->back_ic != "" && $form->front_ic != "") | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| @@ -597,6 +527,7 @@ | |||
| </td> | |||
| </tr> | |||
| <tr><td height="10"></td></tr> | |||
| @if ($ext1 != "pdf") | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Front) | |||
| @@ -608,7 +539,9 @@ | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| @endif | |||
| <tr><td height="5"></td></tr> | |||
| @if ($ext2 != "pdf") | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Back) | |||
| @@ -620,456 +553,68 @@ | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| @endif | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @endif | |||
| @elseif(($ext3 == "jpeg" && $ext4 == "jpeg") || ($ext3 == "jpg" && $ext4 == "jpg") || ($ext3 == "JPG" && $ext4 == "JPG")) | |||
| @if(($ext5 == "jpeg" && $ext6 == "jpeg") || ($ext5 == "jpg" && $ext6 == "jpg") || ($ext5 == "JPG" && $ext6 == "JPG")) | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| <tr><td height="10"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaF) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaB) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 24_49 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form24_49) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 9_44 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @elseif($ext5 == "pdf" && $ext6 == "pdf") | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| <tr><td height="10"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 24_49 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form24_49) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 9_44 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @else | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| <tr><td height="10"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Identity Card (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 24_49 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form24_49) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 9_44 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @if($form->form9_44 != "" && $ext3 != "pdf") | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Company Form | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%" style="text-align: center"> | |||
| <img style="display:block;max-width:700px;max-height:500px" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| @endif | |||
| @endif | |||
| @elseif($ext1 == "pdf" && $ext2 == "pdf") | |||
| @if($ext3 == "pdf" && $ext4 == "pdf") | |||
| @if($ext5 == "pdf" && $ext6 == "pdf") | |||
| @elseif(($ext5 == "jpeg" && $ext6 == "jpeg") || ($ext5 == "jpg" && $ext6 == "jpg") || ($ext5 == "JPG" && $ext6 == "JPG")) | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaF) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaB) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @else | |||
| @if($form->paymentReceipt != "" && $ext4 !="pdf") | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Upfront Payment Receipt | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%" style="text-align: center"> | |||
| <img style="display:block;max-width:700px;max-height:500px" src="{{ url($form->paymentReceipt) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| @endif | |||
| @elseif(($ext3 == "jpeg" && $ext4 == "jpeg") || ($ext3 == "jpg" && $ext4 == "jpg") || ($ext3 == "JPG" && $ext4 == "JPG")) | |||
| @if($ext5 == "pdf" && $ext6 == "pdf") | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 24_49 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form24_49) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 9_44 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @elseif(($ext5 == "jpeg" && $ext6 == "jpeg") || ($ext5 == "jpg" && $ext6 == "jpg") || ($ext5 == "JPG" && $ext6 == "JPG")) | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Front) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaF) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Visa (Back) | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->visaB) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 24_49 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form24_49) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 9_44 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @else | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td align="center" style="font-size: 16; font-weight: bold;"> | |||
| Attachment | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 24_49 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form24_49) }}"> | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Form 9_44 | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%"> | |||
| <img style="display:block;max-width:670px;height:auto" src="{{ url($form->form9_44) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @if($form->soForm != "" && $ext5 !="pdf") | |||
| <tr> | |||
| <td> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| <tr> | |||
| <td style="font-size: 14; font-weight: bold;"> | |||
| Service Order Form | |||
| </td> | |||
| </tr> | |||
| <tr><td height="5"></td></tr> | |||
| <tr> | |||
| <td width="100%" style="text-align: center"> | |||
| <img style="display:block;max-width:700px;max-height:500px" src="{{ url($form->soForm) }}"> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </td> | |||
| </tr> | |||
| @endif | |||
| @endif | |||
| @endif | |||
| @endif | |||
| </table> | |||
| </body> | |||
| </html> | |||
| @@ -654,6 +654,9 @@ | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @if ($ext1 =="pdf" && $ext2 =="pdf" && $ext3 =="pdf" && $ext4 =="pdf") | |||
| @else | |||
| @if($form->back_ic != "" && $form->front_ic != "") | |||
| <!-- <div class="page-break"></div> --> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| @@ -771,5 +774,6 @@ | |||
| @endif | |||
| </table> | |||
| @endif | |||
| @endif | |||
| </body> | |||
| </html> | |||
| @@ -180,6 +180,9 @@ | |||
| @foreach($coverage as $c) | |||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||
| @endforeach | |||
| @if ($company == "5bb2bc66ee0dc2271c6fedf6") | |||
| <option value="{{ $exclusiveBuilding->_id }}">{{ $exclusiveBuilding->building_name }}</option> | |||
| @endif | |||
| </select> | |||
| </div> | |||
| </div> | |||
| @@ -161,13 +161,13 @@ Route::group(['middleware' => 'csAuth'], function () { | |||
| Route::get('/customer-service/profile', ['uses' => 'CustomerService\ProfileController@viewProfile', 'as' => 'csProfile']); | |||
| Route::post('/customer-service/update-profile-picture', ['uses' => 'CustomerService\ProfileController@updateProfilePicture', 'as' => 'csProfileImg']); | |||
| Route::get('/CustomerService/customer/get-customer-list', 'DS\CustomerService\CustomerController@getCustomerList')->name('getCustomerList'); | |||
| // Route::get('/CustomerService/customer/get-customer-list', 'DS\CustomerService\CustomerController@getCustomerList')->name('getCustomerList'); | |||
| Route::get('/CustomerService/wo/get-wo-list', 'DS\CustomerService\CustomerController@getCustomerWo')->name('getCustomerWo'); | |||
| Route::get('/CustomerService/wo/country-json', 'DS\CustomerService\CustomerController@getCountry')->name('getCountry'); | |||
| Route::get('/CustomerService/wo/building-json', 'DS\CustomerService\CustomerController@getBuilding')->name('getBuilding'); | |||
| Route::get('/CustomerService/wo/filter/{year}/{month}/{status}', 'DS\CustomerService\CustomerController@filterCustomerWo')->name('filterCustomerWo'); | |||
| Route::post('/CustomerService/wo/delete-wo', 'DS\CustomerService\CustomerController@deleteCustomerWo')->name('deleteCustomerWo'); | |||
| // Route::get('/CustomerService/wo/get-wo-list', 'DS\CustomerService\CustomerController@getCustomerWo')->name('getCustomerWo'); | |||
| // Route::get('/CustomerService/wo/country-json', 'DS\CustomerService\CustomerController@getCountry')->name('getCountry'); | |||
| // Route::get('/CustomerService/wo/building-json', 'DS\CustomerService\CustomerController@getBuilding')->name('getBuilding'); | |||
| // Route::get('/CustomerService/wo/filter/{year}/{month}/{status}', 'DS\CustomerService\CustomerController@filterCustomerWo')->name('filterCustomerWo'); | |||
| // Route::post('/CustomerService/wo/delete-wo', 'DS\CustomerService\CustomerController@deleteCustomerWo')->name('deleteCustomerWo'); | |||
| Route::get('/customer-service/get-data-claim','Api\ClaimedController@get_data_claim'); | |||
| Route::get('/customer-service/get-data-form','Api\FormController@get_data_form'); | |||