forked from Kowshikreddy007/Botswithdots-SeatingAllotment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lecturehallwisedata.php
128 lines (123 loc) · 4.86 KB
/
lecturehallwisedata.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
<!--lecturehall wise data is present here-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Arrangement in Lecture Hall</title>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/bootstraap.css"/>
<link rel="stylesheet" href="css/lecturehalldata.css"/>
</head>
<body>
<a href="selectoneof3.php" class="btn btn-sm"><span class="glyphicon glyphicon-chevron-left"></span>back</a>
<?php
$server='localhost';
$dbuser='root';
$dbpass='';
$db='trial';
$conn=mysqli_connect($server,$dbuser,$dbpass,$db);//database connection
mysqli_query($conn,"UPDATE viewcount set views=views+1 where pagename='lecturehalldata'");
$re=mysqli_query($conn,"SELECT * from viewcount where pagename='lecturehalldata' ");
while ($view=mysqli_fetch_array($re)) {
?>
<span class="glyphicon glyphicon-eye-open"></span><?php echo " ".$view['views'];} ?>
<?php
$classroomtake=$_POST["classroom"]; //classroom which is enter taken here
if($classroomtake)
{
foreach ($classroomtake as $cl )
{
$class=mysqli_real_escape_string($conn,$cl);
}
}
$branchq="SELECT distinct department from trisub where classroom='$class'";//distinct department selection
$retvalbranch=mysqli_query($conn,$branchq);
$yearq="SELECT distinct year from trisub where classroom='$class'";//distinct year selection
$retvalyear=mysqli_query($conn,$yearq);
?>
<center><h2 class="table-header"><?php echo $class; ?></h2></center>
<div class="panel panel-default">
<table class="table" >
<tr>
<td rowspan="10">
<table class="table table-hover" border="3">
<tr>
<td><lable>Branch :<label></td>
<td><?php $rowbranch=mysqli_fetch_row($retvalbranch);
$rowyear=mysqli_fetch_row($retvalyear);
$branch1=$rowbranch[0];
$year1=$rowyear[0];
echo $year1." Year ".$branch1;
?></td>
</tr>
<?php
$subq1="SELECT distinct subject,examdate,starttime,endtime from trisub where classroom='$class' AND year='$year1' AND department='$branch1'";
$retvalsub1=mysqli_query($conn,$subq1);
while($rowall1=mysqli_fetch_assoc($retvalsub1)){?>
<tr>
<td><?php echo $rowall1['subject'];?><!--subject--></td>
<td><?php echo $rowall1['examdate']." / ".$rowall1['starttime']." to ".$rowall1['endtime']." "; ?><!--date and time is display here--></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
<tr>
<td rowspan="10">
<table class="table table-hover" border="4">
<tr>
<td><lable>Branch :<label></td>
<td><?php $rowbranch=mysqli_fetch_row($retvalbranch);
$rowyear=mysqli_fetch_row($retvalyear);
$branch2=$rowbranch[0];
$year2=$rowyear[0];
echo $year2." Year ".$branch2;
?></td>
</tr>
<?php
$subq2="SELECT distinct subject,examdate,starttime,endtime from trisub where classroom='$class' AND year='$year2' AND department='$branch2'";
$retvalsub2=mysqli_query($conn,$subq2);
while($rowall2=mysqli_fetch_assoc($retvalsub2)){?>
<tr>
<td><?php echo $rowall2['subject'];?><!--subject--></td>
<td><?php echo $rowall2['examdate']." / ".$rowall2['starttime']." to ".$rowall2['endtime']." "; ?><!--date and time is display here--></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<table class="table main-table" border="2">
<!--this table is also appear from database-->
<?php
$numq1="SELECT distinct enrollnumber from trisub where classroom='$class' AND year='$year1' AND department='$branch1'";
$retvalnum1=mysqli_query($conn,$numq1);
$numq2="SELECT distinct enrollnumber from trisub where classroom='$class' AND year='$year2' AND department='$branch2'";
$retvalnum2=mysqli_query($conn,$numq2);
?>
<tr><th><center>Row 1</center><th><center>Row 2</center><th><center>Row 3</center><th><center>Row 4</center></th>
<tr><?php $count=1;
$count1=1; ?>
<?php while(($count1%5)!=0) {$count=1;
?>
<td rowspan="10">
<table class="table table-hover" border="3">
<?php while(($count%11)!=0) {
$rownum1=mysqli_fetch_assoc($retvalnum1);//first branch rollnumber selected here
$rownum2=mysqli_fetch_assoc($retvalnum2);//second branch rollnumber selected here
?>
<tr>
<td><?php $no1=$rownum1['enrollnumber']; echo $no1; ?></td><!--first branch student seat here-->
<td><?php $no2=$rownum2['enrollnumber']; echo $no2; ?></td><!--second branch student seat here-->
</tr>
<?php $count=$count+1;} ?>
</table>
</td>
<?php $count1=$count1+1;} ?>
</tr>
</table>
</div>
</body>
</html>