-
Notifications
You must be signed in to change notification settings - Fork 0
/
export.php
250 lines (246 loc) · 12.6 KB
/
export.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
<?php
include('functions.php');
$user = $_SESSION['user'];
$project_ids = explode(', ', $user['project_id']);
$project_names = explode(', ', $user['project_name']);
if(!$user){
header("Location: ./login.php?nexturl=collaborate.php?$_SERVER[QUERY_STRING]");
exit;
}
if (isset($_GET['id'])) {
if ($user['user_type']!=='administrator') {
header('HTTP/1.0 403 Forbidden');
header('Location: ./403.html');
} elseif (!in_array(e($_GET['id']), $project_ids, true)||!in_array(e($_GET['name']), $project_names, true)) {
header('HTTP/1.0 404 Not Found');
header('Location: ./404.html');
}
} else {
header("Location: ./forms.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Content-Language" content="en"/>
<meta name="theme-color" content="#817729">
<meta name="msapplication-TileColor" content="#817729">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Agridata">
<meta name="mobile-web-app-capable" content="yes">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="application-name" content="Agridata">
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon-precomposed.png">
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<link rel="manifest" href="./site.webmanifest">
<link rel="mask-icon" href="./safari-pinned-tab.svg" color="#5bbad5">
<title>Verde - Agricultural Extension and Analytics</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,500,500i,600,600i,700,700i&subset=latin-ext">
<script charset="utf-8" src="./assets/js/pace.min.js"></script>
<script src="./assets/js/require.min.js"></script>
<script>
setTimeout(hideURLbar, 0);
function hideURLbar(){
window.scrollTo(0,1);
}
requirejs.config({
baseUrl: '.'
});
</script>
<!-- Dashboard Core -->
<link href="./assets/css/dashboard.css" rel="stylesheet" />
<link href="./assets/css/pace.css" rel="stylesheet" />
<script charset="utf-8" async src="./assets/js/dashboard.js"></script>
</head>
<body class="">
<div class="page">
<div class="page-main">
<div class="header py-4">
<div class="container">
<div class="d-flex">
<a class="header-brand" href="./forms.php">
<img src="./assets/images/logo.png" class="header-brand-img" alt="[VERDE]">
</a>
<div class="d-flex order-lg-2 ml-auto">
<div class="dropdown d-none d-md-flex">
<a class="nav-link icon" data-toggle="dropdown">
<i class="fe fe-bell"></i>
<span class="nav-unread"></span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a href="#" class="dropdown-item d-flex">
<!-- <span class="avatar mr-3 align-self-center" style="background-image: url(demo/faces/male/41.jpg)"></span> -->
<div>
<p>New farmer signed on - <strong>Musa Abdullahi</strong></p>
<div class="small text-muted">10 minutes ago</div>
</div>
</a>
<a href="#" class="dropdown-item d-flex">
<div>
<p>50 messages sent to farmers in <strong>Kano State</strong></p>
<div class="small text-muted">1 hour ago</div>
</div>
</a>
<a href="#" class="dropdown-item d-flex">
<div>
<p>5 voice calls were not picked.</p>
<div class="small text-muted">2 hours ago</div>
</div>
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item text-center text-muted-dark">Mark all as read</a>
</div>
</div>
<div class="dropdown">
<a href="#" class="nav-link pr-0 leading-none" data-toggle="dropdown">
<span class="avatar avatar-blue">
<?php
$firstname = $_SESSION['user']['firstname'];
$lastname = $_SESSION['user']['lastname'];
if ($firstname) {
$words = explode(" ", $firstname .' '. $lastname);
$initials = null;
foreach ($words as $w) {
$initials .= $w[0];
}
echo $initials;
} else if ($_SESSION['user']['user_type'] === 'agent') {
echo "A";
}
?>
</span>
<span class="ml-2 d-none d-lg-block">
<span class="text-primary">
<?php
if ($_SESSION['user']['firstname']) {
echo $_SESSION['user']['firstname'].' '.$_SESSION['user']['lastname'];
} else {
echo ucfirst($_SESSION['user']['username']);
}
?>
</span>
<small class="text-muted d-block mt-1">
<?php echo ucfirst($_SESSION['user']['user_type']); ?>
</small>
</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="./profile.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>">
<i class="dropdown-icon fe fe-user"></i> Profile
</a>
<a class="dropdown-item" href="#">
<i class="dropdown-icon fe fe-settings"></i> Settings
</a>
<a class="dropdown-item" href="#">
<span class="float-right"><span class="badge badge-primary">6</span></span>
<i class="dropdown-icon fe fe-mail"></i> Inbox
</a>
<!-- <a class="dropdown-item" href="#">
<i class="dropdown-icon fe fe-send"></i> Message
</a> -->
<div class="dropdown-divider"></div>
<!-- <a class="dropdown-item" href="#">
<i class="dropdown-icon fe fe-help-circle"></i> Need help?
</a> -->
<a class="dropdown-item" href="./export.php?logout='1'">
<i class="dropdown-icon fe fe-log-out"></i> Sign out
</a>
</div>
</div>
</div>
<a href="#" class="header-toggler d-lg-none ml-3 ml-lg-0" data-toggle="collapse" data-target="#headerMenuCollapse">
<span class="header-toggler-icon"></span>
</a>
</div>
</div>
</div>
<div class="header collapse d-lg-flex p-0" id="headerMenuCollapse">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-3 ml-auto">
<form class="input-icon my-3 my-lg-0">
<input type="search" class="form-control header-search" placeholder="Search…" tabindex="1">
<div class="input-icon-addon">
<i class="fe fe-search"></i>
</div>
</form>
</div>
<div class="col-lg order-lg-first">
<ul class="nav nav-tabs border-0 flex-column flex-lg-row">
<li class="nav-item dropdown">
<a href="javascript:void(0)" class="nav-link" data-toggle="dropdown"><i class="fe fe-trending-up"></i> Analytics</a>
<?php if ($_GET['name'] === 'register-farmer') { ?>
<div class="dropdown-menu dropdown-menu-arrow">
<a href="./overview.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="dropdown-item"><i class="fe fe-box"></i> Overview</a>
<a href="./biodata.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="dropdown-item"><i class="fe fe-file-text"></i> Bio-data</a>
<a href="./demography.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="dropdown-item"><i class="fe fe-bar-chart-2"></i> Demographics</a>
</div>
<?php } elseif ($_GET['name'] === 'market-prices') { ?>
<div class="dropdown-menu dropdown-menu-arrow">
<a href="./overview.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="dropdown-item"><i class="fe fe-box"></i> Overview</a>
<a href="./price-tables.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="dropdown-item"><i class="fe fe-file-text"></i> Price Tables</a>
</div>
<?php } ?>
</li>
<li class="nav-item">
<a href="./data.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="nav-link"><i class="fe fe-file-text"></i> Data</a>
</li>
<li class="nav-item">
<a href="./collaborate.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="nav-link active"><i class="fe fe-users"></i> Collaborate</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="my-3 my-md-5">
<div class="container">
<div class="row">
<div class="col-md-3">
<h3 class="page-title mb-5">Data</h3>
<div>
<div class="list-group list-group-transparent mb-0">
<a href="./reports.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="list-group-item list-group-item-action d-flex align-items-center">
<span class="icon mr-3"><i class="fe fe-download-cloud"></i></span>Generate Report
</a>
</div>
<div class="list-group list-group-transparent mb-0">
<a href="./export.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="list-group-item list-group-item-action d-flex align-items-center active">
<span class="icon mr-3"><i class="fe fe-share"></i></span>Export
</a>
</div>
<div class="mt-6 mb-6">
<a href="./data.php<?php echo isset($_GET['id']) ? '?name='.e($_GET['name']).'&id='.e($_GET['id']) : null ?>" class="btn btn-secondary btn-block">Show Individual Responses</a>
</div>
</div>
</div>
<div class="col-md-9">
<div class="card">
<div class="card-head"></div>
<div class="card-body"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<div class="row align-items-center">
<div class="col-12 col-lg-auto mt-3 mt-lg-0 text-center">
Copyright © 2018 <a href="../index.html" target="_blank" class="text-primary">Plurimus Technologies</a>. All rights reserved.
</div>
</div>
</div>
</footer>
</div>
</body>
</html>