Browse Source

Merge branch 'master' into hajar

ifah
Siti Hajar Ibrahim 5 years ago
parent
commit
9f1831944f

+ 1
- 1
app/Http/Controllers/Api/ClaimedController.php View File

$id = Auth::guard('cs')->id(); $id = Auth::guard('cs')->id();
$user = Staff::with('StaffDetail')->find($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(); $start = $dateS->copy()->startOfDay();
$dateE = Carbon::createFromFormat('Y-m-d', '2020-12-31'); $dateE = Carbon::createFromFormat('Y-m-d', '2020-12-31');
$end = $dateE->copy()->endOfDay(); $end = $dateE->copy()->endOfDay();

+ 15
- 9
app/Http/Controllers/Api/DocketMobile.php View File

} }


function createDocketID($limit){ 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){ public function createDocket(Request $request){

+ 26
- 17
app/Http/Controllers/Api/FormController.php View File



public function get_data_form(Request $request){ 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(); $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(); $end = $dateE->copy()->endOfDay();


$result = array(); $result = array();


if(!empty($f->dealer_id)){ if(!empty($f->dealer_id)){
$c = Company::find($f->company_id); $c = Company::find($f->company_id);
if(!empty($c->name)){
$labelD = $c->name; $labelD = $c->name;
}
}else{ }else{
$labelD = ""; $labelD = "";
} }
// if(!empty($f->Subscriber->DealerClaim)){ // if(!empty($f->Subscriber->DealerClaim)){
// $amount_claim = $f->Subscriber->DealerClaim->total_claim; // $amount_claim = $f->Subscriber->DealerClaim->total_claim;
// } // }
$subscriber_id=''; $ic=''; $company_reg='';
if(!empty($f->Subscriber) && !empty($f->PackageDetail)){ if(!empty($f->Subscriber) && !empty($f->PackageDetail)){
if($f->type_application == 'R'){ if($f->type_application == 'R'){
$name = $f->Subscriber->name; $name = $f->Subscriber->name;
$ic = $f->Subscriber->ic;
$subscriber_id = $f->Subscriber->subscriber_id; $subscriber_id = $f->Subscriber->subscriber_id;
$contact_no = $f->Subscriber->phone1; $contact_no = $f->Subscriber->phone1;
$building = $f->Subscriber->building_name; $building = $f->Subscriber->building_name;
} }
}else if($f->type_application == 'B'){ }else if($f->type_application == 'B'){
$name = $f->Subscriber->company_name; $name = $f->Subscriber->company_name;
$ic = $f->Subscriber->ic;
$company_reg = $f->Subscriber->company_reg;
$subscriber_id = $f->Subscriber->subscriber_id;
$contact_no = $f->Subscriber->company_num; $contact_no = $f->Subscriber->company_num;
$building = $f->Subscriber->street; $building = $f->Subscriber->street;
$address = $f->Subscriber->postcode. ' , '.$f->Subscriber->city. ' , '.$f->Subscriber->state; $address = $f->Subscriber->postcode. ' , '.$f->Subscriber->city. ' , '.$f->Subscriber->state;
} }
array_push($result,array( 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, "customer_name"=> $name,
"subscriber_id" => $subscriber_id,
"contact_no"=> $contact_no,
"unit_no"=>$f->Subscriber->unit_no,
"building"=>$building,
"street"=>$address,
"submitted_date" => $f->created_at->toDateTimeString(),
"package_contract" => $f->PackageDetail->contract,
"package_name" => $f->PackageDetail->name,
'dealer' => $labelD,
'wo' => $woId,
'activated_date' => $woD,
'installer_name' => $installer_name,
'contractor_name' => $contractor_name,
//"ic" => $ic,
//"company_reg" => $company_reg,
"subscriber_id" => $subscriber_id,
"contact_no"=> $contact_no,
"unit_no"=>$f->Subscriber->unit_no,
"building"=>$building,
"street"=>$address,
"submitted_date" => $f->created_at->toDateTimeString(),
"package_contract" => $f->PackageDetail->contract,
"package_name" => $f->PackageDetail->name,
'dealer' => $labelD,
'wo' => $woId,
'activated_date' => $woD,
'installer_name' => $installer_name,
'contractor_name' => $contractor_name,
)); ));
// array_push($result,array( // array_push($result,array(
// // 'Installer' => $installerId, // // 'Installer' => $installerId,

+ 24
- 15
app/Http/Controllers/Contractor/WorkOrderController.php View File

return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); 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() public function viewContractorWork()
{ {
$data = array(); $data = array();
$wod = WorkOrder::where('wo',$request->wo)->first(); $wod = WorkOrder::where('wo',$request->wo)->first();
$form = Form::where('_id',$wod->_id)->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)){ if(!empty($wod)){


$wod->status = $request->type_work; $wod->status = $request->type_work;
$wod->installer_id = $request->installer; $wod->installer_id = $request->installer;
$wod->save(); $wod->save();
$formH = new FormStatus; $formH = new FormStatus;
$formH->form_id = $form->_id; $formH->form_id = $form->_id;
$formH->status_id = 6; $formH->status_id = 6;
$formH->date = new \MongoDB\BSON\UTCDateTime(time()*1000); $formH->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
$formH->status = 'Pending Installer'; $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); $form->formstatus()->save($formH);


array_push($data, array( array_push($data, array(
return redirect('/contractor/work-order/list'); return redirect('/contractor/work-order/list');
} }
} }
}
}

