add todos

This commit is contained in:
Bruno Rybársky 2023-08-07 20:33:24 +02:00
parent 0e4ad244f4
commit c3cab73502
No known key found for this signature in database
GPG Key ID: DFE2C061EF985CD4

47
api.php

@ -1,4 +1,5 @@
<?php
session_start();
$mysqllogin = json_decode(file_get_contents("secrets/MysqlLogin.json"), false);
@ -84,6 +85,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
if($actionin == "getcurrentuser"){
//TODO Create this query
}
if($actionin == "getallusers"){
$stmt6 = $mysqliconn->prepare("SELECT ID, Username, Nickname, FullName, IsAdmin FROM Users;");
$stmt6->execute();
@ -133,32 +138,44 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
function processCitationRelated($actionin, mysqli $mysqliconn){
if($actionin == "getcitations"){
if($actionin == "getallcitations"){
//TODO Create this query
}
if($actionin == "getrandomcitation"){
//TODO Create this query
}
if($actionin == "getcitationfulltextsearch"){
if($actionin == "getcitationsfulltextsearch"){
//TODO Create this query
}
if($actionin == "getcitationsbyuser"){
//TODO Create this query
}
if($actionin == "getcitationthreadbyid"){
//TODO Create this query
}
if($actionin == "getcitationversionbyid"){
//TODO Create this query
}
if($actionin == "getcitationsbysource"){
//TODO Create this query
}
if($actionin == "getcitationsbytags"){
//TODO Create this query
}
if($actionin == "getcitationbyverse"){
if($actionin == "getcitationsbyverse"){
//TODO Create this query
}
if($actionin == "getcitationsuggestionsbyverse"){
//TODO Create this query
}
return 0;
@ -230,6 +247,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
if($actionin == "getallsources"){
//TODO Use JOIN to embed the publication info
$stmt17 = $mysqliconn->prepare("SELECT ID, PublicationID, Place, CreatorID FROM Sources;");
$stmt17->execute();
$stmt17->bind_result($id, $publicationid, $place, $creatorid);
@ -248,6 +266,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
if($actionin == "getallsourcesbycreator"){
//TODO Use JOIN to embed the publication info
$stmt13 = $mysqliconn->prepare("SELECT ID, PublicationID, Place, CreatorID FROM Sources WHERE CreatorID = ?;");
$cruid = intval($_POST['creatorid']);
$stmt13->bind_param("i", $cruid);
@ -284,6 +303,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
if($actionin == "getallcommentsbycreator"){
//TODO Use JOIN to embed the citation info
$stmt15 = $mysqliconn->prepare("SELECT ID, CreatorID, CitationID, CitationThreadID, Content FROM Comments WHERE CreatorID = ?;");
$cruid = intval($_POST['creatorid']);
$stmt15->bind_param("i", $cruid);
@ -303,17 +323,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
return json_encode($outarr);
}
//TODO Also send user info with ID
if($actionin == "getcommentsbycitationlatestversion"){
//TODO Create this query
//TODO Use JOIN to embed the citation info
}
if($actionin == "getcommentsbycitationbyversion"){
//TODO Create this query
//TODO Use JOIN to embed the citation info
}
if($actionin == "getcommentsbycitationallversions"){
//TODO Create this query
//TODO Use JOIN to embed the citation info
}
return 0;