Domain: amberpublishers.in
Server Adress: 86.38.243.169

privdayz.com

/home/u866425823/domains/amberpublishers.in/public_html/admin/
Dosya Yükle :
Current File : /home/u866425823/domains/amberpublishers.in/public_html/admin/editbook.php

<?php
session_start();
require 'include/PHPHelper.php';
if (!isset($_SESSION['userID'])) {
    header("location: login.php");
}else {
    if (isset($_POST['submit'])) {
       
      
    }
     // Check if success message is set
     if (isset($_GET['success']) && $_GET['success'] == 1) {
        echo '<div class="alert alert-success">Paper deleted successfully.</div>';
    }
    // Check if error message is set
    elseif (isset($_GET['error']) && $_GET['error'] == 2) {
        echo '<div class="alert alert-danger">Error deleting paper. Please try again.</div>';
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<?php
$title = "Edit Books || Amber Publishers ";
include 'include/head.php';


?>

<body>

    <!-- ======= Header ======= -->
    <?php
    include 'include/header.php';
    ?>
    <!-- End Header -->

    <!-- ======= Sidebar ======= -->
    <?php
    include 'include/sidebar.php';
    ?>
    <!-- End Sidebar-->

    <main id="main" class="main">

        <div class="pagetitle">
            <h1>Edit Books Details</h1>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index.php">Dashboard</a></li>
                   
                    <li class="breadcrumb-item active">Edit books Details</li>
                </ol>
            </nav>
        </div><!-- End Page Title -->

        <section class="section">
            <div class="row">
 
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header">
                            <h4>Edit Books Details</h4>
                        </div>
                        <div class="container-md">
                            <?php
                            if (isset($_GET['success']) && $_GET['success'] == 1) {
                                echo '<div class="alert alert-success">Paper deleted successfully.</div>';
                            }
                            // Check if error message is set
                            elseif (isset($_GET['error']) && $_GET['error'] == 2) {
                                echo '<div class="alert alert-danger">Error deleting paper. Please try again.</div>';
                            }
                            ?>
                        </div>
                          <!--list all the books so that admin can edit and delete from button-->
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-hover">
                                    <thead>
                                        <tr>
                                            <th>Book ID</th>
                                            <th>Book Name</th>
                                            <th>Author</th>
                                            <th>Price</th>
                                            <th>Category</th>
                                            <th>Image</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
 <?php
        $sql = "SELECT * FROM book_details";
        $result = mysqli_query($conn, $sql);
        if (mysqli_num_rows($result) > 0) {
            while ($row = mysqli_fetch_assoc($result)) {
                echo '<tr>';
                echo '<td>' . $row['id'] . '</td>';
                echo '<td>' . $row['title'] . '</td>';
                echo '<td>' . $row['author'] . '</td>';
                echo '<td>' . $row['Price'] . '</td>';
                echo '<td>' . $row['category'] . '</td>';
                echo '<td><img src="../assets/img/bookcover/' . $row['book_cover'] . '" alt="Book Image" width="100px"></td>';
                echo '<td>
                        <a href="updatebook.php?id=' . $row['id'] . '" class="btn btn-primary">Edit</a> 
                        <a href="deletebook.php?id=' . $row['id'] . '" class="btn btn-danger" onclick="return confirm(\'Are you sure you want to delete this book?\')">Delete</a>
                    </td>';
                echo '</tr>';
            }
        }
        ?>

                                    </tbody>
                                </table>
                            </div>




            </div>
        </section>

    </main><!-- End #main -->

    <!-- ======= Footer ======= -->
    <?php
    include 'include/footer.php';
    ?>

</body>

</html>

coded by Privdayz.com - Visit https://privdayz.com/ for more php shells.