+ 17
- 12
app/Http/Controllers/CustomerService/CoverageController.php View File

return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); 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() public function viewCoverageR()
{ {
return 'false'; return 'false';
} }
} }
}
}

+ 211
- 31
app/Http/Controllers/CustomerService/CustomerController.php View File

return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); 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(); $number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first();
$numberOnly = str_replace('WO-','',$number->wo); $numberOnly = str_replace('WO-','',$number->wo);
info('before WO'.$numberOnly);
$numberOnly++; $numberOnly++;
info('after WO'.$numberOnly);
return $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() public function viewCustomer()
return view('customer-service.view_customer',compact('user','pp','sp','rs','ss','cm','coverage','company')); 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(); $id = Auth::guard('cs')->id();
$user = Staff::with('StaffDetail')->find($id); $user = Staff::with('StaffDetail')->find($id);
$nested_data = array(); $nested_data = array();


if($type == 'null' && $building == 'null' && $dealer == 'null'){ 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'){ }else if($type != 'null' && $building == 'null' && $dealer == 'null'){
$form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get();
}else if($type != 'null' && $building != 'null' && $dealer == 'null'){ }else if($type != 'null' && $building != 'null' && $dealer == 'null'){
} }
if(!empty($form)){ if(!empty($form)){
foreach ($form as $key => $f) { foreach ($form as $key => $f) {
if(empty($f->WorkOrder)){
if(empty($f->WorkOrder->nature_work)){
$i++; $i++;


$n1 = ''; $n1 = '';
if($f->status_email == 'verified'){ if($f->status_email == 'verified'){
$work_order = ''; $work_order = '';
if($f->type_application == 'R'){ 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; $wo = $work_order.'/'.$f->Subscriber->subscriber_id;
$cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','R')->first(); $cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','R')->first();
} }


}else if($f->type_application == 'B'){ }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; $wo = $work_order.'/'.$f->Subscriber->subscriber_id;
$cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','B')->first(); $cov = Coverage::where('building_name',$f->Subscriber->building_name)->where('Type','B')->first();
if(!empty($cov)){ if(!empty($cov)){
} }
} }


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){ public function getAllNewCustomerss($type,$building,$dealer){
return view('customer-service.view_subscriber', compact('user','pp','sp','rs','ss','cm','rec','re','bu','coverage','company')); 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(); $id = Auth::guard('cs')->id();
$user = Staff::with('StaffDetail')->find($id); $user = Staff::with('StaffDetail')->find($id);
$nested_data = array(); $nested_data = array();


if($type == 'null' && $building == 'null' && $dealer == 'null'){ 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'){ }else if($type != 'null' && $building == 'null' && $dealer == 'null'){
$form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get();
}else if($type != 'null' && $building != 'null' && $dealer == 'null'){ }else if($type != 'null' && $building != 'null' && $dealer == 'null'){
} }
} }


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(); $id = Auth::guard('cs')->id();
$user = Staff::with('StaffDetail')->find($id); $user = Staff::with('StaffDetail')->find($id);
$nested_data = array(); $nested_data = array();


if($type == 'null' && $building == 'null' && $dealer == 'null'){ 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'){ }else if($type != 'null' && $building == 'null' && $dealer == 'null'){
$form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get();
}else if($type != 'null' && $building != 'null' && $dealer == 'null'){ }else if($type != 'null' && $building != 'null' && $dealer == 'null'){
} }
} }


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(); $id = Auth::guard('cs')->id();
$user = Staff::with('StaffDetail')->find($id); $user = Staff::with('StaffDetail')->find($id);
$nested_data = array(); $nested_data = array();


