OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
html
/
process
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/15/2024 04:24:02 PM
rwxr-xr-x
📄
add.edit.paper.php
7.04 KB
03/15/2024 04:24:02 PM
rw-r--r--
📄
article.php
1.14 KB
03/15/2024 04:24:02 PM
rw-r--r--
📄
featured.articles.php
535 bytes
03/15/2024 04:24:02 PM
rw-r--r--
📄
login.php
1.19 KB
03/15/2024 04:24:02 PM
rw-r--r--
📄
register.php
2.59 KB
03/15/2024 04:24:02 PM
rw-r--r--
📄
search.php
3.18 KB
03/15/2024 04:24:02 PM
rw-r--r--
📄
user.articles.php
1.03 KB
03/15/2024 04:24:02 PM
rw-r--r--
📄
verify.php
856 bytes
03/15/2024 04:24:02 PM
rw-r--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 isPublished=1 AND 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);