-
Notifications
You must be signed in to change notification settings - Fork 1
/
edit.php
145 lines (117 loc) · 4.39 KB
/
edit.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
$link = new mysqli("localhost","root",'',"jobapp1");
date_default_timezone_set('Asia/Kolkata');
$curr_date= date("Y-m-d H:i:s"); // time in India
$id =$_GET["id"];
$firstname = "";
$lastname= "";
$email= "";
$linkedin= "";
$position="";
$branch="";
$res = mysqli_query($link, "SELECT * from submissions where `id`=$id");
while($row=mysqli_fetch_array($res))
{
$firstname=$row["fname"];
$lastname=$row["lname"];
$email=$row["email"];
$linkedin= $row["linkedin"];
$position=$row["position"];
$branch=$row["branch"];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Edit</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="form-group">
<form action="" method="post">
<h1 style="text-align: center;text-shadow:4px 4px 5px rgba(0,0,0,0.4); font-weight:900;">Edit entries:</h1>
<br>
<div class="col-sm-12">
<label for="firstname">First Name:</label>
<input required type="text" class="form-control" id="firstname" placeholder="Enter First name" name="firstname" value="<?php echo
$firstname ?>">
</div> </div> <br>
<div class="form-group">
<div class="col-sm-12">
<label for="lastname">Last Name:</label>
<input type="text" class="form-control" id="lastname" placeholder="Enter Last name" name="lastname" value="<?php echo
$lastname ?>">
</div> </div> <br>
<div class="form-group">
<div class="col-sm-12">
<label for="email">Email:</label>
<input required type="email" class="form-control" id="email" placeholder="Enter email" name="email" value="<?php echo
$email ?>">
</div> </div> <br>
<div class="form-group">
<div class="col-sm-12">
<label for="linkedin">Linkedin:</label>
<input required type="url" class="form-control" id="linkedin" placeholder="Enter Linkedin link" name="linkedin" value="<?php echo
$linkedin ?>">
</div> </div> <br>
<div class="form-group">
<div class="col-sm-12">
<label for="position">Position:</label>
<input required type="text" class="form-control" id="position" placeholder="Enter Position" name="position" value="<?php echo
$position ?>">
</div> </div> <br>
<div class="form-group">
<div class="col-sm-12">
<label for="city_name">Branch:</label>
<input required type="text" class="form-control" placeholder="City name" name="branch" value="<?php echo
$branch ?>">
</div> </div> <br>
<div class="form-group">
<div class="col-sm-12">
<br>
<label >Are you willing to relocate?</label>
<label> <input type="radio" name="relocate" value="Yes"> Yes </label>
<label> <input type="radio" aria-selected="true" name="relocate" value="No"> No </label>
<label> <input type="radio" name="relocate" aria-selected="true" value="Notsure"> Not Sure </label>
<!-- <input type="submit" name="submit" value="Submit" checked> -->
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<div class="form-group">
<div class="col-md-12">
<br>
<button type="submit" name="update" class="btn btn-warning btn-block">Update</button>
</div>
</div>
</form>
</div>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins',sans-serif;
}
</style>
</body>
<?php
if(isset($_POST["update"]))
{
mysqli_query($link, "UPDATE submissions set fname= '$_POST[firstname]', lname='$_POST[lastname]',
email='$_POST[email]',linkedin='$_POST[linkedin]',position='$_POST[position]',
branch= '$_POST[branch]'
where id='$id' ")or die (mysqli_error($link));
?>
<script type="text/javascript">
window.location="view.php";
</script>
<?php
}
?>
</html>