aboutsummaryrefslogtreecommitdiff
path: root/modules/rudi/includes/information.class.php
blob: 26326758ecb98fec36c5f2c77f013fc4a870883c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

class RUDI_Information extends RUDI_Common
{
	public function __construct()
	{
		global $db;
		$this->db = $db;
	}
	
	public function Unit($unit_id)
	{
		$query = sprintf("SELECT leader_id, name, logo, url, creed, bio 
		FROM rudi_units 
		WHERE unit_id = %d", (int)$unit_id);
		$result = $this->db->Query($query);
		$unit = $this->db->FetchObject($result, 'UnitInfo', true);
		return $unit;
	}
	
	public function Platoon($unit_id, $platoon_id)
	{
		$query = sprintf("SELECT leader_id, name, logo, creed, bio  
		FROM rudi_platoons 
		WHERE unit_id = %d AND platoon_id = %d", (int)$unit_id, (int)$platoon_id);
		$result = $this->db->Query($query);
		$platoon = $this->db->FetchObject($result, 'UnitInfo', true);
		decho($platoon);
		
		return $platoon;		
	}
}

?>