Cognetify QR & Barcode Generator

Hattan Fleet Registry — QR / Barcode Record Tool
DEMO BUILD 3.0 — NOT A GOVERNMENT SITE
INTERNAL RECORDS VIEWER

Hattan Fleet Registry

مكتب هتان لسجلات الأسطول

Generate QR and barcode records. A generated QR code contains a shareable record URL, so scanning it from another phone opens the formatted record automatically.

Thank you for reading this post, don't forget to subscribe!

Record Details

Enter the same information that should appear after the QR code is scanned.
Important: The QR code stores the record URL. The record values are therefore visible to anyone who scans the QR code. This demo does not use a government database or server-side authentication.

Record QR Code

Scan this QR with another phone to open the formatted record page.
No QR code generated yet.
Shareable Record URL

Camera Scanner

Scan a generated QR or supported barcode.

Decoded Result

If the scan contains a Hattan record URL, the formatted record opens below.
Nothing scanned yet.

Saved Records

Records are saved only in this browser using local storage.

Hattan Fleet Registry QR & Barcode Tool

Create a fleet record, generate a QR code and barcode, and share the record with another device. The important upgrade in this version is that the QR code contains a record URL rather than raw JSON. When the QR is scanned outside this tool, the same page can decode the URL and display the record as a readable table.

For real production use, connect the record ID to a secure server/database. This demo keeps record data in the URL and local browser history and should not be treated as an official government registry.

Operator: Desk clerk · Hattan Technical Desk
Mail: desk@hattan-records.example · Fax: +966 13 000 0000
DeskSoft Records v3.0 · Fictional registry for cargo-barrier cards.
`); w.document.close(); w.focus(); setTimeout(()=>w.print(),300); } function handleScannedText(text){ lastScan = text || ""; $("hf-scan-output").textContent = lastScan || "Nothing scanned."; $("hf-copy-scan").disabled = !lastScan; $("hf-open-result").disabled = true; let record = null; try{ const url = new URL(lastScan); const encoded = url.searchParams.get("record"); if(encoded) record = decodeRecord(encoded); }catch(e){} if(record){ currentRecord = record; $("hf-open-result").disabled = false; renderRecord($("hf-scan-record"), record); $("hf-scan-record").scrollIntoView({behavior:"smooth", block:"start"}); }else{ $("hf-scan-record").classList.add("hf-hidden"); } } async function startScanner(){ if(scanner) return; scanner = new Html5Qrcode("hf-reader"); try{ await scanner.start( { facingMode:"environment" }, { fps:10, qrbox:{width:250,height:250} }, decodedText => handleScannedText(decodedText), () => {} ); }catch(e){ $("hf-scan-output").textContent = "Camera could not start. Check camera permission or use Scan Image."; scanner = null; } } async function stopScanner(){ if(!scanner) return; try{ await scanner.stop(); }catch(e){} try{ scanner.clear(); }catch(e){} scanner = null; } // Tabs document.querySelectorAll(".hf-tab").forEach(btn => { btn.addEventListener("click", ()=>showTab(btn.dataset.tab)); }); $("hf-generate").addEventListener("click", ()=>generate(collectForm(), false)); $("hf-save").addEventListener("click", ()=>generate(collectForm(), true)); $("hf-form").addEventListener("reset", ()=>{ setTimeout(()=>{ currentRecord = null; currentURL = ""; $("hf-qr").innerHTML = ""; $("hf-url-wrap").classList.add("hf-hidden"); $("hf-created-result").classList.add("hf-hidden"); $("hf-download-qr").disabled = true; $("hf-copy-url").disabled = true; $("hf-print").disabled = true; $("hf-qr-status").textContent = "No QR code generated yet."; },0); }); $("hf-download-qr").addEventListener("click", downloadQR); $("hf-copy-url").addEventListener("click", async ()=>{ if(await copyText(currentURL)) alert("Record URL copied."); }); $("hf-print").addEventListener("click", ()=>printRecord(currentRecord)); $("hf-start-scan").addEventListener("click", startScanner); $("hf-stop-scan").addEventListener("click", stopScanner); $("hf-copy-scan").addEventListener("click", async ()=>{ if(lastScan && await copyText(lastScan)) alert("Scanned result copied."); }); $("hf-open-result").addEventListener("click", ()=>{ if(currentRecord) renderRecord($("hf-scan-record"), currentRecord); $("hf-scan-record").scrollIntoView({behavior:"smooth"}); }); $("hf-file-scan").addEventListener("change", async function(){ const file = this.files && this.files[0]; if(!file) return; const temp = new Html5Qrcode("hf-reader"); try{ const result = await temp.scanFile(file, true); handleScannedText(result); }catch(e){ $("hf-scan-output").textContent = "No readable QR/barcode was found in this image."; }finally{ try{ temp.clear(); }catch(e){} this.value = ""; } }); $("hf-history").addEventListener("click", e=>{ const btn = e.target.closest("button[data-action]"); if(!btn) return; const records = getRecords(); const index = Number(btn.dataset.index); const record = records[index]; if(!record) return; if(btn.dataset.action === "load"){ fillForm(record); generate(record, false); showTab("create"); window.scrollTo({top:0, behavior:"smooth"}); } if(btn.dataset.action === "copy"){ copyText(buildRecordURL(record)).then(ok=>{if(ok) alert("Record URL copied.");}); } if(btn.dataset.action === "delete"){ records.splice(index,1); localStorage.setItem(STORAGE_KEY, JSON.stringify(records)); renderHistory(); } }); $("hf-delete-all").addEventListener("click", ()=>{ if(confirm("Delete all saved records from this browser?")){ localStorage.removeItem(STORAGE_KEY); renderHistory(); } }); // IMPORTANT: If ?record=... is present, this is the shareable record view. function openURLRecord(){ const params = new URLSearchParams(window.location.search); const encoded = params.get("record"); if(!encoded) return; const record = decodeRecord(encoded); if(!record) return; currentRecord = record; renderRecord($("hf-created-result"), record); $("hf-created-result").scrollIntoView({behavior:"smooth", block:"start"}); $("hf-created-result").classList.remove("hf-hidden"); document.querySelector(".hf-panel.active")?.classList.remove("active"); $("hf-create").classList.add("active"); } renderHistory(); openURLRecord(); })();

Scroll to Top