Revision 1, 2.6 KB
(checked in by andrewgunn, 14 years ago)
|
Added original EVE-Killboard.net source code.
|
Line | |
---|
1 | <? |
---|
2 | require_once( "class.page.php" ); |
---|
3 | require_once( "admin_menu.php" ); |
---|
4 | |
---|
5 | $page = new Page( "Administration - Rental" ); |
---|
6 | |
---|
7 | $sql = "select * |
---|
8 | from kb3_rental |
---|
9 | where rtl_site = '".KB_SITE."'"; |
---|
10 | |
---|
11 | $qry = new DBQuery(); |
---|
12 | $qry->execute( $sql ) or die( $qry->getErrorMsg() ); |
---|
13 | |
---|
14 | if ( $qry->recordCount() == 1 ) { |
---|
15 | $html = "<table class=kb-table cellspacing=1>"; |
---|
16 | $html .= "<tr class=kb-table-header><td align=center width=100>Weekly fee</td><td align=center width=140>Current week</td><td align=center width=160>Payment received up to</td><td align=center width=140>Payment required</td><td align=center width=140>Contact</td></tr>"; |
---|
17 | |
---|
18 | $row = $qry->getRow(); |
---|
19 | if ( $row['rtl_paidyear'] > date( "Y" ) ) { |
---|
20 | $due = 0; |
---|
21 | } |
---|
22 | else if ( $row['rtl_paidweek'] > date( "W" ) && $row['rtl_paidyear'] < date( "Y" ) ) { |
---|
23 | $due = date( "W" ) + ( 52 - $row['rtl_paidweek'] ); |
---|
24 | } |
---|
25 | else |
---|
26 | $due = date( "W" ) - $row['rtl_paidweek']; |
---|
27 | |
---|
28 | $due = $due * $row['rtl_rent']; |
---|
29 | |
---|
30 | if ( $due <= 0 ) { |
---|
31 | $due = 0; |
---|
32 | $paydue = "-"; |
---|
33 | } |
---|
34 | else $paydue = $due."M ISK"; |
---|
35 | |
---|
36 | if ( $due > 0 ) |
---|
37 | $dueclass = "kl-loss"; |
---|
38 | else |
---|
39 | $dueclass = "kl-kill"; |
---|
40 | |
---|
41 | if ( date( "W" ) < 10 ) |
---|
42 | $curweek = substr( date( "W" ), 1, 1 ); |
---|
43 | else |
---|
44 | $curweek = date( "W" ); |
---|
45 | |
---|
46 | $html .= "<tr class=kb-table-row-odd><td align=center>".$row['rtl_rent']."M ISK</td><td align=center>Week ".$curweek." (".date( "Y" ).")</td><td align=center>Week ".$row['rtl_paidweek']." (".$row['rtl_paidyear'].")</td><td class=".$dueclass." align=center>".$paydue."</td><td align=center width=70>".$row['rtl_contact']."</td></tr>"; |
---|
47 | |
---|
48 | $html .= "</table><br>Payment is to be wired to rig0r ingame. Thank you !"; |
---|
49 | } |
---|
50 | else { |
---|
51 | $html .= "No details.<br><br>"; |
---|
52 | } |
---|
53 | |
---|
54 | $page->setContent( $html ); |
---|
55 | $page->addContext( $menubox->generate() ); |
---|
56 | $page->generate(); |
---|
57 | ?> |
---|