if($type == 'null' && $building == 'null' && $dealer == 'null'){ 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'){ }else if($type != 'null' && $building == 'null' && $dealer == 'null'){
$form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get();
}else if($type != 'null' && $building != 'null' && $dealer == 'null'){ }else if($type != 'null' && $building != 'null' && $dealer == 'null'){
} }
} }


return \DataTables::of($nested_data)->make(true);
$response = array(
"draw" => intval($draw),
"recordsTotal" => $totalRecords,
"recordsFiltered" => $totalRecordswithFilter,
"data" => $nested_data
);

return json_encode($response);
} }





+ 11
- 11
app/Http/Controllers/CustomerService/DocketController.php View File

return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); 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() public function viewDocket()
{ {

+ 11
- 11
app/Http/Controllers/CustomerService/TeamController.php View File

return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); 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) { public function encryptPassword($action, $string) {
$output = false; $output = false;

+ 273
- 77
app/Http/Controllers/CustomerService/WorkOrderController.php View File

return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); 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() public function viewWorkOrder()
$company = Company::where('team','CBB')->get(); $company = Company::where('team','CBB')->get();
$today = Carbon::today(); $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')); return view('customer-service.view_add_new_schedule', compact('user','pp','sp','rs','ss','cm','company','wo','today','subscriber_id','status'));
} }


