login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > Overige scripts > KNVB-link script [V3]

KNVB-link script [V3]

Auteur: rambo - 07 april 2005 - 16:41 - Gekeurd door: Maarten - Hits: 26017 - Aantal punten: 4.57 (27 stemmen)



Auteur: Remco van Noorloos
Laatste update: 16-09-2007
Versie: 3.0.0
-----------------------------------

Inleiding:
Dit script is speciaal geschreven voor webmasters van voetbalvereniging-websites in Nederland. Het script leest bepaalde informatie van de website van de KNVB (Koninklijke Nederlandse Voetbal Bond), http://www.knvb.nl. Vervolgens wordt deze informatie 'vertaald', waardoor het makkelijk op een website te integreren is. Een erg handig hulpmiddeltje, wil je niet met de hand alle gegevens over gaan nemen of de layout van KNVB.nl buiten schot laten. Tevens is het mogelijk dit script automatisch te laten uitvoeren (dmv bijvoorbeeld crontabs/jobs), wat je weer een aanzienlijke hoop werk bespaard.
------------------------------------

Benodigheden:

* Een server welke PHP 5 ondersteund.
* De server dient allow_url_fopen aan hebben te staan, anders is het niet mogelijk externe pagina's (van knvb.nl) op te halen.
* De CURL-library dient aanwezig te zijn in de PHP installatie. Dit is na te vragen bij je webhost.
* Een account op KNVB.nl
* Een website van een voetbalclub/team/elftal/etc.

Files:
* knvbupdater.class.php
* club.bo.class.php
* standregel.bo.class.php
* wedstrijd.bo.class.php

Klassen:
KnvbUpdater
* string getVersion()
Geeft de versie van de KNVB Updater terug
* string[] getErrorLog()
Geeft array met errors terug
* StandRegel[] getStand($resource)
Geeft array met StandRegel-objecten terug.
* Wedstrijd[] getClubProgramma()
Geeft array met Wedstrijd-objecten terug
* Wedstrijd[] getUitslagen()
Geeft array met Wedstrijd-objecten terug.
* Wedstrijd[] getSpeelSchema()
Geeft array met Wedstrijd-objecten terug.
* Club[] getCompetitieIndeling()
Geeft array met Club-objecten terug.
* Wedstrijd[] getAlleUitslagen()
Geeft array met Wedstrijd-objecten terug.
* Wedstrijd[] getCompProgramma()
Geeft array met Wedstrijd-objecten terug.
* StandRegel[][] getPeriodeStand()
Geeft multi-dimensionale array met StandRegel-objecten terug.

Club
* string getClub()
Geeft clubnaam terug
* string getVoorkeursTijd()
Geeft voorkeurstijd van club terug

StandRegel
* string getPositie()
Geeft positie van club terug
* string getTeam()
Geeft naam van de club terug
* string getGespeeld()
Geeft aantal gespeelde wedstrijden terug
* string getGewonnen()
Geeft aantal gewonnen wedstrijden terug
* string getGelijk()
Geeft aantal gelijkgespeelde wedstrijden terug
* string getVerloren()
Geeft aantal verloren wedstrijden terug
* string getPunten()
Geeft aantal behaalde punten terug
* string getDoelVoor()
Geeft aantal gescoorde doelpunten terug
* string getDoelTegen()
Geeft aantal geincasseerde doelpunten terug
* string getPuntenMindering()
Geeft aantal punten in mindering terug

Wedstrijd
* string getDatum()
Geeft datum van de wedstrijd terug
* string getAanvang()
Geeft aanvangstijd van de wedstrijd terug
* string getThuisTeam()
Geeft naam van het thuisspelende team terug
* string getUitTeam()
Geeft naam van het uitspelende team terug
* string getUitslag()
Geeft uitslag van de wedstrijd terug
* string getScheidsrechter()
Geeft naam van scheidsrechter terug


Slot:
Ik hoop dat het zo een beetje duidelijk is en je het nut er ook in van zult zien, zodat je het met alle plezier kan gebruiken. Vragen kun je uiteraard altijd stellen, hier of stuur gewoon een mailtje.

