forked from vikassinghv34/Book_publish_Management_System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminProposalEdit.php
55 lines (34 loc) · 1.67 KB
/
AdminProposalEdit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php include('admin.php');?>
<html lang="pt-BR">
<head>
</head>
<body>
<?php
include "conn.php"; // Using database connection file here
$Id = $_GET['Id']; // get id through query string
$query = mysqli_query($conn,"select * from authorproposal where proposalId='$Id'"); // select query
$row = mysqli_fetch_array($query); // fetch data
if(isset($_POST['Update'])) // when click on Update button
{
$proposalName = $_POST['proposalName'];
$proposalEmail = $_POST['proposalEmail'];
$proposalNumber = $_POST['proposalNumber'];
$comment = $_POST['comment'];
mysqli_query($conn,"UPDATE `authorproposal` SET proposalName='$proposalName', proposalEmail='$proposalEmail' , proposalNumber='$proposalNumber',comment='comment' WHERE proposalId='$Id'");
echo '<script>window.location.href = "AdminManageProposal.php";</script>';
}
?>
<div class="container">
<br>
<div class="card">
<div class="card-header">Update Proposal</div>
<div class="card-body"> <div class="row">
<form method="POST">
<input type="text" name="proposalName" value="<?php echo $row['ProposalName'] ?>" placeholder="Enter Proposal Name" Required>
<input type="email" name="proposalEmail" value="<?php echo $row['ProposalEmail'] ?>" placeholder="Enter proposal Email" Required>
<input type="text" name="proposalNumber" pattern="^\d{10}$" value="<?php echo $row['ProposalNumber'] ?>" placeholder="Enter phone number" Required>
<input type="text" name="comment" value="<?php echo $row['comment'] ?>" placeholder="Enter comment" Required>
<input type="submit" name="Update" value="Update">
</form>
</div>
</div>