-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequestQueenVotes.php
More file actions
59 lines (29 loc) · 868 Bytes
/
requestQueenVotes.php
File metadata and controls
59 lines (29 loc) · 868 Bytes
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
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
Session_Start();
require('database.php');
require('method.php');
require('ini.php');
if (empty($_SESSION['un'])){
echo '{"code":-1}';
die();
}
$un = $_SESSION['un'];
//getting_queen
$ret1 = SQL("SELECT `cid`, `username`, `votes`, `gender` FROM `graduation_prom_2018_voting_best` WHERE `gender` = 'F'");
$arr = array();
$best = 0;
$queencid = -1;
$arr= array();
for($t = 0; $t < count($ret1); $t++){
$arr['cid' . $ret1[$t]['cid']] = $ret1[$t]['votes'];
}
print(json_encode($arr));
/*
echo $queencid . 'best' . $best;
echo 'best' . $ret1[$queencid]['username'] . $ret1[$queencid]['votes'] . 'cid' . $ret1[$queencid]['cid'];
*/
?>