root/2.0.0-dev/application/models/killboard_alliance.php @ 331

Revision 331, 1.7 KB (checked in by knyghtmare, 12 years ago)

Added items remotely

V:\users\knyghtmare\edk\application
V:\users\knyghtmare\edk\media
V:\users\knyghtmare\edk\system
V:\users\knyghtmare\edk\.htaccess
V:\users\knyghtmare\edk\index.php

Line 
1<?php
2
3  defined('SYSPATH') or die('No direct script access.');
4
5  class Killboard_Alliance_Model extends Model
6  {
7
8    public $id = -1;
9    public $name = "";
10    public $killCount = 0;
11    public $lossCount = 0;
12    public $finalBlows = 0;
13    public $damageDone = 0;
14    public $damageReceived = 0;
15    public $efficiency = 0;
16    public $corpCount = 0;
17    public $pilotCount = 0;
18
19    public function __construct($id=0, $name="", $killCount=0, $lossCount=0,
20      $finalBlows=0,$damageDone=0,$damageReceived=0,$efficiency=0,$corps=0,$pilots=0)
21    {
22      parent::__construct();
23     
24      if ($id==0) return;
25     
26      if (!is_numeric($id))
27      {
28        //  Alliance name provided, check for existance and load SQL
29        $db = Database::instance();
30        $query = $db->from('killboard_alliances')->where('alliance_name="'.$name.'"')->get();
31        if ($query->count() > 0)
32        {
33          $row = $query->current();
34          $this->id = $row->alliance_id;
35          $this->name = $row->alliance_name;
36          $this->killCount = $row->alliance_kills;
37          $this->finalBlows = $row->alliance_final_blows;
38          $this->lossCount = $row->alliance_losses;
39          $this->damageDone = $row->alliance_damage_done;
40          $this->damageReceived = $row->alliance_damage_received;
41          $this->pilotCount = $row->alliance_pilots;
42          $this->efficiency = $row->alliance_efficiency;
43        }
44      } else {
45        //  Full/partial object data provided, load that sucka up
46        if ($name == "")
47        {
48          //  Only ID provided, load based on ID
49        } else {
50          //  All data provided
51        }
52      }
53    }
54
55  }
56
57?>
Note: See TracBrowser for help on using the browser.