From 2e18ba4367f89375e4039aa99afec1d33b1876ee Mon Sep 17 00:00:00 2001 From: Pamela Gay <pamela@starstryder.com> Date: Mon, 12 Aug 2024 15:13:05 -0500 Subject: [PATCH] Adding poll table --- csb/csb-apps/Mosaic/template.php | 4 ++-- csb/csb-apps/Mosaic/writeMosaicData.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/csb/csb-apps/Mosaic/template.php b/csb/csb-apps/Mosaic/template.php index 0ec751a..932d4e7 100644 --- a/csb/csb-apps/Mosaic/template.php +++ b/csb/csb-apps/Mosaic/template.php @@ -51,7 +51,7 @@ function loadImage() { .then(data => { document.getElementById('currentImage').src = data.imageUrl; document.getElementById('currentImage').setAttribute('data-image-id', data.imageId); - document.getElementById('test').innerHTML = data.notes; + document.getElementById('test').innerHTML = data.imageId; }); // Add event listener to listen for clicks on a button @@ -68,7 +68,7 @@ function loadImage() { headers: { 'Content-Type': 'application/json' }, - body: 'buttonValue=' + buttonValue + '&imageId=' + imageId + '&userId=' + userId + body: 'buttonvalue=' + buttonValue + '&imageId=' + imageId + '&userId=' + userId }); // load the next image diff --git a/csb/csb-apps/Mosaic/writeMosaicData.php b/csb/csb-apps/Mosaic/writeMosaicData.php index 3b27624..29cfbf7 100644 --- a/csb/csb-apps/Mosaic/writeMosaicData.php +++ b/csb/csb-apps/Mosaic/writeMosaicData.php @@ -19,12 +19,12 @@ } // Handle Button Click -if ($_SERVER["REQUEST_METHOD"] == "GET") { +if ($_SERVER["REQUEST_METHOD"] == "POST") { // submit data to table marks - $imageID = $_GET['imageId']; - $buttonValue = $_GET['buttonvalue']; - $userID = $_GET['userId']; + $imageID = $_POST['imageId']; + $buttonValue = $_POST['buttonvalue']; + $userID = $_POST['userId']; // Insert Data into image_user table $query = "INSERT INTO image_users (image_id, user_id, application_id) VALUES (?, ?, ?)";