|
@@ -1,17 +1,17 @@
|
|
--TODO: show barcode at top
|
|
--TODO: show barcode at top
|
|
--SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/QR.sql') AS properties;
|
|
--SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/QR.sql') AS properties;
|
|
SET ":title" = 'Fuel Voucher';
|
|
SET ":title" = 'Fuel Voucher';
|
|
-SET ":created" = COALESCE(:created, (SELECT created FROM code WHERE hash = $hash));
|
|
|
|
-SET ":expiry" = COALESCE(:expiry, (SELECT expiry FROM code_detail WHERE hash = $hash));
|
|
|
|
-SET ":value" = COALESCE(:value, (SELECT value FROM code_detail WHERE hash = $hash));
|
|
|
|
-SET ":store" = COALESCE(:store, json_array((SELECT store FROM code_detail WHERE hash = $hash)));
|
|
|
|
-SET ":used" = COALESCE(:used, (SELECT used FROM code_detail WHERE hash = $hash));
|
|
|
|
-SET ":content" = (SELECT json(content) FROM code WHERE hash = $hash);
|
|
|
|
|
|
+SET ":created" = COALESCE(:created, (SELECT created FROM code WHERE hash = :hash));
|
|
|
|
+SET ":expiry" = COALESCE(:expiry, (SELECT expiry FROM code_detail WHERE hash = :hash));
|
|
|
|
+SET ":value" = COALESCE(:value, (SELECT value FROM code_detail WHERE hash = :hash));
|
|
|
|
+SET ":store" = COALESCE(:store, json_array((SELECT store FROM code_detail WHERE hash = :hash)));
|
|
|
|
+SET ":used" = COALESCE(:used, (SELECT used FROM code_detail WHERE hash = :hash));
|
|
|
|
+SET ":content" = (SELECT json(content) FROM code WHERE hash = :hash);
|
|
SET ":validate" = 'Update';
|
|
SET ":validate" = 'Update';
|
|
-SET "$action" = 'Update';
|
|
|
|
|
|
+SET ":action" = (CASE COALESCE(:action, '') WHEN '' THEN NULL ELSE :action END);
|
|
SET ":method" = 'post';
|
|
SET ":method" = 'post';
|
|
SET ":type" = json_array('Fuel');
|
|
SET ":type" = json_array('Fuel');
|
|
-SET ":preview" = (SELECT 'data:image/svg+xml;base64,'||svg FROM code WHERE hash = $hash);
|
|
|
|
|
|
+SET ":preview" = (SELECT 'data:image/svg+xml;base64,'||svg FROM code WHERE hash = :hash);
|
|
SET ":autofill" = TRUE;
|
|
SET ":autofill" = TRUE;
|
|
SET ":filter_config" = '[
|
|
SET ":filter_config" = '[
|
|
{"name": "store[]", "required": true},
|
|
{"name": "store[]", "required": true},
|
|
@@ -38,24 +38,24 @@ WHERE COALESCE(:action, '') <> 'Update';
|
|
SELECT 'card' AS component, 1 AS columns
|
|
SELECT 'card' AS component, 1 AS columns
|
|
WHERE COALESCE(:action, '') <> 'Update';
|
|
WHERE COALESCE(:action, '') <> 'Update';
|
|
|
|
|
|
-SELECT COALESCE($store->>'0'||' ', '') || COALESCE($expiry, $created, '') AS title
|
|
|
|
|
|
+SELECT COALESCE(:store->>'0'||' ', '') || COALESCE(:expiry, :created, '') AS title
|
|
, '
|
|
, '
|
|
|
|
|
|
-Type: '||COALESCE($type->>'0','')||'
|
|
|
|
|
|
+Type: '||COALESCE(:type->>'0','')||'
|
|
|
|
|
|
-Value: '||COALESCE($value,'')||'
|
|
|
|
|
|
+Value: '||COALESCE(:value,'')||'
|
|
|
|
|
|
-Expires: '||COALESCE($expiry,'')||'
|
|
|
|
|
|
+Expires: '||COALESCE(:expiry,'')||'
|
|
|
|
|
|
-Submitted: '||COALESCE($created,'')||'
|
|
|
|
|
|
+Submitted: '||COALESCE(:created,'')||'
|
|
|
|
|
|
|
|
|
|
| Type | Content |
|
|
| Type | Content |
|
|
|:-----|:--------|
|
|
|:-----|:--------|
|
|
-| ' || COALESCE($content->>'format', '') || ' | ' || COALESCE($content->>'content', '') || ' |
|
|
|
|
|
|
+| ' || COALESCE(:content->>'format', '') || ' | ' || COALESCE(:content->>'content', '') || ' |
|
|
' AS description_md
|
|
' AS description_md
|
|
-, $preview AS top_image
|
|
|
|
-, $tabler_color AS color
|
|
|
|
|
|
+, :preview AS top_image
|
|
|
|
+, :tabler_color AS color
|
|
WHERE COALESCE(:action, '') <> 'Update';
|
|
WHERE COALESCE(:action, '') <> 'Update';
|
|
;
|
|
;
|
|
|
|
|
|
@@ -63,4 +63,4 @@ SELECT 'dynamic' AS component, sqlpage.run_sql(:inner) AS properties;
|
|
|
|
|
|
SELECT 'table' AS component;
|
|
SELECT 'table' AS component;
|
|
SELECT * FROM code_detail
|
|
SELECT * FROM code_detail
|
|
-WHERE hash = $hash;
|
|
|
|
|
|
+WHERE hash = :hash;
|