| class Controller extends BaseController | class Controller extends BaseController | ||||
| { | { | ||||
| public function getCoverageDetail($id) | |||||
| public function getCoverageDetail($building_name,$street) | |||||
| { | { | ||||
| $data = array(); | $data = array(); | ||||
| $coverage = Coverage::where('_id',$id)->get(); | |||||
| $coverage = Coverage::where('building_name',$building_name)->where('street',$street)->get(); | |||||
| if(!empty($coverage)){ | if(!empty($coverage)){ | ||||
| foreach ($coverage as $key => $c) { | foreach ($coverage as $key => $c) { | ||||
| array_push($data, array( | array_push($data, array( | ||||
| }else{ | }else{ | ||||
| return $this->sendError('', 'Rekod Ditemui'); | return $this->sendError('', 'Rekod Ditemui'); | ||||
| } | } | ||||
| } | |||||
| public function getStreet($building_name) | |||||
| { | |||||
| $data = array(); | |||||
| $coverage = Coverage::where('building_name',$building_name)->get(); | |||||
| if(!empty($coverage)){ | |||||
| foreach ($coverage as $key => $c) { | |||||
| array_push($data, array( | |||||
| 'street' => $c->street, | |||||
| )); | |||||
| } | |||||
| return $this->sendResponse($data, 'Rekod Ditemui'); | |||||
| }else{ | |||||
| return $this->sendError('', 'Rekod Ditemui'); | |||||
| } | |||||
| } | } | ||||
| } | } |
| $w = WorkOrder::where('wo',$wo)->first(); | $w = WorkOrder::where('wo',$wo)->first(); | ||||
| $form = Form::with('Subscriber','WorkOrder')->where('_id',$w->_id)->first(); | $form = Form::with('Subscriber','WorkOrder')->where('_id',$w->_id)->first(); | ||||
| $coverage = Coverage::all(); | |||||
| $coverage = Coverage::groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $installer = Staff::with('StaffDetail')->where('_id',$w->installer_id)->first(); | $installer = Staff::with('StaffDetail')->where('_id',$w->installer_id)->first(); | ||||
| if(empty($installer)){ | if(empty($installer)){ |
| namespace App\Http\Controllers; | namespace App\Http\Controllers; | ||||
| use App\Model\Form; | |||||
| use App\Model\WorkOrder; | |||||
| use App\Model\Coverage; | |||||
| use Illuminate\Foundation\Bus\DispatchesJobs; | use Illuminate\Foundation\Bus\DispatchesJobs; | ||||
| use Illuminate\Routing\Controller as BaseController; | use Illuminate\Routing\Controller as BaseController; | ||||
| use Illuminate\Foundation\Validation\ValidatesRequests; | use Illuminate\Foundation\Validation\ValidatesRequests; | ||||
| if ($response->success == true) { | if ($response->success == true) { | ||||
| foreach ($response->data as $key => $r) { | foreach ($response->data as $key => $r) { | ||||
| $work_order = WorkOrder::where('wo',$r->wo)->first(); | |||||
| $form_submitted = Form::where('_id',$work_order->_id)->first(); | |||||
| $form_submitted->customer_category = $r->category; | |||||
| $form_submitted->save(); | |||||
| $coverage = Coverage::where(strtoupper('building_name'),strtoupper($r->building_name))->where(strtoupper('street'),strtoupper($r->street))->where('Type',$r->Type)->get(); | |||||
| if(count($coverage)==0){ | |||||
| $coveragedetails = [ | |||||
| 'Type' => $r->Type, | |||||
| 'building_name' => strtoupper($r->building_name), | |||||
| 'project_type' => $r->project_type, | |||||
| 'street' => strtoupper($r->street), | |||||
| 'city' => strtoupper($r->city), | |||||
| 'state' => strtoupper($r->state), | |||||
| 'postcode' => $r->postcode, | |||||
| 'installation_fee' => $r->installation_fee, | |||||
| 'status_building' => $r->status_building, | |||||
| 'jmb_email' => "", | |||||
| ]; | |||||
| $coverageUpdate = Coverage::create($coveragedetails); | |||||
| }else{ | |||||
| } | |||||
| } | } | ||||
| $ss = count(WorkOrder::where('status','Suspend')->get()); | $ss = count(WorkOrder::where('status','Suspend')->get()); | ||||
| $cm = count(WorkOrder::where('status','Completed')->get()); | $cm = count(WorkOrder::where('status','Completed')->get()); | ||||
| $coverage = Coverage::all(); | |||||
| $coverage = Coverage::groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $company = Company::where('team','Dealer')->get(); | $company = Company::where('team','Dealer')->get(); | ||||
| 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')); | ||||
| $ss = count(WorkOrder::where('status','Suspend')->get()); | $ss = count(WorkOrder::where('status','Suspend')->get()); | ||||
| $cm = count(WorkOrder::where('status','Completed')->get()); | $cm = count(WorkOrder::where('status','Completed')->get()); | ||||
| $coverage = Coverage::all(); | |||||
| $coverage = Coverage::groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $form = Subscriber::with('Form')->where('_id',$subscriber_id)->first(); | $form = Subscriber::with('Form')->where('_id',$subscriber_id)->first(); | ||||
| return view('customer-service.edit_subscriber',compact('user','pp','sp','rs','ss','cm','form','coverage')); | return view('customer-service.edit_subscriber',compact('user','pp','sp','rs','ss','cm','form','coverage')); | ||||
| } | } | ||||
| if($form->Form->type_application == 'R'){ | if($form->Form->type_application == 'R'){ | ||||
| if($request->street != null){ | |||||
| $street = $request->street; | |||||
| } | |||||
| $cov = Coverage::where('building_name',$request->building)->first(); | |||||
| $cov = Coverage::where('building_name',$request->building)->where('street',$request->street)->first(); | |||||
| if(!empty($cov)){ | if(!empty($cov)){ | ||||
| $building = $cov->building_name; | $building = $cov->building_name; | ||||
| $street = $cov->street; | |||||
| $postcode = $cov->postcode; | $postcode = $cov->postcode; | ||||
| $city = $cov->city; | $city = $cov->city; | ||||
| $state = $cov->state; | $state = $cov->state; | ||||
| $fax = $request->company_fax; | $fax = $request->company_fax; | ||||
| } | } | ||||
| $cov = Coverage::where('building_name',$request->building)->first(); | |||||
| $cov = Coverage::where('building_name',$request->building)->where('street', $request->street)->first(); | |||||
| if(!empty($cov)){ | if(!empty($cov)){ | ||||
| $building = $cov->building_name; | $building = $cov->building_name; | ||||
| $street = $cov->street; | |||||
| $postcode = $cov->postcode; | $postcode = $cov->postcode; | ||||
| $city = $cov->city; | $city = $cov->city; | ||||
| $state = $cov->state; | $state = $cov->state; | ||||
| $re = count(Form::where('type_application','R')->get()); | $re = count(Form::where('type_application','R')->get()); | ||||
| $bu = count(Form::where('type_application','B')->get()); | $bu = count(Form::where('type_application','B')->get()); | ||||
| $coverage = Coverage::all(); | |||||
| $coverage = Coverage::groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $company = Company::where('team','Dealer')->get(); | $company = Company::where('team','Dealer')->get(); | ||||
| 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')); |
| $w = WorkOrder::where('wo',$wo)->first(); | $w = WorkOrder::where('wo',$wo)->first(); | ||||
| $form = Form::with('Subscriber','WorkOrder')->where('_id',$w->_id)->first(); | $form = Form::with('Subscriber','WorkOrder')->where('_id',$w->_id)->first(); | ||||
| $coverage = Coverage::all(); | |||||
| $coverage = Coverage::groupBy('building_name')->orderBy('building_name')->get(); | |||||
| if($w->contractor_id != ''){ | if($w->contractor_id != ''){ | ||||
| $company = Company::where('_id',$w->contractor_id)->first(); | $company = Company::where('_id',$w->contractor_id)->first(); | ||||
| $w = WorkOrder::where('wo',$wo)->first(); | $w = WorkOrder::where('wo',$wo)->first(); | ||||
| $form = Form::with('Subscriber','WorkOrder')->where('_id',$w->_id)->first(); | $form = Form::with('Subscriber','WorkOrder')->where('_id',$w->_id)->first(); | ||||
| $coverage = Coverage::all(); | |||||
| $coverage = Coverage::groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $company = Company::where('_id',$w->contractor_id)->first(); | $company = Company::where('_id',$w->contractor_id)->first(); | ||||
| return view('customer-service.confirm_work_order', compact('user','pp','sp','rs','ss','cm','pc','pi','form','coverage','wo','company')); | return view('customer-service.confirm_work_order', compact('user','pp','sp','rs','ss','cm','pc','pi','form','coverage','wo','company')); | ||||
| $ss = count(WorkOrder::where('status','Suspend')->get()); | $ss = count(WorkOrder::where('status','Suspend')->get()); | ||||
| $cm = count(WorkOrder::where('status','Completed')->get()); | $cm = count(WorkOrder::where('status','Completed')->get()); | ||||
| $coverage = Coverage::where('Type','R')->get(); | |||||
| $coverage = Coverage::where('Type', 'R')->groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $product = Product::where('formT','R')->get(); | $product = Product::where('formT','R')->get(); | ||||
| return view('customer-service.view_wo_formR', compact('user','pp','sp','rs','ss','cm','pc','pi','coverage','product')); | return view('customer-service.view_wo_formR', compact('user','pp','sp','rs','ss','cm','pc','pi','coverage','product')); | ||||
| $su_id = strtoupper('CBB-'.$this->random_code(6).'R'); | $su_id = strtoupper('CBB-'.$this->random_code(6).'R'); | ||||
| } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber); | } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber); | ||||
| $coverage = Coverage::where('_id',$request->buildingsss)->first(); | |||||
| $coverage = Coverage::where('building_name',$request->buildingsss)->where('street',$request->street)->first(); | |||||
| $sdl = new Subscriber(); | $sdl = new Subscriber(); | ||||
| $sdl->subscriber_id = $su_id; | $sdl->subscriber_id = $su_id; | ||||
| $sdl->phone2 = $request->phone2; | $sdl->phone2 = $request->phone2; | ||||
| $sdl->unit_no = $request->unit_no; | $sdl->unit_no = $request->unit_no; | ||||
| $sdl->building_name = $coverage->building_name; | $sdl->building_name = $coverage->building_name; | ||||
| $sdl->street = $request->street; | |||||
| $sdl->street = $coverage->street; | |||||
| $sdl->postcode = $coverage->postcode; | $sdl->postcode = $coverage->postcode; | ||||
| $sdl->city = $coverage->city; | $sdl->city = $coverage->city; | ||||
| $sdl->state = $coverage->state; | $sdl->state = $coverage->state; | ||||
| 'remark_form' => '' | 'remark_form' => '' | ||||
| ]); | ]); | ||||
| $building = '-'; $postcode = '-'; $city = '-'; $state = '-'; | |||||
| $coverage = Coverage::where('_id',$request->buildingssss,'Type','R')->first(); | |||||
| $building = '-'; $postcode = '-'; $city = '-'; $state = '-'; | |||||
| if ($request->has('buildingsss')){ | |||||
| $coverage = Coverage::where('building_name', $request->buildingssss, 'Type', 'R', 'street', $request->streets)->first(); | |||||
| } else if ($request->has('buildingssss')){ | |||||
| $coverage = Coverage::where('building_name', $request->buildingsssss, 'Type', 'R', 'street', $request->streetss)->first(); | |||||
| } | |||||
| if(!empty($coverage)){ | if(!empty($coverage)){ | ||||
| $building = $coverage->building_name; | |||||
| $building = $coverage->building_name; | |||||
| $street = $coverage->street; | |||||
| $postcode = $coverage->postcode; | $postcode = $coverage->postcode; | ||||
| $city = $coverage->city; | $city = $coverage->city; | ||||
| $state = $coverage->state; | $state = $coverage->state; | ||||
| }else { | }else { | ||||
| $building = $request->buildingssss; | |||||
| $building = $request->buildingssss; | |||||
| $street = '-'; | |||||
| $postcode = '-'; | $postcode = '-'; | ||||
| $city = '-'; | $city = '-'; | ||||
| $state = '-'; | $state = '-'; | ||||
| $sdl->phone2 = $request->phone2; | $sdl->phone2 = $request->phone2; | ||||
| $sdl->unit_no = $request->unit_no; | $sdl->unit_no = $request->unit_no; | ||||
| $sdl->building_name = $building; | $sdl->building_name = $building; | ||||
| $sdl->street = $request->street; | |||||
| $sdl->street = $street; | |||||
| $sdl->postcode = $postcode; | $sdl->postcode = $postcode; | ||||
| $sdl->city = $city; | $sdl->city = $city; | ||||
| $sdl->state = $state; | $sdl->state = $state; |
| public function viewFormAddress($package) { | public function viewFormAddress($package) { | ||||
| $dealer_id = ''; | $dealer_id = ''; | ||||
| $coverage = Coverage::where('Type','B')->orderBy('building_name')->get(); | |||||
| $coverage = Coverage::where('Type','B')->groupBy('building_name')->orderBy('building_name')->get(); | |||||
| // dd($coverage); | |||||
| return view('sales.form.business_address', compact('coverage','package','dealer_id')); | return view('sales.form.business_address', compact('coverage','package','dealer_id')); | ||||
| } | } | ||||
| public function viewFormApplication(Request $request) { | public function viewFormApplication(Request $request) { | ||||
| $data = array(); | $data = array(); | ||||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
| array_push($data, array( | array_push($data, array( | ||||
| 'coverage' => $request->coverage, | |||||
| 'coverage' => $coverage[0]['_id'], | |||||
| 'unit' => $request->unit, | 'unit' => $request->unit, | ||||
| 'street' => $request->street, | 'street' => $request->street, | ||||
| 'package' => $request->package | 'package' => $request->package | ||||
| 'project_type' => $coverage->project_type, | 'project_type' => $coverage->project_type, | ||||
| 'status_payment' => 'paid', | 'status_payment' => 'paid', | ||||
| 'status_email' => 'unverified', | 'status_email' => 'unverified', | ||||
| 'customer_coverage' => 'Allo', | |||||
| 'customer_category' => 'Allo', | |||||
| 'remark_form' => '' | 'remark_form' => '' | ||||
| ]); | ]); | ||||
| ***/ | ***/ | ||||
| public function viewFormAddressD($package,$dealer_id) { | public function viewFormAddressD($package,$dealer_id) { | ||||
| $coverage = Coverage::where('Type','B')->orderBy('building_name')->get(); | |||||
| $coverage = Coverage::where('Type','B')->groupBy('building_name')->orderBy('building_name')->get(); | |||||
| return view('sales.form.dealer.business_address', compact('coverage','package','dealer_id')); | return view('sales.form.dealer.business_address', compact('coverage','package','dealer_id')); | ||||
| } | } | ||||
| public function viewFormApplicationD(Request $request) { | public function viewFormApplicationD(Request $request) { | ||||
| $data = array(); | $data = array(); | ||||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
| array_push($data, array( | array_push($data, array( | ||||
| 'coverage' => $request->coverage, | |||||
| 'coverage' => $coverage[0]['_id'], | |||||
| 'unit' => $request->unit, | 'unit' => $request->unit, | ||||
| 'street' => $request->street, | 'street' => $request->street, | ||||
| 'package' => $request->package, | 'package' => $request->package, | ||||
| $sl->project_type = $coverage->project_type; | $sl->project_type = $coverage->project_type; | ||||
| $sl->status_payment = 'paid'; | $sl->status_payment = 'paid'; | ||||
| $sl->status_email = 'unverified'; | $sl->status_email = 'unverified'; | ||||
| $sl->customer_coverage = 'Allo'; | |||||
| $sl->customer_category = 'Allo'; | |||||
| $sl->remark_form = ''; | $sl->remark_form = ''; | ||||
| $sl->dealer_id = $request->dealer_id; | $sl->dealer_id = $request->dealer_id; | ||||
| $sl->company_id = $staff->StaffDetail->company_id; | $sl->company_id = $staff->StaffDetail->company_id; |
| public function viewFormAddress($package) { | public function viewFormAddress($package) { | ||||
| $dealer_id = ''; | $dealer_id = ''; | ||||
| $coverage = Coverage::where('Type','R')->orderBy('building_name')->get(); | |||||
| $coverage = Coverage::where('Type','R')->groupBy('building_name')->orderBy('building_name')->get(); | |||||
| return view('sales.form.residential_address', compact('coverage','package','dealer_id')); | return view('sales.form.residential_address', compact('coverage','package','dealer_id')); | ||||
| } | } | ||||
| public function viewFormApplication(Request $request) { | public function viewFormApplication(Request $request) { | ||||
| $data = array(); | $data = array(); | ||||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
| array_push($data, array( | array_push($data, array( | ||||
| 'coverage' => $request->coverage, | |||||
| 'coverage' => $coverage[0]['_id'], | |||||
| 'unit' => $request->unit, | 'unit' => $request->unit, | ||||
| 'street' => $request->street, | 'street' => $request->street, | ||||
| 'package' => $request->package | 'package' => $request->package | ||||
| **/ | **/ | ||||
| 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')->groupBy('building_name')->orderBy('building_name')->get(); | |||||
| $dealer = Staff::where('_id',$dealer_id)->first(); | $dealer = Staff::where('_id',$dealer_id)->first(); | ||||
| return view('sales.form.dealer.residential_address', compact('coverage','package','dealer_id')); | return view('sales.form.dealer.residential_address', compact('coverage','package','dealer_id')); | ||||
| public function viewFormApplicationD(Request $request) { | public function viewFormApplicationD(Request $request) { | ||||
| $data = array(); | $data = array(); | ||||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
| array_push($data, array( | array_push($data, array( | ||||
| 'coverage' => $request->coverage, | |||||
| 'coverage' => $coverage[0]['_id'], | |||||
| 'unit' => $request->unit, | 'unit' => $request->unit, | ||||
| 'street' => $request->street, | 'street' => $request->street, | ||||
| 'package' => $request->package, | 'package' => $request->package, |
| </div> | </div> | ||||
| <div class="grid4"> | <div class="grid4"> | ||||
| <label><b>Street : </b></label> | <label><b>Street : </b></label> | ||||
| <input type="text" name="street" id="street" value="{{ $form->street }}" /> | |||||
| <select id="street" name="street" class="styled" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="grid4"> | <div class="grid4"> | ||||
| <label><b>Street : </b></label> | <label><b>Street : </b></label> | ||||
| <input type="text" name="street" id="street" value="{{ $form->street }}" /> | |||||
| <select id="street" name="street" class="styled" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| </div> | </div> | ||||
| @endsection | @endsection | ||||
| @section('external_js') | @section('external_js') | ||||
| <script type="text/javascript"> | |||||
| $('#building').change(function(){ | |||||
| if( $(this).val()==""){ | |||||
| $("#street").prop("checked", false); | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#street').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#street').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#city').val(d.city); | |||||
| $('#state').val(d.state); | |||||
| $('#postcode').val(d.postcode); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| </script> | |||||
| @endsection | @endsection |
| <label><b>Building<small style="color: red"> * </small>: </b></label> | <label><b>Building<small style="color: red"> * </small>: </b></label> | ||||
| <select class="styled" id="buildingsss" name="buildingsss" required> | <select class="styled" id="buildingsss" name="buildingsss" required> | ||||
| <option value="">Choose building</option> | <option value="">Choose building</option> | ||||
| @foreach($coverage as $c) | |||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| @foreach($coverage as $c) | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| <div class="formRow"> | <div class="formRow"> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| <div class="grid8"> | |||||
| <label><b>Street<small style="color: red"> * </small>: </b></label> | |||||
| <select id="street" name="street" class="styled" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | |||||
| <div class="grid2"> </div> | |||||
| </div> | |||||
| <div class="formRow"> | |||||
| <div class="grid2"> </div> | |||||
| <div class="grid2"><label><b>Package<small style="color: red"> * </small>: </b></label></div> | <div class="grid2"><label><b>Package<small style="color: red"> * </small>: </b></label></div> | ||||
| <div class="grid6"> | <div class="grid6"> | ||||
| <select class="styled" id="package" name="package" required> | <select class="styled" id="package" name="package" required> | ||||
| <label><b>Building<small style="color: red"> * </small>: </b></label> | <label><b>Building<small style="color: red"> * </small>: </b></label> | ||||
| <select class="styled" id="buildingssss" name="buildingssss" required> | <select class="styled" id="buildingssss" name="buildingssss" required> | ||||
| <option value="">Choose building</option> | <option value="">Choose building</option> | ||||
| @foreach($coverage as $c) | |||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| @foreach($coverage as $c) | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| <div class="formRow"> | <div class="formRow"> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| <div class="grid2"><label><b>Street : </b></label></div> | |||||
| <div class="grid6"> | |||||
| <textarea rows="3" cols="" name="street" id="street" class="auto" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 70px;"></textarea> | |||||
| <div class="grid8"> | |||||
| <label><b>Street<small style="color: red"> * </small>: </b></label> | |||||
| <select id="streets" name="streets" class="styled" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| </div> | </div> | ||||
| <div id="formNFSP"> | <div id="formNFSP"> | ||||
| <form action="{{ url('/customer-service/submit-form-secured-developement') }}" class="main cussPayment" method="POST" enctype="multipart/form-data" id="securedForm" name="securedForm"> | <form action="{{ url('/customer-service/submit-form-secured-developement') }}" class="main cussPayment" method="POST" enctype="multipart/form-data" id="securedForm" name="securedForm"> | ||||
| <input type="hidden" name="_token" value="{{ csrf_token() }}"> | <input type="hidden" name="_token" value="{{ csrf_token() }}"> | ||||
| <input type="hidden" name="buildingssss" value="-"> | |||||
| {{-- <input type="hidden" name="buildingssss" value="-"> --}} | |||||
| <input type="hidden" name="citizensss" value="-"> | <input type="hidden" name="citizensss" value="-"> | ||||
| <fieldset> | <fieldset> | ||||
| <div class="widget grid2 widgetH"></div> | <div class="widget grid2 widgetH"></div> | ||||
| <input type="text" name="unit_no" id="unit_no" required /> | <input type="text" name="unit_no" id="unit_no" required /> | ||||
| </div> | </div> | ||||
| <div class="grid4"> | <div class="grid4"> | ||||
| <!-- <label><b>Building<small style="color: red"> * </small>: </b></label> | |||||
| <select class="styled" id="buildingssss" name="buildingssss" required> | |||||
| <label><b>Building<small style="color: red"> * </small>: </b></label> | |||||
| <select class="styled" id="buildingsssss" name="buildingsssss" required> | |||||
| <option value="">Choose building</option> | <option value="">Choose building</option> | ||||
| @foreach($coverage as $c) | |||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| @foreach($coverage as $c) | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> --> | |||||
| </select> | |||||
| </div> | </div> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| </div> | </div> | ||||
| <div class="formRow"> | <div class="formRow"> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| <div class="grid2"><label><b>Street : </b></label></div> | |||||
| <div class="grid6"> | |||||
| <textarea rows="3" cols="" name="street" id="street" class="auto" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 70px;"></textarea> | |||||
| <div class="grid8"> | |||||
| <label><b>Street<small style="color: red"> * </small>: </b></label> | |||||
| <select id="streetss" name="streetss" class="styled" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| <div class="grid2"> </div> | <div class="grid2"> </div> | ||||
| </div> | </div> | ||||
| $('#buildingsss').append($('<option></option>').attr('value', entry.name).text(entry.name)); | $('#buildingsss').append($('<option></option>').attr('value', entry.name).text(entry.name)); | ||||
| }); | }); | ||||
| } | } | ||||
| }); | |||||
| }); | |||||
| $('#buildingsss').change(function(){ | |||||
| if( $(this).val()==""){ | |||||
| $("#street").prop("checked", false); | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#street').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#street').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#city').val(d.city); | |||||
| $('#state').val(d.state); | |||||
| $('#postcode').val(d.postcode); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| //$(".styled, input:radio, input:checkbox, .dataTables_length select").uniform(); | //$(".styled, input:radio, input:checkbox, .dataTables_length select").uniform(); | ||||
| $('#buildingssss').append($('<option></option>').attr('value', entry.name).text(entry.name)); | $('#buildingssss').append($('<option></option>').attr('value', entry.name).text(entry.name)); | ||||
| }); | }); | ||||
| } | } | ||||
| }); | |||||
| }); | |||||
| $('#buildingssss').change(function(){ | |||||
| if( $(this).val()==""){ | |||||
| $("#streets").prop("checked", false); | |||||
| $('#streets').empty(); | |||||
| $('#streets').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#streets').empty(); | |||||
| $('#streets').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#streets').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#streets').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#streets').change(function(){ | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#city').val(d.city); | |||||
| $('#state').val(d.state); | |||||
| $('#postcode').val(d.postcode); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| //$(".styled, input:radio, input:checkbox, .dataTables_length select").uniform(); | //$(".styled, input:radio, input:checkbox, .dataTables_length select").uniform(); | ||||
| }else if($('#type_customer').val() == "formNFSP"){ | }else if($('#type_customer').val() == "formNFSP"){ | ||||
| // }); | // }); | ||||
| //$(".styled, input:radio, input:checkbox, .dataTables_length select").uniform(); | //$(".styled, input:radio, input:checkbox, .dataTables_length select").uniform(); | ||||
| $('#buildingsssss').change(function(){ | |||||
| if( $(this).val()==""){ | |||||
| $("#streetss").prop("checked", false); | |||||
| $('#streetss').empty(); | |||||
| $('#streetss').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#streetss').empty(); | |||||
| $('#streetss').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#streetss').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#streetss').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#city').val(d.city); | |||||
| $('#state').val(d.state); | |||||
| $('#postcode').val(d.postcode); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| } | } | ||||
| }); | }); | ||||
| </div> | </div> | ||||
| <div class="fluid"> | <div class="fluid"> | ||||
| <form action="/Marketing/request-add-commissionB" class="main cussPayment" method="post" enctype="multipart/form-data"> | |||||
| <form action="/marketing/request-add-commissionB" class="main cussPayment" method="post" enctype="multipart/form-data"> | |||||
| <fieldset> | <fieldset> | ||||
| <div class="widget grid2 widgetH"></div> | <div class="widget grid2 widgetH"></div> | ||||
| <div class="widget grid8"> | <div class="widget grid8"> |
| </div> | </div> | ||||
| <div class="fluid"> | <div class="fluid"> | ||||
| <form action="{{ url('/Marketing/request-add-commissionR') }}" class="main cussPayment" method="post" enctype="multipart/form-data"> | |||||
| <form action="{{ url('/marketing/request-add-commissionR') }}" class="main cussPayment" method="post" enctype="multipart/form-data"> | |||||
| <fieldset> | <fieldset> | ||||
| <div class="widget grid2 widgetH"></div> | <div class="widget grid2 widgetH"></div> | ||||
| <div class="widget grid8"> | <div class="widget grid8"> |
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | ||||
| <option value>Select Coverage/Building</option> | <option value>Select Coverage/Building</option> | ||||
| @foreach($coverage as $c) | @foreach($coverage as $c) | ||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| <div class="col-md-12"> | <div class="col-md-12"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label><b>Street</b> <small style="color: red;">*</small></label> | |||||
| <input type="text" name="street" placeholder="Enter your street" class="form-control" required aria-required="true"> | |||||
| <label> | |||||
| <b>Select Your Street</b> | |||||
| <small style="color: red">*</small> | |||||
| </label> | |||||
| <select id="street" name="street" class="form-control" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| $('footer').removeClass('reached-bottom'); | $('footer').removeClass('reached-bottom'); | ||||
| } | } | ||||
| }); | }); | ||||
| $('#coverage').change(function(){ | $('#coverage').change(function(){ | ||||
| if( $(this).val()==""){ | |||||
| $("#street").prop("checked", false); | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#street').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#street').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | $.ajax({ | ||||
| type: "GET", | type: "GET", | ||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | success: function(result){ | ||||
| $.each(result.data, function(i, d) { | $.each(result.data, function(i, d) { | ||||
| $('#city').val(d.city); | $('#city').val(d.city); | ||||
| $('#postcode').val(d.postcode); | $('#postcode').val(d.postcode); | ||||
| }); | }); | ||||
| } | } | ||||
| }); | |||||
| }); | |||||
| }); | }); | ||||
| </script> | </script> | ||||
| <style> | <style> |
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | ||||
| <option value>Select Coverage/Building</option> | <option value>Select Coverage/Building</option> | ||||
| @foreach($coverage as $c) | @foreach($coverage as $c) | ||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="col-md-12"> | <div class="col-md-12"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label><b>Street</b> <small style="color: red;">*</small></label> | |||||
| <input type="text" name="street" placeholder="Enter your street" class="form-control" required aria-required="true"> | |||||
| <label> | |||||
| <b>Select Your Street</b> | |||||
| <small style="color: red">*</small> | |||||
| </label> | |||||
| <select id="street" name="street" class="form-control" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| }); | }); | ||||
| $('#coverage').change(function(){ | $('#coverage').change(function(){ | ||||
| if( $(this).val()==""){ | |||||
| $("#street").prop("checked", false); | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#street').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#street').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | $.ajax({ | ||||
| type: "GET", | type: "GET", | ||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | success: function(result){ | ||||
| $.each(result.data, function(i, d) { | $.each(result.data, function(i, d) { | ||||
| $('#city').val(d.city); | $('#city').val(d.city); | ||||
| $('#postcode').val(d.postcode); | $('#postcode').val(d.postcode); | ||||
| }); | }); | ||||
| } | } | ||||
| }); | |||||
| }); | |||||
| }); | }); | ||||
| </script> | </script> | ||||
| <style> | <style> |
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | ||||
| <option value>Select Coverage/Building</option> | <option value>Select Coverage/Building</option> | ||||
| @foreach($coverage as $c) | @foreach($coverage as $c) | ||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| <div class="col-md-12"> | <div class="col-md-12"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label><b>Street</b> <small style="color: red;">*</small></label> | |||||
| <input type="text" name="street" placeholder="Enter your street" class="form-control" required aria-required="true"> | |||||
| <label> | |||||
| <b>Select Your Street</b> | |||||
| <small style="color: red">*</small> | |||||
| </label> | |||||
| <select id="street" name="street" class="form-control" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| } | } | ||||
| }); | }); | ||||
| $('#coverage').change(function(){ | $('#coverage').change(function(){ | ||||
| if( $(this).val()==""){ | |||||
| $("#street").prop("checked", false); | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#street').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#street').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | $.ajax({ | ||||
| type: "GET", | type: "GET", | ||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | success: function(result){ | ||||
| $.each(result.data, function(i, d) { | $.each(result.data, function(i, d) { | ||||
| $('#city').val(d.city); | $('#city').val(d.city); | ||||
| $('#postcode').val(d.postcode); | $('#postcode').val(d.postcode); | ||||
| }); | }); | ||||
| } | } | ||||
| }); | |||||
| }); | |||||
| }); | }); | ||||
| </script> | </script> | ||||
| <style> | <style> |
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | ||||
| <option value>Select Coverage/Building</option> | <option value>Select Coverage/Building</option> | ||||
| @foreach($coverage as $c) | @foreach($coverage as $c) | ||||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||||
| @endforeach | @endforeach | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="col-md-12"> | <div class="col-md-12"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label><b>Street</b> <small style="color: red;">*</small></label> | |||||
| <input type="text" name="street" placeholder="Enter your street" class="form-control" required aria-required="true"> | |||||
| <label> | |||||
| <b>Select Your Street</b> | |||||
| <small style="color: red">*</small> | |||||
| </label> | |||||
| <select id="street" name="street" class="form-control" required aria-required="true"> | |||||
| <option value>Select Street</option> | |||||
| </select> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| }); | }); | ||||
| $('#coverage').change(function(){ | $('#coverage').change(function(){ | ||||
| if( $(this).val()==""){ | |||||
| $("#street").prop("checked", false); | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| } | |||||
| else { | |||||
| $('#street').empty(); | |||||
| $('#street').append('<option value="">Please choose street</option>'); | |||||
| $.ajax({ | |||||
| type: "GET", | |||||
| url: "{{ url('api/get-street') }}"+"/"+$(this).val(), | |||||
| success: function(result){ | |||||
| $.each(result.data, function(i, d) { | |||||
| $('#street').append('<option value="' + d.street + '">' + d.street + '</option>'); | |||||
| $('#street').prop('required',true); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| $('#street').change(function(){ | |||||
| $.ajax({ | $.ajax({ | ||||
| type: "GET", | type: "GET", | ||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||||
| success: function(result){ | success: function(result){ | ||||
| $.each(result.data, function(i, d) { | $.each(result.data, function(i, d) { | ||||
| $('#city').val(d.city); | $('#city').val(d.city); | ||||
| $('#postcode').val(d.postcode); | $('#postcode').val(d.postcode); | ||||
| }); | }); | ||||
| } | } | ||||
| }); | |||||
| }); | |||||
| }); | }); | ||||
| </script> | </script> | ||||
| <style> | <style> |
| Route::get('/get-data','Api\FormController@get_data_form'); | Route::get('/get-data','Api\FormController@get_data_form'); | ||||
| }); | }); | ||||
| /* | |||||
| |-------------------------------------------------------------------------- | |||||
| | Check Version | |||||
| |-------------------------------------------------------------------------- | |||||
| */ | |||||
| Route::get('/mobile/apps_version', 'Api\AppVersionController@compareVersion'); | |||||
| /* | |||||
| |-------------------------------------------------------------------------- | |||||
| | Residential Form | |||||
| |-------------------------------------------------------------------------- | |||||
| */ | |||||
| Route::get('/get-coverage-detail/{building_name}/{street}', 'Api\Controller@getCoverageDetail'); | |||||
| Route::get('/get-street/{building_name}', 'Api\Controller@getStreet'); | |||||
| /* | |||||
| |-------------------------------------------------------------------------- | |||||
| | Check Version | |||||
| |-------------------------------------------------------------------------- | |||||
| */ | |||||
| Route::get('/mobile/apps_version', 'Api\AppVersionController@compareVersion'); | |||||
| /* | |||||
| |-------------------------------------------------------------------------- | |||||
| | Residential Form | |||||
| |-------------------------------------------------------------------------- | |||||
| */ | |||||
| Route::get('/get-coverage-detail/{building_name}/{street}', 'Api\Controller@getCoverageDetail')->where('street', '.*'); | |||||
| Route::get('/get-street/{building_name}', 'Api\Controller@getStreet'); | |||||
| //test | |||||