update
							parent
							
								
									3e8552d47b
								
							
						
					
					
						commit
						11b7d848f5
					
				|  | @ -953,7 +953,7 @@ if (!function_exists('renderMenu')) { | ||||||
|             // dd($p1->route);
 |             // dd($p1->route);
 | ||||||
| 
 | 
 | ||||||
|             if ($access1) { |             if ($access1) { | ||||||
|                 $active1 = $active ? ' active ' . null : null; |                 $active1 = activeMenuClass($p1->module) ? 'active' : ''; | ||||||
| 
 | 
 | ||||||
|                 $html .= '<li class="' . $ch1 . $active1 . '"><a class="' . $link1 . '" href="' . url($p1->url) . '"><i class="' . $p1->menu_icons . '"></i> <span class="nav-link-text" data-i18n="nav.application_intel">' . @$p1->title.'</span>'; |                 $html .= '<li class="' . $ch1 . $active1 . '"><a class="' . $link1 . '" href="' . url($p1->url) . '"><i class="' . $p1->menu_icons . '"></i> <span class="nav-link-text" data-i18n="nav.application_intel">' . @$p1->title.'</span>'; | ||||||
|                 if (count($child2) > 0) { |                 if (count($child2) > 0) { | ||||||
|  | @ -966,7 +966,7 @@ if (!function_exists('renderMenu')) { | ||||||
|                         $link2 = count($child3) > 0 ? '' : 'menu-link'; |                         $link2 = count($child3) > 0 ? '' : 'menu-link'; | ||||||
|                         if ($access2) { |                         if ($access2) { | ||||||
|                             $active2 = activeMenuClass($p2->module) ? 'active' : ''; |                             $active2 = activeMenuClass($p2->module) ? 'active' : ''; | ||||||
|                             $html .= '<li class="' . $ch2 . '"><a class="' . $link2 . $active2 . '" href="' . url($p2->url) . '"> <i class="' . $p2->menu_icons . '"></i> <span class="nav-link-text" data-i18n="nav.application_intel">' . @$p2->title.'<span>'; |                             $html .= '<li class="' . $ch2 .$active2. '"><a class="' . $link2 . '" href="' . url($p2->url) . '"> <i class="' . $p2->menu_icons . '"></i> <span class="nav-link-text" data-i18n="nav.application_intel">' . @$p2->title.'<span>'; | ||||||
|                             if (count($child3) > 0) { |                             if (count($child3) > 0) { | ||||||
|                                 $html .= '</a>'; |                                 $html .= '</a>'; | ||||||
|                                 $html .= '<ul>'; |                                 $html .= '<ul>'; | ||||||
|  | @ -976,9 +976,9 @@ if (!function_exists('renderMenu')) { | ||||||
|                                     $ch3 = count($child4) > 0 ? '' : ''; |                                     $ch3 = count($child4) > 0 ? '' : ''; | ||||||
|                                     $link3 = count($child4) > 0 ? '' : 'menu-link'; |                                     $link3 = count($child4) > 0 ? '' : 'menu-link'; | ||||||
|                                     if ($access3) { |                                     if ($access3) { | ||||||
|                                         $active2 = activeMenuClass($p3->module) ? 'active' : ''; |                                         $active3 = activeMenuClass($p3->module) ? 'active' : ''; | ||||||
|                                         // $active3 = $active ? ' ' . null : null;
 |                                         // $active3 = $active ? ' ' . null : null;
 | ||||||
|                                         $html .= '<li class="' . $ch3 . '"><a class="' . $link3 . $active3 . '" href="' . url($p3->url) . '"> <span class="nav-link-text" data-i18n="nav.application_intel">' . @$p3->title.'</span>'; |                                         $html .= '<li class="' . $ch3 . $active3.'"><a class="' . $link3 . '" href="' . url($p3->url) . '"> <span class="nav-link-text" data-i18n="nav.application_intel">' . @$p3->title.'</span>'; | ||||||
|                                         if (count($child4) > 0) { |                                         if (count($child4) > 0) { | ||||||
|                                             $html .= '</a>'; |                                             $html .= '</a>'; | ||||||
|                                             $html .= '<ul class="menu-subs">'; |                                             $html .= '<ul class="menu-subs">'; | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ use App\Models\DokumenAdministrasi; | ||||||
| class AdministrasiController extends Controller | class AdministrasiController extends Controller | ||||||
| { | { | ||||||
|     private $template = 'modules.usulan.administrasi'; |     private $template = 'modules.usulan.administrasi'; | ||||||
|     private $route = 'modules.usulan.administrasi'; |     private $route = 'modules.usulan_adiwiyata.administrasi'; | ||||||
|     private $title = 'Usulan Adiwiyata - Dokumen Administrasi'; |     private $title = 'Usulan Adiwiyata - Dokumen Administrasi'; | ||||||
| 
 | 
 | ||||||
|     public function index() |     public function index() | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ class KriteriaController extends Controller | ||||||
| { | { | ||||||
|     protected $title = 'Pemenuhan Kriteria'; |     protected $title = 'Pemenuhan Kriteria'; | ||||||
|     protected $template = 'modules.usulan.kriteria'; |     protected $template = 'modules.usulan.kriteria'; | ||||||
|     protected $route = 'modules.usulan.kriteria'; |     protected $route = 'modules.usulan_adiwiyata.kriteria'; | ||||||
| 
 | 
 | ||||||
|     public function index() |     public function index() | ||||||
|     { |     { | ||||||
|  |  | ||||||
|  | @ -19,7 +19,7 @@ class SKController extends Controller | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
|     private $template = 'modules.usulan.sk'; |     private $template = 'modules.usulan.sk'; | ||||||
|     private $route    = 'modules.usulan.sk'; |     private $route    = 'modules.usulan_adiwiyata.sk'; | ||||||
|     private $title    = 'Penetapan SK'; |     private $title    = 'Penetapan SK'; | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  |  | ||||||
|  | @ -4,15 +4,25 @@ namespace App\Http\Controllers\Modules\Usulan; | ||||||
| 
 | 
 | ||||||
| use App\Http\Controllers\Controller; | use App\Http\Controllers\Controller; | ||||||
| use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||||
|  | use App\Models\Master\Provinsi; | ||||||
| 
 | 
 | ||||||
| class SuratController extends Controller | class SuratController extends Controller | ||||||
| { | { | ||||||
|  |     private $template = 'modules.usulan.surat'; | ||||||
|  |     private $route = 'modules.usulan.surat'; | ||||||
|  |     private $title = 'Surat Usulan';     | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Display a listing of the resource. |      * Display a listing of the resource. | ||||||
|      */ |      */ | ||||||
|     public function index() |     public function index() | ||||||
|     { |     { | ||||||
|         //
 |         $data = []; | ||||||
|  |         $data['title'] = $this->title; | ||||||
|  |         $data['route'] = $this->route; | ||||||
|  |         $data['provinsi'] = Provinsi::where('kode_wilayah','010000')->get(); | ||||||
|  | 
 | ||||||
|  |         return view($this->template.'.index',$data); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | @ -20,7 +30,12 @@ class SuratController extends Controller | ||||||
|      */ |      */ | ||||||
|     public function create() |     public function create() | ||||||
|     { |     { | ||||||
|         //
 |         permission('is_create', $this->route, 'module',true); | ||||||
|  | 
 | ||||||
|  |         $data['title']    = $this->title; | ||||||
|  |         $data['route']    = $this->route; | ||||||
|  | 
 | ||||||
|  |         return view($this->template.'.form',$data); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  |  | ||||||
|  | @ -19,7 +19,7 @@ | ||||||
|     |     | ||||||
|     <div class="ml-auto d-flex"> |     <div class="ml-auto d-flex"> | ||||||
|         <div> |         <div> | ||||||
|             <a href="#" data-toggle="dropdown" title="drlantern@gotbootstrap.com" class="header-icon d-flex align-items-center justify-content-center"> |             <a href="#" data-toggle="dropdown" class="header-icon d-flex align-items-center justify-content-center"> | ||||||
|                 <div class="rounded-circle bg-fusion-50 width-3 height-3 d-inline-block bg-secondary d-flex align-items-center justify-content-center"> |                 <div class="rounded-circle bg-fusion-50 width-3 height-3 d-inline-block bg-secondary d-flex align-items-center justify-content-center"> | ||||||
|                     <i class="fal fa-user fa-1x"></i> |                     <i class="fal fa-user fa-1x"></i> | ||||||
|                 </div> |                 </div> | ||||||
|  |  | ||||||
|  | @ -0,0 +1,89 @@ | ||||||
|  | @extends('layouts.master') | ||||||
|  | @section('page-css') | ||||||
|  | @endsection | ||||||
|  | @section('content') | ||||||
|  | <div class="subheader"> | ||||||
|  |     <h1 class="subheader-title"> | ||||||
|  |         <i class='subheader-icon fal fa-building'></i> Tambah {{$title}} | ||||||
|  |     </h1> | ||||||
|  | </div> | ||||||
|  | <div class="row"> | ||||||
|  |     <div class="col-lg-12"> | ||||||
|  |         <div id="panel-4" class="panel"> | ||||||
|  |             <div class="panel-container show"> | ||||||
|  |                 <div class="panel-content"> | ||||||
|  |                     <form method="POST" action="{{route($route.'.store')}}" enctype="multipart/form-data"> | ||||||
|  |                         {{csrf_field()}} | ||||||
|  |                         <div class="form-group"> | ||||||
|  |                             <label class="label">Judul Usulan</label> | ||||||
|  |                             <input type="text" name="nama" class="form-control"> | ||||||
|  |                             <small class="text-muted"><i>(Opsional)</i></small> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="form-group"> | ||||||
|  |                             <label class="label">Data Tahun</label> | ||||||
|  |                             <input type="text" name="tahun" value="{{date('Y')}}" disabled class="form-control"> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="form-group"> | ||||||
|  |                             <label class="label">Jenis Usulan</label> | ||||||
|  |                             <select class="select2 form-control usulan" name="jenis_usulan" required> | ||||||
|  |                                 <option value="">Pilih Jenis Usulan</option> | ||||||
|  |                                 <option value="1">Adiwiyata Kab/Kota</option> | ||||||
|  |                                 <option value="2">Adiwiyata Provinsi</option> | ||||||
|  |                                 <option value="3">Adiwiyata Nasional</option> | ||||||
|  |                             </select> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="form-group"> | ||||||
|  |                             <label class="label">Pilih Sekolah</label> | ||||||
|  |                             <select class="select2 form-control sekolah" multiple name="sekolah[]" required> | ||||||
|  |                             </select> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="form-group"> | ||||||
|  |                             <label class="label">File Usulan</label> | ||||||
|  |                             <input type="file" name="file" accept=".pdf" class="form-control" required> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="form-group"> | ||||||
|  |                             <button class="btn btn-primary"><i class="fal fa-loading"></i> Proses Data</button> | ||||||
|  |                         </div> | ||||||
|  |                     </form> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | @endsection | ||||||
|  | @section('page-js') | ||||||
|  | <script type="text/javascript"> | ||||||
|  |     $('.usulan').on('change',function(){ | ||||||
|  |         var jenis_usulan = $(this).find(':selected').val(); | ||||||
|  |         let base_url = "{{url('/')}}"; | ||||||
|  |         $.ajax({ | ||||||
|  |             url: base_url+'/getSekolahSK', // Ganti dengan URL API-mu
 | ||||||
|  |             type: 'POST', // Bisa juga 'POST' kalau perlu
 | ||||||
|  |             data: {  | ||||||
|  |                 _token:'{{csrf_token()}}', | ||||||
|  |                 data: jenis_usulan  | ||||||
|  |             }, // Kirim number sebagai parameter
 | ||||||
|  |             dataType: 'json', // Format respons JSON
 | ||||||
|  |             beforeSend: function () { | ||||||
|  |                 $('#loading-spinner').show(); // Menampilkan spinner
 | ||||||
|  |             }, | ||||||
|  |             success: function (response) { | ||||||
|  |                 // toastr.success("Berhasil menyimpan data", 'Success!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'});
 | ||||||
|  | 
 | ||||||
|  |                 let $select = $('.sekolah'); | ||||||
|  |                     $select.empty(); // kosongkan dulu
 | ||||||
|  |                      | ||||||
|  |                     $.each(response, function(index, item) { | ||||||
|  |                         $select.append('<option value="' + item.id + '">' + item.name + '</option>'); | ||||||
|  |                     }); | ||||||
|  |             }, | ||||||
|  |             error: function (xhr, status, error) { | ||||||
|  |                 toastr.error("Maaf Terjadi Kesalahan Menyimpan Data", 'Error!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'}); | ||||||
|  |             }, | ||||||
|  |             complete: function () { | ||||||
|  |                 $('#loading-spinner').hide(); // Sembunyikan spinner setelah request selesai
 | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }); | ||||||
|  | </script> | ||||||
|  | @endsection | ||||||
|  | @ -0,0 +1,271 @@ | ||||||
|  | @extends('layouts.master') | ||||||
|  | @section('page-css') | ||||||
|  | <link rel="stylesheet" media="screen, print" href="{{asset('assets/css/datagrid/datatables/datatables.bundle.css')}}"> | ||||||
|  | <link rel="stylesheet" href="{{asset('assets/css/bootstrap-table.min.css')}}"> | ||||||
|  | @endsection | ||||||
|  | @section('content') | ||||||
|  | <div class="subheader"> | ||||||
|  |     <h1 class="subheader-title"> | ||||||
|  |         <i class='subheader-icon fal fa-building'></i> {{$title}} | ||||||
|  |     </h1> | ||||||
|  | </div> | ||||||
|  | <div class="row"> | ||||||
|  |     <div class="col-lg-12"> | ||||||
|  |         <div class="accordion" id="accordionExample"> | ||||||
|  |           <div class="card"> | ||||||
|  |             <div class="card-header" id="headingOne"> | ||||||
|  |               <h2 class="mb-0"> | ||||||
|  |                 <button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> | ||||||
|  |                   <i class="fal fa-filter"></i> Filter | ||||||
|  |                 </button> | ||||||
|  |               </h2> | ||||||
|  |             </div> | ||||||
|  | 
 | ||||||
|  |             <div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample"> | ||||||
|  |               <div class="card-body"> | ||||||
|  |                 <div class="row"> | ||||||
|  |                     <div class="col-md-12 mb-2"> | ||||||
|  |                         <div class="row"> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select class="form-control select2"> | ||||||
|  |                                         <option value="">-- PILIH TINGKAT --</option> | ||||||
|  |                                         <option value="1">SD</option> | ||||||
|  |                                         <option value="2">SMP</option> | ||||||
|  |                                         <option value="3">SMA</option> | ||||||
|  |                                         <option value="4">SMK</option> | ||||||
|  |                                         <option value="5">MI</option> | ||||||
|  |                                         <option value="6">MTs</option> | ||||||
|  |                                         <option value="7">MA</option> | ||||||
|  |                                         <option value="8">SD LB</option> | ||||||
|  |                                         <option value="9">SMP LB</option> | ||||||
|  |                                         <option value="10">SMA LM</option> | ||||||
|  |                                         <option value="11">SLB Khusus</option> | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select class="form-control select2"> | ||||||
|  |                                         <option value="">-- PILIH STATUS --</option> | ||||||
|  |                                         <option value="Negeri">Negeri</option> | ||||||
|  |                                         <option value="Swasta">Swasta</option> | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select class="form-control select2"> | ||||||
|  |                                         <option value="">-- PILIH LEVEL --</option> | ||||||
|  |                                         <option value="1"> LEVEL 1</option> | ||||||
|  |                                         <option value="2"> LEVEL 2</option> | ||||||
|  |                                         <option value="3"> LEVEL 3</option> | ||||||
|  |                                         <option value="4"> LEVEL 4</option> | ||||||
|  |                                         <option value="5"> LEVEL 5</option> | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select class="form-control select2"> | ||||||
|  |                                         <option value="">-- PILIH JENIS USULAN --</option> | ||||||
|  |                                         <option value="1">Kab/Kota</option> | ||||||
|  |                                         <option value="2">Provinsi</option> | ||||||
|  |                                         <option value="3">Nasional</option> | ||||||
|  |                                         <option value="4">Mandiri</option> | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|  |                     <div class="col-md-12 mb-2"> | ||||||
|  |                         <div class="row"> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select name="provinsi" class="form-control select2" id="provinsi"> | ||||||
|  |                                         <option value="0">- PILIH PROVINSI -</option> | ||||||
|  |                                         @foreach($provinsi as $datProv) | ||||||
|  |                                         <option value="{{encode_id($datProv->MsProvinsiId)}}">{{$datProv->name}}</option> | ||||||
|  |                                         @endforeach | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select name="kabupaten" class="form-control select2" id="kabupaten"> | ||||||
|  |                                         <option value="0">- PILIH KABUPATEN/KOTA -</option> | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <select name="kecamatan" class="form-control select2" id="kecamatan" required> | ||||||
|  |                                         <option value="0">- PILIH KECAMATAN -</option> | ||||||
|  |                                     </select> | ||||||
|  |                                 </div> | ||||||
|  |                             </div>   | ||||||
|  |                             <div class="col-md-3"> | ||||||
|  |                                 <div class="form-group"> | ||||||
|  |                                     <button class="btn btn-warning btn-block"><i class="fal fa-search"></i> Cari Data</button> | ||||||
|  |                                 </div> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |               </div> | ||||||
|  |             </div> | ||||||
|  |           </div> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <div id="panel-4" class="panel"> | ||||||
|  |             <div class="panel-container show"> | ||||||
|  |                 <div class="panel-content"> | ||||||
|  |                     <div id="toolbar"> | ||||||
|  |                         @if(permission('is_create', $route, 'module',true)) | ||||||
|  |                         <a href="{{route($route.'.create')}}" class="btn btn-primary"><i class="fal fa-plus"></i> Tambah {{$title}}</a> | ||||||
|  |                         @endif | ||||||
|  |                     </div> | ||||||
|  | 
 | ||||||
|  |                     <table class="table table-bordered table-hover table-striped w-100"  | ||||||
|  |                     data-search="true" | ||||||
|  |                     data-toggle="table" | ||||||
|  |                     data-pagination="true" | ||||||
|  |                     data-toolbar="#toolbar" | ||||||
|  |                     data-show-refresh="false" | ||||||
|  |                     data-url="{{route($route.'.grid')}}" | ||||||
|  |                     data-sort-name="ids" | ||||||
|  |                     data-sort-order="desc" | ||||||
|  |                     data-page-size="10" | ||||||
|  |                     data-id-field="id" | ||||||
|  |                     id="grid-data"> | ||||||
|  |                       <thead class="text-white"> | ||||||
|  |                         <tr class="table-primary"> | ||||||
|  |                           <th data-field="action">#</th>
 | ||||||
|  |                           <th data-field="no">No</th> | ||||||
|  |                           <th data-field="judul">Judul Surat</th> | ||||||
|  |                           <th data-field="sekolah">Sekolah</th> | ||||||
|  |                           <th data-field="tahun">Tahun</th> | ||||||
|  |                           <th data-field="jenis_usulan">Jenis Usulan</th> | ||||||
|  |                           <th data-field="file">File</th> | ||||||
|  |                         </tr> | ||||||
|  |                       </thead> | ||||||
|  |                       <tbody></tbody> | ||||||
|  |                   </table> | ||||||
|  |                     <!-- datatable end --> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | @endsection | ||||||
|  | @section('page-js') | ||||||
|  | <script src="{{asset('assets/js/datagrid/datatables/datatables.bundle.js')}}"></script> | ||||||
|  | <script src="{{asset('assets/js/bootstrap-table.min.js')}}"></script> | ||||||
|  | <script type="text/javascript"> | ||||||
|  |     $('select').on("select2:selecting", function(e) { | ||||||
|  |               var selectorOrigin = this.id; | ||||||
|  |               var id = e.params.args.data.id; | ||||||
|  |                | ||||||
|  |                | ||||||
|  |               if(selectorOrigin=='provinsi'){ | ||||||
|  |                 $('#loading-spinner').show(); | ||||||
|  |                 clear('kabupaten'); | ||||||
|  |                 selector = 'kabupaten'; | ||||||
|  |                 url_to = 'kabupaten'; | ||||||
|  |                 getSelect(id, selector, url_to); | ||||||
|  |               } | ||||||
|  | 
 | ||||||
|  |               if(selectorOrigin=='kabupaten'){ | ||||||
|  |                 $('#loading-spinner').show(); | ||||||
|  |                 clear('kecamatan'); | ||||||
|  |                 selector = 'kecamatan'; | ||||||
|  |                 url_to = 'kecamatan'; | ||||||
|  |                 getSelect(id, selector, url_to); | ||||||
|  |               } | ||||||
|  |               if(selectorOrigin=='kecamatan'){ | ||||||
|  |                 $('#loading-spinner').show(); | ||||||
|  |                 clear('sekolah'); | ||||||
|  |                 selector = 'sekolah'; | ||||||
|  |                 url_to = 'sekolah'; | ||||||
|  |                 getSelect(id, selector, url_to); | ||||||
|  |               } | ||||||
|  |             }); | ||||||
|  | 
 | ||||||
|  |             function clear(elementId) { | ||||||
|  |               $('#' + elementId).empty(); | ||||||
|  |               $('#' + elementId).select2(); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             function getSelect(id, selectTo, urlTo, selected = "") { | ||||||
|  |                 id = id; | ||||||
|  |                 var base_url = "{{url('/')}}"; | ||||||
|  |                 //alert(id);
 | ||||||
|  |                 destino = "#" + selectTo; | ||||||
|  |                 valor = $('#' + id).find(":selected").val(); | ||||||
|  | 
 | ||||||
|  |                 $.ajax({ | ||||||
|  |                         method: "POST", | ||||||
|  |                         url: base_url + "/get/" + urlTo, | ||||||
|  |                         data: { | ||||||
|  |                         _token: '{{csrf_token()}}', | ||||||
|  |                             id: id | ||||||
|  |                         } | ||||||
|  |                     }).done(function(msg) { | ||||||
|  |                       obj = msg.data; | ||||||
|  | 
 | ||||||
|  |                       if (obj.length > 0) { | ||||||
|  |                         //Clear the current options
 | ||||||
|  |                         $(destino).empty(); | ||||||
|  |                          | ||||||
|  |                         if(selectTo=='kabupaten'){ | ||||||
|  |                           $(destino).append('<option value="">-PILIH KABUPATEN/KOTA-</option>').select2("val", "0"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |                            | ||||||
|  |                           $.each(obj, function(index) { | ||||||
|  |                             value = obj[index].id; | ||||||
|  |                             text = obj[index].name; | ||||||
|  |                             $(destino).append('<option value=' + value + '>' + text + '</option>'); | ||||||
|  |                           }); | ||||||
|  |                           console.log(selected) | ||||||
|  |                           if (selected) { | ||||||
|  |                             $(destino).val(selected).trigger('change'); | ||||||
|  |                             selected = ""; | ||||||
|  |                           } | ||||||
|  |                         } | ||||||
|  | 
 | ||||||
|  |                         if(selectTo=='kecamatan'){ | ||||||
|  |                           $(destino).append('<option value="">-PILIH KECAMATAN-</option>').select2("val", "0"); | ||||||
|  |                            | ||||||
|  |                           $.each(obj, function(index) { | ||||||
|  |                             value = obj[index].id; | ||||||
|  |                             text = obj[index].name; | ||||||
|  |                             $(destino).append('<option value=' + value + '>' + text + '</option>'); | ||||||
|  |                           }); | ||||||
|  |                           console.log(selected) | ||||||
|  |                           if (selected) { | ||||||
|  |                             $(destino).val(selected).trigger('change'); | ||||||
|  |                             selected = ""; | ||||||
|  |                           } | ||||||
|  |                         } | ||||||
|  | 
 | ||||||
|  |                          | ||||||
|  |                       } else { | ||||||
|  | 
 | ||||||
|  |                         if(selectTo=='provinsi'){ | ||||||
|  |                           $(destino).empty().append('<option value="0">-PILIH PROVINSI-</option>').select2("val", "0"); | ||||||
|  |                         } | ||||||
|  |                         if(selectTo=='kabupaten'){ | ||||||
|  |                           $(destino).empty().append('<option value="0">-PILIH KABUPATEN/KOTA-</option>').select2("val", "0"); | ||||||
|  |                         } | ||||||
|  |                         if(selectTo=='kecamatan'){ | ||||||
|  |                           $(destino).empty().append('<option value="0">-PILIH KECAMATAN-</option>').select2("val", "0"); | ||||||
|  |                         } | ||||||
|  |                          | ||||||
|  |                       } | ||||||
|  |                       $('#loading-spinner').hide(); | ||||||
|  |                     }); | ||||||
|  |                   return false; | ||||||
|  |             } | ||||||
|  | </script> | ||||||
|  | @endsection | ||||||
|  | @ -55,13 +55,6 @@ Route::name('kuesioner.')->prefix('kuesioner')->group(function () { | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| Route::name('usulan.')->prefix('usulan')->group(function () { | Route::name('usulan.')->prefix('usulan')->group(function () { | ||||||
|     Route::name('kriteria.')->prefix('kriteria')->group(function () { |  | ||||||
|         Route::get('/',[KriteriaController::class,'index'])->name('index'); |  | ||||||
|         Route::get('/resume/{sekolah_id}',[KriteriaController::class,'resume'])->name('resume'); |  | ||||||
|         Route::get('/progress/{sekolah_id}',[KriteriaController::class,'progress'])->name('progress'); |  | ||||||
|         Route::post('/kirimData/{sekolah_id}/{kuesioner_id}',[KriteriaController::class,'kirimData'])->name('kirimData'); |  | ||||||
|         Route::post('/store',[KriteriaController::class,'store'])->name('store'); |  | ||||||
|     }); |  | ||||||
| 
 | 
 | ||||||
|     Route::name('csak.')->prefix('csak')->group(function () { |     Route::name('csak.')->prefix('csak')->group(function () { | ||||||
|         Route::resource('/',CSAKController::class); |         Route::resource('/',CSAKController::class); | ||||||
|  | @ -90,6 +83,30 @@ Route::name('usulan.')->prefix('usulan')->group(function () { | ||||||
|         Route::get('/grid',[SuratController::class,'grid'])->name('grid'); |         Route::get('/grid',[SuratController::class,'grid'])->name('grid'); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  |      | ||||||
|  | 
 | ||||||
|  |     // Route::name('progress.')->prefix('progress')->group(function () {
 | ||||||
|  |     //     Route::get('/',[ProgressController::class,'index'])->name('index');
 | ||||||
|  |     // });
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |      | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | Route::name('usulan_adiwiyata.')->prefix('usulan/adiwiyata')->group(function () { | ||||||
|  | 
 | ||||||
|  |      Route::name('kriteria.')->prefix('kriteria')->group(function () { | ||||||
|  |         Route::get('/',[KriteriaController::class,'index'])->name('index'); | ||||||
|  |         Route::get('/resume/{sekolah_id}',[KriteriaController::class,'resume'])->name('resume'); | ||||||
|  |         Route::get('/progress/{sekolah_id}',[KriteriaController::class,'progress'])->name('progress'); | ||||||
|  |         Route::post('/kirimData/{sekolah_id}/{kuesioner_id}',[KriteriaController::class,'kirimData'])->name('kirimData'); | ||||||
|  |         Route::post('/store',[KriteriaController::class,'store'])->name('store'); | ||||||
|  |     }); | ||||||
|  |       | ||||||
|  |     Route::name('binaan.')->prefix('binaan')->group(function () { | ||||||
|  |         Route::get('/',[SekolahBinaanController::class,'index'])->name('index'); | ||||||
|  |     }); | ||||||
|  | 
 | ||||||
|     Route::name('administrasi.')->prefix('administrasi')->group(function () { |     Route::name('administrasi.')->prefix('administrasi')->group(function () { | ||||||
|         Route::get('/',[AdministrasiController::class,'index'])->name('index'); |         Route::get('/',[AdministrasiController::class,'index'])->name('index'); | ||||||
|         Route::get('/grid',[AdministrasiController::class,'grid'])->name('grid'); |         Route::get('/grid',[AdministrasiController::class,'grid'])->name('grid'); | ||||||
|  | @ -98,15 +115,6 @@ Route::name('usulan.')->prefix('usulan')->group(function () { | ||||||
|         Route::get('/tolak/{id?}',[AdministrasiController::class,'tolak'])->name('tolak'); |         Route::get('/tolak/{id?}',[AdministrasiController::class,'tolak'])->name('tolak'); | ||||||
|         Route::post('/update',[AdministrasiController::class,'update'])->name('update'); |         Route::post('/update',[AdministrasiController::class,'update'])->name('update'); | ||||||
|     }); |     }); | ||||||
| 
 |  | ||||||
|     // Route::name('progress.')->prefix('progress')->group(function () {
 |  | ||||||
|     //     Route::get('/',[ProgressController::class,'index'])->name('index');
 |  | ||||||
|     // });
 |  | ||||||
| 
 |  | ||||||
|     Route::name('binaan.')->prefix('binaan')->group(function () { |  | ||||||
|         Route::get('/',[SekolahBinaanController::class,'index'])->name('index'); |  | ||||||
|     }); |  | ||||||
| 
 |  | ||||||
|     Route::name('sk.')->prefix('sk')->group(function () { |     Route::name('sk.')->prefix('sk')->group(function () { | ||||||
|         Route::resource('/',SKController::class); |         Route::resource('/',SKController::class); | ||||||
|         Route::get('/grid',[SKController::class,'grid'])->name('grid'); |         Route::get('/grid',[SKController::class,'grid'])->name('grid'); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue