forked from weikanglim/ACMDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
68 lines (61 loc) · 1.84 KB
/
index.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
<?php
require_once 'core/init.php';
require_once 'core/private.php';
$user = new User();
$uid = $user->data()->uid;
$display = false;
$greeting = "Hello, " . escape($user->data()->firstname) . '!';
$length = strlen($greeting);
setlocale(LC_MONETARY, 'en_US.UTF-8');
$currentBalance = money_format('%i' ,DB::getInstance()->get('users_balances_view', array('uid', '=', $uid))->first()->balance);
$dbo = DB::getInstance()->query("Select event_name, location, event_datetime, organizer
from events_view AS ev where ev.eid IN (Select eid from users_events where UID = ?)", array($uid));
print_r($dbo->error());
if(!$dbo->error() && $dbo->count()){
$display = true;
$events = $dbo->results();
$headers = array_keys((array) $events[0]);
} else{
$display = false;
}
?>
<html>
<head>
<title>ACM Member Page</title>
<link rel="stylesheet" media="all" type="text/css"
href="/css/jquery-ui-1.10.3.custom.css" />
<link rel="stylesheet" type="text/css" href="/css/userTable.css">
<link rel="stylesheet" type="text/css" href="/css/base.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/pure/0.3.0/pure-min.css"></head>
<body>
<div class="main">
<?php echo Session::flash('home');
?>
<pre class="cow" ">
<?php echo delim('_', $length) . '<br>< ' . $greeting . ' ><br> ' . delim('-', $length); ?>
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
</pre>
<div class="content">
<h3>Balance</h3>
Your current balance is <?php echo $currentBalance ?>.
</div>
<div class="content">
<h3>Vending</h3>
<?php echo VendingForm::render(); ?>
</div>
<div class="content">
<h3>Upcoming Participating Events</h3>
<?php if($display){
$upcomingTable = new UserTable($events, $headers, 'index.php');
echo $upcomingTable->render();
} else{
echo 'None.';
}
?>
</div>
</body>
</html>