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

<?php
session_start();
require 'include/PHPHelper.php';
if (!isset($_SESSION['userID'])) {
    header("location: login.php");
} else {
    if (isset($_POST['submit'])) {
        // Get the reviewer ID from the URL
        $reviewerID = $_GET['id'];
        
        // Get the updated reviewer details from the form
        $name = $_POST['name'];
        $affiliation = $_POST['affiliation'];
        $email = $_POST['email'];

        // Update the reviewer details in the database
        $sql = "UPDATE reviewers SET name=?, affiliation=?, email=? WHERE id=?";
        $stmt = mysqli_prepare($conn, $sql);
        mysqli_stmt_bind_param($stmt, "sssi", $name, $affiliation, $email, $reviewerID);
        mysqli_stmt_execute($stmt);
        mysqli_stmt_close($stmt);

        header("Location: editreviewer.php");
        exit();
    } else {
        // Retrieve the reviewer details from the database based on the ID
        $reviewerID = $_GET['id'];
        $query = "SELECT * FROM reviewers WHERE id = ?";
        $stmt = mysqli_prepare($conn, $query);
        mysqli_stmt_bind_param($stmt, "i", $reviewerID);
        mysqli_stmt_execute($stmt);
        $result = mysqli_stmt_get_result($stmt);
        $reviewer = mysqli_fetch_assoc($result);
        mysqli_stmt_close($stmt);
        mysqli_close($conn);
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<?php
$title = "Update Reviewer || 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>Update Reviewer</h1>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index.php">IJSRI Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="editreviewer.php">Edit Reviewers Details</a></li>
                    <li class="breadcrumb-item active">Update Reviewer</li>
                </ol>
            </nav>
        </div><!-- End Page Title -->

        <section class="section">
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="card-title">
                                <h5>Update Reviewer</h5>
                                <div class="form">
                                    <form method="POST" action="updatereviewer.php?id=<?php echo $reviewer['id']; ?>">
                                        <div class="row mb-3">
                                            <label for="name" class="col-md-4 col-lg-3 col-form-label">Name:</label>
                                            <div class="col-md-8 col-lg-9">
                                                <input name="name" type="text" class="form-control" id="name" value="<?php echo $reviewer['name']; ?>" required>
                                            </div>
                                        </div>
                                        <div class="row mb-3">
                                            <label for="affiliation" class="col-md-4 col-lg-3 col-form-label">Affiliation:</label>
                                            <div class="col-md-8 col-lg-9">
                                                <input name="affiliation" type="text" class="form-control" id="affiliation" value="<?php echo $reviewer['affiliation']; ?>" required>
                                            </div>
                                        </div>
                                        <div class="row mb-3">
                                            <label for="email" class="col-md-4 col-lg-3 col-form-label">Email:</label>
                                            <div class="col-md-8 col-lg-9">
                                                <input name="email" type="email" class="form-control" id="email" value="<?php echo $reviewer['email']; ?>" required>
                                            </div>
                                        </div>
                                        <div class="row mt-3">
                                            <div class="text-center">
                                                <input type="submit" name="submit" id="submit" class="btn btn-primary col-lg-12" value="Update Reviewer">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </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.