-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.competitie.php
97 lines (82 loc) · 2.74 KB
/
class.competitie.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/*************************************
* @version 1.6
* @author Jaap Voets - Xperience Automatisering
* competitie lijst opvragen
***********************************/
include_once("class.nbb.php");
class Competitie extends NBB {
var $dispatcher;
var $xml;
var $filter;
function Competitie( $org_ID = 0) {
/* constructor van de parent expliciet aanroepen */
parent::NBB( $org_ID );
$this->dispatcher = 'competities.pl';
$this->data = '';
$this->filter = '';
return true;
}
/* ophalen van xml en parsen */
function data() {
if (! $this->data ) {
$url = parent::base_url() . $this->dispatcher . '?org_ID=' . parent::org_id();
$url .= $this->filter;
$xml_string = $this->get_xml( $url );
$data = $this->parse( $xml_string );
$this->data = $data;
}
return $this->data;
}
/* lijst met ID en naam genereren */
function lijst() {
$data = $this->data();
//$lijst = array();
foreach( $data->organisatie as $org ) {
foreach ($org->competitie as $comp ) {
$id = $comp['id'];
$lijst[ "$id" ] = $comp->nummer . ' - ' . $comp->naam;
}
}
return $lijst;
}
function links() {
$data = $this->data();
foreach( $data->organisatie as $org ) {
foreach ($org->competitie as $comp ) {
$nr = "" . $comp->nummer;
$lijst[ $nr ]['id'] = "" . $comp['id'];
$lijst[ $nr ]['naam'] = "" . $comp->naam;
$lijst[ $nr ]['standen'] = "" . $comp->standen;
$lijst[ $nr ]['uitslagen'] = "" . $comp->uitslagen;
}
}
return $lijst;
}
function standen_links() {
$data = $this->data();
foreach( $data->organisatie as $org ) {
foreach ($org->competitie as $comp ) {
$lijst[ "" . $comp->nummer ] = "" . $comp->standen;
}
}
return $lijst;
}
/* filter for a specific Club using the ISS number for that club*/
function club( $clb_ISSnum = 0 ) {
$this->filter .= "&clb_ISSnum=$clb_ISSnum";
}
/* filter for a specific clb_ID as specified in the NBB database */
function clubid( $clb_ID = 0 ) {
$this->filter .= "&clb_ID=$clb_ID";
}
/* filter on particular season */
function seizoen( $seizoen = '' ) {
$this->filter .= "&seizoen=$seizoen";
}
/* filter on particular team */
function team( $plg_ID ) {
$this->filter .= "&plg_ID=$plg_ID";
}
}
?>