-
Notifications
You must be signed in to change notification settings - Fork 6
/
edit.php
121 lines (99 loc) · 3.68 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
<?php
function fetch_data()
{
$output = '';
$conn = mysqli_connect("localhost", "root", "", "project");
$sql = "SELECT * FROM symbols ORDER BY email";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result))
{
$output .= '<tr>
<td>'.$row["id"].'</td>
<td>'.$row["name"].'</td>
<td>'.$row["title"].'</td>
<td>'.$row["email"].'</td>
<td>'.$row["year"].'</td>
<td>'.$row["gender"].'</td>
<td>'.$row["fromdate"].'</td>
<td>'.$row["todate"].'</td>
<td>'.$row["people"].'</td>
</tr>
';
}
return $output;
}
?>
<?php include('header.php'); ?>
<center>
<h3 style="padding: 20px;">Records In Database:</h3>
<div class="table-responsive table-hover table-bordered col-10" >
<table class="table" >
<thead >
<tr class="table-primary">
<th width="1%">Id</th>
<th width="1%">Name</th>
<th width="1%">Event</th>
<th width="1%">Email</th>
<th width="1%">Year</th>
<th width="1%">Gender</th>
<th width="1%">From date</th>
<th width="1%">To date</th>
<th width="1%">No of people</th>
</tr>
<tbody>
<?php
echo fetch_data();
?>
</tbody>
</table>
</thead>
</table>
</div>
</div>
<h3 style="padding: 20px;">Edit Registration:</h3>
<div class="jumbotron col-6" style=" font-weight: bold;">
<form action='doedit.php' method='post'>
<div class="form-group row">
<label for="name" class="col-4">ID:</label>
<input type="int" class="form-control col-7" id="id" name="id" placeholder="Enter id to be edit" required>
</div>
<div class="form-group row">
<label for="name" class="col-4">Name:</label>
<input type="text" class="form-control col-7" id="name" name="name" placeholder="Enter name" required>
</div>
<div class="form-group row">
<label for="exampleInputEmail1" class="col-4">Email address:</label>
<input type="email" class="form-control col-7" id="email" name="email" placeholder="Enter email" required>
</div>
<div class="form-group row">
<label for="title" class="col-4">Event:</label>
<input type="text" class="form-control col-7" id="title" name="title" placeholder="Enter event" required>
</div>
<div class="form-group row">
<label for="Year" class="col-4">Year:</label>
<input type="int" class="form-control col-7" id="Year" name="Year" placeholder="Enter Year" required>
</div>
<div class="form-group row">
<label for="title" class="col-4">Gender:</label>
<label class="col-4">male<input class="form-check-input col-4" type="radio" name="gender" value="male" required></label>
<label class="col-4">female<input class="form-check-input col-4" type="radio" name="gender" value="female" required></label>
</div>
<div class="form-group row">
<label for="title" class="col-4">From Date:</label>
<input type="date" class="form-control col-7" id="fromdate" name='fromdate' required>
</div>
<div class="form-group row">
<label for="title" class="col-4">To Date:</label>
<input type="date" class="form-control col-7" id="todate" name='todate' required>
</div>
<div class="form-group row">
<label for="Year" class="col-4">No. of People:</label>
<input type="int" class="form-control col-7" id="people" name='people' placeholder="Enter number of people" required>
</div>
<button class="btn btn-primary" type="submit" value='submit' >Submit</button>
<button class="btn btn-warning" type="reset" value='Reset' >Reset</button>
</form>
</div>
</div>
</center>
<?php include('footer.php'); ?>