Revision 331, 1.1 KB
(checked in by knyghtmare, 14 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_Ship_Model extends Model |
---|
6 | { |
---|
7 | |
---|
8 | public $id = -1; |
---|
9 | public $name = ""; |
---|
10 | public $class = null; |
---|
11 | public $typeID = 0; |
---|
12 | public $graphicID = 0; |
---|
13 | |
---|
14 | public function __construct($id=0,$name="",$class=null,$typeID=0,$graphicID=0) |
---|
15 | { |
---|
16 | parent::__construct(); |
---|
17 | |
---|
18 | if ($id==0) return; |
---|
19 | |
---|
20 | if (!is_numeric($id)) |
---|
21 | { |
---|
22 | // $id is a name, look it up |
---|
23 | $db = Database::instance(); |
---|
24 | $query = $db->from('killboard_ships')->where('ship_name="'.$name.'"')->join( |
---|
25 | 'killboard_ship_classes', 'killboard_ships.ship_class_id=killboard_ship_classes.ship_class_id',,'left' |
---|
26 | )->get(); |
---|
27 | if ($query->count() > 0) |
---|
28 | { |
---|
29 | $row = $query->current(); |
---|
30 | $this->id = $row->ship_id; |
---|
31 | $this->name = $row->ship_name; |
---|
32 | $this->class = null; |
---|
33 | $this->typeID = $row->ship_typeID; |
---|
34 | $this->graphicID = $row->ship_graphicID; |
---|
35 | } |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | } |
---|
40 | |
---|
41 | ?> |
---|