DEPLOY GUIDE - PT Hadir Laris Teknologi infohadir.com (Absensi) + laristok.com (Stok) - 1 PT 2 Brand STRUKTUR FILE LENGKAP /public_html/ ├── infohadir.com/ │ ├── index.html (landing dari artifact 1) │ ├── checkout.php │ ├── proses_order.php │ ├── invoice.php │ ├── cek_trial_v2.php │ ├── login.php (tambahkan include cek_trial_v2) │ └── dashboard.php (tambahkan include cek_trial_v2) │ ├── laristok.com/ │ ├── index.html (landing dari artifact 2) │ ├── checkout.php (copy sama, beda source=laristok) │ └── ... │ ├── super_admin/ │ ├── super_admin_dashboard_v2.php │ └── .htaccess (password protect) │ └── cron/ ├── cron_expired_v2.php └── cron.log STEP DEPLOY URUTAN 1. DATABASE Import di phpMyAdmin infe8543_metasby: File: alter_lock_system.sql Ini akan tambah: companies.is_locked, locked_at, locked_reason INDEX untuk kecepatan company_lock_logs (audit) VIEW view_companies_expiring 2. LANDING PAGE SEO Upload infohadir-landing_agentic_artifact_1_fd268da871ff.html jadi infohadir.com/index.html Upload laristok-landing_agentic_artifact_2_28295e507bb6.html jadi laristok.com/index.html Edit tombol CTA: href="checkout.php?package_code=pro" 3. CHECKOUT FLOW File checkout.php sudah ada: Ambil paket MAIN: SELECT * FROM packages WHERE package_tipe='MAIN' List ADD-ON: SELECT * FROM packages WHERE package_tipe='ADD-ON' Form POST ke proses_order.php JS hitung total otomatis Ganti koneksi DB di baris atas: $host="localhost"; $user="infe8543_metasby"; $pass="***"; $db="infe8543_metasby"; 4. PROSES ORDER File proses_order.php: Insert companies (paket, addon_branch_quota, addon_employee_quota, has_addon_custom_domain) Insert users (admin, password random 8 char bcrypt) Insert saas_invoices (invoice_number INV-YYYYMM-XXXX, unique_code 1-199) Insert saas_subscriptions (trial 14 hari) Insert payments Redirect ke invoice.php?inv=INV-xxx 5. INVOICE File invoice.php: Tampilkan invoice dari saas_invoices + companies Tombol WA konfirmasi: wa.me/628976984002?text=... Info login trial 6. CRON TOLERANSI 8 MENIT Pasang di cPanel > Cron Jobs: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/php /home/infe8543/public_html/cron/cron_expired_v2.php >> /home/infe8543/cron.log 2>&1 Fungsi cron_expired_v2.php: Cek trial_until + 8 menit toleransi -> kalau lewat, UPDATE is_locked=1, subscription_status=expired Cek subscription_until + 8 menit -> sama Auto UNLOCK kalau sudah bayar (payment_status=paid) Insert ke company_lock_logs 7. CEK TRIAL MIDDLEWARE (PENTING) File cek_trial_v2.php: FAST PATH: if is_locked=1 langsung blokir (0.001 detik) SLOW PATH: hitung tanggal + toleransi 8 menit, kalau lewat auto-lock Implementasi di login.php: php session_start(); include 'cek_trial_v2.php'; $check = checkCompanyStatusV2($company_id); if(!$check['allowed']){ renderExpiredPopupV2($check); } Implementasi di api/checkin.php (mobile): php include '../cek_trial_v2.php'; $check = checkCompanyStatusV2($_POST['company_id']); if(!$check['allowed']){ echo json_encode(['status'=>'error','code'=>'COMPANY_EXPIRED','expired_at'=>$check['expired_at']]); exit; } 8. SUPER ADMIN DASHBOARD V2 File super_admin_dashboard_v2.php: Stats dari VIEW: WILL_EXPIRE_2_DAYS, EXPIRED, TRIAL, ACTIVE Tabel trial mau habis 2 hari + tombol WA Closing (pesan otomatis) Tabel invoice unpaid Tabel locked (is_locked=1) + Manual Unlock Tabel Lock Logs audit Protect dengan .htaccess: AuthType Basic AuthName "Super Admin" AuthUserFile /home/infe8543/.htpasswd Require valid-user FLOW BISNIS LENGKAP Customer search "aplikasi absensi online" -> Google -> infohadir.com (SEO) Klik "Pesan Pro Rp299k" -> checkout.php?package_code=pro Isi form + centang Addon Cabang +10 Karyawan -> proses_order.php Terbuat companies (trial 14 hari), users (password random), saas_invoices (total + unique code) Redirect ke invoice.php -> customer transfer BCA pas 449.087 Kamu cek super_admin_dashboard_v2.php -> ada pending payment -> konfirmasi Setelah bayar, kamu update saas_invoices payment_status='paid' dan companies subscription_until = +1 bulan, is_locked=0 (atau biar cron auto unlock) Cron tiap 5 menit cek: kalau trial_until + 8 menit lewat -> auto lock + masuk lock_logs Karyawan yang coba absen -> cek_trial_v2.php -> popup "Terkunci, hubungi Owner" 1 PT 2 BRAND LEGAL PT: PT Hadir Laris Teknologi (di akta) Brand di lapangan: infohadir.com = aplikasi absensi (footer: sister product Laristok.com) laristok.com = aplikasi stok (footer: sister product InfoHadir.com) Invoice semua atas nama PT yang sama, jadi 1 laporan keuangan. KONTAK & NEXT STEP Setelah deploy, test dengan buat company dummy trial_until = kemarin, lihat apakah cron lock + cek_trial blokir Setup Midtrans/Xendit nanti bisa ganti bank_transfer jadi payment gateway (tinggal update payment_method di proses_order.php) Selesai. Semua file ada di /mnt/data/ siap download.