-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfc_stats.php
133 lines (113 loc) · 3.5 KB
/
fc_stats.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
<?php
require 'require.php';
require('session.php');
if(!isset($_SESSION['login_fc']))
{
header('Location: index.php');
}
?>
<?php
if(isset($_SESSION['filter_query']))
{
$forms_query = $_SESSION['filter_query'];
}
else
{
$forms_query = "SELECT form_name,counter from feedback_forms ORDER BY form_name";
}
if(isset($_POST['dept']))
{
if(!empty($_POST['dept']))
{
$dept = $_POST['dept'];
$_SESSION['filter_dept'] = $dept;
$forms_query = "SELECT form_name,counter from feedback_forms WHERE branch='$dept' ORDER BY form_name";
}
else
{
$_SESSION['filter_dept']='All Departments';
$forms_query = "SELECT form_name,counter from feedback_forms ORDER BY form_name";
}
}
$_SESSION['filter_query'] = $forms_query;
$results = mysql_query($forms_query) or die(mysql_error());
?>
<!DOCTYPE html>
<html>
<head>
<title>Feedback | Statistics</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/auto_table_final.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:white;">
<div id="logout">
<a href="logout.php"><input type="button" value="Log Out" id="button" /></a>
</div>
<div id="profile">
<br />
<div style="margin-top:-3%;margin-bottom:2%;">
<img src="images/logo.png" style="margin:0 auto 0 auto;" />
</div>
<div style="color:white;display:block;">
<span style="box-shadow:0 0 10px rgba(0,0,0,0.6);background:rgb(79, 79, 79);padding:15px;">Feedback System | Feedback Co-ordinator Panel</span>
</div>
<div id="info">
<div class="welcome">Feedback Statistics</div>
<hr />
</div>
</div>
<div class="operations">
<h2>Filtered By :
<?php
if(isset($_SESSION['filter_dept']))
{
echo $_SESSION['filter_dept'];
}
else
{
echo 'All Departments';
}
?></h2>
<form action="fc_stats.php" method=POST>
Filter by departments : <select name="dept">
<option value="">All</option>
<option value="CS">CS</option>
<option value="IT">IT</option>
<option value="EC">EC</option>
<option value="EX">EX</option>
<option value="EI">EI</option>
<option value="CE">CE</option>
<option value="ME">ME</option>
<option value="TX">TX</option>
<option value="AU">AU</option>
</select>
<input type="submit" value="Submit" class="submit" />
</form>
<div id="stats">
<div class=CSSTableGenerator id=table>
<table style="">
<tr>
<td><b>Form Name</b></td><td><b>Counter</b></td>
</tr>
<?php
while($row = mysql_fetch_assoc($results))
{
echo "<tr>";
echo "<td>".$row['form_name']."</td>"."<td>".$row['counter']."</td>";
echo "</tr>";
}
?>
</table>
</div>
</div>
</div>
<br /><input type="button" onclick="location.href='fc_panel.php';" value="Go Back" />
<script src="chosen/jquery.min.js" type="text/javascript"></script>
<script>
setInterval(function()
{
$('#stats').load('fc_stats.php #stats');
}, 1000)
</script>
</body>
</html>