-
Notifications
You must be signed in to change notification settings - Fork 0
/
tested.php
187 lines (161 loc) · 6.65 KB
/
tested.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['submit']))
{
$coursecode=$_POST['coursecode'];
$coursename=$_POST['coursename'];
$seatlimit=$_POST['seatlimit'];
$ret=mysqli_query($con,"insert into course(courseCode,courseName,noofSeats) values('$coursecode','$coursename','$seatlimit')");
if($ret)
{
$_SESSION['msg']=" Created Successfully !!";
}
else
{
$_SESSION['msg']="Error : not created";
}
}
if(isset($_GET['del']))
{
mysqli_query($con,"delete from course where id = '".$_GET['id']."'");
$_SESSION['delmsg']=" deleted !!";
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>student| enrollment| Course</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<link href="assets/css/style.css" rel="stylesheet" />
</head>
<body>
<?php include('includes/header.php');?>
<!-- LOGO HEADER END-->
<?php if($_SESSION['login']!="")
{
include('includes/menubar.php');
}
?>
<!-- MENU SECTION END-->
<div class="content-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="page-head-line"> student| enrollment </h1>
</div>
</div>
<div class="row" >
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
student| enrollment Course
</div>
<font color="green" align="center"><?php echo htmlentities($_SESSION['msg']);?><?php echo htmlentities($_SESSION['msg']="");?></font>
<div class="panel-body">
<form name="dept" method="post">
<div class="form-group">
<option for="coursecode">Course Code </option>
<select>
<option value="Select">Select</option>}
<option value="Vineet">Vineet Saini</option>
<option value="Sumit">Sumit Sharma</option>
<option value="Dorilal">Dorilal Agarwal</option>
<option value="Omveer">Omveer Singh</option>
<option value="Rohtash">Rohtash Kumar</option>
<option value="Maneesh">Maneesh Tewatia</option>
<option value="Priyanka">Priyanka Sachan</option>
<option value="Neha">Neha Saini</option>
</select>
</div>
<div class="form-group">
<label for="coursename">STUDENT Name </label>
<input type="text" class="form-control" id="coursename" name="coursename" placeholder="Student Name" required />
</div>
<div class="form-group">
<label for="seatlimit">Seat no </label>
<input type="text" class="form-control" id="seatlimit" name="seatlimit" placeholder="Seat no" required />
</div>
<button type="submit" name="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
</div>
</div>
<font color="red" align="center"><?php echo htmlentities($_SESSION['delmsg']);?><?php echo htmlentities($_SESSION['delmsg']="");?></font>
<div class="col-md-12">
<!-- Bordered Table -->
<div class="panel panel-default">
<div class="panel-heading">
Manage Course
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="table-responsive table-bordered">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Course Code</th>
<th>Student Name </th>
<th>Seat no</th>
<th>Creation Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql=mysqli_query($con,"select * from course");
$cnt=1;
while($row=mysqli_fetch_array($sql))
{
?>
<tr>
<td><?php echo $cnt;?></td>
<td><?php echo htmlentities($row['courseCode']);?></td>
<td><?php echo htmlentities($row['courseName']);?></td>
<td><?php echo htmlentities($row['noofSeats']);?></td>
<td><?php echo htmlentities($row['creationDate']);?></td>
<td>
<a href="edit-course.php?id=<?php echo $row['id']?>">
<a href="course.php?id=<?php echo $row['id']?>&del=delete" onClick="return confirm('Are you sure you want to delete?')">
<button class="btn btn-danger">Delete</button>
</a>
</td>
</tr>
<?php
$cnt++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- End Bordered Table -->
</div>
</div>
</div>
</div>
<!-- CONTENT-WRAPPER SECTION END-->
<?php include('includes/footer.php');?>
<!-- FOOTER SECTION END-->
<!-- JAVASCRIPT AT THE BOTTOM TO REDUCE THE LOADING TIME -->
<!-- CORE JQUERY SCRIPTS -->
<script src="assets/js/jquery-1.11.1.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="assets/js/bootstrap.js"></script>
</body>
</html>
<?php } ?>