diff --git a/app/controllers/About.php b/app/controllers/About.php deleted file mode 100644 index 9c90568d0b0dd183dd05cf0288692aec257c056a..0000000000000000000000000000000000000000 --- a/app/controllers/About.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -class About{ - public function index(){ - echo 'About/index'; - } -} \ No newline at end of file diff --git a/app/core/connection.php b/app/core/connection.php deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/app/views/bookmark/delete.php b/app/views/bookmark/delete.php deleted file mode 100644 index 18786a0ce4a591eb35522e7626fa367b286b7d8c..0000000000000000000000000000000000000000 --- a/app/views/bookmark/delete.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -include('C:\xampp\htdocs\tugas-besar-1\app'.'/core/connection.php'); - -// Check if an employee number is provided in the request -if (isset($_POST['title'])) { - $title = $_POST['title']; - - // Sanitize and validate the employee number input to prevent SQL injection - - // Perform the DELETE operation based on the employee number - $deleteSql = "DELETE FROM book WHERE title = '$title'"; - - if ($conn->query($deleteSql) === TRUE) { - // Deletion was successful - $response = array('success' => true, 'message' => 'Record deleted successfully'); - } else { - // Deletion failed - $response = array('success' => false, 'message' => 'Error deleting record: ' . $conn->error); - } - - // Return a JSON response to the client - header('Content-Type: application/json'); - echo json_encode($response); -} else { - // Handle missing or invalid input - $response = array('success' => false, 'message' => 'Invalid input'); - header('Content-Type: application/json'); - echo json_encode($response); -} - -// Close the database connection -$conn->close(); -?> diff --git a/app/views/bookmark/search.php b/app/views/bookmark/search.php deleted file mode 100644 index a508602f06202e17dcefb818f3c8edfad6871541..0000000000000000000000000000000000000000 --- a/app/views/bookmark/search.php +++ /dev/null @@ -1,84 +0,0 @@ - -<?php -/* -include(APPURL .'/core/connection.php'); - -// Read URL parameters -$sortSelect = isset($_GET['sortSelect']) ? $_GET['sortSelect'] : "title"; -$sortOrder = isset($_GET['sortOrder']) ? $_GET['sortOrder'] : "ASC"; -$filterSelect = isset($_GET['filterSelect']) ? $_GET['filterSelect'] : "none"; -$filterQuery = isset($_GET['filterQuery']) ? $_GET['filterQuery'] : ""; -$searchInput = isset($_GET['searchInput']) ? $_GET['searchInput'] : ""; -$activePage = isset($_GET['page']) ? intval($_GET['page']) : 1; - -$itemsPerPage = 10; - - -// Calculate the offset -$offset = ($activePage - 1) * $itemsPerPage; - -$countSql = "SELECT COUNT(*) as totalRecords FROM book"; -$countResult = $conn->query($countSql); -$row = $countResult->fetch_assoc(); -$totalRecords = $row['totalRecords']; - -$totalPages = ceil($totalRecords / $itemsPerPage); - - -// Check if sortSelect and sortOrder values are set in the URL -if (isset($_GET['sortSelect']) && isset($_GET['sortOrder'])) { - // Sanitize and validate the sortSelect and sortOrder values to prevent SQL injection - $sortSelect = $_GET['sortSelect'] === "title" ? "title" : "author_id"; - $sortOrder = $_GET['sortOrder'] === "descending" ? "DESC" : "ASC"; - - if ($_GET['sortSelect'] === "none") { - $sortSelect = null; - $sortOrder = null; - } -} - -// Check if filterSelect and filterQuery values are set in the URL for filtering -if(isset($_GET['filterSelect']) && isset($_GET['filterQuery'])) { - // Sanitize and validate the filterSelect and filterQuery values to prevent SQL injection - $filterSelect = $_GET['filterSelect'] === "category" ? "category" : "author_id"; - $filterQuery = $_GET['filterQuery']; - - if ($_GET['filterSelect'] === "none") { - $filterSelect = null; - $filterQuery = null; - } -} - -$searchInput = isset($_GET['searchInput']) ? $_GET['searchInput'] : ''; -// Check if the search input is provided -$searchQuery = ""; -if (isset($_GET['searchInput']) && !empty($_GET['searchInput'])) { - // Sanitize the search input to prevent SQL injection - $searchInput = mysqli_real_escape_string($conn, $_GET['searchInput']); - - // Create a search query using LIKE clause for substring search - $searchQuery = " AND (title LIKE '%$searchInput%' OR author_id LIKE '%$searchInput%')"; -} - -// Construct the final SQL query based on sorting, filtering, and searching -$sql = "SELECT title, author_id, category FROM book WHERE 1=1"; // Initial WHERE condition - -if ($filterSelect && $filterQuery) { - $sql .= " AND $filterSelect = '$filterQuery'"; -} - -if ($searchQuery) { - $sql .= $searchQuery; -} - -if ($sortSelect && $sortOrder) { - $sql .= " ORDER BY $sortSelect $sortOrder"; -} - -$sql .= " LIMIT $itemsPerPage OFFSET $offset"; - -$result = $conn->query($sql); - -?> -<script src="http://localhost:8080/public/js/search.js"></script> -*/ \ No newline at end of file diff --git a/app/views/error/403.php b/app/views/error/403.php index 988a0b3f7b72d05fd55f3f2d3aa7db34b6a1c7e4..3ce25a838aecc7b40b56a249e2cd29a999c4d6a4 100644 --- a/app/views/error/403.php +++ b/app/views/error/403.php @@ -16,6 +16,11 @@ <?php if (isset($error)) { ?> <div class="error-message"><?php echo $error; ?></div> <?php } ?> + <div class="login-link"> + <p>Please sign in to access this page <br> + <a href="http://localhost:8080/public/login">Sign in</a> + </p> + </div> </div> </body> </html> diff --git a/app/views/library/addbook.php b/app/views/library/addbook.php deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/app/views/library/editbook.php b/app/views/library/editbook.php deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/app/views/library/editlist.php b/app/views/library/editlist.php deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/public/style/403.css b/public/style/403.css index 84a05f9e07c1642b87e7732065f493e39c40f9e1..8d95deca2c4a90bfaebcd8cabf7ea54b953d6295 100644 --- a/public/style/403.css +++ b/public/style/403.css @@ -23,4 +23,13 @@ body { font-family: Helvetica; font-size: 23px; +} +.login-link p a { + color: #FFAC7F; + text-decoration: none; + font-weight: 600; +} + +.login-link p a:hover { + text-decoration: underline; } \ No newline at end of file