From a0fef38211fdff24f7cf3acae7b580225a554042 Mon Sep 17 00:00:00 2001 From: Ilham Wara Nugroho Date: Mon, 2 Feb 2026 10:47:21 +0700 Subject: [PATCH] update --- app/Exceptions/Handler.php | 1 + .../Auth/CustomLoginController.php | 3 +- .../Auth/CustomRegisterController.php | 14 +- app/Http/Controllers/FrontController.php | 4 +- resources/views/auth/login.blade.php | 307 +++--- resources/views/auth/loginold.blade.php | 138 +++ resources/views/auth/register.blade.php | 871 ++++++++---------- resources/views/auth/registerold.blade.php | 494 ++++++++++ resources/views/include/alertNew.blade.php | 6 + resources/views/layouts/appNew.blade.php | 2 +- resources/views/sekolah.blade.php | 175 +++- resources/views/sekolahold.blade.php | 42 + routes/web.php | 2 +- 13 files changed, 1415 insertions(+), 644 deletions(-) create mode 100644 resources/views/auth/loginold.blade.php create mode 100644 resources/views/auth/registerold.blade.php create mode 100644 resources/views/include/alertNew.blade.php create mode 100644 resources/views/sekolahold.blade.php diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index b1c262c..6032ccf 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -33,6 +33,7 @@ class Handler extends ExceptionHandler protected $dontFlash = [ 'current_password', 'password', + 'register', 'password_confirmation', ]; diff --git a/app/Http/Controllers/Auth/CustomLoginController.php b/app/Http/Controllers/Auth/CustomLoginController.php index d0912b9..6e4303b 100644 --- a/app/Http/Controllers/Auth/CustomLoginController.php +++ b/app/Http/Controllers/Auth/CustomLoginController.php @@ -42,7 +42,8 @@ class CustomLoginController extends Controller if(Auth::check()){ return redirect('dashboard'); } - return view('auth.login'); + $data['title'] = 'Login'; + return view('auth.login',$data); } public function post_login(Request $request) { diff --git a/app/Http/Controllers/Auth/CustomRegisterController.php b/app/Http/Controllers/Auth/CustomRegisterController.php index 93c0cb1..53d4d30 100644 --- a/app/Http/Controllers/Auth/CustomRegisterController.php +++ b/app/Http/Controllers/Auth/CustomRegisterController.php @@ -18,6 +18,10 @@ class CustomRegisterController extends Controller { public function index() { + if(Auth::check()){ + return redirect('dashboard'); + } + $data['title'] = 'Register'; $data['provinsi'] = Provinsi::where('kode_wilayah','010000')->get(); return view('auth.register',$data); } @@ -145,10 +149,12 @@ class CustomRegisterController extends Controller DB::commit(); - return redirect('dashboard')->with([ - 'message' => trans('Selamat datang kembali'), - 'type' => "success" - ]); + return response()->json(['status' => true,'message' => 'Daftar Sekolah Berhasil','type' => 'success']); + + // return redirect('dashboard')->with([ + // 'message' => trans('Selamat datang kembali'), + // 'type' => "success" + // ]); diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index d485288..d40726b 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -8,7 +8,7 @@ use App\Models\Kuesioner; class FrontController extends Controller { - function index() { + function indexOld() { $data['side_kegiatan'] = Kegiatan::orderBy('KegiatanId','DESC')->limit(5)->get(); $data['kegiatan'] = Kegiatan::orderBy('KegiatanId','DESC')->limit(8)->get(); $data['usulan'] = [ @@ -24,7 +24,7 @@ class FrontController extends Controller $data['title'] = 'Beranda'; return view('index',$data); } - function indexNew() { + function index() { $data['side_kegiatan'] = Kegiatan::orderBy('KegiatanId','DESC')->limit(3)->get(); $data['kegiatan'] = Kegiatan::orderBy('KegiatanId','DESC')->limit(8)->get(); $data['usulan'] = [ diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index f3c3657..76fb086 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,138 +1,191 @@ - - - - - - Login - SIDIA Jakarta - - - - - - - - - - - - - - - -
-
-
-
- @include('include.alert') -
-
-
-
- -
-
-
- -
-
-
- {{-- --}} - -
-
-
SIDIA Jakarta
-
-
-
-
- {{csrf_field()}} -
- - -
-
- -
- -
- -
-
-
- -
-
- -
-
- OR -
- -
-
-

- {{date('Y')}} © Dinas Lingkungan Hidup Provinsi DKI Jakarta -

-
-
-
-
- -
-
- -
+@extends('layouts.appNew') +@section('content') +
+ +
+
+
+ + + - - - - - + function handleLogin(event) { + event.preventDefault(); + const btn = document.getElementById('submitBtn'); + const btnText = document.getElementById('btnText'); + const btnIcon = document.getElementById('btnIcon'); + // const errorMsg = document.getElementById('errorMessage'); + + // Feedback loop for UI + btn.disabled = true; + btn.classList.add('opacity-70', 'cursor-not-allowed'); + btnText.textContent = 'Memverifikasi...'; + btnIcon.textContent = 'sync'; + btnIcon.classList.add('animate-spin'); + // errorMsg.classList.add('hidden'); + + document.getElementById('loginForm').submit(); + + + // setTimeout(() => { + // // Mock failure to demonstrate interactivity + // btn.disabled = false; + // btn.classList.remove('opacity-70', 'cursor-not-allowed'); + // btnText.textContent = 'Masuk Sekarang'; + // btnIcon.textContent = 'arrow_forward'; + // btnIcon.classList.remove('animate-spin'); + // errorMsg.classList.remove('hidden'); + // }, 1500); + } + + +@endsection \ No newline at end of file diff --git a/resources/views/auth/loginold.blade.php b/resources/views/auth/loginold.blade.php new file mode 100644 index 0000000..f3c3657 --- /dev/null +++ b/resources/views/auth/loginold.blade.php @@ -0,0 +1,138 @@ + + + + + + Login - SIDIA Jakarta + + + + + + + + + + + + + + + +
+
+
+
+ @include('include.alert') +
+
+
+
+ +
+
+
+ +
+
+
+ {{-- --}} + +
+
+
SIDIA Jakarta
+
+
+
+
+ {{csrf_field()}} +
+ + +
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ OR +
+ +
+
+

+ {{date('Y')}} © Dinas Lingkungan Hidup Provinsi DKI Jakarta +

+
+
+
+
+ +
+
+ +
+
+
+
+
+ + + + + + diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 3c740b1..a9215ef 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,494 +1,419 @@ - - - - - - Register - SIDIA Jakarta - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- @include('include.alert') -
-
-
-
- -
-
-
-
-
- {{-- --}} - -
-
-
SIDIA Jakarta
-
-
-
-
- {{csrf_field()}} -
- -
-
- -
- - @error('provinsi') - {{$message}} - @enderror -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
- - @error('tingkat_sekolah') - {{$message}} - @enderror -
-
-
- -
- - @error('name') - {{$message}} - @enderror -
-
-
- - - @error('kontak_person') - {{$message}} - @enderror -
- -
+@extends('layouts.appNew') +@section('css') + +@endsection +@section('content') +
+ + +
+
+

Daftar Sebagai Sekolah Adiwiyata

+
+ +
+
+

Identitas Sekolah

+ Langkah 1 dari 4 +
+
+
+
+
+
+
+
+
+
+
-
- -
- -
- -
    - @error('npsn') - {{$message}} - @enderror -
    -
    - -
    - -
    - - @error('status_sekolah') - {{$message}} - @enderror -
    -
    -
    - - - @error('alamat_sekolah') - {{$message}} - @enderror -
    - -
    - - - @error('telp') - {{$message}} - @enderror -
    - - - -
    + + + {{ csrf_field() }} + +
    + +
    + +
    -
    + +
      -
      - - - @error('email') - {{$message}} - @enderror - * Pastikan email benar dan aktif, akses aplikasi akan dikirim ke email yang didaftarkan. -
      + {{-- --}} + {{-- --}} +
      +

      Data nama dan tingkat sekolah akan terisi otomatis dari Dapodik/EMIS.

      +
      -
      - -
      - -
      - -
      -
      - @error('password') - {{$message}} - @enderror -
      - Kata Sandi harus mengandung Minimal 8 karakter, maksimal 15 karakter,
      setidaknya 1 huruf kecil dan huruf besar, angka dan simbol -
      -
      - -
      - Dengan ini menyatakan bahwa isian registrasi diatas sudah benar. - @error('check') - {{$message}} - @enderror -
      -
      -
      - -
      -
      -
      - - Sudah punya akun? Login - -
      - -
      - -
      - -
      -
      -
      - -
      - -

      - {{date('Y')}} © Dinas Lingkungan Hidup Provinsi DKI Jakarta -

      -
      -
      -
      +
      + + + + + + + + + + + + + +
      + +
      + + +
      + + +
      +

      Sudah memiliki akun? Masuk di sini

      - - - - + {{-- --}} + - - + function prevStep() { + if (currentStep > 1) { + currentStep--; + updateUI(); + } + } + + function fetchSchoolData() { + const npsn = document.getElementById('npsn').value; + const btn = document.getElementById('btn-fetch'); + const autoFill = document.getElementById('auto-fill-data'); + + if (npsn.length === 8) { + btn.innerHTML = `sync Tunggu...`; + btn.disabled = true; + + // Simulate API call + setTimeout(() => { + autoFill.classList.remove('hidden'); + btn.innerHTML = `check_circle Terdata`; + btn.classList.replace('bg-emerald-600', 'bg-blue-600'); + + // Specific Mock Data for Jakarta + const names = ["SDN MENTENG 01", "SMP NEGERI 1 JAKARTA", "SMA NEGERI 8 JAKARTA", "SMK NEGERI 26 JAKARTA"]; + const levels = ["Sekolah Dasar (SD) • Negeri", "Menengah Pertama (SMP) • Negeri", "Menengah Atas (SMA) • Negeri", "Kejuruan (SMK) • Negeri"]; + const idx = Math.floor(Math.random() * names.length); + + document.getElementById('display-school-name').innerText = names[idx]; + document.getElementById('display-school-type').innerText = levels[idx]; + }, 1200); + } else { + alert("NPSN harus 8 digit."); + } + } + + function checkStrength() { + const pwd = document.getElementById('password').value; + const bar = document.getElementById('strength-bar'); + const text = document.getElementById('strength-text'); + + if (pwd.length === 0) { + bar.style.width = '0%'; + text.innerText = 'Sandi Kosong'; + text.className = 'text-xs font-bold text-slate-400 mt-1 uppercase tracking-tighter'; + } else if (pwd.length < 6) { + bar.style.width = '30%'; + bar.className = 'h-full bg-red-500 transition-all'; + text.innerText = 'Sandi Lemah'; + text.className = 'text-xs font-bold text-red-500 mt-1 uppercase tracking-tighter'; + } else if (pwd.length < 10) { + bar.style.width = '60%'; + bar.className = 'h-full bg-amber-500 transition-all'; + text.innerText = 'Sandi Sedang'; + text.className = 'text-xs font-bold text-amber-500 mt-1 uppercase tracking-tighter'; + } else { + bar.style.width = '100%'; + bar.className = 'h-full bg-emerald-500 transition-all'; + text.innerText = 'Sandi Sangat Kuat'; + text.className = 'text-xs font-bold text-emerald-500 mt-1 uppercase tracking-tighter'; + } + } + + function togglePassword() { + const input = document.getElementById('password'); + const icon = document.getElementById('toggle-pwd'); + if (input.type === 'password') { + input.type = 'text'; + icon.innerText = 'visibility_off'; + } else { + input.type = 'password'; + icon.innerText = 'visibility'; + } + } + + + + form.addEventListener('submit', (e) => { + e.preventDefault(); + if (!document.getElementById('terms').checked) { + alert("Mohon setujui Syarat & Ketentuan."); + return; + } + $.ajax({ + url: "{{ url('register') }}", + type: "POST", + xhrFields: { + withCredentials: true + }, + data: $(form).serialize(), // 🔥 serialize di sini + success: function(response) { + $('#errorMessage').addClass('hidden'); + document.getElementById('success-modal').classList.remove('hidden'); + },error:function(xhr){ + let res = xhr.responseJSON; + $('#errorMessage').removeClass('hidden'); + $('.message').html(res.message); + } + }); + }); + + // Styles for animations + const style = document.createElement('style'); + style.textContent = ` + @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } + @keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } } + `; + document.head.appendChild(style); + +@endsection \ No newline at end of file diff --git a/resources/views/auth/registerold.blade.php b/resources/views/auth/registerold.blade.php new file mode 100644 index 0000000..3c740b1 --- /dev/null +++ b/resources/views/auth/registerold.blade.php @@ -0,0 +1,494 @@ + + + + + + Register - SIDIA Jakarta + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      + @include('include.alert') +
      +
      +
      +
      + +
      +
      +
      +
      +
      + {{-- --}} + +
      +
      +
      SIDIA Jakarta
      +
      +
      +
      +
      + {{csrf_field()}} +
      + +
      +
      + +
      + + @error('provinsi') + {{$message}} + @enderror +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      +
      +
      + +
      + + @error('tingkat_sekolah') + {{$message}} + @enderror +
      +
      +
      + +
      + + @error('name') + {{$message}} + @enderror +
      +
      +
      + + + @error('kontak_person') + {{$message}} + @enderror +
      + +
      + +
      + +
      + +
      + +
        + @error('npsn') + {{$message}} + @enderror +
        +
        + +
        + +
        + + @error('status_sekolah') + {{$message}} + @enderror +
        +
        +
        + + + @error('alamat_sekolah') + {{$message}} + @enderror +
        + +
        + + + @error('telp') + {{$message}} + @enderror +
        + + + +
        + +
        + +
        + + + @error('email') + {{$message}} + @enderror + * Pastikan email benar dan aktif, akses aplikasi akan dikirim ke email yang didaftarkan. +
        + +
        + +
        + +
        + +
        +
        + @error('password') + {{$message}} + @enderror +
        + Kata Sandi harus mengandung Minimal 8 karakter, maksimal 15 karakter,
        setidaknya 1 huruf kecil dan huruf besar, angka dan simbol +
        +
        + +
        + Dengan ini menyatakan bahwa isian registrasi diatas sudah benar. + @error('check') + {{$message}} + @enderror +
        +
        +
        + +
        +
        +
        + + Sudah punya akun? Login + +
        + +
        + +
        + +
        +
        +
        + +
        +
        +

        + {{date('Y')}} © Dinas Lingkungan Hidup Provinsi DKI Jakarta +

        +
        +
        +
        +
        +
        +
        +
        +
        + + + + + + diff --git a/resources/views/include/alertNew.blade.php b/resources/views/include/alertNew.blade.php new file mode 100644 index 0000000..55eaf23 --- /dev/null +++ b/resources/views/include/alertNew.blade.php @@ -0,0 +1,6 @@ +@if(session()->get('type')=='error') +
        + error + Username atau password salah. Silakan coba lagi. +
        +@endif \ No newline at end of file diff --git a/resources/views/layouts/appNew.blade.php b/resources/views/layouts/appNew.blade.php index 8dc7b0c..8b037ea 100644 --- a/resources/views/layouts/appNew.blade.php +++ b/resources/views/layouts/appNew.blade.php @@ -145,7 +145,7 @@ Kegiatan Sekolah Adiwiyata Galeri
        - Masuk login + Masuk login
        diff --git a/resources/views/sekolah.blade.php b/resources/views/sekolah.blade.php index 26b94f4..198440a 100644 --- a/resources/views/sekolah.blade.php +++ b/resources/views/sekolah.blade.php @@ -1,42 +1,147 @@ -@extends('layouts.app') +@extends('layouts.appNew') @section('title',@$title) @section('css') - @endsection @section('content') -
        -
        -

        {{@$title}}

        -
        -
        - - - - - - - - - - - -
        NoSekolahKotaTahunSkor
        -
        -
        +
        +
        +
        +

        Direktori Sekolah Adiwiyata

        +

        Cari dan filter sekolah-sekolah di Jakarta yang telah berhasil meraih predikat Adiwiyata.

        +
        + + +
        +
        + search + +
        +
        + + +
        +
        + + +
        +
        + + Nasional + +
        +

        SMAN 62 JAKARTA

        +

        + location_on Jakarta Timur +

        +
        +
        +
        + + Provinsi + +
        +

        SMAN 9 JAKARTA

        +

        + location_on Jakarta Timur +

        +
        +
        +
        + + Kota + +
        +

        SDS Merpati

        +

        + location_on Jakarta Pusat +

        +
        +
        +
        + + Nasional + +
        +

        MAN 4 JAKARTA

        +

        + location_on Jakarta Selatan +

        +
        +
        +
        + + Mandiri + +
        +

        SDN Rambutan 03 Pagi

        +

        + location_on Jakarta Timur +

        +
        +
        +
        + + Provinsi + +
        +

        SMPN 23 JAKARTA

        +

        + location_on Jakarta Utara +

        +
        +
        +
        + + Nasional + +
        +

        SMAN 42 JAKARTA

        +

        + location_on Jakarta Timur +

        +
        +
        +
        + + Kota + +
        +

        SDN 01 Grogol

        +

        + location_on Jakarta Barat +

        +
        +
        +
        + + Provinsi + +
        +

        SMAN 1 JAKARTA

        +

        + location_on Jakarta Pusat +

        +
        +
        + +
        + +
        +
        +
        @endsection @section('js') - - @endsection \ No newline at end of file diff --git a/resources/views/sekolahold.blade.php b/resources/views/sekolahold.blade.php new file mode 100644 index 0000000..1bcca71 --- /dev/null +++ b/resources/views/sekolahold.blade.php @@ -0,0 +1,42 @@ +@extends('layouts.app') +@section('title',@$title) +@section('css') + +@endsection +@section('content') +
        +
        +

        {{@$title}}

        +
        +
        + + + + + + + + + + + +
        NoSekolahKotaTahunSkor
        +
        +
        +@endsection +@section('js') + + +@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 9fcb01c..954ff9e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -51,7 +51,7 @@ Route::middleware([Session::class])->name('modules.')->group(function () { }); Route::get('/',[FrontController::class,'index'])->name('index'); -Route::get('/new',[FrontController::class,'indexNew'])->name('indexNew'); +// Route::get('/new',[FrontController::class,'indexNew'])->name('indexNew'); Route::get('/sekolah',[FrontController::class,'sekolah'])->name('sekolah'); Route::get('/kegiatan',[FrontController::class,'kegiatan'])->name('kegiatan'); Route::get('/kegiatan/{slug}',[FrontController::class,'kegiatan_detail'])->name('kegiatan_detail');