fix(ui): enhance qr modal responsive orientation controls and convert super admin user forms to landscape

This commit is contained in:
Ray1111-aa
2026-10-28 10:55:06 +07:00
parent 0e705d8644
commit 7058cc57c6
3 changed files with 859 additions and 737 deletions
+139 -77
View File
@@ -288,23 +288,43 @@
</div> </div>
<!-- ========================================================================= --> <!-- ========================================================================= -->
<!-- MODAL: TAMBAH PENGGUNA BARU --> <!-- MODAL: TAMBAH PENGGUNA BARU (LANDSCAPE 2 KOLOM) -->
<!-- ========================================================================= --> <!-- ========================================================================= -->
<div id="createUserModal" data-backdrop="static" class="fixed inset-0 z-50 hidden overflow-y-auto bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4"> <div id="createUserModal" data-backdrop="static" class="fixed inset-0 z-50 hidden overflow-y-auto bg-slate-900/60 backdrop-blur-sm p-3 sm:p-5">
<div class="bg-white rounded-2xl max-w-lg w-full shadow-2xl overflow-hidden animate-scale-in"> <div class="min-h-full flex items-center justify-center py-4 sm:py-6">
<div class="px-6 py-4 border-b border-slate-100 flex items-center justify-between"> <div class="bg-white rounded-3xl max-w-4xl w-full shadow-2xl overflow-hidden border border-slate-100 flex flex-col max-h-[92vh] my-auto animate-scale-in">
<h3 class="text-sm font-bold text-slate-800 flex items-center gap-2"> <!-- Header Modal (Pinned at Top) -->
<i class="fa-solid fa-user-plus text-indigo-600"></i> <div class="px-6 py-4 border-b border-slate-100 flex items-center justify-between flex-shrink-0 bg-white">
Tambah Pengguna Baru <div class="flex items-center space-x-3">
</h3> <div class="w-10 h-10 rounded-2xl bg-indigo-50 text-indigo-600 flex items-center justify-center font-bold text-base border border-indigo-200/60 shadow-2xs">
<button type="button" onclick="closeCreateUserModal()" class="text-slate-400 hover:text-slate-600"> <i class="fa-solid fa-user-plus"></i>
<i class="fa-solid fa-xmark text-base"></i> </div>
<div>
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Tambah Pengguna Baru</h3>
<p class="text-xs text-slate-500">Pendaftaran akun akses sistem & integrasi data profil personil/anggota</p>
</div>
</div>
<button type="button" onclick="closeCreateUserModal()" class="text-slate-400 hover:text-slate-600 p-1.5 rounded-lg hover:bg-slate-100 transition cursor-pointer">
<i class="fa-solid fa-xmark text-lg"></i>
</button> </button>
</div> </div>
<form action="{{ route('admin.users.store') }}" method="POST" enctype="multipart/form-data" class="p-6 space-y-4"> <!-- Form Body (Scrollable & Landscape 2-Column Grid) -->
<form action="{{ route('admin.users.store') }}" method="POST" enctype="multipart/form-data" class="flex flex-col flex-1 min-h-0">
@csrf @csrf
<div class="overflow-y-auto flex-1 p-5 sm:p-6 space-y-5">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 items-start">
<!-- KOLOM KIRI: Kredensial & Akun Login -->
<div class="space-y-4 bg-slate-50/70 p-4 sm:p-5 rounded-2xl border border-slate-200/80">
<div class="flex items-center justify-between pb-2.5 border-b border-slate-200/80">
<span class="text-xs font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1.5">
<i class="fa-solid fa-shield-halved text-indigo-600"></i>
1. Kredensial & Akun Login
</span>
<span class="text-[10px] text-amber-700 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 font-semibold">Wajib Diisi</span>
</div>
<!-- Upload Foto Profil (Opsional) --> <!-- Upload Foto Profil (Opsional) -->
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna (Opsional)</label> <label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna (Opsional)</label>
@@ -327,49 +347,50 @@
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Nama Lengkap *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Nama Lengkap *</label>
<input type="text" name="name" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="Contoh: Ahmad Rizky"> <input type="text" name="name" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="Contoh: Ahmad Rizky">
</div> </div>
<div class="grid grid-cols-2 gap-3"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">NIK (Nomor Induk Karyawan) *</label> <label class="block text-xs font-bold text-slate-700 mb-1">NIK (Nomor Induk Karyawan) *</label>
<input type="text" name="username" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white font-mono" placeholder="Contoh: KMH-2026-101"> <input type="text" name="username" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white font-mono" placeholder="Contoh: KMH-2026-101">
</div> </div>
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Email *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Email *</label>
<input type="email" name="email" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="[email protected]"> <input type="email" name="email" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="[email protected]">
</div> </div>
</div> </div>
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Password *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Password *</label>
<input type="password" name="password" required minlength="6" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="Minimal 6 karakter"> <input type="password" name="password" required minlength="6" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="Minimal 6 karakter">
</div> </div>
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Role RBAC *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Role RBAC *</label>
<select name="role" id="create_role" onchange="handleUserRoleChange(this.value, 'create')" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white"> <select name="role" id="create_role" onchange="handleUserRoleChange(this.value, 'create')" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white cursor-pointer font-medium text-slate-800">
<option value="">-- Pilih Role --</option> <option value="">-- Pilih Role --</option>
@foreach($roles as $role) @foreach($roles as $role)
<option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option> <option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
<!-- Section: Data Profil Karyawan & Penugasan (Selaras Master HSE) -->
<div class="pt-3 border-t border-slate-100 space-y-3">
<div class="flex items-center justify-between">
<label class="text-xs font-bold text-slate-700 flex items-center gap-1.5">
<i class="fa-solid fa-id-badge text-indigo-600"></i>
<span>Data Profil Karyawan & Penugasan</span>
</label>
<span class="text-[10px] text-slate-400 font-medium">(Opsional)</span>
</div> </div>
<div class="grid grid-cols-2 gap-3"> <!-- KOLOM KANAN: Data Profil Karyawan & Penugasan -->
<div class="space-y-4 bg-slate-50/70 p-4 sm:p-5 rounded-2xl border border-slate-200/80">
<div class="flex items-center justify-between pb-2.5 border-b border-slate-200/80">
<span class="text-xs font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1.5">
<i class="fa-solid fa-id-badge text-emerald-600"></i>
2. Profil Personil & Penugasan
</span>
<span class="text-[10px] text-emerald-700 bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200 font-semibold">Sinkron Master HSE</span>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Jenis Personil</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Jenis Personil</label>
<select name="employee_type" id="create_employee_type" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700"> <select name="employee_type" id="create_employee_type" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700 cursor-pointer">
<option value="karyawan">Karyawan (Internal KMH)</option> <option value="karyawan">Karyawan (Internal KMH)</option>
<option value="sukon">Sukon (Subkontraktor)</option> <option value="sukon">Sukon (Subkontraktor)</option>
</select> </select>
@@ -380,61 +401,91 @@
name="unit_kerja" name="unit_kerja"
id="create_unit_kerja" id="create_unit_kerja"
list="adminUnitKerjaSuggestions" list="adminUnitKerjaSuggestions"
class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700"
placeholder="Ketik atau pilih unit kerja..."> placeholder="Ketik atau pilih unit kerja...">
</div> </div>
</div> </div>
<div class="grid grid-cols-2 gap-3"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Divisi</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Divisi</label>
<input type="text" name="division" id="create_division" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Operasi / Keuangan"> <input type="text" name="division" id="create_division" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Operasi / Keuangan">
</div> </div>
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Posisi / Jabatan</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Posisi / Jabatan</label>
<input type="text" name="position" id="create_position" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Driver / Staff Finance"> <input type="text" name="position" id="create_position" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Driver / Anggota / Staff">
</div> </div>
</div> </div>
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Operator / Driver</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Operator / Driver</label>
<select name="is_operator" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700"> <select name="is_operator" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700 cursor-pointer">
<option value="0">TIDAK (Bukan Driver)</option> <option value="0">TIDAK (Bukan Driver)</option>
<option value="1">YA (Aktif Mengemudi)</option> <option value="1">YA (Aktif Mengemudi)</option>
</select> </select>
</div> </div>
<div class="p-3 bg-white rounded-xl border border-slate-200 text-[11px] text-slate-600 flex items-start gap-2.5">
<i class="fa-solid fa-circle-info text-indigo-500 mt-0.5 flex-shrink-0"></i>
<span class="leading-relaxed">Data profil personil otomatis terintegrasi ke Master Karyawan HSE, modul SIMPER pengemudi, serta pencatatan pergerakan armada / gate.</span>
</div>
</div>
</div>
</div> </div>
<div class="pt-4 border-t border-slate-100 flex items-center justify-end gap-2.5"> <!-- Footer Modal (Pinned at Bottom) -->
<button type="button" onclick="closeCreateUserModal()" class="px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-600 rounded-xl text-xs font-bold transition"> <div class="px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-2.5 bg-slate-50/80 flex-shrink-0">
<button type="button" onclick="closeCreateUserModal()" class="px-4 py-2 bg-white hover:bg-slate-100 border border-slate-200 text-slate-700 rounded-xl text-xs font-bold transition cursor-pointer">
Batal Batal
</button> </button>
<button type="submit" class="px-5 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-bold shadow-sm transition"> <button type="submit" class="px-5 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-bold shadow-sm transition cursor-pointer flex items-center gap-1.5">
Simpan Pengguna <i class="fa-solid fa-check"></i>
<span>Simpan Pengguna</span>
</button> </button>
</div> </div>
</form> </form>
</div> </div>
</div>
</div> </div>
<!-- ========================================================================= --> <!-- ========================================================================= -->
<!-- MODAL: EDIT PENGGUNA --> <!-- MODAL: EDIT PENGGUNA (LANDSCAPE 2 KOLOM + DIRECT PERMISSIONS) -->
<!-- ========================================================================= --> <!-- ========================================================================= -->
<div id="editUserModal" data-backdrop="static" class="fixed inset-0 z-50 hidden overflow-y-auto bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4"> <div id="editUserModal" data-backdrop="static" class="fixed inset-0 z-50 hidden overflow-y-auto bg-slate-900/60 backdrop-blur-sm p-3 sm:p-5">
<div class="bg-white rounded-2xl max-w-lg w-full shadow-2xl overflow-hidden animate-scale-in"> <div class="min-h-full flex items-center justify-center py-4 sm:py-6">
<div class="px-6 py-4 border-b border-slate-100 flex items-center justify-between"> <div class="bg-white rounded-3xl max-w-4xl w-full shadow-2xl overflow-hidden border border-slate-100 flex flex-col max-h-[92vh] my-auto animate-scale-in">
<h3 class="text-sm font-bold text-slate-800 flex items-center gap-2"> <!-- Header Modal (Pinned at Top) -->
<i class="fa-solid fa-user-pen text-indigo-600"></i> <div class="px-6 py-4 border-b border-slate-100 flex items-center justify-between flex-shrink-0 bg-white">
Edit Data Pengguna <div class="flex items-center space-x-3">
</h3> <div class="w-10 h-10 rounded-2xl bg-indigo-50 text-indigo-600 flex items-center justify-center font-bold text-base border border-indigo-200/60 shadow-2xs">
<button type="button" onclick="closeEditUserModal()" class="text-slate-400 hover:text-slate-600"> <i class="fa-solid fa-user-pen"></i>
<i class="fa-solid fa-xmark text-base"></i> </div>
<div>
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Edit Data Pengguna</h3>
<p class="text-xs text-slate-500">Perbarui identitas akun, profil personil/anggota, serta izin wewenang sistem</p>
</div>
</div>
<button type="button" onclick="closeEditUserModal()" class="text-slate-400 hover:text-slate-600 p-1.5 rounded-lg hover:bg-slate-100 transition cursor-pointer">
<i class="fa-solid fa-xmark text-lg"></i>
</button> </button>
</div> </div>
<form id="editUserForm" method="POST" enctype="multipart/form-data" class="p-6 space-y-4"> <!-- Form Body (Scrollable & Landscape 2-Column Grid) -->
<form id="editUserForm" method="POST" enctype="multipart/form-data" class="flex flex-col flex-1 min-h-0">
@csrf @csrf
<div class="overflow-y-auto flex-1 p-5 sm:p-6 space-y-5">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 items-start">
<!-- KOLOM KIRI: Kredensial & Akun Login -->
<div class="space-y-4 bg-slate-50/70 p-4 sm:p-5 rounded-2xl border border-slate-200/80">
<div class="flex items-center justify-between pb-2.5 border-b border-slate-200/80">
<span class="text-xs font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1.5">
<i class="fa-solid fa-shield-halved text-indigo-600"></i>
1. Identitas Akun Pengguna
</span>
<span class="text-[10px] text-indigo-700 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-200 font-semibold">RBAC Auth</span>
</div>
<!-- Upload / Ganti Foto Profil --> <!-- Upload / Ganti Foto Profil -->
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna</label> <label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna</label>
@@ -457,50 +508,51 @@
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Nama Lengkap *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Nama Lengkap *</label>
<input type="text" id="edit_name" name="name" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white"> <input type="text" id="edit_name" name="name" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white">
</div> </div>
<div class="grid grid-cols-2 gap-3"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">NIK (Nomor Induk Karyawan) *</label> <label class="block text-xs font-bold text-slate-700 mb-1">NIK (Nomor Induk Karyawan) *</label>
<input type="text" id="edit_username" name="username" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white font-mono"> <input type="text" id="edit_username" name="username" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white font-mono">
</div> </div>
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Email *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Email *</label>
<input type="email" id="edit_email" name="email" required class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white"> <input type="email" id="edit_email" name="email" required class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white">
</div> </div>
</div> </div>
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1"> <label class="block text-xs font-bold text-slate-700 mb-1">
Ganti Password <span class="text-slate-400 font-normal">(Kosongkan jika tidak ingin mengubah)</span> Ganti Password <span class="text-slate-400 font-normal">(Kosongkan jika tidak diubah)</span>
</label> </label>
<input type="password" name="password" minlength="6" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="Masukkan password baru"> <input type="password" name="password" minlength="6" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white" placeholder="Masukkan password baru">
</div> </div>
<div> <div>
<label class="block text-xs font-bold text-slate-700 mb-1">Role RBAC *</label> <label class="block text-xs font-bold text-slate-700 mb-1">Role RBAC *</label>
<select id="edit_role" name="role" required onchange="handleUserRoleChange(this.value, 'edit')" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white"> <select id="edit_role" name="role" required onchange="handleUserRoleChange(this.value, 'edit')" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white cursor-pointer font-medium text-slate-800">
@foreach($roles as $role) @foreach($roles as $role)
<option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option> <option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
<!-- Section: Data Profil Karyawan & Penugasan (Selaras Master HSE) -->
<div class="pt-3 border-t border-slate-100 space-y-3">
<div class="flex items-center justify-between">
<label class="text-xs font-bold text-slate-700 flex items-center gap-1.5">
<i class="fa-solid fa-id-badge text-indigo-600"></i>
<span>Data Profil Karyawan & Penugasan</span>
</label>
<span class="text-[10px] text-slate-400 font-medium">(Opsional)</span>
</div> </div>
<div class="grid grid-cols-2 gap-3"> <!-- KOLOM KANAN: Data Profil Karyawan & Penugasan -->
<div class="space-y-4 bg-slate-50/70 p-4 sm:p-5 rounded-2xl border border-slate-200/80">
<div class="flex items-center justify-between pb-2.5 border-b border-slate-200/80">
<span class="text-xs font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1.5">
<i class="fa-solid fa-id-badge text-emerald-600"></i>
2. Profil Personil & Penugasan
</span>
<span class="text-[10px] text-emerald-700 bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200 font-semibold">Sinkron Master HSE</span>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Jenis Personil</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Jenis Personil</label>
<select id="edit_employee_type" name="employee_type" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700"> <select id="edit_employee_type" name="employee_type" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700 cursor-pointer">
<option value="karyawan">Karyawan (Internal KMH)</option> <option value="karyawan">Karyawan (Internal KMH)</option>
<option value="sukon">Sukon (Subkontraktor)</option> <option value="sukon">Sukon (Subkontraktor)</option>
</select> </select>
@@ -511,36 +563,42 @@
id="edit_unit_kerja" id="edit_unit_kerja"
name="unit_kerja" name="unit_kerja"
list="adminUnitKerjaSuggestions" list="adminUnitKerjaSuggestions"
class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700"
placeholder="Ketik atau pilih unit kerja..."> placeholder="Ketik atau pilih unit kerja...">
</div> </div>
</div> </div>
<div class="grid grid-cols-2 gap-3"> <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Divisi</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Divisi</label>
<input type="text" id="edit_division" name="division" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Operasi / Keuangan"> <input type="text" id="edit_division" name="division" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Operasi / Keuangan">
</div> </div>
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Posisi / Jabatan</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Posisi / Jabatan</label>
<input type="text" id="edit_position" name="position" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Driver / Staff Finance"> <input type="text" id="edit_position" name="position" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Driver / Anggota / Staff">
</div> </div>
</div> </div>
<div> <div>
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Operator / Driver</label> <label class="block text-[11px] font-semibold text-slate-600 mb-1">Operator / Driver</label>
<select id="edit_is_operator" name="is_operator" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700"> <select id="edit_is_operator" name="is_operator" class="w-full px-3 py-2 bg-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700 cursor-pointer">
<option value="0">TIDAK (Bukan Driver)</option> <option value="0">TIDAK (Bukan Driver)</option>
<option value="1">YA (Aktif Mengemudi)</option> <option value="1">YA (Aktif Mengemudi)</option>
</select> </select>
</div> </div>
<div class="p-3 bg-white rounded-xl border border-slate-200 text-[11px] text-slate-600 flex items-start gap-2.5">
<i class="fa-solid fa-circle-info text-indigo-500 mt-0.5 flex-shrink-0"></i>
<span class="leading-relaxed">Perubahan pada data profil personil akan otomatis menyelaraskan data di Master Karyawan HSE dan izin SIMPER.</span>
</div>
</div>
</div> </div>
<!-- Accordion: Izin Tambahan Khusus (Direct Permissions) --> <!-- Accordion: Izin Tambahan Khusus (Direct Permissions) -->
<div class="border border-slate-200 rounded-xl overflow-hidden bg-slate-50/50"> <div class="border border-slate-200 rounded-2xl overflow-hidden bg-slate-50/50">
<button type="button" <button type="button"
onclick="toggleDirectPermsAccordion()" onclick="toggleDirectPermsAccordion()"
class="w-full px-4 py-2.5 bg-slate-100/70 hover:bg-slate-100 flex items-center justify-between text-xs font-bold text-slate-700 transition"> class="w-full px-4 py-3 bg-slate-100/70 hover:bg-slate-100 flex items-center justify-between text-xs font-bold text-slate-700 transition cursor-pointer">
<span class="flex items-center gap-2"> <span class="flex items-center gap-2">
<i class="fa-solid fa-key text-indigo-600"></i> <i class="fa-solid fa-key text-indigo-600"></i>
<span>Izin Tambahan Khusus (Direct Permissions)</span> <span>Izin Tambahan Khusus (Direct Permissions)</span>
@@ -591,17 +649,21 @@
@endforeach @endforeach
</div> </div>
</div> </div>
</div>
<div class="pt-4 border-t border-slate-100 flex items-center justify-end gap-2.5"> <!-- Footer Modal (Pinned at Bottom) -->
<button type="button" onclick="closeEditUserModal()" class="px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-600 rounded-xl text-xs font-bold transition"> <div class="px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-2.5 bg-slate-50/80 flex-shrink-0">
<button type="button" onclick="closeEditUserModal()" class="px-4 py-2 bg-white hover:bg-slate-100 border border-slate-200 text-slate-700 rounded-xl text-xs font-bold transition cursor-pointer">
Batal Batal
</button> </button>
<button type="submit" class="px-5 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-bold shadow-sm transition"> <button type="submit" class="px-5 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-bold shadow-sm transition cursor-pointer flex items-center gap-1.5">
Simpan Perubahan <i class="fa-solid fa-check"></i>
<span>Simpan Perubahan</span>
</button> </button>
</div> </div>
</form> </form>
</div> </div>
</div>
</div> </div>
<!-- ========================================================================= --> <!-- ========================================================================= -->
+68 -40
View File
@@ -630,10 +630,11 @@
<!-- MODAL: PREVIEW & CETAK STIKER QR CODE KENDARAAN --> <!-- MODAL: PREVIEW & CETAK STIKER QR CODE KENDARAAN -->
<!-- ========================================================================= --> <!-- ========================================================================= -->
<div id="qrVehicleModal" <div id="qrVehicleModal"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto"> class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm overflow-y-auto p-3 sm:p-5">
<div id="qrModalDialog" class="bg-white rounded-3xl shadow-2xl max-w-3xl w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8"> <div class="min-h-full flex items-center justify-center py-4 sm:py-6">
<!-- Header Modal --> <div id="qrModalDialog" class="bg-white rounded-3xl shadow-2xl max-w-3xl w-full p-5 sm:p-6 border border-slate-100 transform transition-all my-auto max-h-[92vh] flex flex-col overflow-hidden">
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between pb-4 border-b border-slate-100 gap-3"> <!-- Header Modal (Pinned / Locked at Top) -->
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between pb-3.5 border-b border-slate-100 gap-3 flex-shrink-0 bg-white">
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-2xl bg-emerald-50 text-[#1b5e20] flex items-center justify-center font-bold text-base border border-emerald-200/60 shadow-2xs"> <div class="w-10 h-10 rounded-2xl bg-emerald-50 text-[#1b5e20] flex items-center justify-center font-bold text-base border border-emerald-200/60 shadow-2xs">
<i class="fa-solid fa-qrcode"></i> <i class="fa-solid fa-qrcode"></i>
@@ -645,7 +646,7 @@
</div> </div>
<!-- Switcher Orientasi & Tombol Tutup --> <!-- Switcher Orientasi & Tombol Tutup -->
<div class="flex items-center space-x-2.5 self-end sm:self-auto"> <div class="flex items-center space-x-2 self-end sm:self-auto">
<!-- Toggle Tab Orientasi: Landscape & Portrait --> <!-- Toggle Tab Orientasi: Landscape & Portrait -->
<div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold"> <div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold">
<button type="button" <button type="button"
@@ -673,8 +674,8 @@
</div> </div>
</div> </div>
<!-- Area Kartu Stiker Fisik (Bisa Dicetak Langsung) --> <!-- Area Kartu Stiker Fisik (Scrollable Body) -->
<div class="mt-5"> <div class="overflow-y-auto flex-1 my-3 pr-1">
<!-- 1. PREVIEW STIKER LANDSCAPE (DEFAULT AKTIF) --> <!-- 1. PREVIEW STIKER LANDSCAPE (DEFAULT AKTIF) -->
<div id="printableStickerAreaLandscape" class="printable-card bg-white border-2 border-slate-900 rounded-3xl p-5 sm:p-6 text-left shadow-sm max-w-[660px] mx-auto"> <div id="printableStickerAreaLandscape" class="printable-card bg-white border-2 border-slate-900 rounded-3xl p-5 sm:p-6 text-left shadow-sm max-w-[660px] mx-auto">
<!-- Kop Stiker Resmi Perusahaan --> <!-- Kop Stiker Resmi Perusahaan -->
@@ -743,35 +744,35 @@
</div> </div>
</div> </div>
<!-- 2. PREVIEW STIKER POTRAIT --> <!-- 2. PREVIEW STIKER POTRAIT (COMPACT & RESPONSIVE) -->
<div id="printableStickerAreaPortrait" class="printable-card hidden bg-white border-2 border-slate-900 rounded-3xl p-5 text-center shadow-sm max-w-[360px] mx-auto"> <div id="printableStickerAreaPortrait" class="printable-card hidden bg-white border-2 border-slate-900 rounded-3xl p-4 sm:p-5 text-center shadow-sm max-w-[340px] mx-auto">
<!-- Kop Stiker Resmi Perusahaan --> <!-- Kop Stiker Resmi Perusahaan -->
<div class="border-b-2 border-slate-900 pb-3 mb-4"> <div class="border-b-2 border-slate-900 pb-2.5 mb-3">
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div> <div class="text-[9px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
<h4 class="text-xs font-black uppercase tracking-tight text-slate-900 mt-0.5">TIMESHEET KENDARAAN OPERASIONAL</h4> <h4 class="text-xs font-black uppercase tracking-tight text-slate-900 mt-0.5">TIMESHEET KENDARAAN OPERASIONAL</h4>
<div class="text-[9px] font-bold text-slate-500 tracking-wider">LIGHT VEHICLE (LV) • RKM SYSTEM</div> <div class="text-[9px] font-bold text-slate-500 tracking-wider">LIGHT VEHICLE (LV) • RKM SYSTEM</div>
</div> </div>
<!-- Kontainer QR Code Vektor --> <!-- Kontainer QR Code Vektor (Compact) -->
<div class="bg-white p-3.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-4"> <div class="bg-white p-2.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-3">
<div class="w-52 h-52 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container"> <div class="w-40 h-40 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
<!-- SVG QR Code di-inject di sini --> <!-- SVG QR Code di-inject di sini -->
</div> </div>
</div> </div>
<!-- Rincian Identitas Unit Kendaraan --> <!-- Rincian Identitas Unit Kendaraan -->
<div class="space-y-1.5 mb-3 text-left bg-slate-50/80 p-3.5 rounded-2xl border border-slate-200"> <div class="space-y-1.5 mb-2.5 text-left bg-slate-50/80 p-3 rounded-2xl border border-slate-200">
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60"> <div class="flex items-center justify-between pb-1 border-b border-slate-200/60">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
<span class="font-mono font-extrabold text-sm text-[#1b5e20] bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200 modal-qr-code-text">LV01</span> <span class="font-mono font-extrabold text-xs text-[#1b5e20] bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200 modal-qr-code-text">LV01</span>
</div> </div>
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60"> <div class="flex items-center justify-between pb-1 border-b border-slate-200/60">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">NO. POLISI:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">NO. POLISI:</span>
<span class="font-mono font-bold text-xs text-amber-900 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 modal-qr-plate-text">BH 1024 AB</span> <span class="font-mono font-bold text-xs text-amber-900 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 modal-qr-plate-text">BH 1024 AB</span>
</div> </div>
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60"> <div class="flex items-start justify-between pb-1 border-b border-slate-200/60">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">MEREK & TIPE:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">MEREK & TIPE:</span>
<span class="font-bold text-xs text-slate-900 text-right max-w-[200px] modal-qr-brand-text">TOYOTA HILUX 4X4 DC</span> <span class="font-bold text-xs text-slate-900 text-right max-w-[170px] modal-qr-brand-text">TOYOTA HILUX 4X4 DC</span>
</div> </div>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">DIVISI:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">DIVISI:</span>
@@ -780,26 +781,26 @@
</div> </div>
<!-- Panduan Driver --> <!-- Panduan Driver -->
<div class="text-[10px] text-slate-700 bg-emerald-50/90 p-2.5 rounded-xl border border-emerald-200/60 flex items-center space-x-2.5 text-left"> <div class="text-[9px] text-slate-700 bg-emerald-50/90 p-2 rounded-xl border border-emerald-200/60 flex items-center space-x-2 text-left mb-2">
<div class="w-6 h-6 rounded-lg bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0"> <div class="w-5 h-5 rounded-md bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3.5 h-3.5 fill-current"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3 h-3 fill-current">
<path d="M149.1 64l-21.7 48L64 112c-35.3 0-64 28.7-64 64L0 400c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-63.4 0-21.7-48L149.1 64zM256 208a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 48a48 48 0 1 0 0 96 48 48 0 1 0 0-96z"/> <path d="M149.1 64l-21.7 48L64 112c-35.3 0-64 28.7-64 64L0 400c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-63.4 0-21.7-48L149.1 64zM256 208a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 48a48 48 0 1 0 0 96 48 48 0 1 0 0-96z"/>
</svg> </svg>
</div> </div>
<span class="leading-snug"> <span class="leading-tight">
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir pencatatan kilometer & perlintasan gerbang. <strong>Scan QR ini</strong> menggunakan HP untuk pencatatan KM & perlintasan.
</span> </span>
</div> </div>
<!-- Tautan Langsung --> <!-- Tautan Langsung -->
<div class="mt-2.5 text-[9px] font-mono text-slate-400 break-all modal-qr-url"> <div class="text-[8.5px] font-mono text-slate-400 break-all modal-qr-url">
http://.../gate-activity/LV01 http://.../gate-activity/LV01
</div> </div>
</div> </div>
</div> </div>
<!-- Tombol Aksi Cetak & Unduh --> <!-- Tombol Aksi Cetak & Unduh (Pinned / Locked at Bottom) -->
<div class="pt-4 mt-5 border-t border-slate-100 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2.5"> <div class="pt-3 border-t border-slate-100 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2.5 flex-shrink-0 bg-white">
<div class="flex flex-wrap items-center gap-2"> <div class="flex flex-wrap items-center gap-2">
<!-- Dropdown / Tombol Cetak --> <!-- Dropdown / Tombol Cetak -->
<div class="relative inline-block text-left" id="printDropdownContainer"> <div class="relative inline-block text-left" id="printDropdownContainer">
@@ -807,13 +808,13 @@
<button type="button" <button type="button"
onclick="printSticker()" onclick="printSticker()"
id="btnMainPrint" id="btnMainPrint"
class="inline-flex items-center space-x-1.5 px-4 py-2.5 rounded-l-xl bg-[#1b5e20] hover:bg-[#144919] text-white font-bold text-xs transition cursor-pointer"> class="inline-flex items-center space-x-1.5 px-3.5 py-2 rounded-l-xl bg-[#1b5e20] hover:bg-[#144919] text-white font-bold text-xs transition cursor-pointer">
<i class="fa-solid fa-print"></i> <i class="fa-solid fa-print"></i>
<span id="btnMainPrintLabel">Cetak Landscape</span> <span id="btnMainPrintLabel">Cetak Landscape</span>
</button> </button>
<button type="button" <button type="button"
onclick="toggleQrDropdown('printDropdownMenu', event)" onclick="toggleQrDropdown('printDropdownMenu', event)"
class="px-2.5 py-2.5 rounded-r-xl bg-[#144919] hover:bg-[#0f3612] text-white border-l border-emerald-800 transition cursor-pointer" class="px-2 py-2 rounded-r-xl bg-[#144919] hover:bg-[#0f3612] text-white border-l border-emerald-800 transition cursor-pointer"
title="Pilihan Orientasi Cetak"> title="Pilihan Orientasi Cetak">
<i class="fa-solid fa-chevron-down text-[10px]"></i> <i class="fa-solid fa-chevron-down text-[10px]"></i>
</button> </button>
@@ -836,13 +837,13 @@
<button type="button" <button type="button"
id="btnDownloadSticker" id="btnDownloadSticker"
onclick="downloadQrCode()" onclick="downloadQrCode()"
class="inline-flex items-center space-x-1.5 px-3.5 py-2.5 rounded-l-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer"> class="inline-flex items-center space-x-1.5 px-3 py-2 rounded-l-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer">
<i class="fa-solid fa-download"></i> <i class="fa-solid fa-download"></i>
<span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span> <span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span>
</button> </button>
<button type="button" <button type="button"
onclick="toggleQrDropdown('downloadDropdownMenu', event)" onclick="toggleQrDropdown('downloadDropdownMenu', event)"
class="px-2.5 py-2.5 rounded-r-xl bg-slate-200 hover:bg-slate-300 text-slate-600 border-l border-slate-300 transition cursor-pointer" class="px-2 py-2 rounded-r-xl bg-slate-200 hover:bg-slate-300 text-slate-600 border-l border-slate-300 transition cursor-pointer"
title="Pilihan Orientasi Unduh"> title="Pilihan Orientasi Unduh">
<i class="fa-solid fa-chevron-down text-[10px]"></i> <i class="fa-solid fa-chevron-down text-[10px]"></i>
</button> </button>
@@ -858,6 +859,24 @@
</button> </button>
</div> </div>
</div> </div>
<!-- Secondary Bottom Switcher -->
<div class="inline-flex p-0.5 bg-slate-100 rounded-lg border border-slate-200 text-[11px] font-bold">
<button type="button"
id="btnFooterTabLandscape"
onclick="setStickerOrientation('landscape')"
class="px-2.5 py-1 rounded-md transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1 cursor-pointer">
<i class="fa-solid fa-image text-emerald-600 text-[10px]"></i>
<span>Landscape</span>
</button>
<button type="button"
id="btnFooterTabPortrait"
onclick="setStickerOrientation('portrait')"
class="px-2.5 py-1 rounded-md transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1 cursor-pointer">
<i class="fa-solid fa-file text-slate-400 text-[10px]"></i>
<span>Potrait</span>
</button>
</div>
</div> </div>
<div class="flex items-center space-x-2 justify-end"> <div class="flex items-center space-x-2 justify-end">
@@ -865,7 +884,7 @@
<a id="modalQrTestLink" <a id="modalQrTestLink"
href="#" href="#"
target="_blank" target="_blank"
class="inline-flex items-center space-x-1 px-3 py-2.5 rounded-xl text-xs font-semibold text-blue-700 hover:bg-blue-50 transition border border-transparent hover:border-blue-200" class="inline-flex items-center space-x-1 px-2.5 py-2 rounded-xl text-xs font-semibold text-blue-700 hover:bg-blue-50 transition border border-transparent hover:border-blue-200"
title="Buka form input penggunaan kendaraan di tab baru untuk pengetesan"> title="Buka form input penggunaan kendaraan di tab baru untuk pengetesan">
<i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i> <i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i>
<span>Tes Form</span> <span>Tes Form</span>
@@ -873,15 +892,12 @@
<button type="button" <button type="button"
onclick="closeQrModal()" onclick="closeQrModal()"
class="px-4 py-2.5 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer"> class="px-4 py-2 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer">
Tutup Tutup
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div> </div>
</div> </div>
@@ -1192,7 +1208,7 @@
currentOrientation = orient === 'portrait' ? 'portrait' : 'landscape'; currentOrientation = orient === 'portrait' ? 'portrait' : 'landscape';
const isLand = currentOrientation === 'landscape'; const isLand = currentOrientation === 'landscape';
// Update active tab buttons // Update active tab buttons (Header & Footer)
const tabLand = document.getElementById('btnTabLandscape'); const tabLand = document.getElementById('btnTabLandscape');
const tabPort = document.getElementById('btnTabPortrait'); const tabPort = document.getElementById('btnTabPortrait');
if (tabLand && tabPort) { if (tabLand && tabPort) {
@@ -1205,15 +1221,27 @@
} }
} }
const fTabLand = document.getElementById('btnFooterTabLandscape');
const fTabPort = document.getElementById('btnFooterTabPortrait');
if (fTabLand && fTabPort) {
if (isLand) {
fTabLand.className = "px-2.5 py-1 rounded-md transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1 cursor-pointer";
fTabPort.className = "px-2.5 py-1 rounded-md transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1 cursor-pointer";
} else {
fTabPort.className = "px-2.5 py-1 rounded-md transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1 cursor-pointer";
fTabLand.className = "px-2.5 py-1 rounded-md transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1 cursor-pointer";
}
}
// Update Card Dialog Width // Update Card Dialog Width
const dialog = document.getElementById('qrModalDialog'); const dialog = document.getElementById('qrModalDialog');
if (dialog) { if (dialog) {
if (isLand) { if (isLand) {
dialog.classList.remove('max-w-lg'); dialog.classList.remove('max-w-md');
dialog.classList.add('max-w-2xl', 'sm:max-w-3xl'); dialog.classList.add('max-w-2xl', 'sm:max-w-3xl');
} else { } else {
dialog.classList.remove('max-w-2xl', 'sm:max-w-3xl'); dialog.classList.remove('max-w-2xl', 'sm:max-w-3xl');
dialog.classList.add('max-w-lg'); dialog.classList.add('max-w-md');
} }
} }
@@ -793,10 +793,11 @@
<!-- MODAL: PREVIEW & CETAK STIKER QR CODE HEAVY EQUIPMENT --> <!-- MODAL: PREVIEW & CETAK STIKER QR CODE HEAVY EQUIPMENT -->
<!-- ========================================================================= --> <!-- ========================================================================= -->
<div id="qrVehicleModal" <div id="qrVehicleModal"
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto"> class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm overflow-y-auto p-3 sm:p-5">
<div id="qrModalDialog" class="bg-white rounded-3xl shadow-2xl max-w-3xl w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8"> <div class="min-h-full flex items-center justify-center py-4 sm:py-6">
<!-- Header Modal --> <div id="qrModalDialog" class="bg-white rounded-3xl shadow-2xl max-w-3xl w-full p-5 sm:p-6 border border-slate-100 transform transition-all my-auto max-h-[92vh] flex flex-col overflow-hidden">
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between pb-4 border-b border-slate-100 gap-3"> <!-- Header Modal (Pinned / Locked at Top) -->
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between pb-3.5 border-b border-slate-100 gap-3 flex-shrink-0 bg-white">
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-2xl bg-emerald-50 text-[#1b5e20] flex items-center justify-center font-bold text-base border border-emerald-200/60 shadow-2xs"> <div class="w-10 h-10 rounded-2xl bg-emerald-50 text-[#1b5e20] flex items-center justify-center font-bold text-base border border-emerald-200/60 shadow-2xs">
<i class="fa-solid fa-qrcode"></i> <i class="fa-solid fa-qrcode"></i>
@@ -808,7 +809,7 @@
</div> </div>
<!-- Switcher Orientasi & Tombol Tutup --> <!-- Switcher Orientasi & Tombol Tutup -->
<div class="flex items-center space-x-2.5 self-end sm:self-auto"> <div class="flex items-center space-x-2 self-end sm:self-auto">
<!-- Toggle Tab Orientasi: Landscape & Portrait --> <!-- Toggle Tab Orientasi: Landscape & Portrait -->
<div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold"> <div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold">
<button type="button" <button type="button"
@@ -836,8 +837,8 @@
</div> </div>
</div> </div>
<!-- Area Kartu Stiker Fisik (Bisa Dicetak Langsung) --> <!-- Area Kartu Stiker Fisik (Scrollable Body) -->
<div class="mt-5"> <div class="overflow-y-auto flex-1 my-3 pr-1">
<!-- 1. PREVIEW STIKER LANDSCAPE (DEFAULT AKTIF) --> <!-- 1. PREVIEW STIKER LANDSCAPE (DEFAULT AKTIF) -->
<div id="printableStickerAreaLandscape" class="printable-card bg-white border-2 border-slate-900 rounded-3xl p-5 sm:p-6 text-left shadow-sm max-w-[660px] mx-auto"> <div id="printableStickerAreaLandscape" class="printable-card bg-white border-2 border-slate-900 rounded-3xl p-5 sm:p-6 text-left shadow-sm max-w-[660px] mx-auto">
<!-- Kop Stiker Resmi Perusahaan --> <!-- Kop Stiker Resmi Perusahaan -->
@@ -906,35 +907,35 @@
</div> </div>
</div> </div>
<!-- 2. PREVIEW STIKER POTRAIT --> <!-- 2. PREVIEW STIKER POTRAIT (COMPACT & RESPONSIVE) -->
<div id="printableStickerAreaPortrait" class="printable-card hidden bg-white border-2 border-slate-900 rounded-3xl p-5 text-center shadow-sm max-w-[360px] mx-auto"> <div id="printableStickerAreaPortrait" class="printable-card hidden bg-white border-2 border-slate-900 rounded-3xl p-4 sm:p-5 text-center shadow-sm max-w-[340px] mx-auto">
<!-- Kop Stiker Resmi Perusahaan --> <!-- Kop Stiker Resmi Perusahaan -->
<div class="border-b-2 border-slate-900 pb-3 mb-4"> <div class="border-b-2 border-slate-900 pb-2.5 mb-3">
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div> <div class="text-[9px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
<h4 class="text-xs font-black uppercase tracking-tight text-slate-900 mt-0.5 modal-qr-sub-title">HEAVY EQUIPMENT • RKM SYSTEM</h4> <h4 class="text-xs font-black uppercase tracking-tight text-slate-900 mt-0.5 modal-qr-sub-title">HEAVY EQUIPMENT • RKM SYSTEM</h4>
<div class="text-[9px] font-bold text-slate-500 tracking-wider uppercase modal-qr-category-text">{{ $category->name ?? $category->unit_category ?? 'ALAT BERAT' }}</div> <div class="text-[9px] font-bold text-slate-500 tracking-wider uppercase modal-qr-category-text">{{ $category->name ?? $category->unit_category ?? 'ALAT BERAT' }}</div>
</div> </div>
<!-- Kontainer QR Code Vektor --> <!-- Kontainer QR Code Vektor (Compact) -->
<div class="bg-white p-3.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-4"> <div class="bg-white p-2.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-3">
<div class="w-52 h-52 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container"> <div class="w-40 h-40 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
<!-- SVG QR Code di-inject di sini --> <!-- SVG QR Code di-inject di sini -->
</div> </div>
</div> </div>
<!-- Rincian Identitas Unit Kendaraan --> <!-- Rincian Identitas Unit Kendaraan -->
<div class="space-y-1.5 mb-3 text-left bg-slate-50/80 p-3.5 rounded-2xl border border-slate-200"> <div class="space-y-1.5 mb-2.5 text-left bg-slate-50/80 p-3 rounded-2xl border border-slate-200">
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60"> <div class="flex items-center justify-between pb-1 border-b border-slate-200/60">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
<span class="font-mono font-extrabold text-sm text-[#1b5e20] bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200 modal-qr-code-text">-</span> <span class="font-mono font-extrabold text-xs text-[#1b5e20] bg-emerald-50 px-2 py-0.5 rounded border border-emerald-200 modal-qr-code-text">-</span>
</div> </div>
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60"> <div class="flex items-center justify-between pb-1 border-b border-slate-200/60">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">NO. POLISI:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">NO. POLISI:</span>
<span class="font-mono font-bold text-xs text-amber-900 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 modal-qr-plate-text">-</span> <span class="font-mono font-bold text-xs text-amber-900 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 modal-qr-plate-text">-</span>
</div> </div>
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60"> <div class="flex items-start justify-between pb-1 border-b border-slate-200/60">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">MEREK & TIPE:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">MEREK & TIPE:</span>
<span class="font-bold text-xs text-slate-900 text-right max-w-[200px] modal-qr-brand-text">-</span> <span class="font-bold text-xs text-slate-900 text-right max-w-[170px] modal-qr-brand-text">-</span>
</div> </div>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">LOKASI KERJA:</span> <span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">LOKASI KERJA:</span>
@@ -943,26 +944,26 @@
</div> </div>
<!-- Panduan Driver / Operator --> <!-- Panduan Driver / Operator -->
<div class="text-[10px] text-slate-700 bg-emerald-50/90 p-2.5 rounded-xl border border-emerald-200/60 flex items-center space-x-2.5 text-left"> <div class="text-[9px] text-slate-700 bg-emerald-50/90 p-2 rounded-xl border border-emerald-200/60 flex items-center space-x-2 text-left mb-2">
<div class="w-6 h-6 rounded-lg bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0"> <div class="w-5 h-5 rounded-md bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3.5 h-3.5 fill-current"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3 h-3 fill-current">
<path d="M149.1 64l-21.7 48L64 112c-35.3 0-64 28.7-64 64L0 400c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-63.4 0-21.7-48L149.1 64zM256 208a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 48a48 48 0 1 0 0 96 48 48 0 1 0 0-96z"/> <path d="M149.1 64l-21.7 48L64 112c-35.3 0-64 28.7-64 64L0 400c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-63.4 0-21.7-48L149.1 64zM256 208a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 48a48 48 0 1 0 0 96 48 48 0 1 0 0-96z"/>
</svg> </svg>
</div> </div>
<span class="leading-snug modal-qr-instruction-text"> <span class="leading-tight modal-qr-instruction-text">
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir operasional unit. <strong>Scan QR ini</strong> menggunakan HP untuk membuka formulir operasional unit.
</span> </span>
</div> </div>
<!-- Tautan Langsung --> <!-- Tautan Langsung -->
<div class="mt-2.5 text-[9px] font-mono text-slate-400 break-all modal-qr-url"> <div class="text-[8.5px] font-mono text-slate-400 break-all modal-qr-url">
- -
</div> </div>
</div> </div>
</div> </div>
<!-- Tombol Aksi Cetak & Unduh --> <!-- Tombol Aksi Cetak & Unduh (Pinned / Locked at Bottom) -->
<div class="pt-4 mt-5 border-t border-slate-100 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2.5"> <div class="pt-3 border-t border-slate-100 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2.5 flex-shrink-0 bg-white">
<div class="flex flex-wrap items-center gap-2"> <div class="flex flex-wrap items-center gap-2">
<!-- Dropdown / Tombol Cetak --> <!-- Dropdown / Tombol Cetak -->
<div class="relative inline-block text-left" id="printDropdownContainer"> <div class="relative inline-block text-left" id="printDropdownContainer">
@@ -970,13 +971,13 @@
<button type="button" <button type="button"
onclick="printSticker()" onclick="printSticker()"
id="btnMainPrint" id="btnMainPrint"
class="inline-flex items-center space-x-1.5 px-4 py-2.5 rounded-l-xl bg-[#1b5e20] hover:bg-[#144919] text-white font-bold text-xs transition cursor-pointer"> class="inline-flex items-center space-x-1.5 px-3.5 py-2 rounded-l-xl bg-[#1b5e20] hover:bg-[#144919] text-white font-bold text-xs transition cursor-pointer">
<i class="fa-solid fa-print"></i> <i class="fa-solid fa-print"></i>
<span id="btnMainPrintLabel">Cetak Landscape</span> <span id="btnMainPrintLabel">Cetak Landscape</span>
</button> </button>
<button type="button" <button type="button"
onclick="toggleQrDropdown('printDropdownMenu', event)" onclick="toggleQrDropdown('printDropdownMenu', event)"
class="px-2.5 py-2.5 rounded-r-xl bg-[#144919] hover:bg-[#0f3612] text-white border-l border-emerald-800 transition cursor-pointer" class="px-2 py-2 rounded-r-xl bg-[#144919] hover:bg-[#0f3612] text-white border-l border-emerald-800 transition cursor-pointer"
title="Pilihan Orientasi Cetak"> title="Pilihan Orientasi Cetak">
<i class="fa-solid fa-chevron-down text-[10px]"></i> <i class="fa-solid fa-chevron-down text-[10px]"></i>
</button> </button>
@@ -999,13 +1000,13 @@
<button type="button" <button type="button"
id="btnDownloadSticker" id="btnDownloadSticker"
onclick="downloadQrCode()" onclick="downloadQrCode()"
class="inline-flex items-center space-x-1.5 px-3.5 py-2.5 rounded-l-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer"> class="inline-flex items-center space-x-1.5 px-3 py-2 rounded-l-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer">
<i class="fa-solid fa-download"></i> <i class="fa-solid fa-download"></i>
<span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span> <span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span>
</button> </button>
<button type="button" <button type="button"
onclick="toggleQrDropdown('downloadDropdownMenu', event)" onclick="toggleQrDropdown('downloadDropdownMenu', event)"
class="px-2.5 py-2.5 rounded-r-xl bg-slate-200 hover:bg-slate-300 text-slate-600 border-l border-slate-300 transition cursor-pointer" class="px-2 py-2 rounded-r-xl bg-slate-200 hover:bg-slate-300 text-slate-600 border-l border-slate-300 transition cursor-pointer"
title="Pilihan Orientasi Unduh"> title="Pilihan Orientasi Unduh">
<i class="fa-solid fa-chevron-down text-[10px]"></i> <i class="fa-solid fa-chevron-down text-[10px]"></i>
</button> </button>
@@ -1021,6 +1022,24 @@
</button> </button>
</div> </div>
</div> </div>
<!-- Secondary Bottom Switcher -->
<div class="inline-flex p-0.5 bg-slate-100 rounded-lg border border-slate-200 text-[11px] font-bold">
<button type="button"
id="btnFooterTabLandscape"
onclick="setStickerOrientation('landscape')"
class="px-2.5 py-1 rounded-md transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1 cursor-pointer">
<i class="fa-solid fa-image text-emerald-600 text-[10px]"></i>
<span>Landscape</span>
</button>
<button type="button"
id="btnFooterTabPortrait"
onclick="setStickerOrientation('portrait')"
class="px-2.5 py-1 rounded-md transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1 cursor-pointer">
<i class="fa-solid fa-file text-slate-400 text-[10px]"></i>
<span>Potrait</span>
</button>
</div>
</div> </div>
<div class="flex items-center space-x-2 justify-end"> <div class="flex items-center space-x-2 justify-end">
@@ -1028,7 +1047,7 @@
<a id="modalQrTestLink" <a id="modalQrTestLink"
href="#" href="#"
target="_blank" target="_blank"
class="inline-flex items-center space-x-1 px-3 py-2.5 rounded-xl text-xs font-semibold text-blue-700 hover:bg-blue-50 transition border border-transparent hover:border-blue-200" class="inline-flex items-center space-x-1 px-2.5 py-2 rounded-xl text-xs font-semibold text-blue-700 hover:bg-blue-50 transition border border-transparent hover:border-blue-200"
title="Buka form input di tab baru untuk pengetesan"> title="Buka form input di tab baru untuk pengetesan">
<i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i> <i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i>
<span>Tes Form</span> <span>Tes Form</span>
@@ -1036,12 +1055,13 @@
<button type="button" <button type="button"
onclick="closeQrModal()" onclick="closeQrModal()"
class="px-4 py-2.5 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer"> class="px-4 py-2 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer">
Tutup Tutup
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<script> <script>
@@ -1294,7 +1314,7 @@
currentOrientation = orient === 'portrait' ? 'portrait' : 'landscape'; currentOrientation = orient === 'portrait' ? 'portrait' : 'landscape';
const isLand = currentOrientation === 'landscape'; const isLand = currentOrientation === 'landscape';
// Update active tab buttons // Update active tab buttons (Header & Footer)
const tabLand = document.getElementById('btnTabLandscape'); const tabLand = document.getElementById('btnTabLandscape');
const tabPort = document.getElementById('btnTabPortrait'); const tabPort = document.getElementById('btnTabPortrait');
if (tabLand && tabPort) { if (tabLand && tabPort) {
@@ -1307,15 +1327,27 @@
} }
} }
const fTabLand = document.getElementById('btnFooterTabLandscape');
const fTabPort = document.getElementById('btnFooterTabPortrait');
if (fTabLand && fTabPort) {
if (isLand) {
fTabLand.className = "px-2.5 py-1 rounded-md transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1 cursor-pointer";
fTabPort.className = "px-2.5 py-1 rounded-md transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1 cursor-pointer";
} else {
fTabPort.className = "px-2.5 py-1 rounded-md transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1 cursor-pointer";
fTabLand.className = "px-2.5 py-1 rounded-md transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1 cursor-pointer";
}
}
// Update Card Dialog Width // Update Card Dialog Width
const dialog = document.getElementById('qrModalDialog'); const dialog = document.getElementById('qrModalDialog');
if (dialog) { if (dialog) {
if (isLand) { if (isLand) {
dialog.classList.remove('max-w-lg'); dialog.classList.remove('max-w-md');
dialog.classList.add('max-w-2xl', 'sm:max-w-3xl'); dialog.classList.add('max-w-2xl', 'sm:max-w-3xl');
} else { } else {
dialog.classList.remove('max-w-2xl', 'sm:max-w-3xl'); dialog.classList.remove('max-w-2xl', 'sm:max-w-3xl');
dialog.classList.add('max-w-lg'); dialog.classList.add('max-w-md');
} }
} }