| @@ -92,7 +92,7 @@ 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-08-12'); | |||
| $start = $dateS->copy()->startOfDay(); | |||
| $dateE = Carbon::createFromFormat('Y-m-d', '2020-08-31'); | |||
| $end = $dateE->copy()->endOfDay(); | |||
| @@ -30,6 +30,11 @@ class WorkOrderController extends Controller | |||
| } | |||
| 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); | |||
| @@ -762,4 +767,4 @@ class WorkOrderController extends Controller | |||
| return redirect('/contractor/work-order/list'); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -29,7 +29,12 @@ class CoverageController extends Controller | |||
| return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit); | |||
| } | |||
| function createWorkID($limit){ | |||
| 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); | |||
| @@ -207,4 +212,4 @@ class CoverageController extends Controller | |||
| return 'false'; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -74,7 +74,7 @@ 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(); | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->take(2000)->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'){ | |||
| @@ -743,7 +743,7 @@ 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(); | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->take(2000)->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'){ | |||
| @@ -860,7 +860,7 @@ 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(); | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->take(2000)->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'){ | |||
| @@ -33,6 +33,11 @@ class WorkOrderController extends Controller | |||
| } | |||
| 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); | |||
| @@ -1446,4 +1451,4 @@ class WorkOrderController extends Controller | |||
| return redirect()->to('/customer-service/work-order/add/schedule/secured/'.$wo.'/'. $su_id); | |||
| } | |||
| } | |||
| } | |||
| @@ -204,6 +204,7 @@ class BusinessController extends Controller | |||
| $destinationPath = 'document/'.$su_id; | |||
| // create folder/dir if not exist | |||
| info(public_path()); | |||
| 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')); | |||
| } | |||
| } | |||
| } | |||
| @@ -207,7 +207,8 @@ class ResidentialController extends Controller | |||
| $destinationPath = 'document/'.$su_id; | |||
| // create folder/dir if not exist | |||
| if(!File::exists(public_path().'/'.$destinationPath)){ | |||
| info(public_path()); | |||
| if(!File::exists(public_path().'/'.$destinationPath)){ | |||
| File::makeDirectory(public_path().'/'.$destinationPath,0777,true); | |||
| } | |||
| @@ -654,6 +654,7 @@ | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| @if ($ext1 !="pdf" && $ext2 !="pdf" && $ext3 !="pdf" && $ext4 !="pdf" && $ext5 != "pdf" && $ext6 !="pdf") | |||
| @if($form->back_ic != "" && $form->front_ic != "") | |||
| <!-- <div class="page-break"></div> --> | |||
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||
| @@ -771,5 +772,6 @@ | |||
| @endif | |||
| </table> | |||
| @endif | |||
| @endif | |||
| </body> | |||
| </html> | |||