$product = 'R Mbps'; $product = 'R Mbps';
}else { }else {
$product = $product->package_name; $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( array_push($nested_data, array(
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $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( array_push($nested_data, array(
'formT' => $n1.$i.$w->Form->type_application, 'formT' => $n1.$i.$w->Form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $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( array_push($nested_data, array(
'formT' => $n1.$i.$w->Form->type_application, 'formT' => $n1.$i.$w->Form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $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( array_push($nested_data, array(
'formT' => $n1.$i.$w->Form->type_application, 'formT' => $n1.$i.$w->Form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $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( array_push($nested_data, array(
'formT' => $n1.$i.$w->Form->type_application, 'formT' => $n1.$i.$w->Form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $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( array_push($nested_data, array(
'formT' => $n1.$i.$w->Form->type_application, 'formT' => $n1.$i.$w->Form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $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( array_push($nested_data, array(
'formT' => $n1.$i.$w->Form->type_application, 'formT' => $n1.$i.$w->Form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, '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, 'status' => $w->status,
'action' => $w->wo, 'action' => $w->wo,
)); ));
$product = $product->package_name; $product = $product->package_name;
} }


if(empty($company)){
$company = ' ';
}else {
$company = $company->name;
}

array_push($nested_data, array( array_push($nested_data, array(
'formT' => $n1.$i.$form->type_application, 'formT' => $n1.$i.$form->type_application,
'service' => $w->nature_work, 'service' => $w->nature_work,
'building' => $building, 'building' => $building,
'city' => $form->Subscriber->city, 'city' => $form->Subscriber->city,
'package' => $product, 'package' => $product,
'contractor' => $company->name,
'contractor' => $company,
'installer' => $installer, 'installer' => $installer,
'date' => date("d/m/Y", strtotime($w->end_job)), 'date' => date("d/m/Y", strtotime($w->end_job)),
'time' => date("h:i A", strtotime($w->end_job)), 'time' => date("h:i A", strtotime($w->end_job)),
{ {
$data = array(); $data = array();
$wod = WorkOrder::where('wo',$request->wo)->first(); $wod = WorkOrder::where('wo',$request->wo)->first();
if(!empty($wod)){
if(($wod->status == 'Pending Contractor')){
array_push($data, array( array_push($data, array(
'result' => 'yes', 'result' => 'yes',
)); ));


}else{ }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( array_push($data, array(
'result' => 'yes', 'result' => 'yes',
)); ));
}
} }


return response()->json($data); return response()->json($data);
$formH->desc = 'Rectification form been submitted'; $formH->desc = 'Rectification form been submitted';
$form->formstatus()->save($formH); $form->formstatus()->save($formH);


$wo = '';
do { 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'){ }else if($request->formT == 'B'){


$formH->desc = 'Rectification form been submitted'; $formH->desc = 'Rectification form been submitted';
$form->formstatus()->save($formH); $form->formstatus()->save($formH);


$wo = '';
do { 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);
} }
} }


$formH->desc = 'Secured development form been submitted'; $formH->desc = 'Secured development form been submitted';
$form->formstatus()->save($formH); $form->formstatus()->save($formH);


$wo = '';
do { 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);


} }
}
}

+ 425
- 27
app/Http/Controllers/DS/DealerController.php View File

'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $c['formT'], 'index' => $c['formT'],
'contract' => $c['contract'], 'contract' => $c['contract'],
'wo' => $c['wo'], 'wo' => $c['wo'],
'submission' => $d['submission_dt'],
'activation' => $c['activated_dt'], 'activation' => $c['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $d['formT'], 'index' => $d['formT'],
'contract' => $d['contract'], 'contract' => $d['contract'],
'wo' => $d['wo'], 'wo' => $d['wo'],
'submission' => $d['submission_dt'],
'activation' => $d['activated_dt'], 'activation' => $d['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'index' => $c['formT'], 'index' => $c['formT'],
'contract' => $c['contract'], 'contract' => $c['contract'],
'wo' => $c['wo'], 'wo' => $c['wo'],
'submission' => $d['submission_dt'],
'activation' => $c['activated_dt'], 'activation' => $c['activated_dt'],
'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
if($year!='null' && $month!='null' && $app=='null'){ if($year!='null' && $month!='null' && $app=='null'){


$count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); $count_menglembu = array(); $count_ipoh = array(); $count_cyberjaya = array(); $count_jasin = array(); $count_ayerKeroh = array(); $count_alorGajah = array(); $count_menglembu = array(); $count_ipoh = array();
$extra = 0; $basic_total = 0; $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')){ // if(($year == '2019' || $year == '2020') && ($month == '12' || $month == '01')){
// $dataDis = $this->returnDataR($company,'2019','12'); // $dataDis = $this->returnDataR($company,'2019','12');
} }
} }
}
}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; $i = 0;
$nested_data = array(); $nested_data = array();
if(!empty($combineData)){ if(!empty($combineData)){
foreach ($combineData as $c){ foreach ($combineData as $c){

$update_dealer = DealerClaim::where('wo',$c['wo'])->first(); $update_dealer = DealerClaim::where('wo',$c['wo'])->first();
if(!empty($update_dealer)){ if(!empty($update_dealer)){
$update_dealer->incentives1 = $c['incentives1']; $update_dealer->incentives1 = $c['incentives1'];
$update_dealer->incentives2 = $c['incentives2']; $update_dealer->incentives2 = $c['incentives2'];
$update_dealer->retail_price = $c['retail_price'];
$update_dealer->total_claim = $c['total']; $update_dealer->total_claim = $c['total'];
$update_dealer->save(); $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'],
// ));
} }
} }


'name' => $name, 'name' => $name,
'address' => $address, 'address' => $address,
'package' => $c->package, 'package' => $c->package,
'retail_price' => 'RM '.$c->retail_price,
'retail_price' => $c->retail_price,
'incentives1' => $c->incentives1, 'incentives1' => $c->incentives1,
'incentives2' => $c->incentives2, 'incentives2' => $c->incentives2,
'total' => $c->total_claim, 'total' => $c->total_claim,


foreach ($dealer as $key => $d) { foreach ($dealer as $key => $d) {
$claim = str_replace("RM ","",$d->total_claim); $claim = str_replace("RM ","",$d->total_claim);
$price = str_replace("RM ","",$d->retail_price);
$d->total_claim = floatval($claim); $d->total_claim = floatval($claim);
$d->retail_price = floatval($price);
$d->save(); $d->save();
} }
} }

+ 2
- 1
app/Http/Controllers/Form/BusinessController.php View File

$destinationPath = 'document/'.$su_id; $destinationPath = 'document/'.$su_id;
// create folder/dir if not exist // create folder/dir if not exist

if(!File::exists(public_path().'/'.$destinationPath)){ if(!File::exists(public_path().'/'.$destinationPath)){
File::makeDirectory(public_path().'/'.$destinationPath,0777,true); File::makeDirectory(public_path().'/'.$destinationPath,0777,true);
} }
} }
return view('email.invoiceb', compact ('form', 'product')); return view('email.invoiceb', compact ('form', 'product'));
} }
}
}

+ 37
- 0
app/Http/Controllers/Form/FormController.php View File

use App\Model\Product; use App\Model\Product;


use App\Model\Form; use App\Model\Form;
use App\Model\WorkOrder;
use App\Model\Subscriber; use App\Model\Subscriber;
use App\Model\PackageDetail; use App\Model\PackageDetail;
use App\Model\FormStatus; use App\Model\FormStatus;


class FormController extends Controller 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){ public function updateStatus($f_id){
$fm = Form::where('_id',$f_id)->first(); $fm = Form::where('_id',$f_id)->first();
if(!empty($fm)){ if(!empty($fm)){
$formH->desc = 'Email already been verified by Customer Service'; $formH->desc = 'Email already been verified by Customer Service';


$fm->formstatus()->save($formH); $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'); return redirect('/customer-service/new/customer/list');
} }
} }

+ 42
- 1
app/Http/Controllers/Form/ResidentialController.php View File

use App\Model\Product; use App\Model\Product;


use App\Model\Form; use App\Model\Form;
use App\Model\WorkOrder;
use App\Model\Subscriber; use App\Model\Subscriber;
use App\Model\PackageDetail; use App\Model\PackageDetail;
use App\Model\FormStatus; use App\Model\FormStatus;
$destinationPath = 'document/'.$su_id; $destinationPath = 'document/'.$su_id;
// create folder/dir if not exist // create folder/dir if not exist

if(!File::exists(public_path().'/'.$destinationPath)){ if(!File::exists(public_path().'/'.$destinationPath)){
File::makeDirectory(public_path().'/'.$destinationPath,0777,true); File::makeDirectory(public_path().'/'.$destinationPath,0777,true);
} }
public function viewFormAddressD($package,$dealer_id) { public function viewFormAddressD($package,$dealer_id) {


$coverage = Coverage::where('Type','R')->orderBy('building_name')->get(); $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) { public function viewFormApplicationD(Request $request) {
} }
} }
} }
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){ public function verifyEmail($subscriber_id){
$subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first(); $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first();
$stat->desc = 'Email already been verified by customer'; $stat->desc = 'Email already been verified by customer';
$form->formstatus()->save($stat); $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'); return redirect('http://db.citybroadband.my/residential/application-form/success-verified');
} }
} }

