Skip to content

Commit

Permalink
Adding poll table
Browse files Browse the repository at this point in the history
  • Loading branch information
starstryder committed Aug 12, 2024
1 parent 4b0afb0 commit 2e18ba4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions csb/csb-apps/Mosaic/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions csb/csb-apps/Mosaic/writeMosaicData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 (?, ?, ?)";
Expand Down

0 comments on commit 2e18ba4

Please sign in to comment.