1 | <? |
---|
2 | require_once( "db.php" ); |
---|
3 | require_once( "class.killlist.php" ); |
---|
4 | require_once( "class.graph.php" ); |
---|
5 | require_once( "class.pagesplitter.php" ); |
---|
6 | |
---|
7 | class Contract |
---|
8 | { |
---|
9 | function Contract( $ctr_id = 0 ) |
---|
10 | { |
---|
11 | $this->ctr_id_ = $ctr_id; |
---|
12 | $this->contracttargets_ = array(); |
---|
13 | |
---|
14 | // overall kill/losslist |
---|
15 | $this->klist_ = new KillList(); |
---|
16 | $this->llist_ = new KillList(); |
---|
17 | if ( CORP_ID ) { |
---|
18 | $this->klist_->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
19 | $this->llist_->addVictimCorp( new Corporation( CORP_ID ) ); |
---|
20 | } |
---|
21 | if ( ALLIANCE_ID ) { |
---|
22 | $this->klist_->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
23 | $this->llist_->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
24 | } |
---|
25 | $this->contractpointer_ = 0; |
---|
26 | $this->qry_ = null; |
---|
27 | } |
---|
28 | |
---|
29 | function execQuery() |
---|
30 | { |
---|
31 | if ( $this->qry_ ) |
---|
32 | return; |
---|
33 | |
---|
34 | $this->qry_ = new DBQuery(); |
---|
35 | // general |
---|
36 | $sql = "select * from kb3_contracts ctr |
---|
37 | where ctr.ctr_id = ".$this->ctr_id_; |
---|
38 | |
---|
39 | $this->qry_ = new DBQuery(); |
---|
40 | if ( !$this->qry_->execute( $sql ) ) |
---|
41 | die( $this->qry_->getErrorMsg() ); |
---|
42 | |
---|
43 | $row = $this->qry_->getRow(); |
---|
44 | $this->ctr_name_ = $row['ctr_name']; |
---|
45 | $this->ctr_started_ = $row['ctr_started']; |
---|
46 | $this->ctr_ended_ = $row['ctr_ended']; |
---|
47 | $this->campaign_ = ( $row['ctr_campaign'] == "1" ); |
---|
48 | |
---|
49 | // get corps & alliances for contract |
---|
50 | $sql = "select ctd.ctd_crp_id, ctd.ctd_all_id, ctd.ctd_reg_id |
---|
51 | from kb3_contract_details ctd |
---|
52 | where ctd.ctd_ctr_id = ".$row['ctr_id']." |
---|
53 | order by 3, 2, 1"; |
---|
54 | |
---|
55 | $caqry = new DBQuery(); |
---|
56 | $caqry->execute( $sql ) or die( $caqry->getErrorMsg() ); |
---|
57 | |
---|
58 | while ( $carow = $caqry->getRow() ) { |
---|
59 | $contracttarget = & new ContractTarget( $this, $carow['ctd_crp_id'], $carow['ctd_all_id'], $carow['ctd_reg_id'] ); |
---|
60 | array_push( $this->contracttargets_, $contracttarget ); |
---|
61 | if ( $carow['ctd_crp_id'] ) { |
---|
62 | $this->klist_->addVictimCorp( new Corporation( $carow['ctd_crp_id'] ) ); |
---|
63 | $this->llist_->addInvolvedCorp( new Corporation( $carow['ctd_crp_id'] ) ); |
---|
64 | } elseif ( $carow['ctd_all_id'] ) { |
---|
65 | $this->klist_->addVictimAlliance( new Alliance( $carow['ctd_all_id'] ) ); |
---|
66 | $this->llist_->addInvolvedAlliance( new Alliance( $carow['ctd_all_id'] ) ); |
---|
67 | } elseif ( $carow['ctd_reg_id'] ) { |
---|
68 | $this->klist_->addRegion( new Region( $carow['ctd_reg_id'] ) ); |
---|
69 | $this->llist_->addRegion( new Region( $carow['ctd_reg_id'] ) ); |
---|
70 | } |
---|
71 | } |
---|
72 | |
---|
73 | $this->klist_->setStartDate( $this->getStartDate() ); |
---|
74 | $this->llist_->setStartDate( $this->getStartDate() ); |
---|
75 | if ( $this->getEndDate() != "" ) { |
---|
76 | $this->klist_->setEndDate( $this->getEndDate() ); |
---|
77 | $this->llist_->setEndDate( $this->getEndDate() ); |
---|
78 | } |
---|
79 | |
---|
80 | } |
---|
81 | |
---|
82 | function getID() |
---|
83 | { |
---|
84 | return $this->ctr_id_; |
---|
85 | } |
---|
86 | |
---|
87 | function getName() |
---|
88 | { |
---|
89 | $this->execQuery(); |
---|
90 | return $this->ctr_name_; |
---|
91 | } |
---|
92 | |
---|
93 | function getStartDate() |
---|
94 | { |
---|
95 | $this->execQuery(); |
---|
96 | return $this->ctr_started_; |
---|
97 | } |
---|
98 | |
---|
99 | function getEndDate() |
---|
100 | { |
---|
101 | $this->execQuery(); |
---|
102 | return $this->ctr_ended_; |
---|
103 | } |
---|
104 | |
---|
105 | function getRunTime() |
---|
106 | { |
---|
107 | if ( $this->getEndDate() != "" ) |
---|
108 | $datet = getdate( strtotime( $this->getEndDate() ) ); |
---|
109 | else |
---|
110 | $datet = getdate( strtotime( date( "Y-m-d" ) ) ); |
---|
111 | |
---|
112 | $datef = getdate( strtotime( $this->getStartDate() ) ); |
---|
113 | return $datet['yday']-$datef['yday']; |
---|
114 | } |
---|
115 | |
---|
116 | function getCampaign() |
---|
117 | { |
---|
118 | $this->execQuery(); |
---|
119 | return $this->campaign_; |
---|
120 | } |
---|
121 | |
---|
122 | function getCorps() |
---|
123 | { |
---|
124 | $this->execQuery(); |
---|
125 | return $this->corps_; |
---|
126 | } |
---|
127 | |
---|
128 | function getAlliances() |
---|
129 | { |
---|
130 | $this->execQuery(); |
---|
131 | return $this->alliances_; |
---|
132 | } |
---|
133 | |
---|
134 | function getKills() |
---|
135 | { |
---|
136 | $this->execQuery(); |
---|
137 | return $this->klist_->getCount(); |
---|
138 | } |
---|
139 | |
---|
140 | function getLosses() |
---|
141 | { |
---|
142 | $this->execQuery(); |
---|
143 | return $this->llist_->getCount(); |
---|
144 | } |
---|
145 | |
---|
146 | function getKillISK() |
---|
147 | { |
---|
148 | $this->execQuery(); |
---|
149 | if ( !$this->klist_->getISK() ) $this->klist_->getAllKills(); |
---|
150 | return $this->klist_->getISK(); |
---|
151 | } |
---|
152 | |
---|
153 | function getLossISK() |
---|
154 | { |
---|
155 | $this->execQuery(); |
---|
156 | if ( !$this->llist_->getISK() ) $this->llist_->getAllKills(); |
---|
157 | return $this->llist_->getISK(); |
---|
158 | } |
---|
159 | |
---|
160 | function getEfficiency() |
---|
161 | { |
---|
162 | $this->execQuery(); |
---|
163 | if ( $this->klist_->getISK() ) |
---|
164 | $efficiency = round( $this->klist_->getISK() / ( $this->klist_->getISK() + $this->llist_->getISK() ) * 100, 2 ); |
---|
165 | else |
---|
166 | $efficiency = 0; |
---|
167 | |
---|
168 | return $efficiency; |
---|
169 | } |
---|
170 | |
---|
171 | function getKillList() |
---|
172 | { |
---|
173 | $this->execQuery(); |
---|
174 | return $this->klist_; |
---|
175 | } |
---|
176 | |
---|
177 | function getLossList() |
---|
178 | { |
---|
179 | $this->execQuery(); |
---|
180 | return $this->llist_; |
---|
181 | } |
---|
182 | |
---|
183 | function getContractTarget() |
---|
184 | { |
---|
185 | if ( $this->contractpointer_ > 10 ) |
---|
186 | return null; |
---|
187 | |
---|
188 | $target = $this->contracttargets_[$this->contractpointer_]; |
---|
189 | if ( $target ) |
---|
190 | $this->contractpointer_++; |
---|
191 | return $target; |
---|
192 | } |
---|
193 | |
---|
194 | function add( $name, $type, $startdate, $enddate = "" ) |
---|
195 | { |
---|
196 | $qry = new DBQuery(); |
---|
197 | if ( $type == "campaign" ) $campaign = 1; else $campaign = 0; |
---|
198 | if ( $enddate != "" ) $enddate = "'".$enddate."'"; else $enddate = "null"; |
---|
199 | |
---|
200 | if ( !$this->ctr_id_ ) { |
---|
201 | $sql = "insert into kb3_contracts values ( null, '".$name."', |
---|
202 | '".KB_SITE."', ". |
---|
203 | $campaign.", |
---|
204 | '".$startdate."', |
---|
205 | ".$enddate." )"; |
---|
206 | $qry->execute( $sql ) or die( $qry->getErrorMsg() ); |
---|
207 | $this->ctr_id_ = $qry->getInsertID(); |
---|
208 | } |
---|
209 | else { |
---|
210 | $sql = "update kb3_contracts set ctr_name = '".$name."', |
---|
211 | ctr_started = '".$startdate."', |
---|
212 | ctr_ended = ".$enddate." |
---|
213 | where ctr_id = ".$this->ctr_id_; |
---|
214 | $qry->execute( $sql ) or die( $qry->getErrorMsg() ); |
---|
215 | $this->ctr_id_ = $qry->getInsertID(); |
---|
216 | } |
---|
217 | } |
---|
218 | |
---|
219 | function remove() |
---|
220 | { |
---|
221 | $qry = new DBQuery(); |
---|
222 | |
---|
223 | $qry->execute( "delete from kb3_contracts |
---|
224 | where ctr_id = ".$this->ctr_id_ ); |
---|
225 | |
---|
226 | $qry->execute( "delete from kb3_contract_details |
---|
227 | where ctd_ctr_id = ".$this->ctr_id_ ); |
---|
228 | } |
---|
229 | |
---|
230 | function validate() |
---|
231 | { |
---|
232 | $qry = new DBQuery(); |
---|
233 | |
---|
234 | $qry->execute( "select * from kb3_contracts |
---|
235 | where ctr_id = ".$this->ctr_id_." |
---|
236 | and ctr_site = '".KB_SITE."'" ); |
---|
237 | return ( $qry->recordCount() > 0 ); |
---|
238 | } |
---|
239 | } |
---|
240 | |
---|
241 | class ContractTarget |
---|
242 | { |
---|
243 | function ContractTarget( $contract, $crp_id, $all_id, $reg_id ) |
---|
244 | { |
---|
245 | $this->contract_ = $contract; |
---|
246 | $this->crp_id_ = $crp_id; |
---|
247 | $this->all_id_ = $all_id; |
---|
248 | $this->reg_id_ = $reg_id; |
---|
249 | |
---|
250 | $this->klist_ = & new KillList(); |
---|
251 | $this->llist_ = & new KillList(); |
---|
252 | |
---|
253 | if ( $this->crp_id_ ) { |
---|
254 | $this->type_ = "corp"; |
---|
255 | $this->klist_->addVictimCorp( new Corporation( $this->crp_id_ ) ); |
---|
256 | $this->llist_->addInvolvedCorp( new Corporation( $this->crp_id_ ) ); |
---|
257 | $this->id_ = $this->crp_id_; |
---|
258 | } elseif ( $this->all_id_ ) { |
---|
259 | $this->type_ = "alliance"; |
---|
260 | $this->klist_->addVictimAlliance( new Alliance( $this->all_id_ ) ); |
---|
261 | $this->llist_->addInvolvedAlliance( new Alliance( $this->all_id_ ) ); |
---|
262 | $this->id_ = $this->all_id_; |
---|
263 | } elseif ( $this->reg_id_ ) { |
---|
264 | $this->type_ = "region"; |
---|
265 | $this->klist_->addRegion( new Region( $this->reg_id_ ) ); |
---|
266 | $this->llist_->addRegion( new Region( $this->reg_id_ ) ); |
---|
267 | $this->id_ = $this->reg_id_; |
---|
268 | } |
---|
269 | |
---|
270 | if ( CORP_ID ) { |
---|
271 | $this->klist_->addInvolvedCorp( new Corporation( CORP_ID ) ); |
---|
272 | $this->llist_->addVictimCorp( new Corporation( CORP_ID ) ); |
---|
273 | } |
---|
274 | if ( ALLIANCE_ID ) { |
---|
275 | $this->klist_->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
276 | $this->llist_->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); |
---|
277 | } |
---|
278 | |
---|
279 | $this->klist_->setStartDate( $contract->getStartDate() ); |
---|
280 | $this->llist_->setStartDate( $contract->getStartDate() ); |
---|
281 | if ( $contract->getEndDate() != "" ) { |
---|
282 | $this->klist_->setEndDate( $contract->getEndDate() ); |
---|
283 | $this->llist_->setEndDate( $contract->getEndDate() ); |
---|
284 | } |
---|
285 | } |
---|
286 | |
---|
287 | function getID() |
---|
288 | { |
---|
289 | return $this->id_; |
---|
290 | } |
---|
291 | |
---|
292 | function getName() |
---|
293 | { |
---|
294 | if ( $this->name_ == "" ) { |
---|
295 | $qry = new DBQuery(); |
---|
296 | switch ( $this->type_ ) { |
---|
297 | case "corp": |
---|
298 | $qry->execute( "select crp_name as name from kb3_corps where crp_id = ".$this->crp_id_ ); |
---|
299 | break; |
---|
300 | case "alliance": |
---|
301 | $qry->execute( "select all_name as name from kb3_alliances where all_id = ".$this->all_id_ ); |
---|
302 | break; |
---|
303 | case "region": |
---|
304 | $qry->execute( "select reg_name as name from kb3_regions where reg_id = ".$this->reg_id_ ); |
---|
305 | break; |
---|
306 | } |
---|
307 | $row = $qry->getRow(); |
---|
308 | $this->name_ = $row['name']; |
---|
309 | } |
---|
310 | return $this->name_; |
---|
311 | } |
---|
312 | |
---|
313 | function getType() |
---|
314 | { |
---|
315 | return $this->type_; |
---|
316 | } |
---|
317 | |
---|
318 | function getKillList() |
---|
319 | { |
---|
320 | return $this->klist_; |
---|
321 | } |
---|
322 | |
---|
323 | function getLossList() |
---|
324 | { |
---|
325 | return $this->llist_; |
---|
326 | } |
---|
327 | |
---|
328 | function getEfficiency() |
---|
329 | { |
---|
330 | if ( $this->klist_->getISK() ) |
---|
331 | $efficiency = round( $this->klist_->getISK() / ( $this->klist_->getISK() + $this->llist_->getISK() ) * 100, 2 ); |
---|
332 | else |
---|
333 | $efficiency = 0; |
---|
334 | |
---|
335 | return $efficiency; |
---|
336 | } |
---|
337 | |
---|
338 | function getKills() |
---|
339 | { |
---|
340 | } |
---|
341 | |
---|
342 | function getLosses() |
---|
343 | { |
---|
344 | } |
---|
345 | |
---|
346 | function add() |
---|
347 | { |
---|
348 | $qry = new DBQuery(); |
---|
349 | $sql = "insert into kb3_contract_details |
---|
350 | values ( ".$this->contract_->getID().","; |
---|
351 | switch( $this->type_ ) { |
---|
352 | case "corp": |
---|
353 | $sql .= $this->id_.", 0, 0 )"; |
---|
354 | break; |
---|
355 | case "alliance": |
---|
356 | $sql .= "0, ".$this->id_.", 0 )"; |
---|
357 | break; |
---|
358 | case "region": |
---|
359 | $sql .= "0, 0, ".$this->id_." )"; |
---|
360 | break; |
---|
361 | } |
---|
362 | $qry->execute( $sql ) or die( $qry->getErrorMsg() ); |
---|
363 | } |
---|
364 | |
---|
365 | function remove() |
---|
366 | { |
---|
367 | $qry = new DBQuery(); |
---|
368 | $sql = "delete from kb3_contract_details |
---|
369 | where ctd_ctr_id = ".$this->contract_->getID(); |
---|
370 | switch( $this->type_ ) { |
---|
371 | case "corp": |
---|
372 | $sql .= " and ctd_crp_id = ".$this->id_; |
---|
373 | break; |
---|
374 | case "alliance": |
---|
375 | $sql .= " and ctd_all_id = ".$this->id_; |
---|
376 | break; |
---|
377 | case "region": |
---|
378 | $sql .= " and ctd_reg_id = ".$this->id_; |
---|
379 | break; |
---|
380 | } |
---|
381 | $qry->execute( $sql ) or die( $qry->getErrorMsg() ); |
---|
382 | } |
---|
383 | } |
---|
384 | |
---|
385 | class ContractList |
---|
386 | { |
---|
387 | function ContractList() |
---|
388 | { |
---|
389 | $this->qry_ = new DBQuery(); |
---|
390 | $this->active_ = "both"; |
---|
391 | $this->contractcounter_ = 1; |
---|
392 | } |
---|
393 | |
---|
394 | function execQuery() |
---|
395 | { |
---|
396 | if ( $this->qry_->executed() ) |
---|
397 | return; |
---|
398 | |
---|
399 | $sql = "select ctr.ctr_id, ctr.ctr_started, ctr.ctr_ended, ctr.ctr_name |
---|
400 | from kb3_contracts ctr |
---|
401 | where ctr.ctr_site = '".KB_SITE."'"; |
---|
402 | if ( $this->active_ == "yes" ) |
---|
403 | $sql .= " and ( ctr_ended is null or now() <= ctr_ended )"; |
---|
404 | elseif ( $this->active_ == "no" ) |
---|
405 | $sql .= " and ( now() >= ctr_ended )"; |
---|
406 | |
---|
407 | if ( $this->campaigns_ ) |
---|
408 | $sql .= " and ctr.ctr_campaign = 1"; |
---|
409 | else |
---|
410 | $sql .= " and ctr.ctr_campaign = 0"; |
---|
411 | |
---|
412 | $sql .= " order by ctr_ended, ctr_started desc"; |
---|
413 | |
---|
414 | //if ( $this->limit_ ) |
---|
415 | // $sql .= " limit ".( $this->page_ / $this->limit_ ).", ".$this->limit_; |
---|
416 | |
---|
417 | $this->qry_ = new DBQuery(); |
---|
418 | $this->qry_->execute( $sql ) or die( $this->qry_->getErrorMsg() ); |
---|
419 | } |
---|
420 | |
---|
421 | function setActive( $active ) |
---|
422 | { |
---|
423 | $this->active_ = $active; |
---|
424 | } |
---|
425 | |
---|
426 | function setCampaigns( $campaigns ) |
---|
427 | { |
---|
428 | $this->campaigns_ = $campaigns; |
---|
429 | } |
---|
430 | |
---|
431 | function setLimit( $limit ) |
---|
432 | { |
---|
433 | $this->limit_ = $limit; |
---|
434 | } |
---|
435 | |
---|
436 | function setPage( $page ) |
---|
437 | { |
---|
438 | $this->page_ = $page; |
---|
439 | $this->offset_ = ( $page * $this->limit_ ) - $this->limit_; |
---|
440 | } |
---|
441 | |
---|
442 | function getContract() |
---|
443 | { |
---|
444 | //echo "off: ".$this->offset_."<br>"; |
---|
445 | //echo "cnt: ".$this->contractcounter_."<br>"; |
---|
446 | //echo "limit: ".$this->limit_."<br>"; |
---|
447 | $this->execQuery(); |
---|
448 | if ( $this->offset_ && $this->contractcounter_ < $this->offset_ ) { |
---|
449 | for ( $i = 0; $i < $this->offset_; $i++ ) { |
---|
450 | $row = $this->qry_->getRow(); |
---|
451 | $this->contractcounter_++; |
---|
452 | } |
---|
453 | } |
---|
454 | if ( $this->limit_ && ( $this->contractcounter_ - $this->offset_ ) > $this->limit_ ) |
---|
455 | return null; |
---|
456 | |
---|
457 | $row = $this->qry_->getRow(); |
---|
458 | if ( $row ) { |
---|
459 | $this->contractcounter_++; |
---|
460 | return new Contract( $row['ctr_id'] ); |
---|
461 | } |
---|
462 | else |
---|
463 | return null; |
---|
464 | } |
---|
465 | |
---|
466 | function getCount() |
---|
467 | { |
---|
468 | $this->execQuery(); |
---|
469 | return $this->qry_->recordCount(); |
---|
470 | } |
---|
471 | |
---|
472 | function getActive() |
---|
473 | { |
---|
474 | return $this->active_; |
---|
475 | } |
---|
476 | } |
---|
477 | |
---|
478 | class ContractListTable |
---|
479 | { |
---|
480 | function ContractListTable( $contractlist ) |
---|
481 | { |
---|
482 | $this->contractlist_ = $contractlist; |
---|
483 | } |
---|
484 | |
---|
485 | function paginate( $paginate, $page = 1 ) |
---|
486 | { |
---|
487 | if ( !$page ) $page = 1; |
---|
488 | $this->paginate_ = $paginate; |
---|
489 | $this->contractlist_->setLimit( $paginate ); |
---|
490 | $this->contractlist_->setPage( $page ); |
---|
491 | } |
---|
492 | |
---|
493 | function generate() |
---|
494 | { |
---|
495 | if ( $this->contractlist_->getCount() ) { |
---|
496 | $rowid = 0; |
---|
497 | $html .= "<table class=kb-table width=\"98%\" align=center cellspacing=1>"; |
---|
498 | $html .= "<tr class=kb-table-header>"; |
---|
499 | $html .= "<td class=kb-table-cell width=180>Name</td>"; |
---|
500 | $html .= "<td class=kb-table-cell width=80 align=center>Start date</td>"; |
---|
501 | if ( $this->contractlist_->getActive() == "no" ) |
---|
502 | $html .= "<td class=kb-table-cell width=80 align=center>End date</td>"; |
---|
503 | $html .= "<td class=kb-table-cell width=50 align=center>Kills</td>"; |
---|
504 | $html .= "<td class=kb-table-cell width=70 align=center>ISK (M)</td>"; |
---|
505 | $html .= "<td class=kb-table-cell width=50 align=center>Losses</td>"; |
---|
506 | $html .= "<td class=kb-table-cell width=70 align=center>ISK (M)</td>"; |
---|
507 | $html .= "<td class=kb-table-cell width=70 align=center colspan=2>Efficiency</td>"; |
---|
508 | $html .= "</tr>"; |
---|
509 | |
---|
510 | $odd = false; |
---|
511 | $rowclass = "kb-table-row-even"; |
---|
512 | while ( $contract = $this->contractlist_->getContract() ) { |
---|
513 | if ( $odd ) { |
---|
514 | $rowclass = "kb-table-row-even"; |
---|
515 | $odd = false; |
---|
516 | } |
---|
517 | else { |
---|
518 | $rowclass = "kb-table-row-odd"; |
---|
519 | $odd = true; |
---|
520 | } |
---|
521 | |
---|
522 | $html .= "<tr class=".$rowclass." onmouseover=\"this.className='kb-table-row-hover';\" onmouseout=\"this.className='".$rowclass."';\" onClick=\"window.location.href='?a=cc_detail&ctr_id=".$contract->getID()."';\">"; |
---|
523 | $html .= "<td class=kb-table-cell><b>".$contract->getName()."</b></td>"; |
---|
524 | $html .= "<td class=kb-table-cell align=center>".substr( $contract->getStartDate(), 0, 10 )."</td>"; |
---|
525 | if ( $this->contractlist_->getActive() == "no" ) { |
---|
526 | if ( $contract->getEndDate() == "" ) |
---|
527 | $ended = "Active"; |
---|
528 | else |
---|
529 | $ended = substr( $contract->getEndDate(), 0, 10 ); |
---|
530 | $html .= "<td class=kb-table-cell align=center>".$ended."</td>"; |
---|
531 | } |
---|
532 | if ( $contract->getKills() == 0 ) |
---|
533 | $kclass = "kl-null"; |
---|
534 | else |
---|
535 | $kclass = "kl-kill"; |
---|
536 | |
---|
537 | if ( $contract->getLosses() == 0 ) |
---|
538 | $lclass = "kl-null"; |
---|
539 | else |
---|
540 | $lclass = "kl-loss"; |
---|
541 | |
---|
542 | $html .= "<td class=".$kclass." align=center>".$contract->getKills()."</td>"; |
---|
543 | $html .= "<td class=".$kclass." align=center>".$contract->getKillISK()."</td>"; |
---|
544 | $html .= "<td class=".$lclass." align=center>".$contract->getLosses()."</td>"; |
---|
545 | $html .= "<td class=".$lclass." align=center>".$contract->getLossISK()."</td>"; |
---|
546 | $bar = new BarGraph( $contract->getEfficiency(), 100, 75 ); |
---|
547 | $html .= "<td class=kb-table-cell align=center width=40><b>".$contract->getEfficiency()."%</b></td>"; |
---|
548 | $html .= "<td class=kb-table-cell align=left width=75>".$bar->generate()."</td>"; |
---|
549 | $html .= "</tr>"; |
---|
550 | } |
---|
551 | $html .= "</table>"; |
---|
552 | $pagesplitter = new PageSplitter( $this->contractlist_->getCount(), 10 ); |
---|
553 | $html .= $pagesplitter->generate(); |
---|
554 | } |
---|
555 | else $html .= "None."; |
---|
556 | |
---|
557 | return $html; |
---|
558 | } |
---|
559 | } |
---|
560 | |
---|
561 | ?> |
---|