1 | <? |
---|
2 | require_once( "db.php" ); |
---|
3 | require_once( "globals.php" ); |
---|
4 | |
---|
5 | class KillListTable |
---|
6 | { |
---|
7 | function KillListTable( $kill_list ) |
---|
8 | { |
---|
9 | $this->limit = 0; |
---|
10 | $this->offset = 0; |
---|
11 | |
---|
12 | $this->kill_list_ = $kill_list; |
---|
13 | |
---|
14 | $this->daybreak_ = true; |
---|
15 | } |
---|
16 | |
---|
17 | function setBrowsable( $browsable ) |
---|
18 | { |
---|
19 | $this->browsable = $browsable; |
---|
20 | } |
---|
21 | |
---|
22 | function setDayBreak( $daybreak ) |
---|
23 | { |
---|
24 | $this->daybreak_ = $daybreak; |
---|
25 | } |
---|
26 | |
---|
27 | function setLimit( $limit ) |
---|
28 | { |
---|
29 | $this->limit_ = $limit; |
---|
30 | } |
---|
31 | |
---|
32 | function generate() |
---|
33 | { |
---|
34 | $odd = false; |
---|
35 | $prevdate = ""; |
---|
36 | $this->kill_list_->rewind(); |
---|
37 | while ( $kill = $this->kill_list_->getKill() ) { |
---|
38 | |
---|
39 | if ( $this->limit_ && $c > $this->limit_ ) |
---|
40 | break; |
---|
41 | else |
---|
42 | $c++; |
---|
43 | |
---|
44 | if ( !$odd ) { |
---|
45 | $odd = true; |
---|
46 | $class = 'kb-table-row-odd'; |
---|
47 | } |
---|
48 | else { |
---|
49 | $odd = false; |
---|
50 | $class = 'kb-table-row-even'; |
---|
51 | } |
---|
52 | |
---|
53 | $curdate = substr( $kill->getTimeStamp(), 0, 10 ); |
---|
54 | if ( $curdate != $prevdate ) { |
---|
55 | if ( $prevdate != "" && $this->daybreak_ ) { |
---|
56 | $html .= "</table>\n"; |
---|
57 | } |
---|
58 | |
---|
59 | if ( $this->daybreak_ ) |
---|
60 | $html .= "<div class=kb-date-header>".date( "l, F jS", strtotime( $curdate ) )."</div><br>\n"; |
---|
61 | |
---|
62 | if ( $this->daybreak_ || $prevdate == "" ) { |
---|
63 | $html .= "<table class=kb-table width=\"99%\" align=center cellspacing=\"1\">\n"; |
---|
64 | $html .= "<tr class=kb-table-header>\n"; |
---|
65 | $html .= "<td class=kb-table-header colspan=2 align=\"center\">Ship type</td>\n"; |
---|
66 | $html .= "<td class=kb-table-header>Victim</td>\n"; |
---|
67 | $html .= "<td class=kb-table-header>Final blow</td>\n"; |
---|
68 | $html .= "<td class=kb-table-header align=\"center\">System</td>\n"; |
---|
69 | $html .= "<td class=kb-table-header align=\"center\">Time</td></tr>\n"; |
---|
70 | } |
---|
71 | $prevdate = $curdate; |
---|
72 | } |
---|
73 | |
---|
74 | $html .= "<tr class=".$class." style=\"height: 34px; cursor: pointer;\" onmouseover=\"this.className='kb-table-row-hover';\" onmouseout=\"this.className='".$class."';\" onClick=\"window.location.href='?a=kill_detail&kll_id=".$kill->getID()."';\">"; |
---|
75 | |
---|
76 | $html .= "<td width=32 align=center><img src=\"".$kill->getVictimShipImage( 32 )."\" border=\"0\"></td>"; |
---|
77 | |
---|
78 | $html .= "<td height=34 width=150 valign=center><div class=kb-shiptype><b>".$kill->getVictimShipName()."</b><br>".$kill->getVictimShipClassName()."</div><div class=kb-shipicon><img src=\"".$kill->getVictimShipValueIndicator()."\" border=\"0\"></div></td>"; |
---|
79 | |
---|
80 | $html .= "<td width=200 class=kb-table-cell><b>".$kill->getVictimName()."</b><br>".shorten( $kill->getVictimCorpName() )."</td>"; |
---|
81 | $html .= "<td width=200 class=kb-table-cell><b>".$kill->getFBPilotName()."</b><br>".shorten( $kill->getFBCorpName() )."</td>"; |
---|
82 | $html .= "<td width=110 class=kb-table-cell align=\"center\"><b>".shorten( $kill->getSolarSystemName(), 10 )."</b><br>(".roundsec( $kill->getSolarSystemSecurity() ).")</td>"; |
---|
83 | if ( $this->daybreak_ ) |
---|
84 | $html .= "<td class=kb-table-cell align=\"center\"><b>".substr( $kill->getTimeStamp(), 11, 5 )."</b></td>"; |
---|
85 | else |
---|
86 | $html .= "<td class=kb-table-cell align=\"center\" width=80><b>".substr( $kill->getTimeStamp(), 0, 10 )."<br>".substr( $kill->getTimeStamp(), 11, 5 )."</b></td>"; |
---|
87 | |
---|
88 | $html .= "</tr>\n"; |
---|
89 | } |
---|
90 | |
---|
91 | if ( $this->kill_list_->qry_->recordCount() > 0 ) |
---|
92 | $html .= "</table>\n"; |
---|
93 | else |
---|
94 | $html .= "<p>No data."; |
---|
95 | |
---|
96 | return $html; |
---|
97 | |
---|
98 | } |
---|
99 | } |
---|
100 | |
---|
101 | ?> |
---|