forked from Doenet/DoenetTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ffb2b4
commit 24cb133
Showing
3 changed files
with
129 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
header("Access-Control-Allow-Origin: *"); | ||
header("Access-Control-Allow-Headers: access"); | ||
header("Access-Control-Allow-Methods: GET"); | ||
header("Access-Control-Allow-Credentials: true"); | ||
header('Content-Type: application/json'); | ||
|
||
include "db_connection.php"; | ||
// $jwtArray = include "jwtArray.php"; | ||
|
||
$success = TRUE; | ||
$message = ""; | ||
$carouselData = [[],[],[]]; | ||
|
||
|
||
$sql = " | ||
SELECT section, | ||
position, | ||
imagePath, | ||
text, | ||
link | ||
FROM homepage_carousel | ||
ORDER BY section,position | ||
"; | ||
|
||
$result = $conn->query($sql); | ||
if ($result->num_rows > 0) { | ||
while($row = $result->fetch_assoc()){ | ||
$section = $row['section']; | ||
|
||
array_push($carouselData[$section],array( | ||
"imagePath"=>$row['imagePath'], | ||
"text"=>$row['text'], | ||
"link"=>$row['link'], | ||
)); | ||
} | ||
} | ||
|
||
|
||
|
||
$response_arr = array( | ||
"success"=>$success, | ||
"message"=>$message, | ||
"carouselData"=>$carouselData, | ||
); | ||
|
||
http_response_code(200); | ||
|
||
// make it json format | ||
echo json_encode($response_arr); | ||
|
||
$conn->close(); | ||
|
||
?> |
Binary file added
BIN
+206 KB
src/Media/bafkreihiarx7whru5lampno3m2gybfixf2vuumyhgh7ov747ao6rsh3uya.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters