-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp2.txt
More file actions
163 lines (114 loc) · 3.66 KB
/
temp2.txt
File metadata and controls
163 lines (114 loc) · 3.66 KB
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
<?php
require_once 'config.php';
session_start();
if(!isset($_SESSION['user']) || empty($_SESSION['user']))
{
header("location: index.php");
exit;
}
if($_POST["doj"]=="Select Day")
{
header( "refresh:2;url=select_date_for_overview.php" );
echo "<br><br><center><h2 style='color:red'>Select A Day....!</h2><h2 style='color:red'>You Are Redirecting To The Previous Page...!</h2></center>";
}
$_SESSION['dateForOverview']=$_POST["doj"];
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $_SESSION['dateForOverview']."-Overview";?></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
</style>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
</head>
<body>
<?php
if($_POST["doj"]!="Select Day")
{
//echo $d;
//echo "<br>".$_SESSION['yearfortimetable'];
$sql="SELECT `resource`, `period` FROM `allocation` WHERE day='".$_SESSION['dateForOverview']."'";
$result = $conn->query($sql);
ECHO $sql;
if ($result->num_rows== 0 )
{
echo "<div class='w3-panel w3-red'>";
echo "<h3>Message!</h3>";
echo "<p>No Allocation Found For Selected Date</p>";
echo "</div>";
}
else
{
echo "<br><br><br><br><center><h1><b>".$_SESSION['dateForOverview']."-Overview ";
echo"</b></h1></center><br><br><br>";
echo "<center><table id='customers'><tr>";
echo "<th>P/R</th>";
echo "<th>CR2</th>";
echo "<th>CR3</th>";
echo "<th>CR4</th>";
echo "<th>CR5</th>";
echo "<th>CR6</th>";
echo "<th>VCS</th>";
echo "<th>MM-LAB</th>";
echo "<th>PL-LAB</th>";
echo "<th>LINUX-LAB</th>";
echo "<th>NETWORKING-LAB</th>";
echo "<th>DB-L</th>";
$period=array( "08:00AM - 09:00AM","09:00AM - 10:00AM","10:10AM - 11:10AM", "11:10AM - 12:10PM", "12:40PM - 01:40PM","01:40PM - 02:40PM","02:50PM - 03:50PM", "03:50PM - 04:50PM");
echo "<tr>";
for ($k=0; $k <8; $k++) {
echo "<td>".$period[$k]."</td>";
$resultset=array("r1"=>"FREE","r2"=>"FREE","r3"=>"FREE","r4"=>"FREE","r5"=>"FREE","r6"=>"FREE","r7"=>"FREE","r8"=>"FREE","r9"=>"FREE","r10"=>"FREE","r11"=>"FREE");
for ($i=1; $i <= 11; $i++) {
while($row=mysqli_fetch_array($result,MYSQLI_NUM))
{
}
$j="r".$i;
if($resultset[$j]!="FREE")
{
echo "<td style='color:red'><center><b>$resultset[$k]</b></center></td>";
}
else
{
echo "<td><center>$resultset[$k]</center></td>";
}
}
echo "</tr>";
}
echo "</center></table>";
echo '<br><br>';
echo '<button class="btn btn-info btn-lg" onclick="location.href="select_year_for_time_table.php" type="button">
<span class="glyphicon glyphicon-repeat"></span> Check Another</button>';
echo '<button onclick="myFunction()" class="btn btn-info btn-lg"><span class="glyphicon glyphicon-print"></span> Print this page</button>
';
}
}
?>
<script>
function myFunction() {
window.print();
}
</script>
</body>
</html>