-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagree-report.php
More file actions
146 lines (129 loc) · 5.23 KB
/
agree-report.php
File metadata and controls
146 lines (129 loc) · 5.23 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
<!DOCTYPE html>
<html lang="en">
<?php
require_once('header.php');
require_once('includes/config.php');
global $db;
$school_name = "";
$district_name = "";
//create URL
$school_id = isset($_REQUEST['s_id']) ? urldecode($_REQUEST['s_id']) : "";
if ($school_id == "") {
header('Location:' . BASE_URL . '/index.php');
exit();
}
$district_id = isset($_REQUEST['d_id']) ? urldecode($_REQUEST['d_id']) : "";
if ($district_id == "") {
header('Location' . BASE_URL . '/index.php');
exit();
}
$school_name = "";
$district_name = "";
// get data about school and district
if($school_id != -1 && $district_id != -1) {
$stmt = $db->pdo->prepare("select s.name as school_name, d.name as district_name from tbl_school as s left join tbl_district as d on s.district_id = d.id where s.id=".$school_id." and d.id=".$district_id);
if($stmt->execute()) {
$tmp = $stmt->fetch();
if(count($tmp) > 0) {
$school_name = $tmp['school_name'];
$district_name = $tmp['district_name'];
} else {
// return
header('Location'.BASE_URL.'/index.php');
exit();
}
}
} else if($school_id == -1 && $district_id != -1) {
$stmt = $db->pdo->prepare("select name from tbl_district where id=".$district_id);
if($stmt->execute()) {
$tmp = $stmt->fetch();
if(count($tmp) > 0) {
$district_name = $tmp['name'];
} else {
header('Location'.BASE_URL.'/index.php');
exit();
}
}
}
?>
<body class="dash" id="printable">
<nav class="navbar sticky-top navbar-dark bg-dark">
<a class="navbar-brand" href="https://nc2012.asqnc.com"><h3> <span class="year"><?php echo $year; ?></span> NC TWC Survey - Home</h3>
</a>
</nav
<div class="page-wrapper">
<!-- Page Content-->
<div class="page-content">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<h3 class="page-title">NC TWC <span class="year"><?php echo $year; ?></span> Survey (% Agree) Analysis </h3>
<?php if($district_id != -1) { ?>
<h4 class="school-name">District : <?php echo $district_name; ?></h4>
<?php } ?>
<?php if($school_id != -1) { ?>
<h4 class="school-name"> School : <?php echo $school_name; ?></h4>
<?php } ?>
<div class="q_legend_info col-12">
<div class="row">
<div class="col-md-3 legend-title-col"><span class="legendBox range27"></span>Under 29%</div>
<div class="col-md-3 legend-title-col"><span class="legendBox range48"></span>30%-49%</div>
<div class="col-md-3 legend-title-col"><span class="legendBox range69"></span>50%-69%</div>
<div class="col-md-3 legend-title-col"><span class="legendBox range100"></span>Above 70%</div>
</div>
</div>
<input type="hidden" id="hide_school_id" name="hide_school_id" value="<?php echo $school_id; ?>"/>
<input type="hidden" id="hide_school_name" name="hide_school_name" value="<?php echo $school_name; ?>"/>
<input type="hidden" id="hide_district_id" name="hide_district_id" value="<?php echo $district_id; ?>"/>
<input type="hidden" id="hide_district_name" name="hide_district_name" value="<?php echo $district_name; ?>"/>
<a target="_blank" class="btn btn-primary " onclick="ExportPdf();">EXPORT TO PDF</a>
</div>
</div>
</div>
<div class="row ">
<div class="col-md-12 loading-wrap">
<div class="spinner-border text-danger" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<div class="col-md-12 reports-col">
</div> <!-- end col -->
</div> <!-- end row -->
</div><!-- container -->
</div>
<!-- end page content -->
</div>
<!-- end page-wrapper -->
<?php require_once('footer.php') ?>
<script>
var base_url = "<?php echo BASE_URL ?>";
</script>
<script src="js/agree-report.js?v=1.1.1"></script>
<script src="https://kendo.cdn.telerik.com/2017.2.621/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2017.2.621/js/kendo.all.min.js"></script>
<script>
function ExportPdf() {
var draw = kendo.drawing;
draw.drawDOM($("#printable"), {
avoidLinks: true,
paperSize: "A4",
margin: {top: "1cm"},
landscape: false,
scale: 0.5,
keepTogether: ".prevent-split"
//template: $("#page-template").html()
})
.then(function (root) {
return draw.exportPDF(root);
})
.done(function (data) {
kendo.saveAs({
dataURI: data,
fileName: "2012NCTWC_SurveyResults.pdf"
});
});
}
</script>
</body>
</html>