-
Notifications
You must be signed in to change notification settings - Fork 0
/
blow_whistle.php
298 lines (223 loc) · 12.3 KB
/
blow_whistle.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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?php
include_once('app/init.php');
global $user;
if($user->is_loggedin()){
$user_is_logged_in = "yes";
}else{
$user_is_logged_in = "no";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
<link rel="icon" type="image/png" sizes="96x96" href="assets/img/favicon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>WhistleBlower.ng | Report Anything corrupt practice that we encounter in our daily lives, business, and community</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/gaia.css" rel="stylesheet"/>
<!-- Fonts and icons -->
<link href='https://fonts.googleapis.com/css?family=Cambo|Poppins:400,600' rel='stylesheet' type='text/css'>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" rel="stylesheet">
<link href="assets/css/fonts/pe-icon-7-stroke.css" rel="stylesheet">
</head>
<body>
<div class="section section-header section-header-small">
<div class="parallax filter filter-color-black">
<div class="image"
style="background-image:url('assets/img/whistles.png')">
</div>
<div class="container">
<div class="content">
<h1>Blow Whistle</h1>
<h3 class="subtitle">Here's how we start to kick out corruption from our nation</h3>
</div>
</div>
</div>
</div>
<?php
if($user_is_logged_in == "no"){
load_template('not_user_nav');
?>
<div class="section" style="margin-bottom:15em;">
<div class="container">
<div class="row">
<div class="col-lg-7 col-lg-offset-2">
<?php
$string = "You need to be a registered user before you can blow whistle, <a href='login.php'> signup/login here </a>";
echo "<div class='alert alert-danger'>".$string."<strong></strong></div>";
?>
</div>
</div>
</div>
</div>
<?php
} else{
?>
<?php
load_template("user_nav"); ?>
<!-- /.navbar-collapse -->
<style>
#file-box{
display:none;
}
#file-box1{
display:none;
}
</style>
<div class="section">
<div class="container">
<div class="row">
<div class="col-lg-7">
<span id="whistle_error"></span>
<form id="whistle">
<div class="form-group">
<input type="hidden" value="<?php echo htmlspecialchars($user->logged_in_user()); ?>" name="email" class="form-control" id="email" placeholder="Email">
</div>
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" class="form-control">
<input type="hidden" value="<?php echo htmlspecialchars($_SESSION['nickname']) ?>" name="nickname" id="nickname" class="form-control">
</div>
<div class="form-group"> <!-- State Button -->
<label for="category_id" class="control-label">Category </label>
<select class="form-control" name="category" id="lsTipType" onchange="tipSelectionEvent(this)">
<?php
// fetch all categories
$data = "http://127.0.0.1/whistleb/api/get_all_category.php";
$response = file_get_contents($data);
// var_dump($response);
$json_response = json_decode($response,true);
$num = $json_response['count'];
$x = 0;
while ($x < $num) {
?>
<div class="row">
<?php
for ($z = 0; $z <= $num; $z++) {
if (!isset($json_response['data'][$x]))
break;
?>
<option value="<?php echo $json_response['data'][$x]['id'] ?>"><?php echo $json_response['data'][$x]['name'] ?></option>
<!-- <span class="label label-fill label-danger"><a href="category_whistle.php?cat=<?php echo $json_response1['data'][$x]['id'] ?>&name=<?php echo $json_response1['data'][$x]['name'] ?>" style="color:white;"><?php echo $json_response1['data'][$x]['name'] ?></a></span> -->
<?php
$x++;
}
?>
</div>
<?php
}
?>
<!-- <option value="Diversion of revenues">Diversion of revenues</option>
<option value="Violation of TSA guidelines">Violation of TSA guidelines (e.g. multiple revenue accounts)</option>
<option>Underreporting of revenues</option>
<option>Non-remittance or late remittance of revenues</option>
<option>Manipulation of revenue collection receipts</option>
<option>Conversion of funds to personal use</option>
<option>Mismanagement of revenues</option>
<option>Unapproved expenditures</option>
<option value="Undocumented expenditures">Undocumented expenditures (e.g. no payment vouchers with appropriate signatures)</option>
<option>Non-compliance with efficiency unit expenditure guidelines/circulars</option>
<option value="Fraudulent payments">Fraudulent payments</option>
<option>Violation of public procurement procedures</option>
<option>Procurement fraud (kickbacks, over-invoicing etc)</option>
<option>Splitting of contracts</option>
<option>Manipulation of data or records</option>
<option>Misstatement of financial information</option>
<option value="Mismanagement or misappropriation of public funds and assets">Mismanagement or misappropriation of public funds and assets (e.g. properties, vehicles etc.)</option>
<option>Collecting / soliciting bribes</option>
<option>Conflict of interest</option>
<option>Fraud</option>
<option>Corruption</option>
<option>Information on stolen public funds</option>
<option>Information on concealed public funds</option>
<option value="Others">Specify</option> -->
</select>
</div>
<div class="form-group">
<label for="description" class="control-label">Description </label>
<textarea name="description" class="form-control" id="description" cols="150" rows="10" style="resize: none" placeholder="Descriptions"></textarea>
</div>
<div class="form-group">
<label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="1"> Live Upload
</label>
<label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="2"> Document Upload
</label>
</div>
<div id="file-box1" class="form-group">
<video controls autoplay src=""></video><br>
<button id="rec" type="button" onclick="onBtnRecordClicked()">Record</button>
<button id="pauseRes" type="button" onclick="onPauseResumeClicked()" disabled>Pause</button>
<button id="stop" type="button" onclick="onBtnStopClicked()" disabled>Stop</button>
</div>
<div id="file-box" class="form-group">
<label for="file">File input</label>
<input class="form-control" name="uploadFile" type="file" id="file">
<p class="help-block">Document backing whistle you want to blow</p>
</div>
<div id="file-box" class="form-group">
<input class="form-control" name="add_whistle" type="hidden" id="file">
</div>
<button type="submit" class="btn btn-submit btn-default" style="background:#ED1C24;color:#ffffff">Submit</button>
<span id="whistle_error1"></span>
</form>
</div>
</div>
</div>
</div>
<?php
}
?>
<?php
load_template('footer');
?>
<script>
$("input[name='inlineRadioOptions']").change(function(){
if( $("input[name='inlineRadioOptions']:checked").val() == 2){
$("#file-box1").css('display','none');
$("#file-box").css('display','block');
}else{
$("#file-box").css('display','none');
$("#file-box1").css('display','block');
}
});
</script>
<script>
$("#whistle").submit(function(e){
e.preventDefault();
$.ajax({
type:"POST",
url:'./WhistleBlow/parser/parser.php',
contentType: false,
cache: false,
processData:false,
data: new FormData(this),
beforeSend:function(){
$('.btn-submit').css('opacity','0.6');
$('.btn-submit').prop('disabled',true);
},
success: function(html){
console.log(html);
obj=JSON.parse(html);
//alert(obj[0]);
if(obj['status'] == 1){
$("#whistle_error").html(" ");
$("#whistle_error").html("<div class='alert alert-success'><strong>"+obj['message']+" "+"click <a href='blow_whistle.php'>here to blow another whistle</a></strong></div>" );
$('.btn-submit').css('opacity','1');
$('.btn-submit').prop('disabled',true);
$("#whistle").fadeOut();
}else{
$("#whistle_error").html(" ");
$("#whistle_error").html("<div class='alert alert-danger'><strong>"+obj['message']+"</strong></div>");
$('.btn-submit').css('opacity','1');
$('.btn-submit').prop('disabled',false);
$("#whistle").fadeOut();
}
}
});
});
</script>