-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiwp_alt_comp.php
272 lines (218 loc) · 6.76 KB
/
iwp_alt_comp.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<link rel="stylesheet" href="style.css">
<!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap">
<!-- Bootstrap core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.0/css/mdb.min.css" rel="stylesheet">
<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.0/js/mdb.min.js"></script>
</head>
<style type="text/css">
.header1
{
height: 150px;
}
table {
width: 85%;
border-collapse: collapse;
}
th {
height: 50px;
text-align: center;
background-color:#e8dfd3;
}
td
{
padding:10px;
text-align: center;
}
table, td, th {
border: 1px solid black;
}
tr:nth-child(even) {background-color:#b87442; color:white;}
tr:nth-child(odd) {background-color: #d1bbab;}
input[type=radio] {
border: 0px;
width: 70%;
height: 1.0em;
margin: 2px -10px 0 -20px;
}
.buttonx1
{
background-color: #674a40;
color: white;
padding: 10px 25px;
text-align: center;
border: none;
text-decoration: none;
display: inline-block;
font-size: 14px;
margin: 4px 2px;
cursor: pointer;
border-radius: 12px;
}
.panel{
height:3000px;
width:100%;
padding: 20px;
}
hr {height:2px; border-width:0;color:gray;background-color:gray;}
.iconDetails {
margin-left:0px;
float:left;
height:40px;
width:40px;
}
.container2 {
width:100%;
height:auto;
padding:6px;
}
</style>
<body oncontextmenu="return false;" >
<div class="bg" id="intro-section" >
<div class="" id="page-wrapper">
<header class="header1" >
<div class="container">
<div class="logo" style="position:relative; left:75px;">
<img src="vit_logo.png" alt="User Image" width="270" height="175" />
</div>
<div class="header" style=" position: relative; left:470px; bottom:60px">
<a href="http://localhost/iwp_project/iwp_home.php" style="color:white;">| Home |</a>
<a href="http://localhost/iwp_project/iwp_view.php" style="color:white;">View |</a>
<a href="http://localhost/iwp_project/timetable.php" style="color:white;">Timetable |</a>
</div>
<div class="header" style="color:white; position:relative; left:750px; bottom:170px">
<h1>V-TOP</h1> <h3>COURSE REGISTRATION </h3>
</div>
<div class="header" style="color:white; position:relative; left:570px; bottom:220px">
<div class=" text-center">
<button type="button" class="buttonx1" onclick="location.href = 'http://localhost/iwp_project/iwp_login.php';">Logout</button>
</div>
</div>
</header>
</div>
<?php
session_start();
$reg_no=$_SESSION['t_reg_no'];
$name=$_SESSION['t_name'];
echo '<div class="container2 bg1">
<div class="iconDetails" >
<img style="position:relative; left:1000px;" src="id.png" alt="User Image" width="26" height="26" />
</div>
<div style="margin-left:60px;">';
echo '<p style=" font-weight: 900;" class="text-right">'.$reg_no.'-'.$name.'</p>';
echo '</div>';
echo '</div>';
?>
<section class="text-center py-5 bg1">
<div class="container">
<h1 style="font-weight: bold;font-family:verdana;">Alternate Course Page</h1>
</div>
<hr>
<div class="container">
<div id="option_buttons" class="horizontal-scroll-no-collapse text-center">
</div>
</div>
</section>
<?php
$link = mysqli_connect("localhost:3307","root","","crer1");
?>
<section class="bg1">
<div class="container py-1">
<div id="slot-sel-area" class="row">
<div class="panel panel-primary text-center bg2">
<br>
<div class="panel-body ">
<form class="col-xs-12 text-center" method="post" action="iwp_timetable_auth2.php">
<?php
$t_slot1=$_POST['slot'];
$ccode=$_SESSION['t_ccode'];
$sql= "select * from all_course1 where course_code='$ccode' and slot1='$t_slot1'";
$result = mysqli_query($link, $sql);
if ($result)
{
$num_results = mysqli_num_rows($result);
echo '<table border="1" align="center">';
echo '<tr>
<th>Course Name</th>
<th>Faculty Name</th>
<th>Slot</th>
<th>Credits</th>
<th>Register</th>
</tr>';
for ($i=0;$i<$num_results;$i++)
{
$row = mysqli_fetch_array($result);
$course_name= $row["course_name"];
$faculty_name= $row["faculty_name"];
$slot1= $row["slot1"];
$slot2= $row["slot2"];
$s_no=$row["s_no"];
$seat_avl=$row["seat_avl"];
$credit=$row["credit"];
$seat_tot=$row["seat_tot"];
$class_str=$row["class_str"];
if($seat_tot<$class_str)
{
$sql12="UPDATE all_course1 SET seat_avl=seat_avl+1 WHERE s_no='$s_no'";
mysqli_query($link, $sql12);
$sql13="update all_course1 set seat_tot=seat_tot+1 where s_no='$s_no'";
mysqli_query($link, $sql13);
$seat_avl=$seat_avl+1;
echo '<tr>';
echo '<td>';
echo $row['course_name'];
echo '</td>';
echo '<td>';
echo $row['faculty_name'];
echo '</td>';
echo '<td>';
if($row["slot2"]==NULL)
{
echo $row["slot1"];
}
else
{
echo $row["slot1"]. " + " . $row["slot2"] . "<br>";
}
echo '</td>';
echo '<td>';
echo $row['credit'];
echo '</td>';
echo '<td>';
echo '<input type="radio" name="slot" value="'.$s_no.'">';
echo '<label for="seat">'.$seat_avl.'</label>';
echo '</td>';
echo '</tr>';
break;
}
}
echo '</table>';
}
else
{
echo "0 results";
}
?>
<br>
<input type="submit" class="buttonx1 " name="submit"></input>
</form>
</div>
</div>
</div>
</div>
</section>
</body>
</html>