BUG. Check sPoint selPoints and pointValue to make sure its pulling from NAME not ID for value in attribute.
This commit is contained in:
parent
072fd8c30c
commit
81c94611c5
|
|
@ -28,7 +28,8 @@
|
||||||
{
|
{
|
||||||
"name": ":P1",
|
"name": ":P1",
|
||||||
"value": "{{$_GET.subid}}",
|
"value": "{{$_GET.subid}}",
|
||||||
"test": "11"
|
"test": "1",
|
||||||
|
"recid": 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,3 +21,24 @@ async function toBase64(filePath) {
|
||||||
return img
|
return img
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const terminal = document.getElementById('terminal');
|
||||||
|
|
||||||
|
// Function to add a line to the terminal
|
||||||
|
function addLine(text) {
|
||||||
|
const line = document.createElement('p');
|
||||||
|
line.className = 'line';
|
||||||
|
line.textContent = text;
|
||||||
|
terminal.appendChild(line);
|
||||||
|
|
||||||
|
// Automatically scroll to the bottom
|
||||||
|
terminal.scrollTop = terminal.scrollHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Simulate adding lines
|
||||||
|
let lineCount = 0;
|
||||||
|
setInterval(() => {
|
||||||
|
addLine(`Line ${++lineCount}: This is a test log.`);
|
||||||
|
}, 500); // Add a new line every 500ms
|
||||||
|
|
@ -44,7 +44,21 @@ dmx.config({
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"local": {}
|
"local": {}
|
||||||
}
|
},
|
||||||
|
"datastore1": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "numSection"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "description"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"name": "Points"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"index": {
|
"index": {
|
||||||
"global": [
|
"global": [
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,40 @@
|
||||||
// JavaScript Document
|
// JavaScript Document
|
||||||
|
|
||||||
|
const sqlite3 = require('sqlite3').verbose();
|
||||||
|
|
||||||
|
async function insertPdfBytesIntoDb(pdfBytes) {
|
||||||
|
// Create or open the database
|
||||||
|
const db = new sqlite3.Database('example.db');
|
||||||
|
|
||||||
|
// Ensure the table exists
|
||||||
|
const createTableQuery = `
|
||||||
|
CREATE TABLE IF NOT EXISTS PDFdata (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
pdfByteData BLOB
|
||||||
|
)
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Execute the table creation query
|
||||||
|
await new Promise((resolve, reject) => {
|
||||||
|
db.run(createTableQuery, (err) => {
|
||||||
|
if (err) return reject(err);
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Insert the PDF bytes into the table
|
||||||
|
const insertQuery = `
|
||||||
|
INSERT INTO PDFdata (pdfByteData) VALUES (?)
|
||||||
|
`;
|
||||||
|
|
||||||
|
await new Promise((resolve, reject) => {
|
||||||
|
db.run(insertQuery, pdfBytes, function (err) {
|
||||||
|
if (err) return reject(err);
|
||||||
|
console.log(`Inserted PDF bytes with ID: ${this.lastID}`);
|
||||||
|
resolve(this.lastID); // Return the last inserted ID
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close the database
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -266,8 +266,8 @@
|
||||||
<tbody is="dmx-repeat" dmx-generator="bs5table" id="tableRepeat2" dmx-bind:repeat="scQuerySubSections.data.query">
|
<tbody is="dmx-repeat" dmx-generator="bs5table" id="tableRepeat2" dmx-bind:repeat="scQuerySubSections.data.query">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input id="pointValue" name="section" type="hidden" class="form-control" dmx-bind:value="numSection">
|
<input id="pointValue" name="section" class="form-control" dmx-bind:value="selPoints.selectedValue">
|
||||||
<select id="selPoints" class="form-select" name="sPoints" dmx-on:changed="datastore1.upsert({numSection: pointValue.value, $id: numSection, description: txtSection},{numSection: pointValue.value, Points: value, description: txtSection})" dmx-bind:id="numSection">
|
<select id="selPoints" class="form-select" name="sPoints" dmx-on:changed="datastore1.upsert({numSection: pointValue.value, $id: numSection, description: txtSection},{numSection: pointValue.value, Points: value, description: txtSection});selPoints.setValue(0)" dmx-bind:id="numSection" dmx-bind:value="selectedValue">
|
||||||
<option value="0">0 points</option>
|
<option value="0">0 points</option>
|
||||||
<option value="1">1 point</option>
|
<option value="1">1 point</option>
|
||||||
<option value="2">2 points</option>
|
<option value="2">2 points</option>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue