OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
opalv1
/
api
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/25/2024 03:43:29 AM
rwxr-xr-x
📄
add.edit.paper.php
7.04 KB
02/18/2024 05:41:10 AM
rw-rw-r--
📄
article.php
1.13 KB
02/18/2024 05:42:18 AM
rw-rw-r--
📄
featured.articles.php
517 bytes
02/18/2024 05:04:20 AM
rw-rw-r--
📄
login.php
1.19 KB
02/17/2024 03:38:38 PM
rw-rw-r--
📄
register.php
1.73 KB
02/17/2024 03:38:38 PM
rw-rw-r--
📄
search.php
3.13 KB
02/18/2024 05:01:46 AM
rw-rw-r--
📄
user.articles.php
1.03 KB
02/18/2024 05:49:34 AM
rw-rw-r--
📄
verify.php
869 bytes
02/18/2024 06:01:26 AM
rw-rw-r--
Editing: article.php
Close
<? // Opal API: Get Article require_once '../inc/config.php'; $articleId = isset($_GET['id']) ? $_GET['id'] : ''; if ($articleId == '') die(json_encode(['status' => 500, 'message' => 'Invalid Call!'])); $sql = "SELECT categoryId,articleId AS id,articleTitle AS title,articleDOI AS doi,articleSummary AS summary,filePdf,fileImg,yearPublished FROM articles WHERE articleId=$articleId"; $result = mysqli_query($db, $sql); $numRows = mysqli_num_rows($result); if ($numRows > 0) { $data = mysqli_fetch_all($result, MYSQLI_ASSOC); $sql = "SELECT A.authorId AS id,A.salutation,A.firstName,A.lastName FROM authors A INNER JOIN article_authors B WHERE A.authorId=B.authorId AND B.articleId=$articleId"; $resultAuthor = mysqli_query($db, $sql); $numRowsAuthor = mysqli_num_rows($resultAuthor); if ($numRowsAuthor > 0) { $dataAuthor = mysqli_fetch_all($resultAuthor, MYSQLI_ASSOC); $data[0]['author'] = $dataAuthor; } else { $data[0]['author'] = []; } $dataJSON = ['status' => 200, 'data' => $data[0]]; } else { $dataJSON = ['status' => 500, 'message' => 'The Article could not be found!']; } echo json_encode($dataJSON);