This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprofile.php
115 lines (109 loc) · 3.24 KB
/
profile.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
<?php
require 'openid.php';
require 'util.php';
require 'view_util.php';
if (!isset($_SESSION['uid']))
throw new Error('Denied', 'Go away.');
echo " <div class='content_box'>";
echo '<h3>Private user info</h3>';
# main info
echo '<p>You are logged in.</p>';
$uid = $_SESSION['uid'];
$oidlogin = $_SESSION['oidlogin'];
echo '<p>User ID: '.$uid.'</p>';
echo '<p>OpenID: '.$oidlogin.'</p>';
show_balances();
echo '</div>';
$query = "
SELECT
orderid,
IF(status='OPEN', amount, initial_amount) AS amount,
type,
IF(status='OPEN', want_amount, initial_want_amount) AS want_amount,
want_type,
DATE_FORMAT(timest, '%H:%i %d/%m/%y') AS timest,
status
FROM orderbook
WHERE uid='$uid'
ORDER BY orderbook.timest DESC;
";
$result = do_query($query);
$row = mysql_fetch_assoc($result);
if ($row) { ?>
<div class='content_box'>
<h3>Your orders</h3>
<table class='display_data'>
<tr>
<th>Giving</th>
<th>Wanted</th>
<th>Time</th>
<th>Status</th>
<th></th>
</tr><?php
do {
$orderid = $row['orderid'];
$amount = internal_to_numstr($row['amount']);
$type = $row['type'];
$want_amount = internal_to_numstr($row['want_amount']);
$want_type = $row['want_type'];
$timest = $row['timest'];
$status = $row['status'];
$status = translate_order_code($status);
echo " <tr>\n";
echo " <td>$amount $type</td>\n";
echo " <td>$want_amount $want_type</td>\n";
echo " <td>$timest</td>\n";
echo " <td>$status</td>\n";
echo " <td><a href='?page=view_order&orderid=$orderid'>View order</a></td>\n";
echo " </tr>\n";
} while ($row = mysql_fetch_assoc($result));
echo "</table></div>";
}
# also used when you view an order
display_transactions($uid, -1);
$query = "
SELECT
reqid,
req_type,
amount,
curr_type,
DATE_FORMAT(timest, '%H:%i %d/%m/%y') AS timest,
status
FROM requests
WHERE
uid='$uid'
AND (req_type='WITHDR' OR req_type='DEPOS')
AND status!='IGNORE'
ORDER BY requests.timest DESC;
";
$result = do_query($query);
$row = mysql_fetch_assoc($result);
if ($row) { ?>
<div class='content_box'>
<h3>Your requests</h3>
<table class='display_data'>
<tr>
<th>Amount</th>
<th>Time</th>
<th>Status</th>
<th></th>
</tr><?php
do {
$reqid = $row['reqid'];
$req_type = $row['req_type'];
$req_type = translate_request_type($req_type);
$amount = internal_to_numstr($row['amount']);
$curr_type = $row['curr_type'];
$timest = $row['timest'];
$status = $row['status'];
$status = translate_request_code($status);
echo " <tr>\n";
echo " <td>$req_type $amount $curr_type</td>\n";
echo " <td>$timest</td>\n";
echo " <td>$status</td>\n";
echo " <td><a href='?page=view_request&reqid=$reqid'>View request</a></td>\n";
echo " </tr>\n";
} while ($row = mysql_fetch_assoc($result));
echo "</table></div>";
}
?>