Code:
----- knvbupdater.class.php -----
  1. <?php
  2. /******************************************
  3. *************KNVB CLASS v3.0.0*************
  4. *******Laatste update: 16-09-2007**********
  5. *******(C) by Remco van Noorloos***********
  6. ***Dit script mag door iedereen en overal**
  7. **gebruikt worden mits deze melding intact*
  8. *****************blijft.*******************
  9. *******************************************
  10. *****Voor opmerkingen en/of commentaar:****
  11. ************remcovn@gmail.com**************
  12. ******************************************/
  13.  
  14. require_once("wedstrijd.bo.class.php");
  15. require_once("club.bo.class.php");
  16. require_once("standregel.bo.class.php");
  17.  
  18. /**
  19.  * Met behulp van deze class kun je diverse informatie van knvb.nl afhalen en
  20.  * makkelijk interpreteren in je eigen website-layout.
  21.  */
  22. class KnvbUpdater
  23. {
  24. private $sUsername;
  25. private $sPassword;
  26. private $aErrorLog = array();
  27.  
  28. private static $sVersion = "3.0.0";
  29.  
  30. public function __construct($Username, $Password)
  31. {
  32. $this->sUsername = $Username;
  33. $this->sPassword = $Password;
  34. }
  35.  
  36. /**
  37. * Geeft huidige versie terug
  38. *
  39. * @return string
  40. */
  41. public function getVersion()
  42. {
  43. return KnvbUpdater::$sVersion;
  44. }
  45.  
  46. /**
  47. * Geeft de error-log terug
  48. *
  49. * @return array
  50. */
  51. public function getErrorLog()
  52. {
  53. return $this->aErrorLog;
  54. }
  55.  
  56. /**
  57. * Haal de stand op met behulp van een resource
  58. *
  59. * @param string $resource
  60. * @return array
  61. */
  62. public function getStand($resource)
  63. {
  64. $connectknvb = $this->connectknvb($resource);
  65. if(!$connectknvb)
  66. {
  67. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  68. return false;
  69. }
  70. else
  71. {
  72. $exp1 = explode('<table border="0" cellpadding="4" cellspacing="0" width="100%" class="score">', $connectknvb);
  73. $standstr = $exp1[3];
  74. $standstr = explode('</table></td>', $standstr);
  75. $standstr = str_replace('</td>', '', $standstr);
  76. $exp2 = explode('</tr>', $standstr[0]);
  77. $count = count($exp2)-1;
  78.  
  79. for($i = 1; $i < $count; $i++)
  80. {
  81. $exp3 = explode('<td align="center" class="scoretd">', $exp2[$i]);
  82. $exp4 = explode('<td align="left" class="scoretd">', $exp3[0]);
  83.  
  84. $StandRegel =
  85. new StandRegel(
  86. $i, str_replace("</b>", "", str_replace("<b>", "", trim($exp4[2]))),
  87. trim($exp3[1]), trim($exp3[2]), trim($exp3[3]), trim($exp3[4]),
  88. str_replace("</b>", "", str_replace("<b>", "", trim($exp3[5]))),
  89. trim($exp3[6]), trim($exp3[7]), trim($exp3[8])
  90. );
  91. $stand[] = $StandRegel;
  92. }
  93.  
  94. return $stand;
  95. }
  96. }
  97.  
  98. /**
  99. * Haal het volledige programma van een club op met behulp van een resource
  100. *
  101. * @param string $resource
  102. * @return array
  103. */
  104. public function getClubProgramma($resource)
  105. {
  106. $connectknvb = $this->connectknvb($resource);
  107. if(!$connectknvb)
  108. {
  109. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  110. return false;
  111. }
  112. else
  113. {
  114. $exp1 = explode('<TABLE cellSpacing=2 cellPadding=4 width="100%" border=0 >', $connectknvb);
  115. $exp1 = $exp1[1] . $exp1[2];
  116.  
  117. $progstring = str_replace('<td class="coachtd">', '', $exp1);
  118. $progstring = str_replace('<td class="coachtd" align="center">', '', $progstring);
  119. $exp2 = explode('<TR class="trlb">', $progstring);
  120.  
  121. for($i = 1; $i < count($exp2); $i++)
  122. {
  123. $Wedstrijd = new Wedstrijd();
  124.  
  125. $exp3 = explode('</tr>', $exp2[$i]);
  126. $exp4 = explode('</td>', $exp3[0]);
  127.  
  128. $datum = trim($exp4[0]);
  129. $datumexpl = explode("/", $datum);
  130.  
  131. $Wedstrijd->setDatum($datumexpl[2] . "-" . $datumexpl[1] . "-" . $datumexpl[0]);
  132. $Wedstrijd->setAanvang(trim($exp4[1]));
  133.  
  134. $wedstrijd = trim($exp4[3]);
  135. $wedstrijdexpl = explode(" - ", $wedstrijd);
  136.  
  137. $Wedstrijd->setScheidsrechter(trim($exp4[4]));
  138. $Wedstrijd->setThuisTeam(trim(str_replace("(zat)", "", $wedstrijdexpl[0])));
  139. $Wedstrijd->setUitTeam(trim(str_replace("(zat)", "", $wedstrijdexpl[1])));
  140.  
  141. if(strlen( $Wedstrijd->getThuisTeam() ) > 0)
  142. {
  143. $programma[] = $Wedstrijd;
  144. }
  145. }
  146.  
  147. return $programma;
  148. }
  149. }
  150.  
  151. /**
  152. * Haal de uitslagen op met behulp van een resource
  153. *
  154. * @param string $resource
  155. * @return array
  156. */
  157. public function getUitslagen($resource)
  158. {
  159. $connectknvb = $this->connectknvb($resource);
  160. if(!$connectknvb)
  161. {
  162. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  163. return false;
  164. }
  165. else
  166. {
  167. $exp1 = explode('<table border="0" cellpadding="4" cellspacing="0" width="100%" class="score">', $connectknvb);
  168.  
  169. $uitslagstr = $exp1[2];
  170. $uitslagstr = str_replace('', '', $uitslagstr);
  171. $exp2 = explode('<table border="0" cellpadding="0" cellspacing="0">', $uitslagstr);
  172. $exp3 = explode('</tr>', $exp2[0]);
  173.  
  174. for($i = 1; $i < count($exp3)-2; $i++)
  175. {
  176. $Wedstrijd = new Wedstrijd();
  177.  
  178. $string = str_replace('</td>', '', $exp3[$i]);
  179. $string = str_replace('<b>', '', $string);
  180. $string = str_replace('</b>', '', $string);
  181. $string = str_replace('&nbsp;', '', $string);
  182. $exp4 = explode('<td class="scoretd">', $string);
  183.  
  184. $datum = $exp4[1];
  185. $datumexp = explode("-", $datum);
  186.  
  187. $Wedstrijd->setDatum(trim($datumexp[2]) . "-" . trim($datumexp[1]) . "-" . trim($datumexp[0]));
  188. $Wedstrijd->setThuisTeam( trim($exp4[2]) );
  189. $Wedstrijd->setUitTeam( trim($exp4[3]) );
  190.  
  191. $uitslag = trim($exp4[4]);
  192. $uitslagexp = explode(" - ", $uitslag);
  193. $Wedstrijd->setUitslag( $uitslagexp[0] . "-" . $uitslagexp[1] );
  194.  
  195. $uitslagen[] = $Wedstrijd;
  196. }
  197.  
  198. return $uitslagen;
  199. }
  200. }
  201.  
  202. /**
  203. * Haal het speelschema op met behulp van een resource
  204. *
  205. * @param string $resource
  206. * @return array
  207. */
  208. public function getSpeelSchema($resource)
  209. {
  210. $connectknvb = $this->connectknvb($resource);
  211. if(!$connectknvb)
  212. {
  213. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  214. return false;
  215. }
  216. else
  217. {
  218. $exp1 = explode('<table border="0" cellpadding="4" cellspacing="0" width="100%" class="score">', $connectknvb);
  219. $exp2 = explode('<table border="0" cellpadding="2" cellspacing="2" width="100%" class="score">', $exp1[1]);
  220. for($i = 1; $i < count($exp2); $i++)
  221. {
  222. $exp3 = explode('<td align="left" width="50%">', $exp2[$i]);
  223. for($y = 1; $y < count($exp3); $y++)
  224. {
  225. $Wedstrijd = new Wedstrijd();
  226.  
  227. $exp4 = explode('</td>', $exp3[$y]);
  228. $wedstrijd = str_replace('<tr class="clubselectie">', '', $exp4[0]);
  229. $wedstrijd = str_replace('<tr>', '', $wedstrijd);
  230. $wedstrijd = str_replace('<td class="scoretd" colspan="8"><b>Wedstrijd 1</b><br/>', '', $wedstrijd);
  231. $wedstrijdexp = explode(' - ', $wedstrijd);
  232.  
  233. $Wedstrijd->setThuisTeam( $wedstrijdexp[0] );
  234. $Wedstrijd->setUitTeam( $wedstrijdexp[1] );
  235.  
  236. $speelschema[$i][$y] = $Wedstrijd;
  237. }
  238. }
  239. return $speelschema;
  240. }
  241. }
  242.  
  243. /**
  244. * Haal de uitslagen op met behulp van een resource
  245. *
  246. * @param string $resource
  247. * @return array
  248. */
  249. public function getCompetitieIndeling($resource)
  250. {
  251. $connectknvb = $this->connectknvb($resource);
  252. if(!$connectknvb)
  253. {
  254. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  255. return false;
  256. }
  257. else
  258. {
  259. $exp1 = explode('<table border="0" cellpadding="4" cellspacing="0" width="100%" class="score">', $connectknvb);
  260. $exp2 = explode('<td align="center" width="100" style="background-color: White;"><b>Voorkeurstijd</b></td>', $exp1[0]);
  261. $exp3 = explode('</table></td>', $exp2[1]);
  262. $exp4 = explode('<tr class="clubselectie">', $exp3[0]);
  263.  
  264. for($i = 1; $i < count($exp4); $i++)
  265. {
  266. $exp5 = explode('</td>', $exp4[$i]);
  267.  
  268. $club = str_replace('<td>', '', $exp5[1]);
  269. $tijd = str_replace('<td align="center">', '', $exp5[2]);
  270. $tijd = str_replace('</tr>', '', $tijd);
  271.  
  272. $Club = new Club( trim($club), trim($tijd) );
  273.  
  274. $indeling[] = $Club;
  275. }
  276.  
  277. return $indeling;
  278. }
  279. }
  280.  
  281. /**
  282. * Haal alle uitslagen op met behulp van de opgegeven resource
  283. *
  284. * @param string $resource
  285. * @return array
  286. */
  287. public function getAlleUitslagen($resource)
  288. {
  289. $connectknvb = $this->connectknvb($resource);
  290. if(!$connectknvb)
  291. {
  292. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  293. return false;
  294. }
  295. else
  296. {
  297. $exp1 = explode('<tr class="scoreheader">', $connectknvb);
  298. for($i = 1; $i < count($exp1); $i++)
  299. {
  300. $exp2 = explode('<td align="center"', $exp1[$i]);
  301. for($y = 1; $y < count($exp2); $y++)
  302. {
  303. $sTemp = str_replace('class="matrixWhite" title="', '', $exp2[$y]);
  304. $sTemp = str_replace('class="matrixGreen', '', $sTemp);
  305. $exp3 = explode('">', $sTemp);
  306. $exp4 = explode('</tr>', $exp3[1]);
  307. $exp5 = explode('><TABLE height=60 cellSpacing=0 cellPadding=0 width=468 border=0>', $exp3[0]);
  308.  
  309. if(strlen(trim($exp5[0])))
  310. {
  311. $Wedstrijd = new Wedstrijd();
  312.  
  313. $wedstrijdexp = explode(" - ", trim($exp5[0]));
  314. if(trim(str_replace('</td>', '', $exp4[0])) == "*")
  315. {
  316. $uitslag = "";
  317. }
  318. else
  319. {
  320. $uitslag = trim(str_replace('</td>', '', $exp4[0]));
  321. }
  322. $Wedstrijd->setUitslag($uitslag);
  323.  
  324. if( strlen($wedstrijdexp[0]) > 0 && strlen($wedstrijdexp[1]) > 0)
  325. {
  326. $Wedstrijd->setThuisTeam( $wedstrijdexp[0] );
  327. $Wedstrijd->setUitTeam( $wedstrijdexp[1] );
  328. $uitslagen[] = $Wedstrijd;
  329. }
  330. }
  331. }
  332. }
  333.  
  334. return $uitslagen;
  335. }
  336. }
  337.  
  338. /**
  339. * Haalt het programma van een bepaalde competitie op
  340. *
  341. * @param string $resource
  342. * @return array
  343. */
  344. public function getCompProgramma($resource)
  345. {
  346. $connectknvb = $this->connectknvb($resource);
  347. if(!$connectknvb)
  348. {
  349. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  350. return false;
  351. }
  352. else
  353. {
  354. $connectknvb = str_replace('<tr class="clubselectie">', '<tr>', $connectknvb);
  355. $exp1 = explode('<tr class="scoreheader">', $connectknvb);
  356. $exp2 = explode('</table></td>', $exp1[3]);
  357. $exp3 = explode('<tr>', $exp2[0]);
  358. for($i = 1; $i < count($exp3); $i++)
  359. {
  360. $Wedstrijd = new Wedstrijd();
  361.  
  362. $sString = str_replace('</td>', '', $exp3[$i]);
  363. $sString = str_replace('<td class="scoretd" nowrap="nowrap">', '', $sString);
  364. $sString = str_replace('</tr>', '', $sString);
  365. $exp4 = explode('<td class="scoretd">', $sString);
  366.  
  367. $wedstrijdexp = explode(" - ", trim(str_replace("</b>", "", str_replace("<b>", "", $exp4[2]))));
  368. $Wedstrijd->setDatum( trim($exp4[0]) );
  369. $Wedstrijd->setAanvang( trim($exp4[1]) );
  370.  
  371. $Wedstrijd->setThuisTeam( $wedstrijdexp[0] );
  372. $Wedstrijd->setUitTeam( $wedstrijdexp[1] );
  373.  
  374.  
  375. $programma[] = $Wedstrijd;
  376. }
  377.  
  378. return $programma;
  379. }
  380. }
  381.  
  382. /**
  383. * Haalt de periode-standen op met behulp van de opgegeven resource
  384. *
  385. * @param string $resource
  386. * @return array
  387. */
  388. public function getPeriodeStand($resource)
  389. {
  390. $connectknvb = $this->connectknvb($resource);
  391. if(!$connectknvb)
  392. {
  393. $this->reportError("101", $resource, date("d-m-Y H:i:s"), $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']));
  394. return false;
  395. }
  396. else
  397. {
  398. $exp1 = explode('<tr class="scoreheader">', $connectknvb);
  399.  
  400. $periode = 1;
  401. for($i = 4; $i < count($exp1); $i++)
  402. {
  403. $exp2 = explode('<td align="right" valign="middle" style="padding: 4px;">', $exp1[$i]);
  404. $sTemp = str_replace('<td align="left" class="scoretd">', '', $exp2[0]);
  405. $sTemp = str_replace('<td align="center" class="scoretd">', '', $sTemp);
  406. $sTemp = str_replace('<tr class="clubselectie">', '<tr>', $sTemp);
  407. $exp3 = explode('<tr>', $sTemp);
  408. for($y = 1; $y < count($exp3); $y++)
  409. {
  410. $exp4 = explode('</td>', $exp3[$y]);
  411.  
  412. if(strlen($exp4[1])!=0)
  413. {
  414. $StandRegel =
  415. new StandRegel(
  416. $y, trim(str_replace("</b>", "", str_replace("<b>", "", $exp4[1]))),
  417. trim($exp4[2]), trim($exp4[3]), trim($exp4[4]), trim($exp4[5]),
  418. str_replace("</b>", "", str_replace("<b>", "", trim($exp4[6]))),
  419. trim($exp4[7]), trim($exp4[8]), trim($exp4[9])
  420. );
  421. $stand[$periode][] = $StandRegel;
  422. }
  423. }
  424. $periode++;
  425. }
  426.  
  427. return $stand;
  428. }
  429. }
  430.  
  431. /**
  432. * Zet array om naar xml-indeling
  433. *
  434. * @param array $resource
  435. * @return string
  436. */
  437. public function write2xml($resource, $type = "default")
  438. {
  439. header("Content-type: text/xml");
  440. $xml = "<knvbupdater version=\"" . $this->sVersion . "\">";
  441. if($type == "speelSchema")
  442. {
  443. $i = 1;
  444. foreach($resource as $array)
  445. {
  446. $xml .= "<speelronde number=\"" . $i . "\">";
  447. foreach($array as $key => $value)
  448. {
  449. $xml .= "<wedstrijd>" . htmlentities($value) . "</wedstrijd>";
  450. }
  451. $xml .= "</speelronde>";
  452. $i++;
  453. }
  454. }
  455. elseif($type == "default")
  456. {
  457. for($i = 0; $i < count($resource); $i++)
  458. {
  459. $xml .= "<item>";
  460. foreach($resource[$i] as $key => $value)
  461. {
  462. $xml .= "<" . htmlentities($key) . ">" . htmlentities($value) . "</" . $key . ">";
  463. }
  464. $xml .= "</item>";
  465. }
  466. }
  467. $xml .= "</knvbupdater>";
  468.  
  469. return $xml;
  470. }
  1. /**
  2. * Breng een verbinding tot stand met knvb.nl
  3. *
  4. * @return string
  5. */
  6. private function connectknvb($resource)
  7. {
  8. if(strlen($resource)!=0)
  9. {
  10. if($this->verifyUser($this->sUsername, $this->sPassword) == "")
  11. {
  12. return false;
  13. }
  14. else
  15. {
  16. if($this->checkCurl())
  17. {
  18. $ch = curl_init();
  19. curl_setopt($ch, CURLOPT_URL, $resource);
  20. curl_setopt($ch, CURLOPT_COOKIE, "sessionId=" . $this->verifyUser($this->sUsername, $this->sPassword));
  21. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  22. $file = curl_exec($ch);
  23. curl_close ($ch);
  24. }
  25.  
  26. return $file;
  27. }
  28. }
  29. else
  30. {
  31. return false;
  32. }
  33. }
  34.  
  35. /**
  36. * Functie om in te loggen met opgegeven gebruikersnaam en wachtwoord
  37. *
  38. * @return string
  39. */
  40. private function verifyUser($sUsername, $sPassword)
  41. {
  42. if($this->checkCurl())
  43. {
  44. $URL = "http://www.knvb.nl/mijn?cc_req=1;next=bla";
  45. $ch = curl_init();
  46. curl_setopt($ch, CURLOPT_URL, $URL);
  47. curl_setopt($ch, CURLOPT_POST, true);
  48. curl_setopt($ch, CURLOPT_POSTFIELDS, "method=login&email=" . $sUsername . "&password=" . $sPassword . "&Login=Login");
  49. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  50. $string = curl_exec($ch);
  51. curl_close ($ch);
  52. }
  53.  
  54. $stringexplode = explode('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', $string);
  55. $sessionId = substr($stringexplode[0], strpos($stringexplode[0], "sessionId=")+10, 32);
  56.  
  57. return $sessionId;
  58. }
  59.  
  60. /**
  61. * Controleert of de CURL library geinstalleerd is
  62. *
  63. * @return boolean
  64. */
  65. private function checkCurl()
  66. {
  67. return function_exists("curl_init");
  68. }
  69.  
  70. /**
  71. * Foutmelding aan log toevoegen
  72. *
  73. * @param array $errorInformation
  74. */
  75. private function reportError($errorInformation)
  76. {
  77. $aErrorLog[] = array("errorno" => $errorInformation[0], "error" => $errorInformation[1], "timestamp" => $errorInformation[2], "ip" => $errorInformation[3], "host" => $errorInformation[4]);
  78. }
  79. }
  80. ?>




----- club.bo.class.php -----
  1. <?php
  2. class Club
  3. {
  4. private $sClub;
  5. private $sVoorkeursTijd;
  6.  
  7. public function __construct
  8. (
  9. $Club = "", $VoorkeursTijd = ""
  10. )
  11. {
  12. $this->sClub = $Club;
  13. $this->sVoorkeursTijd = $VoorkeursTijd;
  14. }
  15.  
  16. public function getClub()
  17. {
  18. return $this->sClub;
  19. }
  20.  
  21. public function getVoorkeursTijd()
  22. {
  23. return $this->sVoorkeursTijd;
  24. }
  25.  
  26. public function setClub($Club)
  27. {
  28. $this->sClub = $Club;
  29. }
  30.  
  31. public function setVoorkeursTijd($VoorkeursTijd)
  32. {
  33. $this->sVoorkeursTijd = $VoorkeursTijd;
  34. }
  35. }
  36. ?>


----- standregel.bo.class.php -----
  1. <?php
  2. class StandRegel
  3. {
  4. private $iPositie;
  5. private $sTeam;
  6. private $iGespeeld;
  7. private $iGewonnen;
  8. private $iGelijk;
  9. private $iVerloren;
  10. private $iPunten;
  11. private $iDoelVoor;
  12. private $iDoelTegen;
  13. private $iPuntenMindering;
  14.  
  15. public function __construct
  16. (
  17. $Positie, $Team, $Gespeeld, $Gewonnen, $Gelijk, $Verloren, $Punten,
  18. $DoelVoor, $DoelTegen, $PuntenMindering
  19. )
  20. {
  21. $this->iPositie = $Positie;
  22. $this->sTeam = $Team;
  23. $this->iGespeeld = $Gespeeld;
  24. $this->iGewonnen = $Gewonnen;
  25. $this->iGelijk = $Gelijk;
  26. $this->iVerloren = $Verloren;
  27. $this->iPunten = $Punten;
  28. $this->iDoelVoor = $DoelVoor;
  29. $this->iDoelTegen = $DoelTegen;
  30. $this->iPuntenMindering = $PuntenMindering;
  31. }
  32.  
  33. public function getPositie()
  34. {
  35. return $this->iPositie;
  36. }
  37.  
  38. public function getTeam()
  39. {
  40. return $this->sTeam;
  41. }
  42.  
  43. public function getGespeeld()
  44. {
  45. return $this->iGespeeld;
  46. }
  47.  
  48. public function getGewonnen()
  49. {
  50. return $this->iGewonnen;
  51. }
  52.  
  53. public function getGelijk()
  54. {
  55. return $this->iGelijk;
  56. }
  57.  
  58. public function getVerloren()
  59. {
  60. return $this->iVerloren;
  61. }
  62.  
  63. public function getPunten()
  64. {
  65. return $this->iPunten;
  66. }
  67.  
  68. public function getDoelVoor()
  69. {
  70. return $this->iDoelVoor;
  71. }
  72.  
  73. public function getDoelTegen()
  74. {
  75. return $this->iDoelTegen;
  76. }
  77.  
  78. public function getPuntenMindering()
  79. {
  80. return $this->iPuntenMindering;
  81. }
  82. }
  83. ?>


----- wedstrijd.bo.class.php -----
  1. <?php
  2. class Wedstrijd
  3. {
  4. private $sDatum;
  5. private $sAanvang;
  6. private $sThuisTeam;
  7. private $sUitTeam;
  8. private $sUitslag;
  9. private $sScheidsrechter;
  10.  
  11. public function __construct
  12. (
  13. $Datum = "", $Aanvang = "",
  14. $ThuisTeam = "", $UitTeam = "", $Uitslag = "",
  15. $Scheidsrechter = ""
  16. )
  17. {
  18. $this->sDatum = $Datum;
  19. $this->sAanvang = $Aanvang;
  20. $this->sThuisTeam = $ThuisTeam;
  21. $this->sUitTeam = $UitTeam;
  22. $this->sUitslag = $Uitslag;
  23. $this->sScheidsrechter = $Scheidsrechter;
  24. }
  25.  
  26. public function getDatum()
  27. {
  28. return $this->sDatum;
  29. }
  30.  
  31. public function getAanvang()
  32. {
  33. return $this->sAanvang;
  34. }
  35.  
  36. public function getThuisTeam()
  37. {
  38. return $this->sThuisTeam;
  39. }
  40.  
  41. public function getUitTeam()
  42. {
  43. return $this->sUitTeam;
  44. }
  45.  
  46. public function getUitslag()
  47. {
  48. return $this->sUitslag;
  49. }
  50.  
  51. public function getScheidsrechter()
  52. {
  53. return $this->sScheidsrechter;
  54. }
  55.  
  56. public function setDatum($Datum)
  57. {
  58. $this->sDatum = $Datum;
  59. }
  60.  
  61. public function setAanvang($Aanvang)
  62. {
  63. $this->sAanvang = $Aanvang;
  64. }
  65.  
  66. public function setThuisTeam($ThuisTeam)
  67. {
  68. $this->sThuisTeam = $ThuisTeam;
  69. }
  70.  
  71. public function setUitTeam($UitTeam)
  72. {
  73. $this->sUitTeam = $UitTeam;
  74. }
  75.  
  76. public function setUitslag($Uitslag)
  77. {
  78. $this->sUitslag = $Uitslag;
  79. }
  80.  
  81. public function setScheidsrechter($Scheidsrechter)
  82. {
  83. $this->sScheidsrechter = $Scheidsrechter;
  84. }
  85.  
  86. public function getWedstrijd()
  87. {
  88. return $this->sThuisTeam . "-" . $this->sUitTeam;
  89. }
  90. }
  91. ?>
Download code! Download code (.txt)

 Bekijk een voorbeeld van dit script!
 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (127)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.328s