-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.team.php
71 lines (61 loc) · 2.01 KB
/
class.team.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/*************************************
* @version 1.0
* @author Jaap Voets - Xperience Automatisering
* teams opvragen
***********************************/
include_once("class.nbb.php");
class Team extends NBB {
var $dispatcher;
var $xml;
var $filter;
var $clb_ID;
function Team( $clb_ID = 0) {
/* constructor van de parent expliciet aanroepen */
parent::NBB( 0 );
$this->dispatcher = 'teams.pl';
$this->data = '';
$this->filter = '';
$this->clb_ID = $clb_ID;
return true;
}
/* ophalen van xml en parsen */
function data() {
if (! $this->data ) {
$url = parent::base_url() . $this->dispatcher . '?';
$url .= $this->filter;
if ($this->clb_ID > 0 ) {
$url .= "&clb_ID=" . $this->clb_ID;
}
$xml_string = $this->get_xml( $url );
$data = $this->parse( $xml_string );
$this->data = $data;
}
return $this->data;
}
function overzicht() {
$data = $this->data();
foreach( $data->team as $team ) {
$id = "" .$team['id'];
$lijst[ $id ]['naam'] = "" . $team->naam;
$lijst[ $id ]['afkorting'] = "" . $team->afkorting;
$lijst[ $id ]['team_id'] = "" . $team->team_id;
$lijst[ $id ]['club_id'] = "" . $team->club_id;
$comp = $team->competitie;
$lijst[ $id ]['competitie'] = "" . $comp->naam;
$lijst[ $id ]['comp_id'] = "" . $comp->id;
$lijst[ $id ]['comp_nr'] = "" . $comp->nr;
}
return $lijst;
}
/* filter for a specific ISS number for a club */
function club_iss( $clb_ISS = '' ) {
$this->clb_ID = 0;
$this->filter .= "&clb_ISSnum=$clb_ISS";
}
/* filter on particular season */
function seizoen( $seizoen = '' ) {
$this->filter .= "&szn_Naam=$seizoen";
}
}
?>