fix(ui): enhance qr modal responsive orientation controls and convert super admin user forms to landscape
This commit is contained in:
@@ -288,319 +288,381 @@
|
|||||||
</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
|
|
||||||
</h3>
|
|
||||||
<button type="button" onclick="closeCreateUserModal()" class="text-slate-400 hover:text-slate-600">
|
|
||||||
<i class="fa-solid fa-xmark text-base"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form action="{{ route('admin.users.store') }}" method="POST" enctype="multipart/form-data" class="p-6 space-y-4">
|
|
||||||
@csrf
|
|
||||||
|
|
||||||
<!-- Upload Foto Profil (Opsional) -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna (Opsional)</label>
|
|
||||||
<div class="flex items-center space-x-3">
|
<div class="flex items-center space-x-3">
|
||||||
<div id="addUserPhotoPreviewContainer" class="w-12 h-12 rounded-full border-2 border-dashed border-slate-300 bg-slate-50 flex items-center justify-center overflow-hidden flex-shrink-0 shadow-2xs">
|
<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">
|
||||||
<img id="addUserPhotoPreview" src="" alt="Pratinjau" class="w-full h-full object-cover hidden">
|
<i class="fa-solid fa-user-plus"></i>
|
||||||
<i id="addUserPhotoPlaceholder" class="fa-solid fa-camera text-slate-400 text-sm"></i>
|
|
||||||
</div>
|
|
||||||
<div class="flex-1">
|
|
||||||
<input type="file"
|
|
||||||
name="photo"
|
|
||||||
id="addUserPhotoInput"
|
|
||||||
accept="image/jpeg,image/png,image/jpg,image/webp"
|
|
||||||
onchange="previewUserImage(this, 'addUserPhotoPreview', 'addUserPhotoPlaceholder')"
|
|
||||||
class="block w-full text-xs text-slate-500 file:mr-2.5 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-[11px] file:font-bold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100 cursor-pointer">
|
|
||||||
<p class="text-[10px] text-slate-400 mt-0.5">Otomatis dikompresi hemat storage (Maks. 10MB).</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-3">
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<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]">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
<option value="">-- Pilih Role --</option>
|
|
||||||
@foreach($roles as $role)
|
|
||||||
<option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</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 class="grid grid-cols-2 gap-3">
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
<option value="karyawan">Karyawan (Internal KMH)</option>
|
|
||||||
<option value="sukon">Sukon (Subkontraktor)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Unit Kerja</label>
|
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Tambah Pengguna Baru</h3>
|
||||||
<input type="text"
|
<p class="text-xs text-slate-500">Pendaftaran akun akses sistem & integrasi data profil personil/anggota</p>
|
||||||
name="unit_kerja"
|
|
||||||
id="create_unit_kerja"
|
|
||||||
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"
|
|
||||||
placeholder="Ketik atau pilih unit kerja...">
|
|
||||||
</div>
|
</div>
|
||||||
</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">
|
||||||
<div class="grid grid-cols-2 gap-3">
|
<i class="fa-solid fa-xmark text-lg"></i>
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
<option value="0">TIDAK (Bukan Driver)</option>
|
|
||||||
<option value="1">YA (Aktif Mengemudi)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-4 border-t border-slate-100 flex items-center justify-end gap-2.5">
|
|
||||||
<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">
|
|
||||||
Batal
|
|
||||||
</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">
|
|
||||||
Simpan Pengguna
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
<!-- 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
|
||||||
|
|
||||||
|
<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) -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna (Opsional)</label>
|
||||||
|
<div class="flex items-center space-x-3">
|
||||||
|
<div id="addUserPhotoPreviewContainer" class="w-12 h-12 rounded-full border-2 border-dashed border-slate-300 bg-slate-50 flex items-center justify-center overflow-hidden flex-shrink-0 shadow-2xs">
|
||||||
|
<img id="addUserPhotoPreview" src="" alt="Pratinjau" class="w-full h-full object-cover hidden">
|
||||||
|
<i id="addUserPhotoPlaceholder" class="fa-solid fa-camera text-slate-400 text-sm"></i>
|
||||||
|
</div>
|
||||||
|
<div class="flex-1">
|
||||||
|
<input type="file"
|
||||||
|
name="photo"
|
||||||
|
id="addUserPhotoInput"
|
||||||
|
accept="image/jpeg,image/png,image/jpg,image/webp"
|
||||||
|
onchange="previewUserImage(this, 'addUserPhotoPreview', 'addUserPhotoPlaceholder')"
|
||||||
|
class="block w-full text-xs text-slate-500 file:mr-2.5 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-[11px] file:font-bold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100 cursor-pointer">
|
||||||
|
<p class="text-[10px] text-slate-400 mt-0.5">Otomatis dikompresi hemat storage (Maks. 10MB).</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<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-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 class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<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-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>
|
||||||
|
<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-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>
|
||||||
|
<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-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>
|
||||||
|
<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-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>
|
||||||
|
@foreach($roles as $role)
|
||||||
|
<option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 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>
|
||||||
|
<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-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="sukon">Sukon (Subkontraktor)</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Unit Kerja</label>
|
||||||
|
<input type="text"
|
||||||
|
name="unit_kerja"
|
||||||
|
id="create_unit_kerja"
|
||||||
|
list="adminUnitKerjaSuggestions"
|
||||||
|
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...">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<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-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>
|
||||||
|
<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-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>
|
||||||
|
<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-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="1">YA (Aktif Mengemudi)</option>
|
||||||
|
</select>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- Footer Modal (Pinned at Bottom) -->
|
||||||
|
<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
|
||||||
|
</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 cursor-pointer flex items-center gap-1.5">
|
||||||
|
<i class="fa-solid fa-check"></i>
|
||||||
|
<span>Simpan Pengguna</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</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
|
|
||||||
</h3>
|
|
||||||
<button type="button" onclick="closeEditUserModal()" class="text-slate-400 hover:text-slate-600">
|
|
||||||
<i class="fa-solid fa-xmark text-base"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form id="editUserForm" method="POST" enctype="multipart/form-data" class="p-6 space-y-4">
|
|
||||||
@csrf
|
|
||||||
|
|
||||||
<!-- Upload / Ganti Foto Profil -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna</label>
|
|
||||||
<div class="flex items-center space-x-3">
|
<div class="flex items-center space-x-3">
|
||||||
<div id="editUserPhotoPreviewContainer" class="w-12 h-12 rounded-full border border-slate-200 bg-slate-50 flex items-center justify-center overflow-hidden flex-shrink-0 shadow-2xs">
|
<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">
|
||||||
<img id="editUserPhotoPreview" src="" alt="Foto" class="w-full h-full object-cover hidden">
|
<i class="fa-solid fa-user-pen"></i>
|
||||||
<i id="editUserPhotoPlaceholder" class="fa-solid fa-user text-slate-400 text-sm"></i>
|
|
||||||
</div>
|
|
||||||
<div class="flex-1">
|
|
||||||
<input type="file"
|
|
||||||
name="photo"
|
|
||||||
id="editUserPhotoInput"
|
|
||||||
accept="image/jpeg,image/png,image/jpg,image/webp"
|
|
||||||
onchange="previewUserImage(this, 'editUserPhotoPreview', 'editUserPhotoPlaceholder')"
|
|
||||||
class="block w-full text-xs text-slate-500 file:mr-2.5 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-[11px] file:font-bold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100 cursor-pointer">
|
|
||||||
<p class="text-[10px] text-slate-400 mt-0.5">Pilih file baru jika ingin mengganti foto profil.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-3">
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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>
|
|
||||||
</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">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
@foreach($roles as $role)
|
|
||||||
<option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</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 class="grid grid-cols-2 gap-3">
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
<option value="karyawan">Karyawan (Internal KMH)</option>
|
|
||||||
<option value="sukon">Sukon (Subkontraktor)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Unit Kerja</label>
|
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Edit Data Pengguna</h3>
|
||||||
<input type="text"
|
<p class="text-xs text-slate-500">Perbarui identitas akun, profil personil/anggota, serta izin wewenang sistem</p>
|
||||||
id="edit_unit_kerja"
|
|
||||||
name="unit_kerja"
|
|
||||||
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"
|
|
||||||
placeholder="Ketik atau pilih unit kerja...">
|
|
||||||
</div>
|
</div>
|
||||||
</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">
|
||||||
<div class="grid grid-cols-2 gap-3">
|
<i class="fa-solid fa-xmark text-lg"></i>
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<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">
|
|
||||||
<option value="0">TIDAK (Bukan Driver)</option>
|
|
||||||
<option value="1">YA (Aktif Mengemudi)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Accordion: Izin Tambahan Khusus (Direct Permissions) -->
|
|
||||||
<div class="border border-slate-200 rounded-xl overflow-hidden bg-slate-50/50">
|
|
||||||
<button type="button"
|
|
||||||
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">
|
|
||||||
<span class="flex items-center gap-2">
|
|
||||||
<i class="fa-solid fa-key text-indigo-600"></i>
|
|
||||||
<span>Izin Tambahan Khusus (Direct Permissions)</span>
|
|
||||||
</span>
|
|
||||||
<i id="directPermsChevron" class="fa-solid fa-chevron-down text-[10px] text-slate-400 transition-transform duration-200"></i>
|
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="directPermsContainer" class="hidden p-4 space-y-4 max-h-64 overflow-y-auto bg-white border-t border-slate-200 text-xs">
|
<!-- Form Body (Scrollable & Landscape 2-Column Grid) -->
|
||||||
<!-- Panduan Visual Matriks Izin -->
|
<form id="editUserForm" method="POST" enctype="multipart/form-data" class="flex flex-col flex-1 min-h-0">
|
||||||
<div class="p-2.5 rounded-xl bg-slate-50 border border-slate-200 flex items-start gap-2.5 text-[11px] text-slate-600">
|
@csrf
|
||||||
<i class="fa-solid fa-circle-info text-indigo-600 text-sm mt-0.5 flex-shrink-0"></i>
|
|
||||||
<div class="leading-relaxed">
|
|
||||||
<span class="font-bold text-slate-800 block mb-0.5">Panduan Wewenang Pengguna:</span>
|
|
||||||
Wewenang dengan tanda <span class="inline-flex items-center px-1.5 py-0.2 rounded text-[10px] font-bold bg-emerald-100 text-emerald-800 border border-emerald-200">✓ Bawaan Role</span> otomatis aktif dari Role utama yang dipilih di atas. Anda dapat mencentang kotak lainnya untuk memberikan <span class="inline-flex items-center px-1.5 py-0.2 rounded text-[10px] font-bold bg-indigo-100 text-indigo-800 border border-indigo-200">+ Izin Khusus</span> tambahan secara individual.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@foreach($modules as $moduleKey => $module)
|
<div class="overflow-y-auto flex-1 p-5 sm:p-6 space-y-5">
|
||||||
<div class="space-y-1.5 pb-2.5 border-b border-slate-100 last:border-0">
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 items-start">
|
||||||
<p class="font-bold text-[11px] text-indigo-950 flex items-center gap-1.5">
|
<!-- KOLOM KIRI: Kredensial & Akun Login -->
|
||||||
<i class="{{ $module['icon'] }} text-[10px] text-indigo-600"></i>
|
<div class="space-y-4 bg-slate-50/70 p-4 sm:p-5 rounded-2xl border border-slate-200/80">
|
||||||
<span>{{ $module['name'] }}</span>
|
<div class="flex items-center justify-between pb-2.5 border-b border-slate-200/80">
|
||||||
</p>
|
<span class="text-xs font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1.5">
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-1.5 pl-3">
|
<i class="fa-solid fa-shield-halved text-indigo-600"></i>
|
||||||
@foreach($module['permissions'] as $permKey => $permMeta)
|
1. Identitas Akun Pengguna
|
||||||
<label class="perm-item-wrapper flex items-start justify-between gap-2 text-[11px] text-slate-700 cursor-pointer select-none p-1.5 rounded-lg border border-transparent transition">
|
</span>
|
||||||
<div class="flex items-start gap-2 min-w-0">
|
<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>
|
||||||
<input type="checkbox"
|
</div>
|
||||||
name="direct_permissions[]"
|
|
||||||
value="{{ $permKey }}"
|
<!-- Upload / Ganti Foto Profil -->
|
||||||
id="edit_perm_{{ str_replace('.', '_', $permKey) }}"
|
<div>
|
||||||
onchange="onDirectPermCheckboxChange(this)"
|
<label class="block text-xs font-bold text-slate-700 mb-1">Foto Profil Pengguna</label>
|
||||||
class="mt-0.5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500 user-direct-perm-checkbox flex-shrink-0">
|
<div class="flex items-center space-x-3">
|
||||||
<div class="min-w-0">
|
<div id="editUserPhotoPreviewContainer" class="w-12 h-12 rounded-full border border-slate-200 bg-slate-50 flex items-center justify-center overflow-hidden flex-shrink-0 shadow-2xs">
|
||||||
<span class="font-medium text-slate-800 transition block truncate">
|
<img id="editUserPhotoPreview" src="" alt="Foto" class="w-full h-full object-cover hidden">
|
||||||
{{ $permMeta['label'] }}
|
<i id="editUserPhotoPlaceholder" class="fa-solid fa-user text-slate-400 text-sm"></i>
|
||||||
</span>
|
</div>
|
||||||
<span class="font-mono text-[9px] text-slate-400 block">{{ $permKey }}</span>
|
<div class="flex-1">
|
||||||
</div>
|
<input type="file"
|
||||||
</div>
|
name="photo"
|
||||||
<div class="flex-shrink-0 pt-0.5">
|
id="editUserPhotoInput"
|
||||||
<span id="badge_edit_perm_{{ str_replace('.', '_', $permKey) }}" class="hidden"></span>
|
accept="image/jpeg,image/png,image/jpg,image/webp"
|
||||||
</div>
|
onchange="previewUserImage(this, 'editUserPhotoPreview', 'editUserPhotoPlaceholder')"
|
||||||
</label>
|
class="block w-full text-xs text-slate-500 file:mr-2.5 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-[11px] file:font-bold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100 cursor-pointer">
|
||||||
@endforeach
|
<p class="text-[10px] text-slate-400 mt-0.5">Pilih file baru jika ingin mengganti foto profil.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<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-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<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-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white font-mono">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<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-white border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-bold text-slate-700 mb-1">
|
||||||
|
Ganti Password <span class="text-slate-400 font-normal">(Kosongkan jika tidak diubah)</span>
|
||||||
|
</label>
|
||||||
|
<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>
|
||||||
|
<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-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)
|
||||||
|
<option value="{{ $role->name }}">{{ ucwords(str_replace('_', ' ', $role->name)) }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-4 border-t border-slate-100 flex items-center justify-end gap-2.5">
|
<!-- KOLOM KANAN: Data Profil Karyawan & Penugasan -->
|
||||||
<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="space-y-4 bg-slate-50/70 p-4 sm:p-5 rounded-2xl border border-slate-200/80">
|
||||||
Batal
|
<div class="flex items-center justify-between pb-2.5 border-b border-slate-200/80">
|
||||||
</button>
|
<span class="text-xs font-bold text-slate-800 uppercase tracking-wider flex items-center gap-1.5">
|
||||||
<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">
|
<i class="fa-solid fa-id-badge text-emerald-600"></i>
|
||||||
Simpan Perubahan
|
2. Profil Personil & Penugasan
|
||||||
</button>
|
</span>
|
||||||
</div>
|
<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>
|
||||||
</form>
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<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-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="sukon">Sukon (Subkontraktor)</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Unit Kerja</label>
|
||||||
|
<input type="text"
|
||||||
|
id="edit_unit_kerja"
|
||||||
|
name="unit_kerja"
|
||||||
|
list="adminUnitKerjaSuggestions"
|
||||||
|
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...">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<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-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>
|
||||||
|
<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-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>
|
||||||
|
<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-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="1">YA (Aktif Mengemudi)</option>
|
||||||
|
</select>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- Accordion: Izin Tambahan Khusus (Direct Permissions) -->
|
||||||
|
<div class="border border-slate-200 rounded-2xl overflow-hidden bg-slate-50/50">
|
||||||
|
<button type="button"
|
||||||
|
onclick="toggleDirectPermsAccordion()"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-key text-indigo-600"></i>
|
||||||
|
<span>Izin Tambahan Khusus (Direct Permissions)</span>
|
||||||
|
</span>
|
||||||
|
<i id="directPermsChevron" class="fa-solid fa-chevron-down text-[10px] text-slate-400 transition-transform duration-200"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div id="directPermsContainer" class="hidden p-4 space-y-4 max-h-64 overflow-y-auto bg-white border-t border-slate-200 text-xs">
|
||||||
|
<!-- Panduan Visual Matriks Izin -->
|
||||||
|
<div class="p-2.5 rounded-xl bg-slate-50 border border-slate-200 flex items-start gap-2.5 text-[11px] text-slate-600">
|
||||||
|
<i class="fa-solid fa-circle-info text-indigo-600 text-sm mt-0.5 flex-shrink-0"></i>
|
||||||
|
<div class="leading-relaxed">
|
||||||
|
<span class="font-bold text-slate-800 block mb-0.5">Panduan Wewenang Pengguna:</span>
|
||||||
|
Wewenang dengan tanda <span class="inline-flex items-center px-1.5 py-0.2 rounded text-[10px] font-bold bg-emerald-100 text-emerald-800 border border-emerald-200">✓ Bawaan Role</span> otomatis aktif dari Role utama yang dipilih di atas. Anda dapat mencentang kotak lainnya untuk memberikan <span class="inline-flex items-center px-1.5 py-0.2 rounded text-[10px] font-bold bg-indigo-100 text-indigo-800 border border-indigo-200">+ Izin Khusus</span> tambahan secara individual.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@foreach($modules as $moduleKey => $module)
|
||||||
|
<div class="space-y-1.5 pb-2.5 border-b border-slate-100 last:border-0">
|
||||||
|
<p class="font-bold text-[11px] text-indigo-950 flex items-center gap-1.5">
|
||||||
|
<i class="{{ $module['icon'] }} text-[10px] text-indigo-600"></i>
|
||||||
|
<span>{{ $module['name'] }}</span>
|
||||||
|
</p>
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-1.5 pl-3">
|
||||||
|
@foreach($module['permissions'] as $permKey => $permMeta)
|
||||||
|
<label class="perm-item-wrapper flex items-start justify-between gap-2 text-[11px] text-slate-700 cursor-pointer select-none p-1.5 rounded-lg border border-transparent transition">
|
||||||
|
<div class="flex items-start gap-2 min-w-0">
|
||||||
|
<input type="checkbox"
|
||||||
|
name="direct_permissions[]"
|
||||||
|
value="{{ $permKey }}"
|
||||||
|
id="edit_perm_{{ str_replace('.', '_', $permKey) }}"
|
||||||
|
onchange="onDirectPermCheckboxChange(this)"
|
||||||
|
class="mt-0.5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500 user-direct-perm-checkbox flex-shrink-0">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<span class="font-medium text-slate-800 transition block truncate">
|
||||||
|
{{ $permMeta['label'] }}
|
||||||
|
</span>
|
||||||
|
<span class="font-mono text-[9px] text-slate-400 block">{{ $permKey }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-shrink-0 pt-0.5">
|
||||||
|
<span id="badge_edit_perm_{{ str_replace('.', '_', $permKey) }}" class="hidden"></span>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer Modal (Pinned at Bottom) -->
|
||||||
|
<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
|
||||||
|
</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 cursor-pointer flex items-center gap-1.5">
|
||||||
|
<i class="fa-solid fa-check"></i>
|
||||||
|
<span>Simpan Perubahan</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -630,256 +630,272 @@
|
|||||||
<!-- 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 items-center space-x-3">
|
<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="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="flex items-center space-x-3">
|
||||||
<i class="fa-solid fa-qrcode"></i>
|
<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>
|
<i class="fa-solid fa-qrcode"></i>
|
||||||
<div>
|
</div>
|
||||||
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Stiker QR Code Kendaraan</h3>
|
|
||||||
<p class="text-xs text-slate-500">Siap dicetak dan ditempelkan pada fisik armada unit</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Switcher Orientasi & Tombol Tutup -->
|
|
||||||
<div class="flex items-center space-x-2.5 self-end sm:self-auto">
|
|
||||||
<!-- Toggle Tab Orientasi: Landscape & Portrait -->
|
|
||||||
<div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold">
|
|
||||||
<button type="button"
|
|
||||||
id="btnTabLandscape"
|
|
||||||
onclick="setStickerOrientation('landscape')"
|
|
||||||
class="px-3 py-1.5 rounded-lg transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1.5 cursor-pointer">
|
|
||||||
<i class="fa-solid fa-image text-emerald-600"></i>
|
|
||||||
<span>Landscape</span>
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
id="btnTabPortrait"
|
|
||||||
onclick="setStickerOrientation('portrait')"
|
|
||||||
class="px-3 py-1.5 rounded-lg transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1.5 cursor-pointer">
|
|
||||||
<i class="fa-solid fa-file text-slate-400"></i>
|
|
||||||
<span>Potrait</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="button"
|
|
||||||
onclick="closeQrModal()"
|
|
||||||
class="text-slate-400 hover:text-slate-600 transition p-1.5 rounded-lg hover:bg-slate-100 cursor-pointer"
|
|
||||||
title="Tutup Modal">
|
|
||||||
<i class="fa-solid fa-xmark text-lg"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Area Kartu Stiker Fisik (Bisa Dicetak Langsung) -->
|
|
||||||
<div class="mt-5">
|
|
||||||
<!-- 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">
|
|
||||||
<!-- Kop Stiker Resmi Perusahaan -->
|
|
||||||
<div class="border-b-2 border-slate-900 pb-3 mb-4 flex items-center justify-between">
|
|
||||||
<div>
|
<div>
|
||||||
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
|
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Stiker QR Code Kendaraan</h3>
|
||||||
<h4 class="text-xs sm:text-sm font-black uppercase tracking-tight text-slate-900 mt-0.5">TIMESHEET KENDARAAN OPERASIONAL</h4>
|
<p class="text-xs text-slate-500">Siap dicetak dan ditempelkan pada fisik armada unit</p>
|
||||||
<div class="text-[9px] font-bold text-slate-500 tracking-wider">LIGHT VEHICLE (LV) • RKM SYSTEM</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-right">
|
|
||||||
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-mono font-black bg-emerald-50 text-[#1b5e20] border border-emerald-200 modal-qr-code-badge">
|
|
||||||
LV01
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Konten Landscape: 2 Kolom Seimbang -->
|
<!-- Switcher Orientasi & Tombol Tutup -->
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-12 gap-4 items-center">
|
<div class="flex items-center space-x-2 self-end sm:self-auto">
|
||||||
<!-- Kolom Kiri: QR Code (5/12) -->
|
<!-- Toggle Tab Orientasi: Landscape & Portrait -->
|
||||||
<div class="sm:col-span-5 flex flex-col items-center justify-center">
|
<div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold">
|
||||||
<div class="bg-white p-3 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs">
|
<button type="button"
|
||||||
<div class="w-44 h-44 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
id="btnTabLandscape"
|
||||||
<!-- SVG QR Code di-inject di sini -->
|
onclick="setStickerOrientation('landscape')"
|
||||||
</div>
|
class="px-3 py-1.5 rounded-lg transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1.5 cursor-pointer">
|
||||||
</div>
|
<i class="fa-solid fa-image text-emerald-600"></i>
|
||||||
<!-- Tautan Langsung -->
|
<span>Landscape</span>
|
||||||
<div class="mt-2 text-[9px] font-mono text-slate-400 break-all text-center modal-qr-url">
|
</button>
|
||||||
http://.../gate-activity/LV01
|
<button type="button"
|
||||||
</div>
|
id="btnTabPortrait"
|
||||||
|
onclick="setStickerOrientation('portrait')"
|
||||||
|
class="px-3 py-1.5 rounded-lg transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1.5 cursor-pointer">
|
||||||
|
<i class="fa-solid fa-file text-slate-400"></i>
|
||||||
|
<span>Potrait</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Kolom Kanan: Rincian Unit & Panduan (7/12) -->
|
<button type="button"
|
||||||
<div class="sm:col-span-7 space-y-2.5">
|
onclick="closeQrModal()"
|
||||||
<!-- Rincian Identitas Unit Kendaraan -->
|
class="text-slate-400 hover:text-slate-600 transition p-1.5 rounded-lg hover:bg-slate-100 cursor-pointer"
|
||||||
<div class="space-y-1.5 bg-slate-50/80 p-3 rounded-2xl border border-slate-200 text-left">
|
title="Tutup Modal">
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
<i class="fa-solid fa-xmark text-lg"></i>
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
|
</button>
|
||||||
<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>
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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-[190px] modal-qr-brand-text">TOYOTA HILUX 4X4 DC</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-between">
|
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">DIVISI:</span>
|
|
||||||
<span class="font-bold text-xs text-slate-700 modal-qr-division-text">HSE</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Panduan Driver -->
|
<!-- Area Kartu Stiker Fisik (Scrollable Body) -->
|
||||||
<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="overflow-y-auto flex-1 my-3 pr-1">
|
||||||
<div class="w-6 h-6 rounded-lg bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
|
<!-- 1. PREVIEW STIKER LANDSCAPE (DEFAULT AKTIF) -->
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3.5 h-3.5 fill-current">
|
<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">
|
||||||
<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"/>
|
<!-- Kop Stiker Resmi Perusahaan -->
|
||||||
</svg>
|
<div class="border-b-2 border-slate-900 pb-3 mb-4 flex items-center justify-between">
|
||||||
</div>
|
<div>
|
||||||
<span class="leading-snug">
|
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
|
||||||
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir pencatatan kilometer & perlintasan gerbang.
|
<h4 class="text-xs sm:text-sm 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>
|
||||||
|
<div class="text-right">
|
||||||
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-mono font-black bg-emerald-50 text-[#1b5e20] border border-emerald-200 modal-qr-code-badge">
|
||||||
|
LV01
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 2. PREVIEW STIKER POTRAIT -->
|
<!-- Konten Landscape: 2 Kolom Seimbang -->
|
||||||
<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 class="grid grid-cols-1 sm:grid-cols-12 gap-4 items-center">
|
||||||
<!-- Kop Stiker Resmi Perusahaan -->
|
<!-- Kolom Kiri: QR Code (5/12) -->
|
||||||
<div class="border-b-2 border-slate-900 pb-3 mb-4">
|
<div class="sm:col-span-5 flex flex-col items-center justify-center">
|
||||||
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
|
<div class="bg-white p-3 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs">
|
||||||
<h4 class="text-xs font-black uppercase tracking-tight text-slate-900 mt-0.5">TIMESHEET KENDARAAN OPERASIONAL</h4>
|
<div class="w-44 h-44 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
||||||
<div class="text-[9px] font-bold text-slate-500 tracking-wider">LIGHT VEHICLE (LV) • RKM SYSTEM</div>
|
<!-- SVG QR Code di-inject di sini -->
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Tautan Langsung -->
|
||||||
|
<div class="mt-2 text-[9px] font-mono text-slate-400 break-all text-center modal-qr-url">
|
||||||
|
http://.../gate-activity/LV01
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Kontainer QR Code Vektor -->
|
<!-- Kolom Kanan: Rincian Unit & Panduan (7/12) -->
|
||||||
<div class="bg-white p-3.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-4">
|
<div class="sm:col-span-7 space-y-2.5">
|
||||||
<div class="w-52 h-52 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
<!-- Rincian Identitas Unit Kendaraan -->
|
||||||
<!-- SVG QR Code di-inject di sini -->
|
<div class="space-y-1.5 bg-slate-50/80 p-3 rounded-2xl border border-slate-200 text-left">
|
||||||
|
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
||||||
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</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 class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60">
|
||||||
|
<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-[190px] modal-qr-brand-text">TOYOTA HILUX 4X4 DC</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">DIVISI:</span>
|
||||||
|
<span class="font-bold text-xs text-slate-700 modal-qr-division-text">HSE</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 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="w-6 h-6 rounded-lg 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">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<span class="leading-snug">
|
||||||
|
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir pencatatan kilometer & perlintasan gerbang.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Rincian Identitas Unit Kendaraan -->
|
<!-- 2. PREVIEW STIKER POTRAIT (COMPACT & RESPONSIVE) -->
|
||||||
<div class="space-y-1.5 mb-3 text-left bg-slate-50/80 p-3.5 rounded-2xl border border-slate-200">
|
<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">
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
<!-- Kop Stiker Resmi Perusahaan -->
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
|
<div class="border-b-2 border-slate-900 pb-2.5 mb-3">
|
||||||
<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>
|
<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>
|
||||||
|
<div class="text-[9px] font-bold text-slate-500 tracking-wider">LIGHT VEHICLE (LV) • RKM SYSTEM</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-between">
|
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">DIVISI:</span>
|
|
||||||
<span class="font-bold text-xs text-slate-700 modal-qr-division-text">HSE</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Panduan Driver -->
|
<!-- Kontainer QR Code Vektor (Compact) -->
|
||||||
<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="bg-white p-2.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-3">
|
||||||
<div class="w-6 h-6 rounded-lg bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
|
<div class="w-40 h-40 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3.5 h-3.5 fill-current">
|
<!-- SVG QR Code di-inject di sini -->
|
||||||
<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"/>
|
</div>
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<span class="leading-snug">
|
|
||||||
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir pencatatan kilometer & perlintasan gerbang.
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tautan Langsung -->
|
<!-- Rincian Identitas Unit Kendaraan -->
|
||||||
<div class="mt-2.5 text-[9px] font-mono text-slate-400 break-all modal-qr-url">
|
<div class="space-y-1.5 mb-2.5 text-left bg-slate-50/80 p-3 rounded-2xl border border-slate-200">
|
||||||
http://.../gate-activity/LV01
|
<div class="flex items-center justify-between pb-1 border-b border-slate-200/60">
|
||||||
</div>
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
|
||||||
</div>
|
<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 border-b border-slate-200/60">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<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="font-bold text-xs text-slate-900 text-right max-w-[170px] modal-qr-brand-text">TOYOTA HILUX 4X4 DC</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">DIVISI:</span>
|
||||||
|
<span class="font-bold text-xs text-slate-700 modal-qr-division-text">HSE</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Tombol Aksi Cetak & Unduh -->
|
<!-- Panduan Driver -->
|
||||||
<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="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="flex flex-wrap items-center gap-2">
|
<div class="w-5 h-5 rounded-md bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
|
||||||
<!-- Dropdown / Tombol Cetak -->
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3 h-3 fill-current">
|
||||||
<div class="relative inline-block text-left" id="printDropdownContainer">
|
<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"/>
|
||||||
<div class="inline-flex rounded-xl shadow-sm">
|
</svg>
|
||||||
<button type="button"
|
</div>
|
||||||
onclick="printSticker()"
|
<span class="leading-tight">
|
||||||
id="btnMainPrint"
|
<strong>Scan QR ini</strong> menggunakan HP untuk pencatatan KM & perlintasan.
|
||||||
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">
|
</span>
|
||||||
<i class="fa-solid fa-print"></i>
|
|
||||||
<span id="btnMainPrintLabel">Cetak Landscape</span>
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
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"
|
|
||||||
title="Pilihan Orientasi Cetak">
|
|
||||||
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="printDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-48 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
|
||||||
<button type="button" onclick="printSticker('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-image text-emerald-600"></i>
|
|
||||||
<span>Cetak Landscape</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" onclick="printSticker('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-file text-slate-500"></i>
|
|
||||||
<span>Cetak Potrait</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Dropdown / Tombol Unduh PNG -->
|
<!-- Tautan Langsung -->
|
||||||
<div class="relative inline-block text-left" id="downloadDropdownContainer">
|
<div class="text-[8.5px] font-mono text-slate-400 break-all modal-qr-url">
|
||||||
<div class="inline-flex rounded-xl shadow-sm border border-slate-200">
|
http://.../gate-activity/LV01
|
||||||
<button type="button"
|
|
||||||
id="btnDownloadSticker"
|
|
||||||
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">
|
|
||||||
<i class="fa-solid fa-download"></i>
|
|
||||||
<span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span>
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
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"
|
|
||||||
title="Pilihan Orientasi Unduh">
|
|
||||||
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div id="downloadDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-52 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
|
||||||
<button type="button" onclick="downloadQrCode('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-image text-emerald-600"></i>
|
|
||||||
<span>Unduh Landscape (PNG)</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" onclick="downloadQrCode('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-file text-slate-500"></i>
|
|
||||||
<span>Unduh Potrait (PNG)</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center space-x-2 justify-end">
|
<!-- Tombol Aksi Cetak & Unduh (Pinned / Locked at Bottom) -->
|
||||||
<!-- Test Form Scan -->
|
<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">
|
||||||
<a id="modalQrTestLink"
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
href="#"
|
<!-- Dropdown / Tombol Cetak -->
|
||||||
target="_blank"
|
<div class="relative inline-block text-left" id="printDropdownContainer">
|
||||||
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"
|
<div class="inline-flex rounded-xl shadow-sm">
|
||||||
title="Buka form input penggunaan kendaraan di tab baru untuk pengetesan">
|
<button type="button"
|
||||||
<i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i>
|
onclick="printSticker()"
|
||||||
<span>Tes Form</span>
|
id="btnMainPrint"
|
||||||
</a>
|
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>
|
||||||
|
<span id="btnMainPrintLabel">Cetak Landscape</span>
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
onclick="toggleQrDropdown('printDropdownMenu', event)"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div id="printDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-48 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
||||||
|
<button type="button" onclick="printSticker('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-image text-emerald-600"></i>
|
||||||
|
<span>Cetak Landscape</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="printSticker('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-file text-slate-500"></i>
|
||||||
|
<span>Cetak Potrait</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="button"
|
<!-- Dropdown / Tombol Unduh PNG -->
|
||||||
onclick="closeQrModal()"
|
<div class="relative inline-block text-left" id="downloadDropdownContainer">
|
||||||
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">
|
<div class="inline-flex rounded-xl shadow-sm border border-slate-200">
|
||||||
Tutup
|
<button type="button"
|
||||||
</button>
|
id="btnDownloadSticker"
|
||||||
</div>
|
onclick="downloadQrCode()"
|
||||||
</div>
|
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">
|
||||||
</div>
|
<i class="fa-solid fa-download"></i>
|
||||||
</div>
|
<span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span>
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
onclick="toggleQrDropdown('downloadDropdownMenu', event)"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div id="downloadDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-52 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
||||||
|
<button type="button" onclick="downloadQrCode('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-image text-emerald-600"></i>
|
||||||
|
<span>Unduh Landscape (PNG)</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="downloadQrCode('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-file text-slate-500"></i>
|
||||||
|
<span>Unduh Potrait (PNG)</span>
|
||||||
|
</button>
|
||||||
|
</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 class="flex items-center space-x-2 justify-end">
|
||||||
|
<!-- Test Form Scan -->
|
||||||
|
<a id="modalQrTestLink"
|
||||||
|
href="#"
|
||||||
|
target="_blank"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i>
|
||||||
|
<span>Tes Form</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<button type="button"
|
||||||
|
onclick="closeQrModal()"
|
||||||
|
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
|
||||||
|
</button>
|
||||||
|
</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,252 +793,272 @@
|
|||||||
<!-- 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 items-center space-x-3">
|
<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="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="flex items-center space-x-3">
|
||||||
<i class="fa-solid fa-qrcode"></i>
|
<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>
|
<i class="fa-solid fa-qrcode"></i>
|
||||||
<div>
|
</div>
|
||||||
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Stiker QR Code Heavy Equipment</h3>
|
|
||||||
<p class="text-xs text-slate-500">Siap dicetak dan ditempelkan pada fisik armada unit</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Switcher Orientasi & Tombol Tutup -->
|
|
||||||
<div class="flex items-center space-x-2.5 self-end sm:self-auto">
|
|
||||||
<!-- Toggle Tab Orientasi: Landscape & Portrait -->
|
|
||||||
<div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold">
|
|
||||||
<button type="button"
|
|
||||||
id="btnTabLandscape"
|
|
||||||
onclick="setStickerOrientation('landscape')"
|
|
||||||
class="px-3 py-1.5 rounded-lg transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1.5 cursor-pointer">
|
|
||||||
<i class="fa-solid fa-image text-emerald-600"></i>
|
|
||||||
<span>Landscape</span>
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
id="btnTabPortrait"
|
|
||||||
onclick="setStickerOrientation('portrait')"
|
|
||||||
class="px-3 py-1.5 rounded-lg transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1.5 cursor-pointer">
|
|
||||||
<i class="fa-solid fa-file text-slate-400"></i>
|
|
||||||
<span>Potrait</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="button"
|
|
||||||
onclick="closeQrModal()"
|
|
||||||
class="text-slate-400 hover:text-slate-600 transition p-1.5 rounded-lg hover:bg-slate-100 cursor-pointer"
|
|
||||||
title="Tutup Modal">
|
|
||||||
<i class="fa-solid fa-xmark text-lg"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Area Kartu Stiker Fisik (Bisa Dicetak Langsung) -->
|
|
||||||
<div class="mt-5">
|
|
||||||
<!-- 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">
|
|
||||||
<!-- Kop Stiker Resmi Perusahaan -->
|
|
||||||
<div class="border-b-2 border-slate-900 pb-3 mb-4 flex items-center justify-between">
|
|
||||||
<div>
|
<div>
|
||||||
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
|
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Stiker QR Code Heavy Equipment</h3>
|
||||||
<h4 class="text-xs sm:text-sm font-black uppercase tracking-tight text-slate-900 mt-0.5 modal-qr-sub-title">HEAVY EQUIPMENT • RKM SYSTEM</h4>
|
<p class="text-xs text-slate-500">Siap dicetak dan ditempelkan pada fisik armada unit</p>
|
||||||
<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 class="text-right">
|
|
||||||
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-mono font-black bg-emerald-50 text-[#1b5e20] border border-emerald-200 modal-qr-code-badge">
|
|
||||||
-
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Konten Landscape: 2 Kolom Seimbang -->
|
<!-- Switcher Orientasi & Tombol Tutup -->
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-12 gap-4 items-center">
|
<div class="flex items-center space-x-2 self-end sm:self-auto">
|
||||||
<!-- Kolom Kiri: QR Code (5/12) -->
|
<!-- Toggle Tab Orientasi: Landscape & Portrait -->
|
||||||
<div class="sm:col-span-5 flex flex-col items-center justify-center">
|
<div class="inline-flex p-1 bg-slate-100 rounded-xl border border-slate-200 text-xs font-bold">
|
||||||
<div class="bg-white p-3 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs">
|
<button type="button"
|
||||||
<div class="w-44 h-44 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
id="btnTabLandscape"
|
||||||
<!-- SVG QR Code di-inject di sini -->
|
onclick="setStickerOrientation('landscape')"
|
||||||
</div>
|
class="px-3 py-1.5 rounded-lg transition text-slate-800 bg-white shadow-2xs border border-slate-200/60 font-bold flex items-center space-x-1.5 cursor-pointer">
|
||||||
</div>
|
<i class="fa-solid fa-image text-emerald-600"></i>
|
||||||
<!-- Tautan Langsung -->
|
<span>Landscape</span>
|
||||||
<div class="mt-2 text-[9px] font-mono text-slate-400 break-all text-center modal-qr-url">
|
</button>
|
||||||
-
|
<button type="button"
|
||||||
</div>
|
id="btnTabPortrait"
|
||||||
|
onclick="setStickerOrientation('portrait')"
|
||||||
|
class="px-3 py-1.5 rounded-lg transition text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1.5 cursor-pointer">
|
||||||
|
<i class="fa-solid fa-file text-slate-400"></i>
|
||||||
|
<span>Potrait</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Kolom Kanan: Rincian Unit & Panduan (7/12) -->
|
<button type="button"
|
||||||
<div class="sm:col-span-7 space-y-2.5">
|
onclick="closeQrModal()"
|
||||||
<!-- Rincian Identitas Unit Kendaraan -->
|
class="text-slate-400 hover:text-slate-600 transition p-1.5 rounded-lg hover:bg-slate-100 cursor-pointer"
|
||||||
<div class="space-y-1.5 bg-slate-50/80 p-3 rounded-2xl border border-slate-200 text-left">
|
title="Tutup Modal">
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
<i class="fa-solid fa-xmark text-lg"></i>
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
|
</button>
|
||||||
<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>
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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-[190px] modal-qr-brand-text">-</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-between">
|
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">LOKASI KERJA:</span>
|
|
||||||
<span class="font-bold text-xs text-slate-700 modal-qr-location-text">-</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Panduan Driver / Operator -->
|
<!-- Area Kartu Stiker Fisik (Scrollable Body) -->
|
||||||
<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="overflow-y-auto flex-1 my-3 pr-1">
|
||||||
<div class="w-6 h-6 rounded-lg bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
|
<!-- 1. PREVIEW STIKER LANDSCAPE (DEFAULT AKTIF) -->
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3.5 h-3.5 fill-current">
|
<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">
|
||||||
<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"/>
|
<!-- Kop Stiker Resmi Perusahaan -->
|
||||||
</svg>
|
<div class="border-b-2 border-slate-900 pb-3 mb-4 flex items-center justify-between">
|
||||||
</div>
|
<div>
|
||||||
<span class="leading-snug modal-qr-instruction-text">
|
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
|
||||||
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir operasional unit.
|
<h4 class="text-xs sm:text-sm 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>
|
||||||
|
<div class="text-right">
|
||||||
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-mono font-black bg-emerald-50 text-[#1b5e20] border border-emerald-200 modal-qr-code-badge">
|
||||||
|
-
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 2. PREVIEW STIKER POTRAIT -->
|
<!-- Konten Landscape: 2 Kolom Seimbang -->
|
||||||
<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 class="grid grid-cols-1 sm:grid-cols-12 gap-4 items-center">
|
||||||
<!-- Kop Stiker Resmi Perusahaan -->
|
<!-- Kolom Kiri: QR Code (5/12) -->
|
||||||
<div class="border-b-2 border-slate-900 pb-3 mb-4">
|
<div class="sm:col-span-5 flex flex-col items-center justify-center">
|
||||||
<div class="text-[10px] font-extrabold uppercase tracking-widest text-[#1b5e20]">PT KERINCI MERANGIN HIDRO</div>
|
<div class="bg-white p-3 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs">
|
||||||
<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="w-44 h-44 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
||||||
<div class="text-[9px] font-bold text-slate-500 tracking-wider uppercase modal-qr-category-text">{{ $category->name ?? $category->unit_category ?? 'ALAT BERAT' }}</div>
|
<!-- SVG QR Code di-inject di sini -->
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Tautan Langsung -->
|
||||||
|
<div class="mt-2 text-[9px] font-mono text-slate-400 break-all text-center modal-qr-url">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Kontainer QR Code Vektor -->
|
<!-- Kolom Kanan: Rincian Unit & Panduan (7/12) -->
|
||||||
<div class="bg-white p-3.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-4">
|
<div class="sm:col-span-7 space-y-2.5">
|
||||||
<div class="w-52 h-52 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
<!-- Rincian Identitas Unit Kendaraan -->
|
||||||
<!-- SVG QR Code di-inject di sini -->
|
<div class="space-y-1.5 bg-slate-50/80 p-3 rounded-2xl border border-slate-200 text-left">
|
||||||
|
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
||||||
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</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 class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60">
|
||||||
|
<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-[190px] modal-qr-brand-text">-</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">LOKASI KERJA:</span>
|
||||||
|
<span class="font-bold text-xs text-slate-700 modal-qr-location-text">-</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 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="w-6 h-6 rounded-lg 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">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<span class="leading-snug modal-qr-instruction-text">
|
||||||
|
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir operasional unit.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Rincian Identitas Unit Kendaraan -->
|
<!-- 2. PREVIEW STIKER POTRAIT (COMPACT & RESPONSIVE) -->
|
||||||
<div class="space-y-1.5 mb-3 text-left bg-slate-50/80 p-3.5 rounded-2xl border border-slate-200">
|
<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">
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
<!-- Kop Stiker Resmi Perusahaan -->
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
|
<div class="border-b-2 border-slate-900 pb-2.5 mb-3">
|
||||||
<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>
|
<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>
|
||||||
|
<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>
|
||||||
<div class="flex items-center justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-start justify-between pb-1.5 border-b border-slate-200/60">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center justify-between">
|
|
||||||
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">LOKASI KERJA:</span>
|
|
||||||
<span class="font-bold text-xs text-slate-700 modal-qr-location-text">-</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Panduan Driver / Operator -->
|
<!-- Kontainer QR Code Vektor (Compact) -->
|
||||||
<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="bg-white p-2.5 rounded-2xl border-2 border-slate-200 inline-block shadow-2xs mb-3">
|
||||||
<div class="w-6 h-6 rounded-lg bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
|
<div class="w-40 h-40 flex items-center justify-center [&>svg]:w-full [&>svg]:h-full modal-qr-container">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3.5 h-3.5 fill-current">
|
<!-- SVG QR Code di-inject di sini -->
|
||||||
<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"/>
|
</div>
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<span class="leading-snug modal-qr-instruction-text">
|
|
||||||
<strong>Scan QR ini</strong> menggunakan kamera HP untuk membuka formulir operasional unit.
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tautan Langsung -->
|
<!-- Rincian Identitas Unit Kendaraan -->
|
||||||
<div class="mt-2.5 text-[9px] font-mono text-slate-400 break-all modal-qr-url">
|
<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 border-b border-slate-200/60">
|
||||||
</div>
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">KODE UNIT:</span>
|
||||||
</div>
|
<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 border-b border-slate-200/60">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<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="font-bold text-xs text-slate-900 text-right max-w-[170px] modal-qr-brand-text">-</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-wider">LOKASI KERJA:</span>
|
||||||
|
<span class="font-bold text-xs text-slate-700 modal-qr-location-text">-</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Tombol Aksi Cetak & Unduh -->
|
<!-- Panduan Driver / Operator -->
|
||||||
<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="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="flex flex-wrap items-center gap-2">
|
<div class="w-5 h-5 rounded-md bg-[#1b5e20] text-white flex items-center justify-center flex-shrink-0">
|
||||||
<!-- Dropdown / Tombol Cetak -->
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-3 h-3 fill-current">
|
||||||
<div class="relative inline-block text-left" id="printDropdownContainer">
|
<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"/>
|
||||||
<div class="inline-flex rounded-xl shadow-sm">
|
</svg>
|
||||||
<button type="button"
|
</div>
|
||||||
onclick="printSticker()"
|
<span class="leading-tight modal-qr-instruction-text">
|
||||||
id="btnMainPrint"
|
<strong>Scan QR ini</strong> menggunakan HP untuk membuka formulir operasional unit.
|
||||||
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">
|
</span>
|
||||||
<i class="fa-solid fa-print"></i>
|
|
||||||
<span id="btnMainPrintLabel">Cetak Landscape</span>
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
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"
|
|
||||||
title="Pilihan Orientasi Cetak">
|
|
||||||
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="printDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-48 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
|
||||||
<button type="button" onclick="printSticker('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-image text-emerald-600"></i>
|
|
||||||
<span>Cetak Landscape</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" onclick="printSticker('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-file text-slate-500"></i>
|
|
||||||
<span>Cetak Potrait</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Dropdown / Tombol Unduh PNG -->
|
<!-- Tautan Langsung -->
|
||||||
<div class="relative inline-block text-left" id="downloadDropdownContainer">
|
<div class="text-[8.5px] font-mono text-slate-400 break-all modal-qr-url">
|
||||||
<div class="inline-flex rounded-xl shadow-sm border border-slate-200">
|
-
|
||||||
<button type="button"
|
|
||||||
id="btnDownloadSticker"
|
|
||||||
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">
|
|
||||||
<i class="fa-solid fa-download"></i>
|
|
||||||
<span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span>
|
|
||||||
</button>
|
|
||||||
<button type="button"
|
|
||||||
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"
|
|
||||||
title="Pilihan Orientasi Unduh">
|
|
||||||
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div id="downloadDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-52 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
|
||||||
<button type="button" onclick="downloadQrCode('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-image text-emerald-600"></i>
|
|
||||||
<span>Unduh Landscape (PNG)</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" onclick="downloadQrCode('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
|
||||||
<i class="fa-solid fa-file text-slate-500"></i>
|
|
||||||
<span>Unduh Potrait (PNG)</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center space-x-2 justify-end">
|
<!-- Tombol Aksi Cetak & Unduh (Pinned / Locked at Bottom) -->
|
||||||
<!-- Test Form Scan -->
|
<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">
|
||||||
<a id="modalQrTestLink"
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
href="#"
|
<!-- Dropdown / Tombol Cetak -->
|
||||||
target="_blank"
|
<div class="relative inline-block text-left" id="printDropdownContainer">
|
||||||
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"
|
<div class="inline-flex rounded-xl shadow-sm">
|
||||||
title="Buka form input di tab baru untuk pengetesan">
|
<button type="button"
|
||||||
<i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i>
|
onclick="printSticker()"
|
||||||
<span>Tes Form</span>
|
id="btnMainPrint"
|
||||||
</a>
|
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>
|
||||||
|
<span id="btnMainPrintLabel">Cetak Landscape</span>
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
onclick="toggleQrDropdown('printDropdownMenu', event)"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div id="printDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-48 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
||||||
|
<button type="button" onclick="printSticker('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-image text-emerald-600"></i>
|
||||||
|
<span>Cetak Landscape</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="printSticker('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-emerald-50 hover:text-[#1b5e20] rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-file text-slate-500"></i>
|
||||||
|
<span>Cetak Potrait</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="button"
|
<!-- Dropdown / Tombol Unduh PNG -->
|
||||||
onclick="closeQrModal()"
|
<div class="relative inline-block text-left" id="downloadDropdownContainer">
|
||||||
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">
|
<div class="inline-flex rounded-xl shadow-sm border border-slate-200">
|
||||||
Tutup
|
<button type="button"
|
||||||
</button>
|
id="btnDownloadSticker"
|
||||||
|
onclick="downloadQrCode()"
|
||||||
|
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>
|
||||||
|
<span id="btnMainDownloadLabel">Unduh Landscape (PNG)</span>
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
onclick="toggleQrDropdown('downloadDropdownMenu', event)"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-chevron-down text-[10px]"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div id="downloadDropdownMenu" style="display: none;" class="absolute left-0 bottom-full mb-2 w-52 bg-white rounded-2xl shadow-xl border border-slate-200 z-50 p-1.5">
|
||||||
|
<button type="button" onclick="downloadQrCode('landscape')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-image text-emerald-600"></i>
|
||||||
|
<span>Unduh Landscape (PNG)</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="downloadQrCode('portrait')" class="w-full text-left px-3.5 py-2 text-xs font-bold text-slate-700 hover:bg-slate-50 rounded-xl flex items-center space-x-2 transition cursor-pointer">
|
||||||
|
<i class="fa-solid fa-file text-slate-500"></i>
|
||||||
|
<span>Unduh Potrait (PNG)</span>
|
||||||
|
</button>
|
||||||
|
</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 class="flex items-center space-x-2 justify-end">
|
||||||
|
<!-- Test Form Scan -->
|
||||||
|
<a id="modalQrTestLink"
|
||||||
|
href="#"
|
||||||
|
target="_blank"
|
||||||
|
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">
|
||||||
|
<i class="fa-solid fa-arrow-up-right-from-square text-[11px]"></i>
|
||||||
|
<span>Tes Form</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<button type="button"
|
||||||
|
onclick="closeQrModal()"
|
||||||
|
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
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user