| @@ -8,10 +8,10 @@ use App\Model\Coverage; | |||
| class Controller extends BaseController | |||
| { | |||
| public function getCoverageDetail($id) | |||
| public function getCoverageDetail($building_name,$street) | |||
| { | |||
| $data = array(); | |||
| $coverage = Coverage::where('_id',$id)->get(); | |||
| $coverage = Coverage::where('building_name',$building_name)->where('street',$street)->get(); | |||
| if(!empty($coverage)){ | |||
| foreach ($coverage as $key => $c) { | |||
| array_push($data, array( | |||
| @@ -24,5 +24,20 @@ class Controller extends BaseController | |||
| }else{ | |||
| 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'); | |||
| } | |||
| } | |||
| } | |||
| @@ -77,7 +77,7 @@ class WorkOrderController extends Controller | |||
| $w = WorkOrder::where('wo',$wo)->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(); | |||
| if(empty($installer)){ | |||
| @@ -2,8 +2,7 @@ | |||
| namespace App\Http\Controllers; | |||
| use App\Model\Form; | |||
| use App\Model\WorkOrder; | |||
| use App\Model\Coverage; | |||
| use Illuminate\Foundation\Bus\DispatchesJobs; | |||
| use Illuminate\Routing\Controller as BaseController; | |||
| use Illuminate\Foundation\Validation\ValidatesRequests; | |||
| @@ -19,11 +18,27 @@ class Controller extends BaseController | |||
| if ($response->success == true) { | |||
| 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{ | |||
| } | |||
| } | |||
| @@ -50,7 +50,7 @@ class CustomerController extends Controller | |||
| $ss = count(WorkOrder::where('status','Suspend')->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(); | |||
| return view('customer-service.view_customer',compact('user','pp','sp','rs','ss','cm','coverage','company')); | |||
| @@ -441,7 +441,7 @@ class CustomerController extends Controller | |||
| $ss = count(WorkOrder::where('status','Suspend')->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(); | |||
| return view('customer-service.edit_subscriber',compact('user','pp','sp','rs','ss','cm','form','coverage')); | |||
| } | |||
| @@ -457,14 +457,11 @@ class CustomerController extends Controller | |||
| 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)){ | |||
| $building = $cov->building_name; | |||
| $street = $cov->street; | |||
| $postcode = $cov->postcode; | |||
| $city = $cov->city; | |||
| $state = $cov->state; | |||
| @@ -499,10 +496,11 @@ class CustomerController extends Controller | |||
| $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)){ | |||
| $building = $cov->building_name; | |||
| $street = $cov->street; | |||
| $postcode = $cov->postcode; | |||
| $city = $cov->city; | |||
| $state = $cov->state; | |||
| @@ -689,7 +687,7 @@ class CustomerController extends Controller | |||
| $re = count(Form::where('type_application','R')->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(); | |||
| return view('customer-service.view_subscriber', compact('user','pp','sp','rs','ss','cm','rec','re','bu','coverage','company')); | |||
| @@ -72,7 +72,7 @@ class WorkOrderController extends Controller | |||
| $w = WorkOrder::where('wo',$wo)->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 != ''){ | |||
| $company = Company::where('_id',$w->contractor_id)->first(); | |||
| @@ -193,7 +193,7 @@ class WorkOrderController extends Controller | |||
| $w = WorkOrder::where('wo',$wo)->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(); | |||
| return view('customer-service.confirm_work_order', compact('user','pp','sp','rs','ss','cm','pc','pi','form','coverage','wo','company')); | |||
| @@ -210,7 +210,7 @@ class WorkOrderController extends Controller | |||
| $ss = count(WorkOrder::where('status','Suspend')->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(); | |||
| return view('customer-service.view_wo_formR', compact('user','pp','sp','rs','ss','cm','pc','pi','coverage','product')); | |||
| @@ -1468,7 +1468,7 @@ class WorkOrderController extends Controller | |||
| $su_id = strtoupper('CBB-'.$this->random_code(6).'R'); | |||
| } 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->subscriber_id = $su_id; | |||
| @@ -1482,7 +1482,7 @@ class WorkOrderController extends Controller | |||
| $sdl->phone2 = $request->phone2; | |||
| $sdl->unit_no = $request->unit_no; | |||
| $sdl->building_name = $coverage->building_name; | |||
| $sdl->street = $request->street; | |||
| $sdl->street = $coverage->street; | |||
| $sdl->postcode = $coverage->postcode; | |||
| $sdl->city = $coverage->city; | |||
| $sdl->state = $coverage->state; | |||
| @@ -1639,15 +1639,22 @@ class WorkOrderController extends Controller | |||
| '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)){ | |||
| $building = $coverage->building_name; | |||
| $building = $coverage->building_name; | |||
| $street = $coverage->street; | |||
| $postcode = $coverage->postcode; | |||
| $city = $coverage->city; | |||
| $state = $coverage->state; | |||
| }else { | |||
| $building = $request->buildingssss; | |||
| $building = $request->buildingssss; | |||
| $street = '-'; | |||
| $postcode = '-'; | |||
| $city = '-'; | |||
| $state = '-'; | |||
| @@ -1665,7 +1672,7 @@ class WorkOrderController extends Controller | |||
| $sdl->phone2 = $request->phone2; | |||
| $sdl->unit_no = $request->unit_no; | |||
| $sdl->building_name = $building; | |||
| $sdl->street = $request->street; | |||
| $sdl->street = $street; | |||
| $sdl->postcode = $postcode; | |||
| $sdl->city = $city; | |||
| $sdl->state = $state; | |||
| @@ -51,15 +51,18 @@ class BusinessController extends Controller | |||
| public function viewFormAddress($package) { | |||
| $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')); | |||
| } | |||
| public function viewFormApplication(Request $request) { | |||
| $data = array(); | |||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||
| array_push($data, array( | |||
| 'coverage' => $request->coverage, | |||
| 'coverage' => $coverage[0]['_id'], | |||
| 'unit' => $request->unit, | |||
| 'street' => $request->street, | |||
| 'package' => $request->package | |||
| @@ -242,7 +245,7 @@ class BusinessController extends Controller | |||
| 'project_type' => $coverage->project_type, | |||
| 'status_payment' => 'paid', | |||
| 'status_email' => 'unverified', | |||
| 'customer_coverage' => 'Allo', | |||
| 'customer_category' => 'Allo', | |||
| 'remark_form' => '' | |||
| ]); | |||
| @@ -304,15 +307,17 @@ class BusinessController extends Controller | |||
| ***/ | |||
| 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')); | |||
| } | |||
| public function viewFormApplicationD(Request $request) { | |||
| $data = array(); | |||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||
| array_push($data, array( | |||
| 'coverage' => $request->coverage, | |||
| 'coverage' => $coverage[0]['_id'], | |||
| 'unit' => $request->unit, | |||
| 'street' => $request->street, | |||
| 'package' => $request->package, | |||
| @@ -517,7 +522,7 @@ class BusinessController extends Controller | |||
| $sl->project_type = $coverage->project_type; | |||
| $sl->status_payment = 'paid'; | |||
| $sl->status_email = 'unverified'; | |||
| $sl->customer_coverage = 'Allo'; | |||
| $sl->customer_category = 'Allo'; | |||
| $sl->remark_form = ''; | |||
| $sl->dealer_id = $request->dealer_id; | |||
| $sl->company_id = $staff->StaffDetail->company_id; | |||
| @@ -62,15 +62,16 @@ class ResidentialController extends Controller | |||
| public function viewFormAddress($package) { | |||
| $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')); | |||
| } | |||
| public function viewFormApplication(Request $request) { | |||
| $data = array(); | |||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||
| array_push($data, array( | |||
| 'coverage' => $request->coverage, | |||
| 'coverage' => $coverage[0]['_id'], | |||
| 'unit' => $request->unit, | |||
| 'street' => $request->street, | |||
| 'package' => $request->package | |||
| @@ -324,7 +325,7 @@ class ResidentialController extends Controller | |||
| **/ | |||
| 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(); | |||
| return view('sales.form.dealer.residential_address', compact('coverage','package','dealer_id')); | |||
| @@ -332,9 +333,10 @@ class ResidentialController extends Controller | |||
| public function viewFormApplicationD(Request $request) { | |||
| $data = array(); | |||
| $coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||
| array_push($data, array( | |||
| 'coverage' => $request->coverage, | |||
| 'coverage' => $coverage[0]['_id'], | |||
| 'unit' => $request->unit, | |||
| 'street' => $request->street, | |||
| 'package' => $request->package, | |||
| @@ -139,7 +139,9 @@ | |||
| </div> | |||
| <div class="grid4"> | |||
| <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 class="grid2"> </div> | |||
| </div> | |||
| @@ -304,7 +306,9 @@ | |||
| </div> | |||
| <div class="grid4"> | |||
| <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 class="grid2"> </div> | |||
| </div> | |||
| @@ -394,4 +398,41 @@ | |||
| @endsection | |||
| @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 | |||
| @@ -143,8 +143,8 @@ | |||
| <label><b>Building<small style="color: red"> * </small>: </b></label> | |||
| <select class="styled" id="buildingsss" name="buildingsss" required> | |||
| <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 | |||
| </select> | |||
| </div> | |||
| @@ -153,6 +153,17 @@ | |||
| <div class="formRow"> | |||
| <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="grid6"> | |||
| <select class="styled" id="package" name="package" required> | |||
| @@ -536,8 +547,8 @@ | |||
| <label><b>Building<small style="color: red"> * </small>: </b></label> | |||
| <select class="styled" id="buildingssss" name="buildingssss" required> | |||
| <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 | |||
| </select> | |||
| </div> | |||
| @@ -546,9 +557,11 @@ | |||
| <div class="formRow"> | |||
| <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 class="grid2"> </div> | |||
| </div> | |||
| @@ -605,7 +618,7 @@ | |||
| <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"> | |||
| <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="-"> | |||
| <fieldset> | |||
| <div class="widget grid2 widgetH"></div> | |||
| @@ -942,22 +955,24 @@ | |||
| <input type="text" name="unit_no" id="unit_no" required /> | |||
| </div> | |||
| <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> | |||
| @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 | |||
| </select> --> | |||
| </select> | |||
| </div> | |||
| <div class="grid2"> </div> | |||
| </div> | |||
| <div class="formRow"> | |||
| <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 class="grid2"> </div> | |||
| </div> | |||
| @@ -1051,7 +1066,43 @@ | |||
| $('#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(); | |||
| @@ -1076,7 +1127,43 @@ | |||
| $('#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(); | |||
| }else if($('#type_customer').val() == "formNFSP"){ | |||
| @@ -1104,6 +1191,42 @@ | |||
| // }); | |||
| //$(".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); | |||
| }); | |||
| } | |||
| }); | |||
| }); | |||
| } | |||
| }); | |||
| @@ -32,7 +32,7 @@ | |||
| </div> | |||
| <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> | |||
| <div class="widget grid2 widgetH"></div> | |||
| <div class="widget grid8"> | |||
| @@ -32,7 +32,7 @@ | |||
| </div> | |||
| <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> | |||
| <div class="widget grid2 widgetH"></div> | |||
| <div class="widget grid8"> | |||
| @@ -178,7 +178,7 @@ | |||
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | |||
| <option value>Select Coverage/Building</option> | |||
| @foreach($coverage as $c) | |||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||
| @endforeach | |||
| </select> | |||
| </div> | |||
| @@ -186,8 +186,13 @@ | |||
| <div class="col-md-12"> | |||
| <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> | |||
| @@ -375,11 +380,34 @@ | |||
| $('footer').removeClass('reached-bottom'); | |||
| } | |||
| }); | |||
| $('#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({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#city').val(d.city); | |||
| @@ -387,7 +415,7 @@ | |||
| $('#postcode').val(d.postcode); | |||
| }); | |||
| } | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||
| <style> | |||
| @@ -179,16 +179,21 @@ | |||
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | |||
| <option value>Select Coverage/Building</option> | |||
| @foreach($coverage as $c) | |||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||
| @endforeach | |||
| </select> | |||
| </div> | |||
| </div> | |||
| <div class="col-md-12"> | |||
| <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> | |||
| @@ -377,9 +382,32 @@ | |||
| }); | |||
| $('#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({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#city').val(d.city); | |||
| @@ -387,7 +415,7 @@ | |||
| $('#postcode').val(d.postcode); | |||
| }); | |||
| } | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||
| <style> | |||
| @@ -178,7 +178,7 @@ | |||
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | |||
| <option value>Select Coverage/Building</option> | |||
| @foreach($coverage as $c) | |||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||
| @endforeach | |||
| </select> | |||
| </div> | |||
| @@ -186,8 +186,13 @@ | |||
| <div class="col-md-12"> | |||
| <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> | |||
| @@ -376,9 +381,32 @@ | |||
| } | |||
| }); | |||
| $('#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({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#city').val(d.city); | |||
| @@ -386,7 +414,7 @@ | |||
| $('#postcode').val(d.postcode); | |||
| }); | |||
| } | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||
| <style> | |||
| @@ -179,16 +179,21 @@ | |||
| <select id="coverage" name="coverage" class="form-control" required aria-required="true"> | |||
| <option value>Select Coverage/Building</option> | |||
| @foreach($coverage as $c) | |||
| <option value="{{ $c->_id }}">{{ $c->building_name }}</option> | |||
| <option value="{{ $c->building_name }}">{{ $c->building_name }}</option> | |||
| @endforeach | |||
| </select> | |||
| </div> | |||
| </div> | |||
| <div class="col-md-12"> | |||
| <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> | |||
| @@ -377,9 +382,32 @@ | |||
| }); | |||
| $('#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({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$(this).val(), | |||
| url: "{{ url('api/get-coverage-detail') }}"+"/"+$('#coverage').val()+"/"+$('#street').val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#city').val(d.city); | |||
| @@ -387,7 +415,7 @@ | |||
| $('#postcode').val(d.postcode); | |||
| }); | |||
| } | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||
| <style> | |||
| @@ -52,19 +52,19 @@ Route::group(['middleware' => 'mobileapps'], function() { | |||
| 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 | |||