+ 8
- 4
app/Jobs/StoreDocket.php View File

public function handle(Docket $docket) public function handle(Docket $docket)
{ {
$note = ''; $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']; $note = $this->request['Note'];
$mac_router = $this->request['mac_router'];
$type_testing = $this->request['type_testing'];
} }
$docket->work_order_id = $this->request['wo']; $docket->work_order_id = $this->request['wo'];
$docket->installer_id = $this->staff; $docket->installer_id = $this->staff;
$docket->end_job = Carbon::now()->toDateTimeString(); $docket->end_job = Carbon::now()->toDateTimeString();
$docket->router_serial_number = $this->request['router_serial_number']; $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->cable_read = $this->request['cable_read'];
$docket->condition = $this->request['condition']; $docket->condition = $this->request['condition'];
$docket->type_testing = $type_testing;
$docket->Note = $note; $docket->Note = $note;
$docket->Rating1 = $this->request['Rating1']; $docket->Rating1 = $this->request['Rating1'];
$docket->Rating2 = $this->request['Rating2']; $docket->Rating2 = $this->request['Rating2'];
$docket->Rating3 = $this->request['Rating3']; $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; $docket->customer_signature = $this->signature;


$work_order = WorkOrder::where('wo',$this->request['wo'])->first(); $work_order = WorkOrder::where('wo',$this->request['wo'])->first();

BIN
public/assets/avatar/5ee1c416a1f29b3d4c69e2d8.jpg View File


+ 5
- 6
resources/views/customer-service/view_customer.blade.php View File

<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>Type App.</th>
<th>Type Application</th>
<th>Customer Name</th> <th>Customer Name</th>
<th>Contact No.</th> <th>Contact No.</th>
<th>Unit No.</th> <th>Unit No.</th>
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>Type App.</th>
<th>Type Application</th>
<th>Customer Name</th> <th>Customer Name</th>
<th>Contact No.</th> <th>Contact No.</th>
<th>Unit No.</th> <th>Unit No.</th>
}; };


$(document).ready(function(){ $(document).ready(function(){

var origin = window.location.origin; var origin = window.location.origin;


//===== Dynamic table toolbars =====// //===== Dynamic table toolbars =====//
], ],
}); });


var table = $('#view_customer').DataTable({
var table3 = $('#view_customer').DataTable({
"bJQueryUI": false, "bJQueryUI": false,
"bAutoWidth": true, "bAutoWidth": true,
"bSort": false, "bSort": false,
}); });


