| @@ -521,7 +521,7 @@ class CompoundResourceController extends BaseController | |||
| // } | |||
| $this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri)); | |||
| array_push($data, array('kpd' => $kpd)); | |||
| $this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama)); | |||
| // $this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama)); | |||
| return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!'); | |||
| // } | |||
| @@ -265,6 +265,7 @@ class DepartmentController extends BaseController | |||
| array_push($nested_data, array( | |||
| 'jbkod' => $n1.$jabatan, | |||
| 'akkod' => $k->DeedLaw->akkod, | |||
| 'nakkod' => $k->DeedLaw->nama, | |||
| 'sketr' => $k->sketr, | |||
| 'nama' => $k->nama, | |||
| 'amount14' => $k->amount_before_14, | |||
| @@ -479,7 +479,7 @@ class CompoundController extends Controller | |||
| $fileData = [ | |||
| 'no_siri' => $no_siri, | |||
| ]; | |||
| if($request->jenisKompaun == 'Parkir'){ | |||
| $compoundData = [ | |||
| 'jenis' => 'Parkir', | |||
| @@ -514,7 +514,7 @@ class CompoundController extends Controller | |||
| ]; | |||
| }else if($request->jenisKompaun == 'Pelbagai_KT'){ | |||
| $compoundData = [ | |||
| 'jenis' => 'Pelbagai', | |||
| 'jenis' => 'Pelbagai_KT', | |||
| 'kpd' => $kpd, | |||
| 'nama' => $request->namaP, | |||
| 'identity' => $request->noIc, | |||
| @@ -544,7 +544,7 @@ class CompoundController extends Controller | |||
| ]; | |||
| }else if($request->jenisKompaun == 'Pelbagai_JPB'){ | |||
| $compoundData = [ | |||
| 'jenis' => 'Pelbagai', | |||
| 'jenis' => 'Pelbagai_JPB', | |||
| 'kpd' => $kpd, | |||
| 'nama' => $request->namaP, | |||
| 'identity' => $request->noIc, | |||
| @@ -574,7 +574,7 @@ class CompoundController extends Controller | |||
| ]; | |||
| }else if($request->jenisKompaun == 'Pelbagai_PA'){ | |||
| $compoundData = [ | |||
| 'jenis' => 'Pelbagai', | |||
| 'jenis' => 'Pelbagai_PA', | |||
| 'kpd' => $kpd, | |||
| 'nama' => $request->namaP, | |||
| 'identity' => $request->noIc, | |||
| @@ -604,7 +604,7 @@ class CompoundController extends Controller | |||
| ]; | |||
| }else if($request->jenisKompaun == 'Pelbagai_LESEN'){ | |||
| $compoundData = [ | |||
| 'jenis' => 'Pelbagai', | |||
| 'jenis' => 'Pelbagai_LESEN', | |||
| 'kpd' => $kpd, | |||
| 'nama' => $request->namaP, | |||
| 'identity' => $request->noIc, | |||
| @@ -184,6 +184,23 @@ class StaffController extends Controller | |||
| $staff = Staff::with('StaffDetail')->where('_id', $request->_id)->first(); | |||
| if(!empty($staff)) { | |||
| $current_password = $staff->password; | |||
| if($request->has('password')){ | |||
| $validator = Validator::make($request->all(), [ | |||
| 'password' => 'min:8|confirmed', | |||
| ]); | |||
| if ($validator->fails()) { | |||
| return redirect()->back()->withInput()->withErrors($validator); | |||
| } | |||
| $current_password = Hash::make($request->get('password')); | |||
| $staff->password = $current_password; | |||
| $staff->save(); | |||
| $staff->StaffDetail->password = $current_password; | |||
| $staff->StaffDetail->save(); | |||
| } | |||
| if($request->hasfile('profil')){ | |||
| $destinationPath = 'uploads/profile'; | |||
| $uploaded = public_path().'/'.$destinationPath; | |||
| @@ -2,7 +2,7 @@ | |||
| <input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" /> | |||
| <input type="hidden" name="Latlong" value="-" /> | |||
| <input type="hidden" name="no_plate" value="-" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai_JPB" /> | |||
| <div class="row clearfix"> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> | |||
| @@ -28,7 +28,7 @@ | |||
| <label for="subject"><b>Seksyen Kesalahan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <select id="seksyen" name="seksyen" class="js-section form-control" multiple="multiple" required> | |||
| <select id="seksyen2" name="seksyen" class="js-section form-control" multiple="multiple" required> | |||
| <option value="">Sila pilih seksyen kesalahan</option> | |||
| @foreach($faulty as $f) | |||
| <option value="{{ $f->_id }}">[{{ $f->sketr }}] {{$f->nama}}</option> | |||
| @@ -44,7 +44,7 @@ | |||
| <label for="subject"><b>Jabatan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <select id="jabatan" name="jabatan" class="form-control" required=""> | |||
| <select id="jabatan2" name="jabatan" class="form-control" required=""> | |||
| <option value="">Sila pilih jabatan</option> | |||
| </select> | |||
| </div> | |||
| @@ -54,7 +54,7 @@ | |||
| <label for="subject"><b>Akta Kesalahan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="akta" name="akta" class="form-control" placeholder="Nama yang dikompaunkan" value="-" readonly=""> | |||
| <input type="text" id="akta2" name="akta" class="form-control" placeholder="Nama yang dikompaunkan" value="-" readonly=""> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -2,7 +2,7 @@ | |||
| <input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" /> | |||
| <input type="hidden" name="Latlong" value="-" /> | |||
| <input type="hidden" name="no_plate" value="-" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai_KT" /> | |||
| <div class="row clearfix"> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> | |||
| @@ -28,7 +28,7 @@ | |||
| <label for="subject"><b>Seksyen Kesalahan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <select id="seksyen" name="seksyen" class="js-section form-control" multiple="multiple" required> | |||
| <select id="seksyen3" name="seksyen" class="js-section form-control" multiple="multiple" required> | |||
| <option value="">Sila pilih seksyen kesalahan</option> | |||
| @foreach($faulty as $f) | |||
| <option value="{{ $f->_id }}">[{{ $f->sketr }}] {{$f->nama}}</option> | |||
| @@ -44,7 +44,7 @@ | |||
| <label for="subject"><b>Jabatan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <select id="jabatan" name="jabatan" class="form-control" required=""> | |||
| <select id="jabatan3" name="jabatan" class="form-control" required=""> | |||
| <option value="">Sila pilih jabatan</option> | |||
| </select> | |||
| </div> | |||
| @@ -54,7 +54,7 @@ | |||
| <label for="subject"><b>Akta Kesalahan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="akta" name="akta" class="form-control" value="-" readonly=""> | |||
| <input type="text" id="akta3" name="akta" class="form-control" value="-" readonly=""> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -2,7 +2,7 @@ | |||
| <input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" /> | |||
| <input type="hidden" name="Latlong" value="-" /> | |||
| <input type="hidden" name="no_plate" value="-" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai_LESEN" /> | |||
| <div class="row clearfix"> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> | |||
| @@ -28,7 +28,7 @@ | |||
| <label for="subject"><b>Seksyen Kesalahan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <select id="seksyen" name="seksyen" class="js-section form-control" multiple="multiple" required> | |||
| <select id="seksyen4" name="seksyen" class="js-section form-control" multiple="multiple" required> | |||
| <option value="">Sila pilih seksyen kesalahan</option> | |||
| @foreach($faulty as $f) | |||
| <option value="{{ $f->_id }}">[{{ $f->sketr }}] {{$f->nama}}</option> | |||
| @@ -44,7 +44,7 @@ | |||
| <label for="subject"><b>Jabatan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <select id="jabatan" name="jabatan" class="form-control" required=""> | |||
| <select id="jabatan4" name="jabatan" class="form-control" required=""> | |||
| <option value="">Sila pilih jabatan</option> | |||
| </select> | |||
| </div> | |||
| @@ -54,7 +54,7 @@ | |||
| <label for="subject"><b>Akta Kesalahan <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="akta" name="akta" class="form-control" value="-" readonly=""> | |||
| <input type="text" id="akta4" name="akta" class="form-control" value="-" readonly=""> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -2,7 +2,7 @@ | |||
| <input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" /> | |||
| <input type="hidden" name="Latlong" value="-" /> | |||
| <input type="hidden" name="no_plate" value="-" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai" /> | |||
| <input type="hidden" name="jenisKompaun" value="Pelbagai_PA" /> | |||
| <div class="row clearfix"> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> | |||
| @@ -157,7 +157,31 @@ | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| }else if($('#type_C').val() == "Pelbagai_JPB"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_KT"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_PA"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_LESEN"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| console.log(SITEURL +'/api/list/compound'+ queryString1); | |||
| console.log(SITEURL +'/api/list/compound'+ queryString2); | |||
| @@ -237,6 +237,105 @@ | |||
| } | |||
| }); | |||
| $('#seksyen2').change(function(){ | |||
| if( $(this).val()==""){ | |||
| $("#jabatan2").prop("checked", false); | |||
| $('#jabatan2').empty(); | |||
| $('#jabatan2').append('<option value="">Sila pilih jabatan</option>'); | |||
| $("#akta2").val('-'); | |||
| } | |||
| else { | |||
| $('#jabatan2').empty(); | |||
| $('#jabatan2').append('<option value="">Sila pilih jabatan</option>'); | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: "{{ url('api/filter-department-based-faulty') }}"+"/"+$(this).val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#jabatan2').append('<option value="' + d._id + '">' + d.nama + '</option>'); | |||
| $('#jabatan2').prop('required',true); | |||
| }); | |||
| } | |||
| }); | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-deedlaw-based-faulty') }}"+"/"+$(this).val(), | |||
| success: function(result){ | |||
| $("#akta2").val(result.data); | |||
| } | |||
| }); | |||
| } | |||
| }); | |||
| $('#seksyen3').change(function(){ | |||
| if( $(this).val()==""){ | |||
| $("#jabatan3").prop("checked", false); | |||
| $('#jabatan3').empty(); | |||
| $('#jabatan3').append('<option value="">Sila pilih jabatan</option>'); | |||
| $("#akta3").val('-'); | |||
| } | |||
| else { | |||
| $('#jabatan3').empty(); | |||
| $('#jabatan3').append('<option value="">Sila pilih jabatan</option>'); | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: "{{ url('api/filter-department-based-faulty') }}"+"/"+$(this).val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#jabatan3').append('<option value="' + d._id + '">' + d.nama + '</option>'); | |||
| $('#jabatan3').prop('required',true); | |||
| }); | |||
| } | |||
| }); | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-deedlaw-based-faulty') }}"+"/"+$(this).val(), | |||
| success: function(result){ | |||
| $("#akta3").val(result.data); | |||
| } | |||
| }); | |||
| } | |||
| }); | |||
| $('#seksyen4').change(function(){ | |||
| if( $(this).val()==""){ | |||
| $("#jabatan4").prop("checked", false); | |||
| $('#jabatan4').empty(); | |||
| $('#jabatan4').append('<option value="">Sila pilih jabatan</option>'); | |||
| $("#akta4").val('-'); | |||
| } | |||
| else { | |||
| $('#jabatan4').empty(); | |||
| $('#jabatan4').append('<option value="">Sila pilih jabatan</option>'); | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: "{{ url('api/filter-department-based-faulty') }}"+"/"+$(this).val(), | |||
| success: function(result){ | |||
| $.each(result.data, function(i, d) { | |||
| $('#jabatan4').append('<option value="' + d._id + '">' + d.nama + '</option>'); | |||
| $('#jabatan4').prop('required',true); | |||
| }); | |||
| } | |||
| }); | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: "{{ url('api/get-deedlaw-based-faulty') }}"+"/"+$(this).val(), | |||
| success: function(result){ | |||
| $("#akta4").val(result.data); | |||
| } | |||
| }); | |||
| } | |||
| }); | |||
| $('#jenis').change(function(){ | |||
| if( $(this).val()==""){ | |||
| $('#petak').hide(); | |||
| @@ -158,7 +158,31 @@ | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| }else if($('#type_C').val() == "Pelbagai_JPB"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_KT"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_PA"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_LESEN"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| console.log(SITEURL +'/api/list/compound'+ queryString1); | |||
| console.log(SITEURL +'/api/list/compound'+ queryString2); | |||
| @@ -158,7 +158,31 @@ | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| }else if($('#type_C').val() == "Pelbagai_JPB"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_KT"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_PA"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_LESEN"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| console.log(SITEURL +'/api/list/compound'+ queryString1); | |||
| console.log(SITEURL +'/api/list/compound'+ queryString2); | |||
| @@ -219,7 +219,31 @@ | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| }else if($('#type_C').val() == "Pelbagai_JPB"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_KT"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_PA"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_LESEN"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| console.log(SITEURL +'/api/list/compound'+ queryString1); | |||
| console.log(SITEURL +'/api/list/compound'+ queryString2); | |||
| @@ -158,7 +158,31 @@ | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| }else if($('#type_C').val() == "Pelbagai_JPB"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_KT"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_PA"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| }else if($('#type_C').val() == "Pelbagai_LESEN"){ | |||
| queryString2 = '?'+form_data; | |||
| $('#viewPelbagai').show(); | |||
| $('#viewParkir').hide(); | |||
| tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
| } | |||
| console.log(SITEURL +'/api/list/compound'+ queryString1); | |||
| console.log(SITEURL +'/api/list/compound'+ queryString2); | |||
| @@ -197,7 +197,7 @@ | |||
| </div> | |||
| </div> --> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 7 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_14" name="amount_14" class="form-control" placeholder="100" value="{{ old('amount_14') }}" required> | |||
| @@ -205,7 +205,7 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 30 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_30" name="amount_30" class="form-control" placeholder="250" value="{{ old('amount_30') }}" required> | |||
| @@ -97,6 +97,7 @@ | |||
| <tr> | |||
| <th>JbKod</th> | |||
| <th>AkKod</th> | |||
| <th>nAkKod</th> | |||
| <th>Seksyen</th> | |||
| <th>Nama</th> | |||
| <th width="60">Kadar 7</th> | |||
| @@ -109,6 +110,7 @@ | |||
| <tr> | |||
| <th>JbKod</th> | |||
| <th>AkKod</th> | |||
| <th>nAkKod</th> | |||
| <th>Seksyen</th> | |||
| <th>Nama</th> | |||
| <th width="60">Kadar 7</th> | |||
| @@ -211,7 +213,7 @@ | |||
| </div> | |||
| </div> --> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 7 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_14" name="amount_14" class="form-control" placeholder="100" value="{{ old('amount_14') }}" required> | |||
| @@ -219,7 +221,7 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 30 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_30" name="amount_30" class="form-control" placeholder="250" value="{{ old('amount_30') }}" required> | |||
| @@ -335,7 +337,7 @@ | |||
| </div> | |||
| </div> --> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 7 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_141" name="amount_14" class="form-control" placeholder="100" value="{{ old('amount_14') }}" required> | |||
| @@ -343,7 +345,7 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 30 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_301" name="amount_30" class="form-control" placeholder="250" value="{{ old('amount_30') }}" required> | |||
| @@ -384,15 +386,16 @@ | |||
| } | |||
| }); | |||
| var groupColumn = 2; | |||
| var table = $('#faulty').DataTable({ | |||
| "ordering": false, | |||
| "serverSide": true, | |||
| "processing": true, | |||
| "autoWidth": false, | |||
| "ajax": "{{ url('api/faulty/list') }}", | |||
| "ajax": "{{ url('api/faulty/list') }}/{{ $user->_id}}", | |||
| "columns": [ | |||
| { "data": "jbkod", "name": "jbkod"}, | |||
| { "data": "akkod","name": "akkod"}, | |||
| { "data": "nakkod","name": "nakkod"}, | |||
| { "data": "sketr", "name": "sketr" }, | |||
| { "data": "nama", "name": "nama"}, | |||
| { "data": "amount14", "name": "amount14"}, | |||
| @@ -416,12 +419,28 @@ | |||
| "render": function ( data, type, row ) { | |||
| var link = "{{ url('/main/faulty') }}"+"/"+row.itkod+"/edit"; | |||
| return '<div class="btn-group btn-group-sm" style="float: none;"><a onclick="getDetail(\''+data+'\')" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Seksyen/Kesalahan"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.sketr + '\')" data-toggle="tooltip" data-placement="top" title="Buang Seksyen/Kesalahan" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;"><span class="icofont icofont-ui-delete" style="color:white"></span></a></div>'; | |||
| // <a href="'+link+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Seksyen/Kesalahan"><span class="icofont icofont-ui-edit" style="color:white"></span></a> | |||
| }, | |||
| "targets": 7, | |||
| "targets": 8, | |||
| }, | |||
| ], | |||
| { "visible": false, "targets": 2 } | |||
| ], | |||
| "order": [[ groupColumn, 'asc' ]], | |||
| "displayLength": 25, | |||
| "drawCallback": function ( settings ) { | |||
| var api = this.api(); | |||
| var rows = api.rows( {page:'current'} ).nodes(); | |||
| var last=null; | |||
| api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) { | |||
| if ( last !== group ) { | |||
| $(rows).eq( i ).before( | |||
| '<tr class="group" style="background-color: #f8f8f8; color: #333; text-align:center"><td colspan="8"><b>'+group+'</b></td></tr>' | |||
| ); | |||
| last = group; | |||
| } | |||
| } ); | |||
| }, | |||
| "language": { | |||
| "paginate": { | |||
| "previous": "Sebelum", | |||
| @@ -436,6 +455,17 @@ | |||
| } | |||
| }); | |||
| // Order by the grouping | |||
| $('#faulty tbody').on( 'click', 'tr.group', function () { | |||
| var currentOrder = table.order()[0]; | |||
| if ( currentOrder[0] === groupColumn && currentOrder[1] === 'asc' ) { | |||
| table.order( [ groupColumn, 'desc' ] ).draw(); | |||
| } | |||
| else { | |||
| table.order( [ groupColumn, 'asc' ] ).draw(); | |||
| } | |||
| }); | |||
| function deleteA(cid,kesalahan) { | |||
| var cid = cid; | |||
| var kesalahan = kesalahan; | |||
| @@ -468,7 +498,7 @@ | |||
| closeOnConfirm: true | |||
| }, | |||
| function(){ | |||
| table.ajax.url("{{ url('api/faulty/list') }}").load(); | |||
| table.ajax.url("{{ url('api/faulty/list') }}/{{ $user->_id}}").load(); | |||
| }); | |||
| }else if(data['status'] == "false"){ | |||
| swal({ | |||
| @@ -480,7 +510,7 @@ | |||
| closeOnConfirm: true | |||
| }, | |||
| function(){ | |||
| table.ajax.url("{{ url('api/faulty/list') }}").load(); | |||
| table.ajax.url("{{ url('api/faulty/list') }}/{{ $user->_id}}").load(); | |||
| }); | |||
| } | |||
| }, | |||
| @@ -539,61 +569,6 @@ | |||
| $('[data-toggle="tooltip"]').tooltip(); | |||
| }); | |||
| // $('#jbkod').change(function(){ | |||
| // if( $(this).val()==""){ | |||
| // $('#showAkta').hide(); | |||
| // $("#akkod").prop("checked", false); | |||
| // $('#akkod').empty(); | |||
| // $('#akkod').append('<option value="">Sila pilih akta/uuk</option>'); | |||
| // } | |||
| // else { | |||
| // $("#akkod").empty(); | |||
| // $('#akkod').append('<option value="">Sila pilih akta/uuk</option>'); | |||
| // $.ajax({ | |||
| // type: "GET", | |||
| // url: "{{ url('api/deed-law') }}"+"/"+$(this).val()+"/list", | |||
| // success: function(result){ | |||
| // $.each(result.data, function(i, d) { | |||
| // $('#akkod').append('<option value="' + d.akkod + '">' + d.nama + '</option>'); | |||
| // $('#showAkta').show(); | |||
| // $('#akkod').prop('required',true); | |||
| // }); | |||
| // } | |||
| // }); | |||
| // } | |||
| // }); | |||
| // $('#jbkod1').change(function(){ | |||
| // if( $(this).val()==""){ | |||
| // $('#showAkta1').hide(); | |||
| // $("#akkod1").prop("checked", false); | |||
| // $('#akkod1').empty(); | |||
| // $('#akkod1').append('<option value="">Sila pilih akta/uuk</option>'); | |||
| // } | |||
| // else { | |||
| // $("#akkod1").empty(); | |||
| // $('#akkod1').append('<option value="">Sila pilih akta/uuk</option>'); | |||
| // $.ajax({ | |||
| // type: "GET", | |||
| // url: "{{ url('api/deed-law') }}"+"/"+$(this).val()+"/list", | |||
| // success: function(result){ | |||
| // $.each(result.data, function(i, d) { | |||
| // if(akkod == d.akkod){ | |||
| // $('#akkod1').append('<option value="' + d.akkod + '" selected>' + d.nama + '</option>'); | |||
| // }else{ | |||
| // $('#akkod1').append('<option value="' + d.akkod + '">' + d.nama + '</option>'); | |||
| // } | |||
| // $('#showAkta1').show(); | |||
| // $('#akkod1').prop('required',true); | |||
| // }); | |||
| // } | |||
| // }); | |||
| // } | |||
| // }); | |||
| // Multi Select | |||
| $(".js-department-multiple").select2(); | |||
| }); | |||
| @@ -228,7 +228,29 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"></div> | |||
| </div> | |||
| </div> | |||
| @if($user->no_badan == 'developer' || $user->roles_access == 'Ketua Jabatan') | |||
| <div class="row clearfix"> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kata-Laluan</b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="password" name="password" class="form-control" value=""> | |||
| <code>Sila biarkan kosong jika tidak perlu | minimum 8</code> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Tulis Semula Kata Laluan</b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="password_confirmation" name="password_confirmation" class="form-control" value=""> | |||
| <code>Sila biarkan kosong jika tidak perlu | minimum 8</code> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @endif | |||
| <hr> | |||
| <div class="row clearfix"> | |||
| <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> | |||
| @@ -211,7 +211,7 @@ | |||
| </div> | |||
| </div> --> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 7 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_14" name="amount_14" class="form-control" placeholder="100" value="{{ old('amount_14') }}" required> | |||
| @@ -219,7 +219,7 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 30 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_30" name="amount_30" class="form-control" placeholder="250" value="{{ old('amount_30') }}" required> | |||
| @@ -335,7 +335,7 @@ | |||
| </div> | |||
| </div> --> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 7 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_141" name="amount_14" class="form-control" placeholder="100" value="{{ old('amount_14') }}" required> | |||
| @@ -343,7 +343,7 @@ | |||
| </div> | |||
| </div> | |||
| <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> | |||
| <label for="subject"><b>Kadar Sebelum 30 Hari <code>*</code></b></label> | |||
| <label for="subject"><b>Kadar Sebelum 14 Hari <code>*</code></b></label> | |||
| <div class="form-group"> | |||
| <div class="form-line"> | |||
| <input type="text" id="amount_301" name="amount_30" class="form-control" placeholder="250" value="{{ old('amount_30') }}" required> | |||
| @@ -46,7 +46,7 @@ Route::group(['middleware' => 'mobileapps'], function() { | |||
| /*------------------------------------------------------------------------- | |||
| | Faulty | |||
| |-------------------------------------------------------------------------*/ | |||
| Route::get('/faulty/list', 'Api\DepartmentController@faultyList'); | |||
| Route::get('/faulty/list/{id}', 'Api\DepartmentController@faultyList'); | |||
| Route::get('/officer/{jbkod}/faulty/list', 'Api\DepartmentController@officerFaultyList'); | |||
| Route::get('/faulty/{jbkod}/{akkod}/list', 'Api\DepartmentController@faultyListFilter'); | |||
| Route::post('/faulty/detail', 'Api\DepartmentController@faultyDetail'); | |||