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: user.articles.php
Close
<? // Opal API: Get Dashboard Articles require_once '../inc/config.php'; $userLogin = isset($_POST['userLogin']) ? $_POST['userLogin'] : ''; if ($userLogin == '') die(json_encode(['status' => 500, 'message' => 'Invalid Call!'])); $data = []; $sql = "SELECT articleId AS id,articleTitle AS title,filePdf,isPublished FROM articles WHERE userId=(SELECT userId FROM users WHERE email='$userLogin') ORDER BY articleTitle"; $result = mysqli_query($db, $sql); while($row = mysqli_fetch_assoc($result)) { $articleId = $row['id']; $sql = "SELECT 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); $row['author'] = $dataAuthor; } else { $row['author'] = []; } array_push($data,$row); } $dataJSON = ['status' => 200, 'data' => $data]; echo json_encode($dataJSON);