Guest User

Untitled

a guest
Oct 24th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.56 KB | None | 0 0
  1. <?php
  2. include_once 'config.php';
  3. include_once 'functions.php';
  4. include 'scoreboard_include.php';
  5.  
  6. function generateFormation ($aSpelers, $aWissels, $aTeams, $aFormatie) {
  7. $aPlayers = array();
  8. $aChanges = array();
  9. $aAantal = array('K'=>0, 'V'=>0, 'M'=>0, 'A'=>0);
  10. $aPosities = array();
  11. for ( $i = 1; $i < sizeof($aSpelers); $i ++ ) {
  12. $sPositie = substr($aSpelers[$i]['bpositie'], 0, 1);
  13. $aPlayers[$i] = $aSpelers[$i]['bpositie'];
  14. $aPosities[$aSpelers[$i]['bpositie']] = TRUE;
  15. $aAantal[$sPositie] ++;
  16. }
  17. for ( $i = 1; $i < sizeof($aWissels); $i ++ ) {
  18. $aChanges[$i] = $aWissels[$i]['positie'];
  19. }
  20. if ($aAantal['K'] == 0) {
  21. foreach ( $aChanges as $nr => $pos ) {
  22. if ($pos == "K") {
  23. $aSpelers[] = array (
  24. 'naam' => $aWissels[$nr]['naam'],
  25. 'bpositie' => 'K',
  26. 'positie' => 'K',
  27. 'A' => $aWissels[$nr]['A'],
  28. 'M' => $aWissels[$nr]['M'],
  29. 'V' => $aWissels[$nr]['V'],
  30. 'K' => $aWissels[$nr]['K'],
  31. 'status' => $aWissels[$nr]['status']
  32. );
  33. $aTeams['K'] += $aWissels[$nr]['K'];
  34. unset($aWissels[$nr]);
  35. unset($aChanges[$nr]);
  36. break;
  37. }
  38. }
  39. }
  40. if ($aAantal['A'] < $aFormatie['A']) {
  41. for ( $i = 1; $i <= $aFormatie['A']; $i ++ ) {
  42. if (!isset($aPosities['A'.$i])) {
  43. foreach ( $aChanges as $nr => $pos ) {
  44. if ($pos == "A") {
  45. $aSpelers[] = array (
  46. 'naam' => $aWissels[$nr]['naam'],
  47. 'bpositie' => 'A'.$i,
  48. 'positie' => $aWissels[$nr]['positie'],
  49. 'A' => $aWissels[$nr]['A'],
  50. 'M' => $aWissels[$nr]['M'],
  51. 'V' => $aWissels[$nr]['V'],
  52. 'K' => $aWissels[$nr]['K'],
  53. 'status' => $aWissels[$nr]['status']
  54. );
  55. $aTeams['A'] += $aWissels[$nr]['A'];
  56. unset($aWissels[$nr]);
  57. unset($aChanges[$nr]);
  58. break;
  59. }
  60. }
  61. }
  62. }
  63. }
  64. if ($aAantal['M'] < $aFormatie['M']) {
  65. for ( $i = 1; $i <= $aFormatie['M']; $i ++ ) {
  66. if (!isset($aPosities['M'.$i])) {
  67. foreach ( $aChanges as $nr => $pos ) {
  68. if ($pos == "M") {
  69. $aSpelers[] = array (
  70. 'naam' => $aWissels[$nr]['naam'],
  71. 'bpositie' => 'M'.$i,
  72. 'positie' => $aWissels[$nr]['positie'],
  73. 'A' => $aWissels[$nr]['A'],
  74. 'M' => $aWissels[$nr]['M'],
  75. 'V' => $aWissels[$nr]['V'],
  76. 'K' => $aWissels[$nr]['K'],
  77. 'status' => $aWissels[$nr]['status']
  78. );
  79. $aTeams['M'] += $aWissels[$nr]['M'];
  80. unset($aWissels[$nr]);
  81. unset($aChanges[$nr]);
  82. break;
  83. }
  84. }
  85. }
  86. }
  87. }
  88. if ($aAantal['V'] < $aFormatie['V']) {
  89. for ( $i = 1; $i <= $aFormatie['V']; $i ++ ) {
  90. if (!isset($aPosities['V'.$i])) {
  91. foreach ( $aChanges as $nr => $pos ) {
  92. if ($pos == "V") {
  93. $aSpelers[] = array (
  94. 'naam' => $aWissels[$nr]['naam'],
  95. 'bpositie' => 'V'.$i,
  96. 'positie' => $aWissels[$nr]['positie'],
  97. 'A' => $aWissels[$nr]['A'],
  98. 'M' => $aWissels[$nr]['M'],
  99. 'V' => $aWissels[$nr]['V'],
  100. 'K' => $aWissels[$nr]['K'],
  101. 'status' => $aWissels[$nr]['status']
  102. );
  103. $aTeams['V'] += $aWissels[$nr]['V'];
  104. unset($aWissels[$nr]);
  105. unset($aChanges[$nr]);
  106. break;
  107. }
  108. }
  109. }
  110. }
  111. }
  112. $aArray = array ($aSpelers, $aWissels, $aTeams, $aFormatie);
  113. return $aArray;
  114. }
  115. function goal($iTeamID, $sSoort2) {
  116. global $aSpelers, $sSoort, $aTeamID, $aSpecialist, $aShots, $iWedstrijdLengte;
  117.  
  118. if ($sSoort2 == 0) {
  119. $iRand = rand(1, 10);
  120. if ($iRand <= 5) $sPos = 'A';
  121. elseif ($iRand > 5 && $iRand <= 8) $sPos = 'M';
  122. else $sPos = 'V';
  123. $iRandom = rand(1, 11);
  124. while ( !isset($aSpelers[$iTeamID][$iRandom]) || $aSpelers[$iTeamID][$iRandom]['positie'] != $sPos ) {
  125. $iRandom = rand(1, 11);
  126. }
  127. $sSpeler = $aSpelers[$iTeamID][$iRandom]['naam'];
  128. }elseif ($sSoort2 == 1) {
  129. $sSpeler = $aSpelers[$iTeamID][$aSpecialist[$iTeamID]['penaltie']]['naam'];
  130. }elseif ($sSoort2 == 2) {
  131. $sSpeler = $aSpelers[$iTeamID][$aSpecialist[$iTeamID]['FK']]['naam'];
  132. }
  133. if ($sSoort == "L") {
  134. $sQuery9 = 'UPDATE players SET goals = goals + 1 WHERE name = "' . $sSpeler . '" AND teamID = ' . $aTeamID[$iTeamID];
  135. $iResult9 = mysql_query($sQuery9);
  136. }
  137. if ($iWedstrijdLengte < 95) $iWedstrijdLengte += 0.5;
  138.  
  139. return $sSpeler;
  140. }
  141. function redCard ($iTeamID) {
  142. global $aSpelers, $aTeams, $sSoort, $aTeamID, $iWedstrijdLengte;
  143.  
  144. $iRandom = rand(1, 11);
  145. while ( isset($aSpelers[$iTeamID][$iRandom]) == FALSE ) {
  146. $iRandom = rand(1, 11);
  147. }
  148. $sSpeler = $aSpelers[$iTeamID][$iRandom]['naam'];
  149. $aTeams[$iTeamID]['A'] -= $aSpelers[$iTeamID][$iRandom]['A'];
  150. $aTeams[$iTeamID]['M'] -= $aSpelers[$iTeamID][$iRandom]['M'];
  151. $aTeams[$iTeamID]['V'] -= $aSpelers[$iTeamID][$iRandom]['V'];
  152. $aTeams[$iTeamID]['K'] -= $aSpelers[$iTeamID][$iRandom]['K'];
  153. unset($aSpelers[$iTeamID][$iRandom]);
  154. $iLengte = rand(2, 6);
  155. $sQuery6 = 'UPDATE players SET status = "R' . $iLengte . '", basisposition="W" WHERE name = "' . $sSpeler . '" AND teamID = ' . $aTeamID[$iTeamID];
  156. $iResult6 = mysql_query($sQuery6);
  157. if ($iWedstrijdLengte < 95) $iWedstrijdLengte += 0.5;
  158. return $sSpeler;
  159. }
  160. function yellowCard ($iTeamID) {
  161. global $aSpelers, $sSoort, $aTeamID, $aTeams, $iWedstrijdLengte;
  162.  
  163. $iRandom = rand(1, 11);
  164. while ( isset($aSpelers[$iTeamID][$iRandom]) == FALSE ) {
  165. $iRandom = rand(1, 11);
  166. }
  167. $sSpeler = $aSpelers[$iTeamID][$iRandom]['naam'];
  168. $sQuery7 = 'SELECT * FROM players WHERE name = "' . $sSpeler . '" AND teamID = ' . $aTeamID[$iTeamID];
  169. $iResult7 = mysql_query($sQuery7);
  170. $aObject7 = mysql_fetch_object($iResult7);
  171. if ($iWedstrijdLengte < 95) $iWedstrijdLengte += 0.5;
  172. if ($aObject7->status == "G") {
  173. $iLengte = rand(1, 4);
  174. $sQuery6 = 'UPDATE players SET status = "R' . $iLengte . '", basisposition="W" WHERE name = "' . $sSpeler . '" AND teamID = ' . $aTeamID[$iTeamID];
  175. $iResult6 = mysql_query($sQuery6);
  176. $aTeams[$iTeamID]['A'] -= $aSpelers[$iTeamID][$iRandom]['A'];
  177. $aTeams[$iTeamID]['M'] -= $aSpelers[$iTeamID][$iRandom]['M'];
  178. $aTeams[$iTeamID]['V'] -= $aSpelers[$iTeamID][$iRandom]['V'];
  179. $aTeams[$iTeamID]['K'] -= $aSpelers[$iTeamID][$iRandom]['K'];
  180. unset($aSpelers[$iTeamID][$iRandom]);
  181. return 'YR-' . $sSpeler;
  182. }else{
  183. $sQuery6 = 'UPDATE players SET status = "G" WHERE name = "' . $sSpeler . '" AND teamID = ' . $aTeamID[$iTeamID];
  184. $iResult6 = mysql_query($sQuery6);
  185. return $sSpeler;
  186. }
  187. }
  188. function injury ($iTeamID) {
  189. global $aSpelers, $aTeams, $sSoort, $aTeamID, $aWissels, $iWedstrijdLengte;
  190.  
  191. $iRandom = rand(1, 11);
  192. while ( isset($aSpelers[$iTeamID][$iRandom]) == FALSE ) {
  193. $iRandom = rand(1, 11);
  194. }
  195. $sSpeler = $aSpelers[$iTeamID][$iRandom]['naam'];
  196. $sPos = substr($aSpelers[$iTeamID][$iRandom]['bpositie'], 0, 1);
  197. $aChanges = array();
  198. foreach ( $aWissels[$iTeamID] as $nr => $pos ) {
  199. if ($aWissels[$iTeamID][$nr]['positie'] == $sPos) $aChanges[] = $nr;
  200. }
  201. if (sizeof($aChanges) > 0) {
  202. $iRandom1 = $aChanges[0];
  203. $aTeams[$iTeamID]['A'] += $aWissels[$iTeamID][$iRandom1]['A'];
  204. $aTeams[$iTeamID]['M'] += $aWissels[$iTeamID][$iRandom1]['M'];
  205. $aTeams[$iTeamID]['V'] += $aWissels[$iTeamID][$iRandom1]['V'];
  206. $aTeams[$iTeamID]['K'] += $aWissels[$iTeamID][$iRandom1]['K'];
  207. $sWissel = ' > ' . $aWissels[$iTeamID][$iRandom1]['naam'];
  208. }else $sWissel = '';
  209. $aTeams[$iTeamID]['A'] -= $aSpelers[$iTeamID][$iRandom]['A'];
  210. $aTeams[$iTeamID]['M'] -= $aSpelers[$iTeamID][$iRandom]['M'];
  211. $aTeams[$iTeamID]['V'] -= $aSpelers[$iTeamID][$iRandom]['V'];
  212. $aTeams[$iTeamID]['K'] -= $aSpelers[$iTeamID][$iRandom]['K'];
  213. $aSpelers[$iTeamID][$iRandom] = $aWissels[$iTeamID][$iRandom1];
  214. unset($aWissels[$iTeamID][$iRandom1]);
  215. $iLengte = rand(1, 4);
  216. $sQuery11 = 'UPDATE players SET status = "B' . $iLengte . '" WHERE name = "' . $sSpeler . '" AND teamID = ' . $iTeamID;
  217. $iResult11 = mysql_query($sQuery11);
  218. if ($iWedstrijdLengte < 95) $iWedstrijdLengte += 0.5;
  219. return $sSpeler . $sWissel;
  220. }
  221. function shot($iTeamID, $iS = 0) {
  222. global $aSpelers, $sSoort, $aTeamID, $aSpecialist, $aShots, $aCorners;
  223.  
  224. $sSpeler = '';
  225. if ($iS == 1) $aCorners[$iTeamID] ++;
  226. elseif ($iS == 2) $sSpeler = $aSpelers[$iTeamID][$aSpecialist[$iTeamID]['penaltie']]['naam'];
  227. elseif ($iS == 3) $sSpeler = $aSpelers[$iTeamID][$aSpecialist[$iTeamID]['FK']]['naam'];
  228.  
  229. if ($sSpeler == '') {
  230. $iRand = rand(1, 10);
  231. if ($iRand <= 5) $sPos = 'A';
  232. elseif ($iRand > 5 && $iRand <= 8) $sPos = 'M';
  233. else $sPos = 'V';
  234. $iRandom = rand(1, 11);
  235. while ( !isset($aSpelers[$iTeamID][$iRandom]) || $aSpelers[$iTeamID][$iRandom]['positie'] != $sPos ) {
  236. $iRandom = rand(1, 11);
  237. }
  238. $sSpeler = $aSpelers[$iTeamID][$iRandom]['naam'];
  239. }
  240.  
  241. return $sSpeler;
  242.  
  243. }
  244.  
  245. $sSql = 'SELECT * FROM competities WHERE divisie = 5';
  246. $iQuery = mysql_query($sSql);
  247. while ( $aResult = mysql_fetch_object($iQuery) ) {
  248. $sQueryH = 'UPDATE competities SET simuleren = 1 WHERE id = ' . $aResult->id;
  249. $iResultH = mysql_query($sQueryH);
  250.  
  251. $sSql1 = 'SELECT * FROM kalender WHERE land = ' . $aResult->id . ' AND week = ' . $aResult->week;
  252. $iQuery1 = mysql_query($sSql1);
  253. if (mysql_num_rows($iQuery1) > 0) {
  254. $aResult1 = mysql_fetch_object($iQuery1);
  255. $sSoort = $aResult1->soort;
  256. if ($sSoort == "P" || $sSoort == "") {
  257. $sQuery6 = 'UPDATE competities SET week=week+1, simuleren = 0 WHERE id='. $aResult->id;
  258. $iResult6 = mysql_query($sQuery6);
  259. continue;
  260. }
  261. $sQuery1 = 'SELECT * FROM matches WHERE land=' . $aResult->id . ' AND week=' . $aResult->week;
  262. $iResult1 = mysql_query($sQuery1);
  263. $sQuery18 = 'SELECT * FROM players WHERE land = ' . $aResult->id . ' AND status != "G" AND status != ""';
  264. $iResult18 = mysql_query($sQuery18);
  265. while ( $aObject18 = mysql_fetch_object($iResult18) ) {
  266. $iOud = intval(substr($aObject18->status, 1, 1));
  267. if ($iOud > 1) $sNieuw = substr($aObject18->status, 0, 1) . ($iOud - 1);
  268. else $sNieuw = '';
  269. $sQuery19 = 'UPDATE players SET status = "' . $sNieuw . '" WHERE id = ' . $aObject18->id;
  270. $iResult19 = mysql_query($sQuery19);
  271. }
  272. setFinances($aResult->id, $aResult->week);
  273. while ( $aResult1 = mysql_fetch_object($iResult1) ) {
  274. echo $aResult1->team1 . ' - ' . $aResult1->team2 . '<br />';
  275. $sSql2 = 'SELECT * FROM teams WHERE land = ' . $aResult->id . ' AND name = "' . $aResult1->team1 . '"';
  276. $sSql3 = 'SELECT * FROM teams WHERE land = ' . $aResult->id . ' AND name = "' . $aResult1->team2 . '"';
  277. $iQuery2 = mysql_query($sSql2) or die($sSql1 . '<br />' . mysql_error());
  278. $iQuery3 = mysql_query($sSql3) or die($sSql3 . '<br />' . mysql_error());
  279. $aResult2 = mysql_fetch_object($iQuery2);
  280. $aResult3 = mysql_fetch_object($iQuery3);
  281. $aCoach[0] = $aResult2->trainer;
  282. $aCoach[1] = $aResult3->trainer;
  283. $aTeamID[0] = $aResult2->id;
  284. $aTeamID[1] = $aResult3->id;
  285. $aSpelers = array();
  286. $aWissels = array();
  287. $aTeams = array();
  288. $aTeams[0] = array('naam'=>'', 'A'=>0, 'M'=>0, 'V'=>0, 'K'=>0);
  289. $aTeams[1] = array('naam'=>'', 'A'=>0, 'M'=>0, 'V'=>0, 'K'=>0);
  290. $aTeams[0]['naam'] = $aResult1->team1;
  291. $aTeams[1]['naam'] = $aResult1->team2;
  292. $aStyles = array ('Rustig' => 240, 'Normaal' => 120, 'Hard' => 60, 'Aggressief' => 30);
  293. $aStyle[0] = $aStyles[$aResult2->style];
  294. $aStyle[1] = $aStyles[$aResult3->style];
  295. $aFormatie = array();
  296. $aFormation = explode('-', $aResult2->formation);
  297. $aFormatie[0]['V'] = $aFormation[0];
  298. $aFormatie[0]['M'] = $aFormation[1];
  299. $aFormatie[0]['A'] = $aFormation[2];
  300. $aFormation = explode('-', $aResult2->formation);
  301. $aFormatie[1]['V'] = $aFormation[0];
  302. $aFormatie[1]['M'] = $aFormation[1];
  303. $aFormatie[1]['A'] = $aFormation[2];
  304. $aSpecialist = array();
  305. for ( $i = 0; $i <= 1; $i ++ ) {
  306. $aSpelers[$i] = array();
  307. $aWissels[$i] = array();
  308. $sSql4 = 'SELECT * FROM players WHERE teamID = ' . $aTeamID[$i];
  309. $iQuery4 = mysql_query($sSql4) or die($sSql4 . '<br />' . mysql_error());
  310. $sQuery10 = 'UPDATE players SET status="" WHERE status="G" AND teamID = ' . $aTeamID[$i];
  311. $iResult10 = mysql_query($sQuery10);
  312. $ii = 1;
  313. $sQuery12 = 'SELECT * FROM specialisten WHERE team_id = ' . $aTeamID[$i];
  314. $iResult12 = mysql_query($sQuery12);
  315. $aObject12 = mysql_fetch_object($iResult12);
  316. $aSpecialist[$i] = array();
  317. while ( $aResult4 = mysql_fetch_object($iQuery4) ) {
  318. if ($aResult4->basisposition != "W" && ($aResult4->status == "" || $aResult4->status == "G")) {
  319. $aSpelers[$i][$ii]['naam'] = $aResult4->name;
  320. $aSpelers[$i][$ii]['bpositie'] = $aResult4->basisposition;
  321. $aSpelers[$i][$ii]['positie'] = $aResult4->position;
  322. $aSpelers[$i][$ii]['A'] = $aResult4->aanval;
  323. $aSpelers[$i][$ii]['M'] = $aResult4->middenveld;
  324. $aSpelers[$i][$ii]['V'] = $aResult4->verdediging;
  325. $aSpelers[$i][$ii]['K'] = $aResult4->keeper;
  326. $aSpelers[$i][$ii]['status'] = $aResult4->status;
  327. $aTeams[$i][$aResult4->position] += $aSpelers[$i][$ii][$aResult4->position];
  328. if ($aResult4->id == $aObject12->penaltie) $aSpecialist[$i]['penaltie'] = $ii;
  329. if ($aResult4->id == $aObject12->vrije_trap) $aSpecialist[$i]['FK'] = $ii;
  330. $ii ++;
  331. }
  332. }
  333. $iii = 1;
  334. $iQuery4 = mysql_query($sSql4);
  335. while ( $aResult4 = mysql_fetch_object($iQuery4) ) {
  336. if ($aResult4->basisposition == "W" && ($aResult4->status == "" || $aResult4->status == "G")) {
  337. $aWissels[$i][$iii]['naam'] = $aResult4->name;
  338. $aWissels[$i][$iii]['bpositie'] = $aResult4->basisposition;
  339. $aWissels[$i][$iii]['positie'] = $aResult4->position;
  340. $aWissels[$i][$iii]['A'] = $aResult4->aanval;
  341. $aWissels[$i][$iii]['M'] = $aResult4->middenveld;
  342. $aWissels[$i][$iii]['V'] = $aResult4->verdediging;
  343. $aWissels[$i][$iii]['K'] = $aResult4->keeper;
  344. $aWissels[$i][$iii]['status'] = $aResult4->status;
  345. $iii ++;
  346. }
  347. }
  348. if ($ii < 11) {
  349. $aArray = generateFormation ($aSpelers[$i], $aWissels[$i], $aTeams[$i], $aFormatie[$i]);
  350. $aSpelers[$i] = $aArray[0];
  351. $aWissels[$i] = $aArray[1];
  352. $aTeams[$i] = $aArray[2];
  353. $aFormatie[$i] = $aArray[3];
  354. }
  355. if ($aCoach[$i] == '') {
  356. $aTeams[$i]['A'] -= 20;
  357. $aTeams[$i]['M'] -= 20;
  358. $aTeams[$i]['V'] -= 20;
  359. $aTeams[$i]['K'] -= 20;
  360. }
  361. }
  362. $iVeld = 1000;
  363. $aBal = array(500);
  364. $iBal = 500;
  365. $aGoals = array(0=>array(), 1=>array());
  366. $aShots = array(0=>array(), 1=>array()); //0 = naast, 1 = keeper houdt tegen, 2 = keeper tikt corner, 3 = doelpunt, 4 = FK raak, 5 = FK mis, 6 = P raak, 7 = P mis
  367. $aCorners = array(0=>0, 1=>0);
  368. $aRedCards = array(0=>array(), 1=>array());
  369. $aYellowCards = array(0=>array(), 1=>array());
  370. $aFreeKicks = array(0=>array(), 1=>array());
  371. $aInjuries = array(0=>array(), 1=>array());
  372. $iWedstrijdLengte = 90;
  373. for ( $i = 1; $i <= $iWedstrijdLengte; $i ++ ) {
  374. if (rand(1, $aStyle[0]) < 3) {
  375. $iR = rand(1, 10);
  376. if ($iR < 2) {
  377. $aRedCards[0][$i] = redCard(0);
  378. $iNr = 3;
  379. }elseif ($iR >= 2 && $iR <= 6) {
  380. $aYellowCards[0][$i] = yellowCard(0);
  381. $iNr = 8;
  382. }else $iNr = 20;
  383. if (rand(0, $iNr) == 1) {
  384. $aInjuries[1][$i] = injury(1);
  385. }
  386. if (isset($aSpecialist[1]['penaltie']) && $iBal <= 100) {
  387. if (rand(1, 2) == 1) {
  388. $aGoals[1][$i] = goal(1, 1);
  389. $aShots[1][$i][6] = $aGoals[1][$i];
  390. $iBal = 500;
  391. }else{
  392. $aShots[1][$i][7] = shot(1, 2);
  393. }
  394. }elseif (isset($aSpecialist[1]['FK']) && $iBal > 100) {
  395. if (rand(1, $iBal/15) == 1) {
  396. $aGoals[1][$i] = goal(1, 2);
  397. $aShots[1][$i][4] = $aGoals[1][$i];
  398. $iBal = 500;
  399. }else{
  400. $aShots[1][$i][5] = shot(1, 3);
  401. }
  402. }
  403. }elseif (rand(1, $aStyle[1]) < 3) {
  404. $iR = rand(1, 10);
  405. if ($iR < 2) {
  406. $aRedCards[1][$i] = redCard(1);
  407. $iNr = 3;
  408. }elseif ($iR >= 2 && $iR <= 6) {
  409. $aYellowCards[1][$i] = yellowCard(1);
  410. $iNr = 8;
  411. }else $iNr = 20;
  412. if (rand(0, $iNr) == 1) $aInjuries[0][$i] = injury(0);
  413. if (isset($aSpecialist[0]['penaltie']) && $iBal >= 900) {
  414. if (rand(1, 2) == 1) {
  415. $aGoals[0][$i] = goal(0, 1);
  416. $aShots[0][$i][6] = $aGoals[0][$i];
  417. $iBal = 500;
  418. }else{
  419. $aShots[0][$i][7] = shot(0, 2);
  420. }
  421. }elseif (isset($aSpecialist[0]['FK']) && $iBal < 900) {
  422. if (rand(1, (1000-$iBal)/15) == 1) {
  423. $aGoals[0][$i] = goal(0, 2);
  424. $aShots[0][$i][4] = $aGoals[0][$i];
  425. $iBal = 500;
  426. }else{
  427. $aShots[0][$i][5] = shot(0, 3);
  428. }
  429. }
  430. }
  431.  
  432. $iBal += rand(0, $aTeams[0]['M']);
  433. $iBal -= rand(0, $aTeams[1]['V']);
  434. if ($iBal >= 1000) {
  435. if (rand(0, 1) == 0) { //schot
  436. $iRand = rand(1, 10);
  437. if (rand(0, 1) == 0) { //schot tussen palen
  438. if ($iRand <= 1) { //doelpunt
  439. $aGoals[0][$i] = goal(0, 0);
  440. $aShots[0][$i][3] = $aGoals[0][$i];
  441. $iBal = 500;
  442. }elseif ($iRand >= 5 && $iRand <= 9) {
  443. $aShots[0][$i][1] = shot(0); //keeper houdt tegen
  444. if (rand(0, 1) == 0) $iBal -= 500;
  445. }else $aShots[0][$i][2] = shot(0, 1); //keeper tikt corner
  446. }else{ //schot naast
  447. if ($iRand <= 3) $aShots[0][$i][2] = shot(0, 1); //corner
  448. else $aShots[0][$i][0] = shot(0); //naast
  449. }
  450. }else { //actie
  451. $iBal += rand(0, $aTeams[0]['A']);
  452. $iBal -= rand(0, $aTeams[1]['K']);
  453. if ($iBal >= 1500) { //doelpunt
  454. $aGoals[0][$i] = goal(0, 0);
  455. $aShots[0][$i][3] = $aGoals[0][$i];
  456. $iBal = 500;
  457. }
  458. }
  459. }
  460. $iBal -= rand(0, $aTeams[1]['M']);
  461. $iBal += rand(0, $aTeams[0]['V']);
  462. if ($iBal <= 0) {
  463. if (rand(0, 1) == 0) { //schot
  464. $iRand = rand(1, 10);
  465. if (rand(0, 1) == 0) { //schot tussen palen
  466. if ($iRand <= 1) { //doelpunt
  467. $aGoals[1][$i] = goal(1, 0);
  468. $aShots[1][$i][3] = $aGoals[1][$i];
  469. $iBal = 500;
  470. }elseif ($iRand >= 5 && $iRand <= 9) {
  471. $aShots[1][$i][1] = shot(1); //keeper houdt tegen
  472. if (rand(0, 1) == 0) $iBal += 500;
  473. }else $aShots[1][$i][2] = shot(1, 1); //keeper tikt corner
  474. }else{ //schot naast
  475. if ($iRand <= 3) $aShots[1][$i][2] = shot(1, 1); //corner
  476. else $aShots[1][$i][0] = shot(1); //naast
  477. }
  478. }else { //actie
  479. $iBal += rand(0, $aTeams[1]['A']);
  480. $iBal -= rand(0, $aTeams[0]['K']);
  481. if ($iBal <= -500) { //doelpunt
  482. $aGoals[1][$i] = goal(1, 0);
  483. $aShots[1][$i][3] = $aGoals[1][$i];
  484. $iBal = 500;
  485. }
  486. }
  487. }
  488. $aBal[] = $iBal;
  489. if ($i == 45) $iBal = 500;
  490. }
  491. $aBalbezit[0] = 50;
  492. $aBalbezit[1] = 50;
  493. $iBAL = 0;
  494. foreach ( $aBal as $min => $bal ) {
  495. $iBAL += $bal;
  496. }
  497. $iBAL = round($iBAL/900);
  498. if ($iBAL < 30) $iBAL += 10;
  499. if ($iBAL > 70) $iBAL -= 10;
  500. if (sizeof($aGoals[0]) > sizeof($aGoals[1])) {
  501. if ($iBAL > 50) {
  502. $aBalbezit[0] = $iBAL;
  503. $aBalbezit[1] = 100-$iBAL;
  504. }else{
  505. $aBalbezit[0] = 100-$iBAL;
  506. $aBalbezit[1] = $iBAL;
  507. }
  508. }else{
  509. if ($iBAL > 50) {
  510. $aBalbezit[1] = $iBAL;
  511. $aBalbezit[0] = 100-$iBAL;
  512. }else{
  513. $aBalbezit[1] = 100-$iBAL;
  514. $aBalbezit[0] = $iBAL;
  515. }
  516. }
  517. if (sizeof($aGoals[0]) == sizeof($aGoals[1]) && $sSoort == "C") {
  518. $aPenalties = array( 0 => 0, 1 => 0 );
  519. for ( $i = 1; $i <= 5; $i ++ ) {
  520. if (rand(0, 1) == 1) $aPenalties[0] ++;
  521. else $aPenalties[1] ++;
  522.  
  523. if ($i < 5) {
  524. if ($aPenalties[0] + 3 == $aPenalties[1] || $aPenalties[1] + 3 == $aPenalties[0]) break;
  525. }elseif ($aPenalties[0] != $aPenalties[1]) break;
  526. }
  527. if ($aPenalties[0] == $aPenalties[1]) {
  528. if (rand(0, 1) == 1) $aPenalties[0] ++;
  529. else $aPenalties[1] ++;
  530. }
  531. }
  532. $sVerslag = '';
  533. $aSoorten = array ( 0 => 'SN', 1 => 'SK', 2 => 'SC', 3 => 'SD', 4 => 'FK1', 5 => 'FK2', 6 => 'P1', 7 => 'P2' );
  534. $aSchoten = array (0 => 0, 1 => 0);
  535. $aSchotenOpDoel = array (0 => 0, 1 => 0);
  536. for ( $i = 0; $i <= 1; $i ++ ) {
  537. ksort($aGoals[$i]);
  538. ksort($aRedCards[$i]);
  539. ksort($aYellowCards[$i]);
  540. ksort($aInjuries[$i]);
  541. ksort($aShots[$i]);
  542. for ( $ii = 1; $ii <= $iWedstrijdLengte; $ii ++ ) {
  543. if ($aRedCards[$i][$ii] != '') {
  544. $sVerslag .= 'R-' . $ii . '-' . $aRedCards[$i][$ii] . '-' . rand(0, count($scoreboardRodeKaarten)-1) . ';';
  545. }
  546. if ($aYellowCards[$i][$ii] != '') {
  547. if (preg_match('/^YR-/', $aYellowCards[$i][$ii])) $sVerslag .= 'YR-' . $ii . '-' . substr($aYellowCards[$i][$ii], 3) . '-' . rand(0, count($scoreboardGeleRodeKaarten)-1) . ';';
  548. else $sVerslag .= 'Y-' . $ii . '-' . $aYellowCards[$i][$ii] . '-' . rand(0, count($scoreboardGeleKaarten)-1) . ';';
  549. }
  550. if ($aInjuries[$i][$ii] != '') {
  551. $sVerslag .= 'B-' . $ii . '-' . $aInjuries[$i][$ii] . '-' . rand(0, count($scoreboardBlessures)-1) . ';';
  552. }
  553. if ($aGoals[$i][$ii] != '' && $aShots[$i][$ii][4] == '' && $aShots[$i][$ii][6] == '') {
  554. $sVerslag .= 'D-' . $ii . '-' . $aGoals[$i][$ii] . '-' . rand(0, count($scoreboardDoelpunten)-1) . ';';
  555. }
  556. if ($aShots[$i][$ii][4] != '') {
  557. $sVerslag .= 'FK1-' . $ii . '-' . $aShots[$i][$ii][4] . '-' . rand(0, count($scoreboardVrijetrapRaak)-1) . ';';
  558. }
  559. if ($aShots[$i][$ii][6] != '') {
  560. $sVerslag .= 'P1-' . $ii . '-' . $aShots[$i][$ii][6] . '-' . rand(0, count($scoreboardPenaltieRaak)-1) . ';';
  561. }
  562. }
  563.  
  564. foreach ( $aShots[$i] as $min => $naam ) {
  565. foreach ( $aShots[$i][$min] as $soort => $naam2 ) {
  566. if ($soort == 0) $aSchot = $scoreboardSchotenNaast;
  567. elseif ($soort == 1) $aSchot = $scoreboardSchotenKeeper;
  568. elseif ($soort == 2) $aSchot = $scoreboardSchotenCorner;
  569. elseif ($soort == 5) $aSchot = $scoreboardVrijetrapMis;
  570. elseif ($soort == 7) $aSchot = $scoreboardPenaltieMis;
  571. else continue;
  572. $sVerslag .= $aSoorten[$soort] . '-' . $min . '-' . $naam2 . '-' . rand(0, count($aSchot)-1) . ';';
  573. if ($soort > 0) $aSchotenOpDoel[$i] ++;
  574. else $aSchoten[$i] ++;
  575. }
  576. }
  577. if ($i == 0) $sVerslag .= '|';
  578. }
  579. if (sizeof($aGoals[0]) > sizeof($aGoals[1])) {
  580. $aPunten[0] = 3;
  581. $aPunten[1] = 0;
  582. $aSoort[0] = 'won';
  583. $aSoort[1] = 'lose';
  584. $aSoort1[0] = 'gewonnen';
  585. $aSoort1[1] = 'verloren';
  586. }elseif (sizeof($aGoals[0]) < sizeof($aGoals[1])) {
  587. $aPunten[1] = 3;
  588. $aPunten[0] = 0;
  589. $aSoort[0] = 'lose';
  590. $aSoort[1] = 'won';
  591. $aSoort1[1] = 'gewonnen';
  592. $aSoort1[0] = 'verloren';
  593. }else{
  594. $aPunten[0] = 1;
  595. $aPunten[1] = 1;
  596. $aSoort[0] = 'draw';
  597. $aSoort[1] = 'draw';
  598. $aSoort1[0] = 'gelijk';
  599. $aSoort1[1] = 'gelijk';
  600. }
  601. $sQuery18 = 'UPDATE users SET ' . $aSoort1[$i] . '=' . $aSoort1[$i] . '+1 WHERE teamID = ' . $aTeamID[$i];
  602. $iResult18 = mysql_query($sQuery18);
  603. if ($sSoort == "L") {
  604. $sQuery12 = '
  605. UPDATE
  606. matches
  607. SET
  608. score1=' . sizeof($aGoals[0]) . ',
  609. score2=' . sizeof($aGoals[1]) . ',
  610. balbezit1=' . $aBalbezit[0] . ',
  611. balbezit2=' . $aBalbezit[1] . ',
  612. schoten1="' . $aSchoten[0] . '/' . $aSchotenOpDoel[0] . '",
  613. schoten2="' . $aSchoten[1] . '/' . $aSchotenOpDoel[1] . '",
  614. corners1=' . $aCorners[0] . ',
  615. corners2=' . $aCorners[1] . ',
  616. gebeurtenissen="' . $sVerslag . '",
  617. lengte = ' . $iWedstrijdLengte . '
  618. WHERE
  619. id=' . $aResult1->id;
  620. $iResult12 = mysql_query($sQuery12) or die($sQuery12 . '<br />' . mysql_error());
  621. $aDoelpunten = array();
  622. $aDoelpunten[0] = sizeof($aGoals[0]) - sizeof($aGoals[1]);
  623. $aDoelpunten[1] = sizeof($aGoals[1]) - sizeof($aGoals[0]);
  624. for ( $i = 0; $i <= 1; $i ++ ) {
  625. $sQuery13 = '
  626. UPDATE
  627. teams
  628. SET
  629. points=points+' . $aPunten[$i] . ',
  630. ' . $aSoort[$i] . '=' . $aSoort[$i] . '+1,
  631. goals=goals+' . $aDoelpunten[$i] . ',
  632. matches=matches+1
  633. WHERE
  634. id=' . $aTeamID[$i] . '
  635. ';
  636. $iResult13 = mysql_query($sQuery13);
  637. }
  638. }elseif ($sSoort == "C") {
  639. $sQuery12 = '
  640. UPDATE
  641. matches
  642. SET
  643. score1=' . sizeof($aGoals[0]) . ',
  644. score2=' . sizeof($aGoals[1]) . ',
  645. balbezit1=' . $aBalbezit[0] . ',
  646. balbezit2=' . $aBalbezit[1] . ',
  647. schoten1="' . $aSchoten[0] . '/' . $aSchotenOpDoel[0] . '",
  648. schoten2="' . $aSchoten[1] . '/' . $aSchotenOpDoel[1] . '",
  649. corners1=' . $aCorners[0] . ',
  650. corners2=' . $aCorners[1] . ',
  651. ';
  652. if (sizeof($aGoals[0]) == sizeof($aGoals[1])) $sQuery12 .= 'penalties="' . $aPenalties[0] . '-' . $aPenalties[1] . '",';
  653. $sQuery12 .= '
  654. gebeurtenissen="' . $sVerslag . '",
  655. lengte = ' . $iWedstrijdLengte . '
  656. WHERE
  657. id=' . $aResult1->id;
  658. $iResult12 = mysql_query($sQuery12) or die($sQuery12 . '<br />' . mysql_error());
  659. }
  660. }
  661. if ($sSoort == "L") {
  662. $sQuery14 = 'SELECT * FROM teams WHERE land=' . $aResult->id . ' ORDER BY points DESC, goals DESC';
  663. $iResult14 = mysql_query($sQuery14);
  664. $P = 1;
  665. while ( $aObject14 = mysql_fetch_object($iResult14) ) {
  666. if ($aObject14->matches == 0) {
  667. $iBest = $P;
  668. }else{
  669. if ($P < $aObject14->best_position) {
  670. $iBest = $P;
  671. }else{
  672. $iBest = $aObject14->best_position;
  673. }
  674. }
  675. $sQuery15 = 'UPDATE teams SET position=' . $P . ', best_position = ' . $iBest . ' WHERE id=' . $aObject14->id . '';
  676. $iResult15 = mysql_query($sQuery15);
  677. $P ++;
  678. }
  679. $sQuery16 = 'UPDATE competities SET week=week+1 WHERE id='. $aResult->id;
  680. $iResult16 = mysql_query($sQuery16) or die($sQuery16 . '<br />' . mysql_error());
  681. }elseif ($sSoort == "C") {
  682. $aTeams2 = array();
  683. $sQuery14 = 'SELECT * FROM teams WHERE land=' . $aResult->id;
  684. $iResult14 = mysql_query($sQuery14);
  685. while ( $aObject14 = mysql_fetch_object($iResult14) ) {
  686. $aTeams2[$aObject14->name] = $aObject14->name;
  687. }
  688. $iTeams = count($aTeams2);
  689. $sQuery13 = 'SELECT * FROM matches WHERE soort="C" AND land=' . $aResult->id . ' ORDER BY week ASC';
  690. $iResult13 = mysql_query($sQuery13);
  691. while ( $aObject13 = mysql_fetch_object($iResult13) ) {
  692. if ($aObject13->ronde == 0 && $aResult->cup == 0 && $iTeams > 18) {
  693. unset($aTeams2[$aObject13->team2]);
  694. unset($aTeams2[$aObject13->team1]);
  695. continue;
  696. }
  697. if ($aObject13->score1 > $aObject13->score2) {
  698. unset($aTeams2[$aObject13->team2]);
  699. }elseif ($aObject13->score1 < $aObject13->score2) {
  700. unset($aTeams2[$aObject13->team1]);
  701. }else{
  702. $aPen = explode('-', $aObject13->penalties);
  703. if (intval($aPen[0]) > intval($aPen[1])) unset($aTeams2[$aObject13->team2]);
  704. else unset($aTeams2[$aObject13->team1]);
  705. }
  706. }
  707. shuffle($aTeams2);
  708. if (sizeof($aTeams2) > 1) {
  709. $aCupFixtures = generateCupFixtures($aTeams2);
  710.  
  711. $sQuery15 = 'SELECT cup FROM competities WHERE id=' .$aResult->id;
  712. $iResult15 = mysql_query($sQuery15);
  713. $aObject15 = mysql_fetch_object($iResult15);
  714. $aWeken = array (5, 14, 23, 32, 41);
  715. for ( $i = 0; $i < sizeof($aCupFixtures); $i ++ ) {
  716. $sQuery16 = '
  717. INSERT INTO
  718. matches
  719. (
  720. land,
  721. soort,
  722. team1,
  723. team2,
  724. ronde,
  725. week
  726. )
  727. VALUES
  728. (
  729. ' . $aResult->id . ',
  730. "C",
  731. "' . $aCupFixtures[$i][0] . '",
  732. "' . $aCupFixtures[$i][1] . '",
  733. "' . ($aObject15->cup+1) . '",
  734. "' . $aWeken[$aObject15->cup+1] . '"
  735. )
  736. ';
  737. $iResult16 = mysql_query($sQuery16);
  738. }
  739. $sQuery17 = 'UPDATE competities SET week=week+1, cup=cup+1 WHERE id=' . $aResult->id;
  740. $iResult17 = mysql_query($sQuery17);
  741. }else{
  742. $sQuery17 = 'UPDATE competities SET week=week+1 WHERE id = ' . $aResult->id;
  743. $iResult17 = mysql_query($sQuery17);
  744. $sQuery18 = 'SELECT * FROM teams WHERE name = "' . $aTeams2[0] . '"';
  745. $iResult18 = mysql_query($sQuery18) or die($sQuery18 . '<br />' . mysql_error());
  746. $aObject18 = mysql_fetch_object($iResult18);
  747. if ($aObject18->trainer != '') {
  748. $sQuery19 = 'UPDATE users SET punten=punten+50 WHERE name = "' . $aObject18->trainer . '"';
  749. $iResult19 = mysql_query($sQuery19);
  750. $sBericht = '
  751. Beste ' . $aObject18->trainer . ',
  752.  
  753. Gefeliciteerd! Je hebt de beker gewonnen. Hiervoor heb je 50 punten gekregen.
  754.  
  755. MVG,
  756. Assistent manager.';
  757. sendPM($aObject18->trainer, 'Assistent Manager', 'Beker gewonnen!', $sBericht, 1);
  758. }
  759. }
  760. }
  761. }else{
  762. $sQuery2 = 'SELECT * FROM teams WHERE land = ' . $aResult->id . ' ORDER BY name ASC';
  763. $iResult2 = mysql_query($sQuery2) or die($sQuery2 . '<br />' . mysql_error());
  764. $p = 1;
  765. while ( $aObject2 = mysql_fetch_object($iResult2) ) {
  766. if ($aObject2->trainer != "") {
  767. $sQuery12 = 'SELECT * FROM users WHERE name = "' . $aObject2->trainer . '"';
  768. $iResult12 = mysql_query($sQuery12) or die($sQuery12 . '<br />' . mysql_error());
  769. $aObject12 = mysql_fetch_object($iResult12);
  770. $iPunten = $aObject2->points / $aObject2->position * 2;
  771. $sQuery11 = 'UPDATE users SET punten = punten + ' . $iPunten . ', teamID=0, competitie=0, divisie=0 WHERE name = "' . $aObject2->trainer . '"';
  772. $sQuery13 = 'INSERT INTO historie (user_id, seizoen, land, club, positie, punten) VALUES ("' . $aObject12->id . '", "' . gmdate("d-m-y") . '", ' . $aObject2->land . ', "' . $aObject2->name . '", ' . $aObject2->position . ', ' . $aObject2->points . ')';
  773. $iResult11 = mysql_query($sQuery11) or die($sQuery11 . '<br />' . mysql_error());
  774. $iResult13 = mysql_query($sQuery13) or die($sQuery13 . '<br />' . mysql_error());
  775. }
  776. }
  777. resetServer($aObject2->land);
  778. }
  779.  
  780. $sQueryG = 'UPDATE competities SET simuleren = 0 WHERE id = ' . $aResult->id;
  781. $iResultG = mysql_query($sQueryG);
  782. }
  783.  
  784.  
  785. include 'training_cron.php';
  786.  
  787. $sQueryA = 'DELETE FROM sponsors WHERE weken = 1';
  788. $sQueryB = 'UPDATE sponsors SET weken = weken - 1 WHERE weken > 1';
  789. $sQueryC = 'UPDATE users SET premiumdagen = premiumdagen - 1 WHERE teamID != 0 AND premiumdagen > 1 AND rank = "user"';
  790. $sQueryD = 'UPDATE users SET premium = 0, premiumdagen = 0 WHERE premiumdagen = 1';
  791. $iResultA = mysql_query($sQueryA);
  792. $iResultB = mysql_query($sQueryB);
  793. $iResultC = mysql_query($sQueryC);
  794. $iResultD = mysql_query($sQueryD);
  795.  
  796. $sQueryQ = 'SELECT * FROM users WHERE verwijderd < 6';
  797. $iResultQ = mysql_query($sQueryQ);
  798. while ( $aObjectQ = mysql_fetch_object($iResultQ) ) {
  799. if ($aObjectQ->verwijderd == 0) {
  800. $sQueryR = 'UPDATE teams SET trainer = "" WHERE trainer = "' . $aObjectQ->name . '"';
  801. $iResultR = mysql_query($sQueryR);
  802. $sQueryT = 'DELETE FROM users WHERE id = ' . $aObjectQ->id;
  803. $iResultT = mysql_query($sQueryT);
  804. }else{
  805. $sQueryR = 'UPDATE users SET verwijderd = verwijderd - 1 WHERE id = ' . $aObjectQ->id;
  806. $iResultR = mysql_query($sQueryR);
  807. }
  808. }
  809.  
  810. $sQueryI = 'UPDATE users SET ban = ban - 1 WHERE ban > 0 AND ban < 100';
  811. $iResultI = mysql_query($sQueryI);
  812.  
  813. $sQueryX = 'SELECT * FROM scouts';
  814. $iResultX = mysql_query($sQueryX);
  815. $aPos = array ( 1 => 'A', 'M', 'V', 'K');
  816. while ( $aObjectX = mysql_fetch_object($iResultX) ) {
  817. $sQueryZ = 'SELECT land, trainer FROM teams WHERE id = ' . $aObjectX->team_id;
  818. $iResultZ = mysql_query($sQueryZ);
  819. $aObjectZ = mysql_fetch_object($iResultZ);
  820.  
  821. $aNaam = explode('-', generateName());
  822. $sNaam = $aNaam[0];
  823. $sLand = $aNaam[1];
  824. $iLeeftijd = rand(17, 19);
  825. $sPos = $aPos[rand(1, 4)];
  826. if ($sPos == 'A') {
  827. $iAanval = rand(50, 65);
  828. $iMiddenveld = rand(30, 50);
  829. $iVerdediging = rand(10, 30);
  830. $iKeeper = rand(0, 10);
  831. }elseif ($sPos == 'M') {
  832. $iAanval = rand(30, 50);
  833. $iMiddenveld = rand(50, 65);
  834. $iVerdediging = rand(30, 50);
  835. $iKeeper = rand(0, 10);
  836. }elseif ($sPos == 'V') {
  837. $iAanval = rand(10, 30);
  838. $iMiddenveld = rand(30, 50);
  839. $iVerdediging = rand(50, 65);
  840. $iKeeper = rand(5, 15);
  841. }elseif ($sPos == 'K') {
  842. $iAanval = rand(0, 10);
  843. $iMiddenveld = rand(0, 10);
  844. $iVerdediging = rand(0, 15);
  845. $iKeeper = rand(50, 65);
  846. }
  847. $aSkills = array ( 'A' => $iAanval, 'M' => $iMiddenveld, 'V' => $iVerdediging, 'K' => $iKeeper );
  848. $iWaarde = (pow($aSkills[$sPos], 5) / ($iLeeftijd * 10)) / 2.5;
  849.  
  850. $sQueryP = 'INSERT INTO players (name,land,teamID,position,age,aanval,middenveld,verdediging,keeper,country,waarde) VALUES ("'.$sNaam.'", "' . $aObjectZ->land . '", "'.$aObjectX->team_id.'", "' . $sPos . '", ' . $iLeeftijd . ', "' . $iAanval . '", "' . $iMiddenveld . '", "' . $iVerdediging . '", "' . $iKeeper . '", "'.$sLand.'", "'.$iWaarde.'")';
  851. $iResultP = mysql_query($sQueryP);
  852. $iPlayerID = mysql_insert_id();
  853.  
  854. $sBericht = '
  855. Beste ' . $aObjectZ->trainer . ',
  856.  
  857. De scout is terug gekomen en heeft een speler aan je selectie toegevoegd.
  858. De speler heet <a href="player.php?id=' . $iPlayerID . '">' . $sNaam . '</a> en hij is ' . $iLeeftijd . ' jaar oud.
  859.  
  860. Met vriendelijke groet,
  861. Assistent Manager';
  862.  
  863. sendPM($aObjectZ->trainer, 'Assistent Manager', 'Scout is terug', $sBericht, 1);
  864.  
  865. $sQueryE = 'UPDATE teams SET scout = scout + 1 WHERE id = ' . $aObjectX->team_id;
  866. $iResultE = mysql_query($sQueryE);
  867.  
  868. $sQueryF = 'DELETE FROM scouts WHERE team_id = ' . $aObjectX->team_id;
  869. $iResultF = mysql_query($sQueryF);
  870. }
  871.  
  872.  
  873.  
  874. echo 'Wedstrijden gespeeld.';
  875. ?>
Advertisement
Add Comment
Please, Sign In to add comment