{"id":527,"date":"2026-03-25T14:10:42","date_gmt":"2026-03-25T14:10:42","guid":{"rendered":"https:\/\/ovecab.com\/?page_id=527"},"modified":"2026-04-13T14:07:51","modified_gmt":"2026-04-13T14:07:51","slug":"ticket","status":"publish","type":"page","link":"https:\/\/ovecab.com\/index.php\/ticket\/","title":{"rendered":"Ticket"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n    <title>Ovecab Lucky Draw &#8211; Smart Limit<\/title>\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/qrcodejs\/1.0.0\/qrcode.min.js\"><\/script>\n    <style>\n        * { box-sizing: border-box; margin: 0; padding: 0; }\n        body { \n            background-color: #000; color: #fff; font-family: 'Segoe UI', Arial, sans-serif; \n            margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; \n            width: 100%; min-height: 100vh; overflow-x: hidden;\n        }\n        .content-wrapper { width: 100%; max-width: 450px; padding: 15px; display: flex; flex-direction: column; align-items: center; }\n        .auth-container { width: 100%; margin-top: 50px; text-align: center; }\n        .auth-card { background: #111; padding: 30px; border-radius: 24px; border: 1px solid #333; }\n        .auth-input { width: 100%; padding: 15px; margin-bottom: 15px; background: #222; border: 1px solid #444; border-radius: 12px; color: #fff; font-size: 16px; outline: none; }\n        .login-btn { width: 100%; padding: 15px; background: #fff; color: #000; border: none; border-radius: 50px; font-weight: bold; cursor: pointer; text-transform: uppercase; }\n        .error-msg { color: #ff4444; font-size: 12px; margin-bottom: 15px; display: none; }\n        #gameScreen, #detailsScreen { display: none; width: 100%; flex-direction: column; align-items: center; }\n        .lotto-container { width: 100%; background: #111; padding: 20px; border-radius: 24px; border: 1px solid #333; text-align: center; margin-bottom: 15px; }\n        .lotto-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 15px; justify-items: center; }\n        .num-btn { background-color: #000; color: #fff; border: 1px solid #fff; width: 11vw; height: 11vw; max-width: 45px; max-height: 45px; font-size: 14px; font-weight: bold; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }\n        .num-btn.selected { background-color: #fff !important; color: #000 !important; }\n        .action-btn { padding: 12px; border-radius: 50px; cursor: pointer; font-weight: bold; font-size: 13px; border: none; text-transform: uppercase; }\n        .autopick-btn { background: #333; color: #fff; border: 1px solid #555; flex: 1; }\n        .add-btn { background: #fff; color: #000; flex: 2; }\n        .add-btn:disabled { background: #444 !important; color: #888 !important; cursor: not-allowed; }\n        #ticketCart { width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; }\n        .cart-item { position: relative; background: #0d0d0d; border: 1px solid #222; padding: 12px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; width: 100%; }\n        .ticket-nums-mini { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: 1px; }\n        .qr-box { background: #fff; padding: 5px; border-radius: 4px; margin-left: 10px; min-width: 60px; min-height: 60px; display: flex; align-items: center; justify-content: center; }\n        .whatsapp-btn { background: #25D366; color: #fff; width: 100%; margin-top: 15px; display: none; padding: 15px; border-radius: 50px; font-weight: bold; border: none; cursor: pointer; text-transform: uppercase; }\n        .print-all-btn { background: #fff; color: #000; width: 100%; margin-top: 8px; display: none; padding: 12px; border-radius: 50px; font-weight: bold; border: none; cursor: pointer; text-transform: uppercase; }\n        .remove-btn { position: absolute; top: 5px; right: 5px; background: #ff4444; color: white; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; }\n        .ticket-date { font-size: 8px; color: #666; margin-top: 4px; display: block; }\n        .stats-badge { font-size: 10px; background: #222; padding: 5px 12px; border-radius: 10px; border: 1px solid #444; }\n        @media print {\n            .no-print { display: none !important; }\n            body { background: #fff; color: #000; padding: 0; margin: 0; }\n            .cart-item { border: 1px solid #000; margin-bottom: 10px; page-break-inside: avoid; }\n            .ticket-nums-mini, .ticket-date { color: #000 !important; }\n        }\n    <\/style>\n<\/head>\n<body>\n\n    <div class=\"content-wrapper\">\n        <div id=\"authScreen\" class=\"auth-container no-print\">\n            <h2 style=\"margin-bottom: 20px;\">Ovecab Secure Access<\/h2>\n            <div class=\"auth-card\">\n                <input type=\"text\" id=\"adminID\" class=\"auth-input\" placeholder=\"Access ID\">\n                <input type=\"password\" id=\"adminPass\" class=\"auth-input\" placeholder=\"Password\">\n                <div id=\"loginError\" class=\"error-msg\">Invalid ID or Password!<\/div>\n                <button class=\"login-btn\" onclick=\"handleAdminLogin()\">Verify Access<\/button>\n            <\/div>\n        <\/div>\n\n        <div id=\"detailsScreen\" class=\"auth-container no-print\">\n            <h2 style=\"margin-bottom: 20px;\">Participant Profile<\/h2>\n            <div class=\"auth-card\">\n                <input type=\"text\" id=\"userName\" class=\"auth-input\" placeholder=\"Player Name\">\n                <input type=\"tel\" id=\"userPhone\" class=\"auth-input\" placeholder=\"Player Phone\">\n                <hr style=\"border: 0; border-top: 1px solid #333; margin-bottom: 15px;\">\n                <input type=\"text\" id=\"driverID\" class=\"auth-input\" placeholder=\"Driver ID\">\n                <button class=\"login-btn\" onclick=\"handleUserSetup()\">Start Drawing<\/button>\n            <\/div>\n        <\/div>\n\n        <div id=\"gameScreen\">\n            <div class=\"lotto-container no-print\" id=\"inputSection\">\n                <div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;\">\n                    <h2 id=\"greetUser\" style=\"color: #888; font-size: 16px;\">WELCOME<\/h2>\n                    <div id=\"limitBadge\" class=\"stats-badge\">Used: 0 | Left: 20<\/div>\n                <\/div>\n                <select id=\"gameMode\" onchange=\"resetSelection()\" style=\"width: 100%; padding: 10px; background: #000; color: #fff; border-radius: 8px; border: 1px solid #333; margin-bottom: 15px;\">\n                    <option value=\"3\">Lucky 3<\/option><option value=\"4\">Lucky 4<\/option><option value=\"5\">Lucky 5<\/option><option value=\"6\" selected>Lucky 6<\/option>\n                <\/select>\n                <div class=\"lotto-grid\" id=\"numberGrid\"><\/div>\n                <div style=\"display: flex; gap: 8px;\">\n                    <button class=\"action-btn autopick-btn\" onclick=\"autoPick()\">\ud83c\udfb2 Auto<\/button>\n                    <button id=\"addBtn\" class=\"action-btn add-btn\" onclick=\"addToCart()\">\ud83d\uded2 Add Ticket<\/button>\n                <\/div>\n            <\/div>\n\n            <div id=\"ticketCart\"><\/div>\n            \n            <button id=\"waBtn\" class=\"whatsapp-btn no-print\" onclick=\"sendToWhatsApp()\">\ud83d\ude80 Submit Entries<\/button>\n            <button id=\"printBtn\" class=\"print-all-btn no-print\" onclick=\"handlePrint()\">\ud83d\udda8\ufe0f Print Now<\/button>\n            <button onclick=\"clearSession()\" class=\"no-print\" style=\"margin-top:20px; background:none; color:#444; border:none; cursor:pointer; font-size: 10px;\">RESET &#038; LOGOUT<\/button>\n        <\/div>\n    <\/div>\n\n<script>\n    const TOTAL_ALLOWED = 20;\n    const allowedIDs = Array.from({length: 20}, (_, i) => ({\n        id: `ovec${(i+1).toString().padStart(2, '0')}`, pass: \"1234\"\n    }));\n\n    let accessAccount = null; \n    let playerProfile = {}; \n    let selected = [];\n    let ticketsArray = []; \/\/ Current session (unprinted)\n    let totalPrintedCount = 0; \/\/ Total already printed across all sessions\n\n    function handleAdminLogin() {\n        const id = document.getElementById('adminID').value;\n        const pass = document.getElementById('adminPass').value;\n        accessAccount = allowedIDs.find(u => u.id === id && u.pass === pass);\n        if (accessAccount) {\n            document.getElementById('authScreen').style.display = 'none';\n            document.getElementById('detailsScreen').style.display = 'block';\n            \/\/ Load printed count for this ID\n            totalPrintedCount = parseInt(localStorage.getItem(`printed_count_${accessAccount.id}`)) || 0;\n        } else {\n            document.getElementById('loginError').style.display = 'block';\n        }\n    }\n\n    function handleUserSetup() {\n        playerProfile = {\n            name: document.getElementById('userName').value,\n            driver: document.getElementById('driverID').value\n        };\n        if(!playerProfile.name || !playerProfile.driver) return alert(\"Fill all fields\");\n        document.getElementById('detailsScreen').style.display = 'none';\n        document.getElementById('gameScreen').style.display = 'flex';\n        document.getElementById('greetUser').innerText = playerProfile.name.toUpperCase();\n        renderCart();\n        initGrid();\n    }\n\n    function initGrid() {\n        const grid = document.getElementById('numberGrid');\n        grid.innerHTML = \"\";\n        for (let i = 1; i <= 25; i++) {\n            let btn = document.createElement('button');\n            btn.innerText = i; btn.className = 'num-btn'; btn.id = 'btn-' + i;\n            btn.onclick = () => {\n                const mode = parseInt(document.getElementById('gameMode').value);\n                if (selected.includes(i)) {\n                    selected = selected.filter(x => x !== i);\n                    btn.classList.remove('selected');\n                } else if (selected.length < mode) {\n                    selected.push(i);\n                    btn.classList.add('selected');\n                }\n            };\n            grid.appendChild(btn);\n        }\n    }\n\n    function autoPick() {\n        resetSelection();\n        const mode = parseInt(document.getElementById('gameMode').value);\n        while(selected.length < mode) {\n            let r = Math.floor(Math.random() * 25) + 1;\n            if(!selected.includes(r)) {\n                selected.push(r);\n                document.getElementById('btn-'+r).classList.add('selected');\n            }\n        }\n    }\n\n    function resetSelection() {\n        selected = [];\n        document.querySelectorAll('.num-btn').forEach(b => b.classList.remove('selected'));\n    }\n\n    function addToCart() {\n        const mode = parseInt(document.getElementById('gameMode').value);\n        const currentLimitLeft = TOTAL_ALLOWED - totalPrintedCount;\n\n        if (ticketsArray.length >= currentLimitLeft) return alert(\"Total limit of 20 reached!\");\n        if (selected.length < mode) return alert(\"Select all numbers\");\n\n        ticketsArray.push({\n            nums: [...selected].map(n => n < 10 ? '0'+n : n).join(' - '),\n            mode: \"Lucky \" + mode,\n            time: new Date().toLocaleString()\n        });\n\n        renderCart();\n        resetSelection();\n    }\n\n    function removeTicket(index) {\n        ticketsArray.splice(index, 1);\n        renderCart();\n    }\n\n    function renderCart() {\n        const cart = document.getElementById('ticketCart');\n        cart.innerHTML = \"\";\n        \n        ticketsArray.forEach((t, i) => {\n            const qrId = `qr-code-${i}`;\n            const item = document.createElement('div');\n            item.className = 'cart-item';\n            item.innerHTML = `\n                <div class=\"ticket-info\" style=\"text-align: left; padding: 5px;\">\n                    <b style=\"font-size:10px\">OVECAB ${t.mode}<\/b>\n                    <div class=\"ticket-nums-mini\">${t.nums}<\/div>\n                    <span class=\"ticket-date\">${t.time}<\/span>\n                <\/div>\n                <div style=\"display:flex; align-items:center\">\n                    <div class=\"qr-box\" id=\"${qrId}\"><\/div>\n                    <button class=\"remove-btn no-print\" onclick=\"removeTicket(${i})\">\u2715<\/button>\n                <\/div>\n            `;\n            cart.appendChild(item);\n            new QRCode(document.getElementById(qrId), {\n                text: `OVECAB|${playerProfile.name}|${t.nums}|${accessAccount.id}`,\n                width: 60, height: 60\n            });\n        });\n\n        const left = TOTAL_ALLOWED - totalPrintedCount - ticketsArray.length;\n        document.getElementById('limitBadge').innerText = `Used: ${totalPrintedCount} | Left: ${left + ticketsArray.length} | In Cart: ${ticketsArray.length}`;\n        \n        const hasTickets = ticketsArray.length > 0;\n        document.getElementById('waBtn').style.display = hasTickets ? 'block' : 'none';\n        document.getElementById('printBtn').style.display = hasTickets ? 'block' : 'none';\n        document.getElementById('addBtn').disabled = (totalPrintedCount + ticketsArray.length >= TOTAL_ALLOWED);\n    }\n\n    function handlePrint() {\n        if (confirm(`Print ${ticketsArray.length} ticket(s)? These will be deducted from your 20-ticket limit permanently.`)) {\n            \/\/ Update the global printed count\n            totalPrintedCount += ticketsArray.length;\n            localStorage.setItem(`printed_count_${accessAccount.id}`, totalPrintedCount);\n            \n            \/\/ Print the current screen\n            window.print();\n\n            \/\/ After printing, CLEAR the cart so they don't show up again\n            ticketsArray = [];\n            renderCart();\n            \n            if(totalPrintedCount >= TOTAL_ALLOWED) {\n                alert(\"You have reached the maximum limit of 20 tickets for this ID.\");\n            }\n        }\n    }\n\n    function clearSession() {\n        if(confirm(\"Logout? (This will NOT reset your 20-ticket limit count)\")) {\n            location.reload();\n        }\n    }\n\n    function sendToWhatsApp() {\n        let msg = `*OVECAB DRAW*%0A\ud83d\udc64 ${playerProfile.name}%0A\ud83d\ude96 Driver: ${playerProfile.driver}%0A%0A`;\n        ticketsArray.forEach((t, i) => msg += `*#${i+1}:* ${t.nums}%0A`);\n        window.open(`https:\/\/wa.me\/971544786374?text=${msg}`);\n    }\n<\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Ovecab Lucky Draw &#8211; Smart Limit Ovecab Secure Access Invalid ID or Password! Verify Access Participant Profile Start Drawing WELCOME [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"aioseo_notices":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/pages\/527"}],"collection":[{"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/comments?post=527"}],"version-history":[{"count":41,"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/pages\/527\/revisions"}],"predecessor-version":[{"id":650,"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/pages\/527\/revisions\/650"}],"wp:attachment":[{"href":"https:\/\/ovecab.com\/index.php\/wp-json\/wp\/v2\/media?parent=527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}