$('.tipS').tipsy({gravity: 's',fade: true, html:true}); $('.tipS').tipsy({gravity: 's',fade: true, html:true});
/*** Filter ***/ /*** Filter ***/
$('#fbtype,#fbbuilding,#fbdealer').on('change', function() { $('#fbtype,#fbbuilding,#fbdealer').on('change', function() {
var link = "{{ url('/customer-service/get-all-new-customer') }}" +"/"+$('#fbtype').val()+"/"+$('#fbbuilding').val()+"/"+$('#fbdealer').val(); var link = "{{ url('/customer-service/get-all-new-customer') }}" +"/"+$('#fbtype').val()+"/"+$('#fbbuilding').val()+"/"+$('#fbdealer').val();
table.ajax.url( link ).load(); table.ajax.url( link ).load();
});
});
}); });
</script> </script>
@endsection @endsection

+ 9
- 9
resources/views/customer-service/view_subscriber.blade.php View File

<thead> <thead>
<tr> <tr>
<th>#</th> <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>Contact No.</th>
<th>Unit No.</th> <th>Unit No.</th>
<th>Building</th> <th>Building</th>
<thead> <thead>
<tr> <tr>
<th>#</th> <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>Contact No.</th>
<th>Unit No.</th> <th>Unit No.</th>
<th>Building</th> <th>Building</th>
<thead> <thead>
<tr> <tr>
<th>#</th> <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>Contact No.</th>
<th>Unit No.</th> <th>Unit No.</th>
<th>Building</th> <th>Building</th>

+ 62
- 517
resources/views/pdf/oldBusiness-pdf.blade.php View File

</td> </td>
</tr> </tr>
</table> </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> <tr>
<td> <td>
@if($form->back_ic != "" && $form->front_ic != "")
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr> <tr>
<td align="center" style="font-size: 16; font-weight: bold;"> <td align="center" style="font-size: 16; font-weight: bold;">
</td> </td>
</tr> </tr>
<tr><td height="10"></td></tr> <tr><td height="10"></td></tr>
@if ($ext1 != "pdf")
<tr> <tr>
<td style="font-size: 14; font-weight: bold;"> <td style="font-size: 14; font-weight: bold;">
Identity Card (Front) Identity Card (Front)
<img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}"> <img style="display:block;max-width:670px;height:auto" src="{{ url($form->front_ic) }}">
</td> </td>
</tr> </tr>
@endif
<tr><td height="5"></td></tr> <tr><td height="5"></td></tr>
@if ($ext2 != "pdf")
<tr> <tr>
<td style="font-size: 14; font-weight: bold;"> <td style="font-size: 14; font-weight: bold;">
Identity Card (Back) Identity Card (Back)
<img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}"> <img style="display:block;max-width:670px;height:auto" src="{{ url($form->back_ic) }}">
</td> </td>
</tr> </tr>
@endif
</table> </table>
</td> </td>
</tr> </tr>
</table>
@endif @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
@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 @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
@endif
</table>
</body> </body>
</html> </html>

+ 4
- 0
resources/views/pdf/residential-pdf.blade.php View File

</td> </td>
</tr> </tr>
</table> </table>
@if ($ext1 =="pdf" && $ext2 =="pdf" && $ext3 =="pdf" && $ext4 =="pdf")

@else
@if($form->back_ic != "" && $form->front_ic != "") @if($form->back_ic != "" && $form->front_ic != "")
<!-- <div class="page-break"></div> --> <!-- <div class="page-break"></div> -->
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
@endif @endif
</table> </table>
@endif @endif
@endif
</body> </body>
</html> </html>

+ 3
- 0
resources/views/sales/form/dealer/residential_address.blade.php View File

@foreach($coverage as $c) @foreach($coverage as $c)
<option value="{{ $c->_id }}">{{ $c->building_name }}</option> <option value="{{ $c->_id }}">{{ $c->building_name }}</option>
@endforeach @endforeach
@if ($company == "5bb2bc66ee0dc2271c6fedf6")
<option value="{{ $exclusiveBuilding->_id }}">{{ $exclusiveBuilding->building_name }}</option>
@endif
</select> </select>
</div> </div>
</div> </div>

+ 6
- 6
routes/web.php View File

Route::get('/customer-service/profile', ['uses' => 'CustomerService\ProfileController@viewProfile', 'as' => 'csProfile']); 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::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-claim','Api\ClaimedController@get_data_claim');
Route::get('/customer-service/get-data-form','Api\FormController@get_data_form'); Route::get('/customer-service/get-data-form','Api\FormController@get_data_form');

Loading…
Cancel
Save