+
+
+ + + +
+ New LPG Cylinder
+ + + + + + + + + + + + +View All LPG Cylinders + + \ No newline at end of file diff --git a/public/cyl/cyl_list.php b/public/cyl/cyl_list.php new file mode 100644 index 000000000..06ecfbe76 --- /dev/null +++ b/public/cyl/cyl_list.php @@ -0,0 +1,85 @@ + + + + + +
+ LPG Cylinder Basic Data
+| ID | +Date | +Time | +Tag | +Qr Code | +Serial | +Brand | +Production Year | +Inspection Year | +Tare | +Net | +Type | +Gas | +Valve | +Owner | +Device | +Operator | +
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {$row['id']} | +{$row['date']} | +{$row['time']} | +{$row['tag']} | +{$row['qrcode']} | +{$row['serial']} | +{$row['brand']} | +{$row['year']} | +{$row['year_insp']} | +{$row['tare']} | +{$row['net']} | +{$row['type']} | +{$row['gas']} | +{$row['valve']} | +{$row['owner']} | +{$row['device']} | +{$row['operator']} | +
| No LPG cylinders found. | ||||||||||||||||
+ ← Add New LPG Cylinder + + \ No newline at end of file diff --git a/public/cyl/cyl_qr.php b/public/cyl/cyl_qr.php new file mode 100644 index 000000000..843965fa2 --- /dev/null +++ b/public/cyl/cyl_qr.php @@ -0,0 +1,62 @@ + PDO::ERRMODE_EXCEPTION]); + + // Value to check (for example, from URL) + $qrcode = $_GET['id'] ?? null; + + if ($qrcode !== null) { + // Check if value exists in the column + $sql = "SELECT EXISTS (SELECT 1 FROM lpg_cylinder_basic_data WHERE qrcode = :value)"; + $stmt = $pdo->prepare($sql); + $stmt->execute([':value' => $qrcode]); + + $exists = $stmt->fetchColumn(); + + if ($exists) { + header('Location: ' .$page2); + + // echo "✅ The value '$qrcode' exists."; + } else { + header("Location: cyl_qr_found.html?id=" . urlencode($currentUrl)); + + //header('Location: ' .$page1); + //echo "❌ The value '$qrcode' does not exist."; + } + } else { + echo "⚠️ Qr code not valide."; + } +} catch (PDOException $e) { + echo "Database error: " . $e->getMessage(); +} +pg_close($conn); +?> + diff --git a/public/cyl/cyl_qr_exists.html b/public/cyl/cyl_qr_exists.html new file mode 100644 index 000000000..2dcb6dc61 --- /dev/null +++ b/public/cyl/cyl_qr_exists.html @@ -0,0 +1,30 @@ + + + + + +
+
+
+
+
+
+ New LPG Cylinder
+ + + + + + + + + + + +View All LPG Cylinders + + \ No newline at end of file diff --git a/public/cyl/cyl_qr_not_found.html b/public/cyl/cyl_qr_not_found.html new file mode 100644 index 000000000..6bb80d2c6 --- /dev/null +++ b/public/cyl/cyl_qr_not_found.html @@ -0,0 +1,34 @@ + + + + + +
+
+
+
+
+ +
+
+ + + +
+
+
+
+
+
+"; + echo 'Add Another LPG Cylinder
'; + echo 'View All LPG Cylinders'; + die() ; +} else { + header('Location: '.$page1) ; + //echo "❌ Error: " . pg_last_error($conn); + die() ; + +} +pg_close($conn); +?> \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 000000000..6ab9520f0 --- /dev/null +++ b/public/index.html @@ -0,0 +1,75 @@ + + + + + +
+
+
+ + + +
+
+
+ + + +
",void e.appendChild(this.fileScanImage);this.fileScanImage=new Image,this.fileScanImage.onload=function(r){e.innerHTML="
",e.appendChild(t.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=Q,this.fileScanImage.alt=p.fileScanAltText()},t.prototype.clearScanRegion=function(){document.getElementById(this.getScanRegionId()).innerHTML=""},t.prototype.getDashboardSectionId=function(){return"".concat(this.elementId,"__dashboard_section")},t.prototype.getDashboardSectionCameraScanRegionId=function(){return"".concat(this.elementId,"__dashboard_section_csr")},t.prototype.getDashboardSectionSwapLinkId=function(){return it.SCAN_TYPE_CHANGE_ANCHOR_ID},t.prototype.getScanRegionId=function(){return"".concat(this.elementId,"__scan_region")},t.prototype.getDashboardId=function(){return"".concat(this.elementId,"__dashboard")},t.prototype.getHeaderMessageContainerId=function(){return"".concat(this.elementId,"__header_message")},t.prototype.getCameraPermissionButtonId=function(){return it.CAMERA_PERMISSION_BUTTON_ID},t.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},t.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},t.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},t}()})(),__Html5QrcodeLibrary__=n})();if (window) { if (!Html5QrcodeScanner) { var Html5QrcodeScanner = window.__Html5QrcodeLibrary__.Html5QrcodeScanner; } if (!Html5Qrcode) { var Html5Qrcode = window.__Html5QrcodeLibrary__.Html5Qrcode; } if (!Html5QrcodeSupportedFormats) { var Html5QrcodeSupportedFormats = window.__Html5QrcodeLibrary__.Html5QrcodeSupportedFormats } if (!Html5QrcodeScannerState) { var Html5QrcodeScannerState = window.__Html5QrcodeLibrary__.Html5QrcodeScannerState; } if (!Html5QrcodeScanType) { var Html5QrcodeScanType = window.__Html5QrcodeLibrary__.Html5QrcodeScanType; }} \ No newline at end of file diff --git a/public/scripts/script.js b/public/scripts/script.js new file mode 100644 index 000000000..0871cc92f --- /dev/null +++ b/public/scripts/script.js @@ -0,0 +1,40 @@ +function docReady(fn) { + // see if DOM is already available + if (document.readyState === "complete" || document.readyState === "interactive") { + // call on next available tick + setTimeout(fn, 1); + } else { + document.addEventListener("DOMContentLoaded", fn); + } +} + +docReady(function() { + var resultContainer = document.getElementById('qr-reader-results'); + var lastResult, countResults = 0; + + var html5QrcodeScanner = new Html5QrcodeScanner( + "qr-reader", { fps: 10, qrbox: 250 }); + + function onScanSuccess(decodedText, decodedResult) { + if (decodedText !== lastResult) { + ++countResults; + lastResult = decodedText; + console.log(`Scan result = ${decodedText}`, decodedResult); + //resultContainer.innerHTML += `