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/updatepaper.php

<?php
session_start();
require 'include/PHPHelper.php';
if (!isset($_SESSION['userID'])) {
    header("location: login.php");
} else {
    if (isset($_POST['submit'])) {
        // Code for handling form submission and updating paper details
        $paperId = $_POST['paper_id'];
        $title = $_POST['title'];
        $authors = $_POST['authors'];
        $pageNumber = $_POST['page_number'];
        $abstract = $_POST['abstract'];
        $keywords = $_POST['keywords'];
        $publicationDate = $_POST['publication_date'];

        // Update the paper details in the database
        $sql = "UPDATE papers SET title = '$title', authors = '$authors', page_number = '$pageNumber', abstract = '$abstract', keywords = '$keywords', date_of_publication = '$publicationDate' WHERE paper_id = '$paperId'";
        if (mysqli_query($conn, $sql)) {
            header("location: editpaperdetails.php?success=1");
            exit();
        } else {
            header("location: editpaperdetails.php?error=2");
            exit();
        }
    }
}

// Retrieve the paper details from the database
$paperId = $_GET['id'];
$sql = "SELECT * FROM papers WHERE paper_id = '$paperId'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
?>

<!DOCTYPE html>
<html lang="en">
<?php
$title = "Update Paper Details || IJSRI Admin Panel";
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>Update Paper Details</h1>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index.php">IJSRI Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="editpapers.php">Edit Paper Details</a></li>
                    <li class="breadcrumb-item active">Update Paper 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>Update Paper Details</h4>
                        </div>
                        <div class="card-body">
                            <form action="updatepaper.php" method="post">
                                <div class="form-group">
                                    <label for="title">Title</label>
                                    <input type="text" class="form-control" name="title" value="<?php echo $row['title']; ?>">
                                </div>
                                <div class="form-group">
                                    <label for="authors">Authors</label>
                                    <input type="text" class="form-control" name="authors" value="<?php echo $row['authors']; ?>">
                                </div>
                                <div class="form-group">
                                    <label for="page_number">Page Number</label>
                                    <input type="number" class="form-control" name="page_number" value="<?php echo $row['page_number']; ?>">
                                </div>
                                <div class="form-group">
                                    <label for="abstract">Abstract</label>
                                    <textarea class="form-control" name="abstract"><?php echo $row['abstract']; ?></textarea>
                                </div>
                                <div class="form-group">
                                    <label for="keywords">Keywords</label>
                                    <input type="text" class="form-control" name="keywords" value="<?php echo $row['keywords']; ?>">
                                </div>
                                <div class="form-group">
                                    <label for="publication_date">Publication Date</label>
                                    <input type="date" class="form-control" name="publication_date" value="<?php echo $row['date_of_publication']; ?>">
                                </div>
                                <input type="hidden" name="paper_id" value="<?php echo $row['paper_id']; ?>">
                                <button type="submit" name="submit" class="btn btn-primary">Update</button>
                            </form>
                        </div>
                    </div>
                </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.