-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback_choose.php
64 lines (48 loc) · 2.08 KB
/
feedback_choose.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
<?php
include_once("includes/inc.global.php");
$p->site_section = SECTION_FEEDBACK;
$p->page_title = "Leave Feedback";
include("classes/class.feedback.php");
$member = new cMember;
if($_REQUEST["mode"] == "admin") {
$cUser->MustBeLevel(2);
$member->LoadMember($_REQUEST["member_id"]);
} else {
$cUser->MustBeLoggedOn();
$member = $cUser;
}
$since_date = new cDateTime("-". DAYS_REQUEST_FEEDBACK ." days");
$tradegrp = new cTradeGroup($member->member_id, $since_date->MySQLDate());
$tradegrp->LoadTradeGroup();
$output = "<B>For which Exchange?</B><BR>";
$output .= "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH=\"100%\">";
$i=0;
if(isset($tradegrp->trade)) {
foreach($tradegrp->trade as $trade) {
if($trade->type == TRADE_REVERSAL or $trade->status == TRADE_REVERSAL)
continue; // No reason to list reversed trades, so let's skip 'em
if($i % 2)
$bgcolor = "#EEEEEE";
else
$bgcolor = "#FFFFFF";
// Was member the buyer or seller?
if ($trade->member_from->member_id == $member->member_id) {
$member_id_other = $trade->member_to->member_id;
$feedback_member =& $trade->feedback_buyer;
} else {
$member_id_other = $trade->member_from->member_id;
$feedback_member =& $trade->feedback_seller;
}
if(!$feedback_member) { // Member hasn't left feedback yet, show link
$date = new cDateTime($trade->trade_date);
$trade_date = $date->ShortDate();
$output .= "<TR VALIGN=TOP BGCOLOR=". $bgcolor ."><TD><FONT SIZE=2><A HREF=feedback.php?author=". $member->member_id ."&about=". $member_id_other ."&trade_id=". $trade->trade_id ."&mode=".$_REQUEST["mode"] .">". $trade_date ."</A></FONT></TD><TD><FONT SIZE=2>". $member_id_other ."</FONT></TD><TD><FONT SIZE=2>". $trade->category->description ."</FONT></TD><TD ALIGN=RIGHT><FONT SIZE=2>". $trade->amount ." </FONT></TD><TD><FONT SIZE=2>". $cDB->UnEscTxt($trade->description) ."</FONT></TD></TR>";
$i+=1;
}
}
}
$output .= "</TABLE>";
if($i == 0)
$output .= "There are no exchanges to leave feedback for. You have already left feedback for all your recent exchanges.";
$p->DisplayPage($output);
?>