PageRenderTime 54ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/extensions/jlextdfbnetplayerimport/admin/views/jlextdfbnetplayerimport/tmpl/default_edit_old.php

https://gitlab.com/julienv/joomleague
PHP | 1383 lines | 1322 code | 44 blank | 17 comment | 187 complexity | 93ba40f9438cec319836037a4870705b MD5 | raw file
  1. <?php defined('_JEXEC') or die('Restricted access');
  2. JHTML::_('behavior.tooltip');
  3. //$document =& JFactory::getDocument();
  4. //$document->addScript( JURI::base() . 'components/com_joomleague/assets/js/JL_import.js' );
  5. if (isset($this->xml) && is_array($this->xml))
  6. {
  7. {
  8. //echo 'this<pre>'.print_r($this,true).'</pre>';
  9. if (array_key_exists('exportversion',$this->xml))
  10. {
  11. $exportversion =& $this->xml['exportversion'];
  12. }
  13. if (array_key_exists('project',$this->xml))
  14. {
  15. $proj =& $this->xml['project'];
  16. }
  17. if (array_key_exists('team',$this->xml))
  18. {
  19. $teams =& $this->xml['team'];
  20. }
  21. if (array_key_exists('club',$this->xml))
  22. {
  23. $clubs =& $this->xml['club'];
  24. }
  25. if (array_key_exists('playground',$this->xml))
  26. {
  27. $playgrounds =& $this->xml['playground'];
  28. }
  29. if (array_key_exists('league',$this->xml))
  30. {
  31. $league =& $this->xml['league'];
  32. }
  33. if (array_key_exists('season',$this->xml))
  34. {
  35. $season =& $this->xml['season'];
  36. }
  37. if (array_key_exists('sportstype',$this->xml))
  38. {
  39. $sportstype =& $this->xml['sportstype'];
  40. }
  41. if (array_key_exists('person',$this->xml))
  42. {
  43. $persons =& $this->xml['person'];
  44. }
  45. if (array_key_exists('event',$this->xml))
  46. {
  47. $events =& $this->xml['event'];
  48. }
  49. if (array_key_exists('position',$this->xml))
  50. {
  51. $positions =& $this->xml['position'];
  52. }
  53. if (array_key_exists('parentposition',$this->xml))
  54. {
  55. $parentpositions =& $this->xml['parentposition'];
  56. }
  57. if (array_key_exists('statistic',$this->xml))
  58. {
  59. $statistics =& $this->xml['statistic'];
  60. }
  61. }
  62. $xmlProjectImport=true;
  63. $xmlImportType='';
  64. if (!isset($proj))
  65. {
  66. $xmlProjectImport=false;
  67. if (isset($clubs))
  68. {
  69. $xmlImportType='clubs'; // There shouldn't be any problems with import of clubs-xml-export files
  70. $xmlImportTitle='Standart XML-Import of JoomLeague Clubs';
  71. $teamsClubs=$clubs;
  72. }
  73. elseif (isset($events)) // There shouldn't be any problems with import of events-xml-export files
  74. {
  75. $xmlImportType='events';
  76. $xmlImportTitle='Standart XML-Import of JoomLeague Events';
  77. }
  78. elseif (isset($positions)) // There shouldn't be any problems with import of positions-xml-export files
  79. { // maybe the positions export routine should also export position_eventtype and events
  80. $xmlImportType='positions';
  81. $xmlImportTitle='Standart XML-Import of JoomLeague Positions';
  82. }
  83. elseif (isset($parentpositions)) // There shouldn't be any problems with import of positions-xml-export files
  84. { // maybe the positions export routine should also export position_eventtype and events
  85. $xmlImportType='positions';
  86. $xmlImportTitle='Standart XML-Import of JoomLeague Positions';
  87. }
  88. elseif (isset($persons)) // There shouldn't be any problems with import of persons-xml-export files
  89. {
  90. $xmlImportType='persons';
  91. $xmlImportTitle='Standart XML-Import of JoomLeague Persons';
  92. }
  93. elseif (isset($playgrounds)) // There shouldn't be any problems with import of statistics-xml-export files
  94. {
  95. $xmlImportType='playgrounds';
  96. $xmlImportTitle='Standart XML-Import of JoomLeague Playgrounds';
  97. }
  98. elseif (isset($statistics)) // There shouldn't be any problems with import of statistics-xml-export files
  99. { // maybe the statistic export routine should also export position_statistic and positions
  100. $xmlImportType='statistics';
  101. $xmlImportTitle='Standart XML-Import of JoomLeague Statistics';
  102. }
  103. elseif (isset($teams)) // There shouldn't be any problems with import of teams-xml-export files
  104. {
  105. $xmlImportType='teams';
  106. $xmlImportTitle='Standart XML-Import of JoomLeague Teams';
  107. $teamsClubs=$teams;
  108. }
  109. JError::raiseNotice(500,JText::_($xmlImportTitle));
  110. }
  111. else
  112. {
  113. $teamsClubs=$teams;
  114. }
  115. if (!empty($teamsClubs)){$teamsClubsCount=count($teamsClubs);}
  116. ?>
  117. <script language="javascript" type="text/javascript"><!--
  118. function trim(stringToTrim)
  119. {
  120. return stringToTrim.replace(/^\s+|\s+$/g,"");
  121. }
  122. function checkAllCustom(n,fldName)
  123. {
  124. if (!fldName) { fldName='tc'; }
  125. var f=document.adminForm;
  126. var c=f.toggleTeamsClubs.checked;
  127. var n2=0;
  128. for (i=0; i < n; i++)
  129. {
  130. tc=eval('f.' + fldName + '' + i);
  131. if (tc)
  132. {
  133. tc.checked=c;
  134. testTeamsClubsData(tc,tc.value);
  135. n2++;
  136. }
  137. }
  138. }
  139. function testTeamsClubsData(box,id)
  140. {
  141. if (box.checked)
  142. {
  143. <?php
  144. if (!empty($teams))
  145. {
  146. ?>
  147. eval("document.adminForm.chooseTeam_"+id+".disabled=true");
  148. eval("document.adminForm.chooseTeam_"+id+".checked=false");
  149. eval("document.adminForm.selectTeam_"+id+".disabled=true");
  150. eval("document.adminForm.selectTeam_"+id+".checked=false");
  151. eval("document.adminForm.createTeam_"+id+".disabled=false");
  152. eval("document.adminForm.createTeam_"+id+".checked=true");
  153. eval("document.adminForm.teamName_"+id+".disabled=false");
  154. eval("document.adminForm.teamShortname_"+id+".disabled=false");
  155. eval("document.adminForm.teamInfo_"+id+".disabled=false");
  156. eval("document.adminForm.teamMiddleName_"+id+".disabled=false");
  157. <?php
  158. }
  159. ?>
  160. <?php
  161. if (!empty($clubs))
  162. {
  163. ?>
  164. eval("document.adminForm.chooseClub_"+id+".disabled=true");
  165. eval("document.adminForm.chooseClub_"+id+".checked=false");
  166. eval("document.adminForm.selectClub_"+id+".disabled=true");
  167. eval("document.adminForm.selectClub_"+id+".checked=false");
  168. eval("document.adminForm.createClub_"+id+".disabled=false");
  169. eval("document.adminForm.createClub_"+id+".checked=true");
  170. eval("document.adminForm.clubName_"+id+".disabled=false");
  171. eval("document.adminForm.clubCountry_"+id+".disabled=false");
  172. eval("document.adminForm.clubID_"+id+".disabled=false");
  173. <?php
  174. }
  175. ?>
  176. }
  177. else
  178. {
  179. <?php
  180. if (!empty($teams))
  181. {
  182. ?>
  183. if (eval("document.adminForm.selectTeam_"+id+".value!=''")){
  184. eval("document.adminForm.chooseTeam_"+id+".disabled=false");
  185. }
  186. eval("document.adminForm.selectTeam_"+id+".disabled=false");
  187. eval("document.adminForm.selectTeam_"+id+".checked=false");
  188. eval("document.adminForm.createTeam_"+id+".checked=false");
  189. eval("document.adminForm.teamName_"+id+".disabled=true");
  190. eval("document.adminForm.teamShortname_"+id+".disabled=true");
  191. eval("document.adminForm.teamInfo_"+id+".disabled=true");
  192. eval("document.adminForm.teamMiddleName_"+id+".disabled=true");
  193. <?php
  194. }
  195. ?>
  196. <?php
  197. if (!empty($clubs))
  198. {
  199. ?>
  200. if (eval("document.adminForm.selectClub_"+id+".value!=''")){
  201. eval("document.adminForm.chooseClub_"+id+".disabled=false");
  202. }
  203. eval("document.adminForm.selectClub_"+id+".disabled=false");
  204. eval("document.adminForm.selectClub_"+id+".checked=false");
  205. eval("document.adminForm.createClub_"+id+".checked=false");
  206. eval("document.adminForm.clubName_"+id+".disabled=true");
  207. eval("document.adminForm.clubCountry_"+id+".disabled=true");
  208. eval("document.adminForm.clubID_"+id+".disabled=true");
  209. <?php
  210. }
  211. ?>
  212. }
  213. }
  214. function checkAllPlaygrounds(n,fldName)
  215. {
  216. if (!fldName) { fldName='pl'; }
  217. var f=document.adminForm;
  218. var c=f.togglePlaygrounds.checked;
  219. var n5=0;
  220. for (i=0; i < n; i++)
  221. {
  222. pl=eval('f.' + fldName + '' + i);
  223. if (pl)
  224. {
  225. pl.checked=c;
  226. testPlaygroundData(pl,pl.value);
  227. n5++;
  228. }
  229. }
  230. }
  231. function testPlaygroundData(box,id)
  232. {
  233. if (box.checked)
  234. {
  235. eval("document.adminForm.choosePlayground_"+id+".disabled=true");
  236. eval("document.adminForm.choosePlayground_"+id+".checked=false");
  237. eval("document.adminForm.selectPlayground_"+id+".disabled=true");
  238. eval("document.adminForm.selectPlayground_"+id+".checked=false");
  239. eval("document.adminForm.createPlayground_"+id+".disabled=false");
  240. eval("document.adminForm.createPlayground_"+id+".checked=true");
  241. eval("document.adminForm.playgroundName_"+id+".disabled=false");
  242. eval("document.adminForm.playgroundShortname_"+id+".disabled=false");
  243. eval("document.adminForm.playgroundID_"+id+".disabled=false");
  244. }
  245. else
  246. {
  247. if (eval("document.adminForm.selectPlayground_"+id+".value!=''")){
  248. eval("document.adminForm.choosePlayground_"+id+".disabled=false");
  249. }
  250. eval("document.adminForm.selectPlayground_"+id+".disabled=false");
  251. eval("document.adminForm.selectPlayground_"+id+".checked=false");
  252. eval("document.adminForm.createPlayground_"+id+".checked=false");
  253. eval("document.adminForm.playgroundName_"+id+".disabled=true");
  254. eval("document.adminForm.playgroundShortname_"+id+".disabled=true");
  255. eval("document.adminForm.playgroundID_"+id+".disabled=true");
  256. }
  257. }
  258. function checkAllEvents(n,fldName)
  259. {
  260. if (!fldName) { fldName='ev'; }
  261. var f=document.adminForm;
  262. var c=f.toggleEvents.checked;
  263. var n5=0;
  264. for (i=0; i < n; i++)
  265. {
  266. ev=eval('f.' + fldName + '' + i);
  267. if (ev)
  268. {
  269. ev.checked=c;
  270. testEventsData(ev,ev.value);
  271. n5++;
  272. }
  273. }
  274. }
  275. function testEventsData(box,id)
  276. {
  277. if (box.checked)
  278. {
  279. eval("document.adminForm.chooseEvent_"+id+".disabled=true");
  280. eval("document.adminForm.chooseEvent_"+id+".checked=false");
  281. eval("document.adminForm.selectEvent_"+id+".disabled=true");
  282. eval("document.adminForm.selectEvent_"+id+".checked=false");
  283. eval("document.adminForm.createEvent_"+id+".disabled=false");
  284. eval("document.adminForm.createEvent_"+id+".checked=true");
  285. eval("document.adminForm.eventName_"+id+".disabled=false");
  286. eval("document.adminForm.eventID_"+id+".disabled=false");
  287. }
  288. else
  289. {
  290. if (eval("document.adminForm.selectEvent_"+id+".value!=''")){
  291. eval("document.adminForm.chooseEvent_"+id+".disabled=false");
  292. }
  293. eval("document.adminForm.selectEvent_"+id+".disabled=false");
  294. eval("document.adminForm.selectEvent_"+id+".checked=false");
  295. eval("document.adminForm.createEvent_"+id+".checked=false");
  296. eval("document.adminForm.eventName_"+id+".disabled=true");
  297. eval("document.adminForm.eventID_"+id+".disabled=true");
  298. }
  299. }
  300. function checkAllParentPositions(n,fldName)
  301. {
  302. if (!fldName) { fldName='pp'; }
  303. var f=document.adminForm;
  304. var c=f.toggleParentPositions.checked;
  305. var n5=0;
  306. for (i=0; i < n; i++)
  307. {
  308. pp=eval('f.' + fldName + '' + i);
  309. if (pp) {
  310. pp.checked=c;
  311. testParentPositionsData(pp,pp.value);
  312. n5++;
  313. }
  314. }
  315. }
  316. function testParentPositionsData(box,id)
  317. {
  318. if (box.checked)
  319. {
  320. eval("document.adminForm.chooseParentPosition_"+id+".disabled=true");
  321. eval("document.adminForm.chooseParentPosition_"+id+".checked=false");
  322. eval("document.adminForm.selectParentPosition_"+id+".disabled=true");
  323. eval("document.adminForm.selectParentPosition_"+id+".checked=false");
  324. eval("document.adminForm.createParentPosition_"+id+".disabled=false");
  325. eval("document.adminForm.createParentPosition_"+id+".checked=true");
  326. eval("document.adminForm.parentPositionName_"+id+".disabled=false");
  327. eval("document.adminForm.parentPositionID_"+id+".disabled=false");
  328. }
  329. else
  330. {
  331. if (eval("document.adminForm.selectParentPosition_"+id+".value!=''")){
  332. eval("document.adminForm.chooseParentPosition_"+id+".disabled=false");
  333. }
  334. eval("document.adminForm.selectParentPosition_"+id+".disabled=false");
  335. eval("document.adminForm.selectParentPosition_"+id+".checked=false");
  336. eval("document.adminForm.createParentPosition_"+id+".checked=false");
  337. eval("document.adminForm.parentPositionName_"+id+".disabled=true");
  338. eval("document.adminForm.parentPositionID_"+id+".disabled=true");
  339. }
  340. }
  341. function checkAllPositions(n,fldName)
  342. {
  343. if (!fldName) { fldName='po'; }
  344. var f=document.adminForm;
  345. var c=f.togglePositions.checked;
  346. var n5=0;
  347. for (i=0; i < n; i++)
  348. {
  349. po=eval('f.' + fldName + '' + i);
  350. if (po)
  351. {
  352. po.checked=c;
  353. testPositionsData(po,po.value);
  354. n5++;
  355. }
  356. }
  357. }
  358. function testPositionsData(box,id)
  359. {
  360. if (box.checked)
  361. {
  362. eval("document.adminForm.choosePosition_"+id+".disabled=true");
  363. eval("document.adminForm.choosePosition_"+id+".checked=false");
  364. eval("document.adminForm.selectPosition_"+id+".disabled=true");
  365. eval("document.adminForm.selectPosition_"+id+".checked=false");
  366. eval("document.adminForm.createPosition_"+id+".disabled=false");
  367. eval("document.adminForm.createPosition_"+id+".checked=true");
  368. eval("document.adminForm.positionName_"+id+".disabled=false");
  369. eval("document.adminForm.positionID_"+id+".disabled=false");
  370. }
  371. else
  372. {
  373. if (eval("document.adminForm.selectPosition_"+id+".value!=''")){
  374. eval("document.adminForm.choosePosition_"+id+".disabled=false");
  375. }
  376. eval("document.adminForm.selectPosition_"+id+".disabled=false");
  377. eval("document.adminForm.selectPosition_"+id+".checked=false");
  378. eval("document.adminForm.createPosition_"+id+".checked=false");
  379. eval("document.adminForm.positionName_"+id+".disabled=true");
  380. eval("document.adminForm.positionID_"+id+".disabled=true");
  381. }
  382. }
  383. function checkAllStatistics(n,fldName)
  384. {
  385. if (!fldName) { fldName='st'; }
  386. var f=document.adminForm;
  387. var c=f.toggleStatistics.checked;
  388. var n5=0;
  389. for (i=0; i < n; i++)
  390. {
  391. st=eval('f.' + fldName + '' + i);
  392. if (st)
  393. {
  394. st.checked=c;
  395. testStatisticsData(st,st.value);
  396. n5++;
  397. }
  398. }
  399. }
  400. function testStatisticsData(box,id)
  401. {
  402. if (box.checked)
  403. {
  404. eval("document.adminForm.chooseStatistic_"+id+".disabled=true");
  405. eval("document.adminForm.chooseStatistic_"+id+".checked=false");
  406. eval("document.adminForm.selectStatistic_"+id+".disabled=true");
  407. eval("document.adminForm.selectStatistic_"+id+".checked=false");
  408. eval("document.adminForm.createStatistic_"+id+".disabled=false");
  409. eval("document.adminForm.createStatistic_"+id+".checked=true");
  410. eval("document.adminForm.statisticName_"+id+".disabled=false");
  411. eval("document.adminForm.statisticID_"+id+".disabled=false");
  412. }
  413. else
  414. {
  415. if (eval("document.adminForm.selectStatistic_"+id+".value!=''")){
  416. eval("document.adminForm.chooseStatistic_"+id+".disabled=false");
  417. }
  418. eval("document.adminForm.selectStatistic_"+id+".disabled=false");
  419. eval("document.adminForm.selectStatistic_"+id+".checked=false");
  420. eval("document.adminForm.createStatistic_"+id+".checked=false");
  421. eval("document.adminForm.statisticName_"+id+".disabled=true");
  422. eval("document.adminForm.statisticID_"+id+".disabled=true");
  423. }
  424. }
  425. function checkAllPersons(n,fldName)
  426. {
  427. if (!fldName) { fldName='pe'; }
  428. var f=document.adminForm;
  429. var c=f.togglePersons.checked;
  430. var n5=0;
  431. for (i=0; i < n; i++)
  432. {
  433. pe=eval('f.' + fldName + '' + i);
  434. if (pe)
  435. {
  436. pe.checked=c;
  437. testPersonsData(pe,pe.value);
  438. n5++;
  439. }
  440. }
  441. }
  442. function testPersonsData(box,id)
  443. {
  444. if (box.checked)
  445. {
  446. eval("document.adminForm.choosePerson_"+id+".disabled=true");
  447. eval("document.adminForm.choosePerson_"+id+".checked=false");
  448. eval("document.adminForm.selectPerson_"+id+".disabled=true");
  449. eval("document.adminForm.selectPerson_"+id+".checked=false");
  450. eval("document.adminForm.createPerson_"+id+".disabled=false");
  451. eval("document.adminForm.createPerson_"+id+".checked=true");
  452. eval("document.adminForm.personLastname_"+id+".disabled=false");
  453. eval("document.adminForm.personFirstname_"+id+".disabled=false");
  454. eval("document.adminForm.personNickname_"+id+".disabled=false");
  455. eval("document.adminForm.personBirthday_"+id+".disabled=false");
  456. eval("document.adminForm.personID_"+id+".disabled=false");
  457. }
  458. else
  459. {
  460. if (eval("document.adminForm.selectPerson_"+id+".value!=''")){
  461. eval("document.adminForm.choosePerson_"+id+".disabled=false");
  462. }
  463. eval("document.adminForm.selectPerson_"+id+".disabled=false");
  464. eval("document.adminForm.selectPerson_"+id+".checked=false");
  465. eval("document.adminForm.createPerson_"+id+".checked=false");
  466. eval("document.adminForm.personLastname_"+id+".disabled=true");
  467. eval("document.adminForm.personFirstname_"+id+".disabled=true");
  468. eval("document.adminForm.personNickname_"+id+".disabled=true");
  469. eval("document.adminForm.personBirthday_"+id+".disabled=true");
  470. eval("document.adminForm.personID_"+id+".disabled=true");
  471. }
  472. }
  473. function chkFormular()
  474. {
  475. return true;
  476. var message='';
  477. <?php
  478. if (($xmlProjectImport) || ($xmlImportType=='events') || ($xmlImportType=='positions'))
  479. {
  480. ?>
  481. if (((document.adminForm.sportstype.selectedIndex=='0') && (document.adminForm.sportstypeNew.disabled) &&
  482. (!document.adminForm.newSportsTypeCheck.checked)) ||
  483. ((document.adminForm.sportstypeNew.disabled==false) && (trim(document.adminForm.sportstypeNew.value)=='')))
  484. {
  485. message+="<?php echo JText::_('Sports type is missing!'); ?>\n";
  486. }
  487. <?php
  488. if ($xmlProjectImport)
  489. {
  490. ?>
  491. if (trim(document.adminForm.name.value)=='')
  492. {
  493. message+="<?php echo JText::_('Please select name of this project!'); ?>\n";
  494. }
  495. if (((document.adminForm.league.selectedIndex=='0') && (document.adminForm.leagueNew.disabled)) ||
  496. ((document.adminForm.leagueNew.disabled==false) && (trim(document.adminForm.leagueNew.value)=='')))
  497. {
  498. message+="<?php echo JText::_('League is missing!'); ?>\n";
  499. }
  500. if (((document.adminForm.season.selectedIndex=='0') && (document.adminForm.seasonNew.disabled)) ||
  501. ((document.adminForm.seasonNew.disabled==false) && (trim(document.adminForm.seasonNew.value)=='')))
  502. {
  503. message+="<?php echo JText::_('Season is missing!'); ?>\n";
  504. }
  505. <?php
  506. }
  507. }
  508. ?>
  509. <?php
  510. if (isset($teams) && count($teams) > 0)
  511. {
  512. for ($counter=0; $counter < count($teams); $counter++)
  513. {
  514. ?>
  515. if (((document.adminForm.chooseTeam_<?php echo $counter; ?>.checked==false) &&
  516. (document.adminForm.createTeam_<?php echo $counter; ?>.checked==false)) ||
  517. ((trim(document.adminForm.teamName_<?php echo $counter; ?>.value)=='') ||
  518. (trim(document.adminForm.teamShortname_<?php echo $counter; ?>.value)=='') ||
  519. (trim(document.adminForm.teamMiddleName_<?php echo $counter; ?>.value)=='')))
  520. {
  521. message+='<?php echo JText::sprintf('No data selected for team [%1$s]',addslashes($teams[$counter]->name)); ?>\n';
  522. }
  523. <?php
  524. }
  525. }
  526. ?>
  527. <?php
  528. if (isset($clubs) && count($clubs) > 0)
  529. {
  530. //$maxCounter=(!empty($teams)) ? count($teams) : count($teamsClubs);
  531. $maxCounter=((isset($clubs) && count($clubs) > 0)) ? count($clubs) : count($teams);
  532. //echo $maxCounter;
  533. for ($counter=0; $counter < $maxCounter; $counter++)
  534. {
  535. ?>
  536. if (((document.adminForm.chooseClub_<?php echo $counter; ?>.checked==false) &&
  537. (document.adminForm.createClub_<?php echo $counter; ?>.checked==false)) ||
  538. ((trim(document.adminForm.clubName_<?php echo $counter; ?>.value)=='') ||
  539. (trim(document.adminForm.clubCountry_<?php echo $counter; ?>.value)=='')))
  540. {
  541. message+='<?php echo JText::sprintf('No data selected for club [%1$s]',addslashes($clubs[$counter]->name)); ?>\n';
  542. }
  543. <?php
  544. }
  545. }
  546. ?>
  547. <?php
  548. if ((isset($playgrounds)) && (count($playgrounds) > 0))
  549. {
  550. for ($counter=0; $counter < count($playgrounds); $counter++)
  551. {
  552. ?>
  553. if (((document.adminForm.choosePlayground_<?php echo $counter; ?>.checked==false) &&
  554. (document.adminForm.createPlayground_<?php echo $counter; ?>.checked==false)) ||
  555. ((trim(document.adminForm.playgroundName_<?php echo $counter; ?>.value)=='') ||
  556. (trim(document.adminForm.playgroundShortname_<?php echo $counter; ?>.value)=='')))
  557. {
  558. message+='<?php echo JText::sprintf('No data selected for playground [%1$s]',addslashes($playgrounds[$counter]->name)); ?>\n';
  559. }
  560. <?php
  561. }
  562. }
  563. ?>
  564. <?php
  565. if ((isset($events)) && (count($events) > 0))
  566. {
  567. for ($counter=0; $counter < count($events); $counter++)
  568. {
  569. ?>
  570. if (((document.adminForm.chooseEvent_<?php echo $counter; ?>.checked==false) &&
  571. (document.adminForm.createEvent_<?php echo $counter; ?>.checked==false)) ||
  572. (trim(document.adminForm.eventName_<?php echo $counter; ?>.value)==''))
  573. {
  574. message+='<?php echo JText::sprintf('No data selected for event [%1$s]',addslashes($events[$counter]->name)); ?>\n';
  575. }
  576. <?php
  577. }
  578. }
  579. ?>
  580. <?php
  581. if ((isset($parentpositions)) && (count($parentpositions) > 0))
  582. {
  583. for ($counter=0; $counter < count($parentpositions); $counter++)
  584. {
  585. ?>
  586. if (((document.adminForm.chooseParentPosition_<?php echo $counter; ?>.checked==false) &&
  587. (document.adminForm.createParentPosition_<?php echo $counter; ?>.checked==false)) ||
  588. (trim(document.adminForm.parentPositionName_<?php echo $counter; ?>.value)==''))
  589. {
  590. message+='<?php echo JText::sprintf('No data selected for parentposition [%1$s]',addslashes($parentpositions[$counter]->name)); ?>\n';
  591. }
  592. <?php
  593. }
  594. }
  595. ?>
  596. <?php
  597. if ((isset($positions)) && (count($positions) > 0))
  598. {
  599. for ($counter=0; $counter < count($positions); $counter++)
  600. {
  601. ?>
  602. if (((document.adminForm.choosePosition_<?php echo $counter; ?>.checked==false) &&
  603. (document.adminForm.createPosition_<?php echo $counter; ?>.checked==false)) ||
  604. (trim(document.adminForm.positionName_<?php echo $counter; ?>.value)==''))
  605. {
  606. message+='<?php echo JText::sprintf('No data selected for position [%1$s]',addslashes($positions[$counter]->name)); ?>\n';
  607. }
  608. <?php
  609. }
  610. }
  611. ?>
  612. <?php
  613. if ((isset($statistics)) && (count($statistics) > 0))
  614. {
  615. for ($counter=0; $counter < count($statistics); $counter++)
  616. {
  617. ?>
  618. if (((document.adminForm.chooseStatistic_<?php echo $counter; ?>.checked==false) &&
  619. (document.adminForm.createStatistic_<?php echo $counter; ?>.checked==false)) ||
  620. (trim(document.adminForm.statisticName_<?php echo $counter; ?>.value)==''))
  621. {
  622. message+='<?php echo JText::sprintf('No data selected for statistic [%1$s]',addslashes($statistics[$counter]->name)); ?>\n';
  623. }
  624. <?php
  625. }
  626. }
  627. ?>
  628. <?php
  629. if ((isset($persons)) && (count($persons) > 0))
  630. {
  631. for ($counter=0; $counter < count($persons); $counter++)
  632. {
  633. ?>
  634. if(document.adminForm.choosePerson_<?php echo $counter; ?>.checked==false) {
  635. if ((document.adminForm.createPerson_<?php echo $counter; ?>.checked==false)||
  636. ((trim(document.adminForm.personLastname_<?php echo $counter; ?>.value)=='') ||
  637. (trim(document.adminForm.personFirstname_<?php echo $counter; ?>.value)=='')))
  638. {
  639. message+='<?php echo JText::sprintf('No data selected for person [%1$s,%2$s]',addslashes($persons[$counter]->lastname),addslashes($persons[$counter]->firstname)); ?>\n';
  640. }
  641. }
  642. <?php
  643. }
  644. }
  645. ?>
  646. if (message=='')
  647. {
  648. return true;
  649. }
  650. else
  651. {
  652. alert("<?php echo JText::_('JL_ADMIN_XML_IMPORT_ERROR'); ?>\n\n"+message);
  653. return false;
  654. }
  655. }
  656. function openSelectWindow(recordid,key,selector,box,datatype)
  657. {
  658. if (datatype==1){ // Team-Selector
  659. eval("document.adminForm.chooseTeam_"+key+".checked=false");
  660. eval("document.adminForm.selectTeam_"+key+".checked=false");
  661. eval("document.adminForm.createTeam_"+key+".checked=false");
  662. eval("document.adminForm.teamName_"+key+".disabled=true");
  663. eval("document.adminForm.teamShortname_"+key+".disabled=true");
  664. eval("document.adminForm.teamInfo_"+key+".disabled=true");
  665. eval("document.adminForm.teamMiddleName_"+key+".disabled=true");
  666. }
  667. else if (datatype==2){ // Club-Selector
  668. eval("document.adminForm.chooseClub_"+key+".checked=false");
  669. eval("document.adminForm.selectClub_"+key+".checked=false");
  670. eval("document.adminForm.createClub_"+key+".checked=false");
  671. eval("document.adminForm.clubName_"+key+".disabled=true");
  672. eval("document.adminForm.clubCountry_"+key+".disabled=true");
  673. }
  674. else if (datatype==3){ // Person-Selector
  675. eval("document.adminForm.choosePerson_"+key+".checked=false");
  676. eval("document.adminForm.selectPerson_"+key+".checked=false");
  677. eval("document.adminForm.createPerson_"+key+".checked=false");
  678. eval("document.adminForm.personLastname_"+key+".disabled=true");
  679. eval("document.adminForm.personFirstname_"+key+".disabled=true");
  680. eval("document.adminForm.personNickname_"+key+".disabled=true");
  681. eval("document.adminForm.personBirthday_"+key+".disabled=true");
  682. }
  683. else if (datatype==4){ // Playground-Selector
  684. eval("document.adminForm.choosePlayground_"+key+".checked=false");
  685. eval("document.adminForm.selectPlayground_"+key+".checked=false");
  686. eval("document.adminForm.createPlayground_"+key+".checked=false");
  687. eval("document.adminForm.playgroundName_"+key+".disabled=true");
  688. eval("document.adminForm.playgroundShortname_"+key+".disabled=true");
  689. }
  690. else if (datatype==5){ // Event-Selector
  691. eval("document.adminForm.chooseEvent_"+key+".checked=false");
  692. eval("document.adminForm.selectEvent_"+key+".checked=false");
  693. eval("document.adminForm.createEvent_"+key+".checked=false");
  694. eval("document.adminForm.eventName_"+key+".disabled=true");
  695. }
  696. else if (datatype==6){ // Position-Selector
  697. eval("document.adminForm.choosePosition_"+key+".checked=false");
  698. eval("document.adminForm.selectPosition_"+key+".checked=false");
  699. eval("document.adminForm.createPosition_"+key+".checked=false");
  700. eval("document.adminForm.positionName_"+key+".disabled=true");
  701. }
  702. else if (datatype==7){ // ParentPosition-Selector
  703. eval("document.adminForm.chooseParentPosition_"+key+".checked=false");
  704. eval("document.adminForm.selectParentPosition_"+key+".checked=false");
  705. eval("document.adminForm.createParentPosition_"+key+".checked=false");
  706. eval("document.adminForm.parentPositionName_"+key+".disabled=true");
  707. }
  708. else if (datatype==8){ // Statistic-Selector
  709. eval("document.adminForm.chooseStatistic_"+key+".checked=false");
  710. eval("document.adminForm.selectStatistic_"+key+".checked=false");
  711. eval("document.adminForm.createStatistic_"+key+".checked=false");
  712. eval("document.adminForm.statisticName_"+key+".disabled=true");
  713. }
  714. //alert(datatype + "-" + recordid + "-" + key + "-" + selector + "-" + box);
  715. query='index.php?option=com_joomleague&tmpl=component&view=jlxmlimports&controller=jlxmlimport'
  716. + '&task=select'
  717. + '&type=' + datatype
  718. + '&id=' + key;
  719. //alert(query);
  720. selectWindow=window.open(query,'teamSelectWindow','width=600,height=100,scrollbars=yes,resizable=yes');
  721. selectWindow.focus();
  722. return false;
  723. }
  724. //--></script>
  725. <div id='editcell'>
  726. <a name='page_top'></a>
  727. <table class='adminlist'>
  728. <thead><tr><th><?php echo JText::_('JL_ADMIN_XML_IMPORT_TABLE_TITLE_2'); ?></th></tr></thead>
  729. <tbody>
  730. <tr>
  731. <td style='text-align:center; '>
  732. <p style='text-align:center;'><b style='color:green; '><?php echo JText::sprintf('JL_ADMIN_XML_IMPORT_UPLOAD_SUCCESS','<i>'.$this->uploadArray['name'].'</i>'); ?></b></p>
  733. <?php
  734. if ($this->import_version!='OLD')
  735. {
  736. if (isset($exportversion->exportRoutine) &&
  737. strtotime($exportversion->exportRoutine) >= strtotime('2010-09-19 23:00:00'))
  738. {
  739. ?>
  740. <p><?php
  741. echo JText::sprintf('This file was created using JoomLeague-Export-Routine dated: %1$s',$exportversion->exportRoutine).'<br />';
  742. echo JText::sprintf('Date and time of this file is: %1$s - %2$s',$exportversion->exportDate,$exportversion->exportTime).'<br />';
  743. echo JText::sprintf('The name of the Joomla-System where this file was created is: %1$s',$exportversion->exportSystem).'<br />';
  744. ?></p><?php
  745. }
  746. else
  747. {
  748. ?>
  749. <p><?php
  750. echo JText::_('This file was created by an older revision of JoomLeague 1.5.0a!').'<br />';
  751. echo JText::_('As we can not guarantee a correct processing the import routine will STOP here!!!');
  752. ?></p></td></tr></tbody></table></div><?php
  753. return;
  754. }
  755. }
  756. ?><p><?php echo JText::sprintf('JL_ADMIN_XML_IMPORT_HINT2',$this->revisionDate); ?></p>
  757. <p><?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_CLUBS_HINT'); ?></p>
  758. </td>
  759. </tr>
  760. </tbody>
  761. </table>
  762. <form name='adminForm' action='<?php echo $this->request_url; ?>' method='post' onsubmit='return chkFormular();' >
  763. <input type='hidden' name='importProject' value="<?php echo $xmlProjectImport; ?>" />
  764. <input type='hidden' name='importType' value="<?php echo $xmlImportType; ?>" />
  765. <input type='hidden' name='sent' value="2" id='sent' />
  766. <input type='hidden' name='controller' value="jlxmlimport" />
  767. <input type='hidden' name='task' value="insert" />
  768. <?php echo JHTML::_('form.token')."\n"; ?>
  769. <?php
  770. if (($xmlProjectImport) || ($xmlImportType=='events') || ($xmlImportType=='positions'))
  771. {
  772. ?>
  773. <fieldset>
  774. <legend><strong><?php echo JText::_('JL_ADMIN_XML_IMPORT_GENERAL_DATA_LEGEND'); ?></strong></legend>
  775. <table class='adminlist'>
  776. <?php
  777. if (($xmlImportType!='events') && ($xmlImportType!='positions'))
  778. {
  779. ?>
  780. <tr>
  781. <td style='background-color:#EEEEEE'><?php echo JText::_('JL_ADMIN_XML_IMPORT_PROJECT_NAME'); ?></td>
  782. <td style='background-color:#EEEEEE'>
  783. <input type='text' name='name' id='name' size='110' maxlength='100' value="<?php echo stripslashes(htmlspecialchars($proj->name)); ?>" />
  784. </td>
  785. </tr>
  786. <?php
  787. }
  788. ?>
  789. <tr>
  790. <td style='background-color:#DDDDDD'><?php echo JText::_('JL_ADMIN_XML_IMPORT_SPORTSTYPE'); ?></td>
  791. <td style='background-color:#DDDDDD'>
  792. <?php
  793. if (isset($sportstype->name))
  794. {
  795. $dSportsTypeName=$sportstype->name;
  796. }
  797. else
  798. {
  799. $dSportsTypeName=$proj->name;
  800. }
  801. if (count($this->sportstypes) > 0)
  802. {
  803. ?>
  804. <select name='sportstype' id='sportstype'>
  805. <option selected value="0"><?php echo JText::_('JL_ADMIN_XML_IMPORT_SPORTSTYPE_SELECT'); ?></option>
  806. <?php
  807. foreach ($this->sportstypes AS $row)
  808. {
  809. echo '<option ';
  810. if (($row->name==$dSportsTypeName) ||
  811. ($row->name==JText::_($dSportsTypeName)) ||
  812. (count($this->sportstypes)==1))
  813. {
  814. echo "selected='selected' ";
  815. }
  816. echo "value='$row->id;'>";
  817. echo JText::_($row->name);
  818. echo '</option>';
  819. }
  820. ?>
  821. </select>
  822. <br />
  823. <input type='checkbox' name='newSportsTypeCheck' value="1"
  824. onclick="
  825. if (this.checked) {
  826. document.adminForm.sportstype.disabled=true;
  827. document.adminForm.sportstypeNew.disabled=false;
  828. document.adminForm.sportstypeNew.value=document.adminForm.sportstypeNew.value;
  829. } else {
  830. document.adminForm.sportstype.disabled=false;
  831. document.adminForm.sportstypeNew.disabled=true;
  832. }" /><?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_NEW'); ?>
  833. <input type='text' name='sportstypeNew' size='30' maxlength='25' id='sportstypeNew' value="<?php echo stripslashes(htmlspecialchars(JText::_($dSportsTypeName))); ?>" disabled='disabled' />
  834. <?php
  835. }
  836. else
  837. {
  838. ?>
  839. <input type="hidden" name="newSportsTypeCheck" value="1" />
  840. <?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_NEW'); ?>
  841. <input type='text' name='sportstypeNew' size='30' maxlength='25' id='sportstypeNew' value="<?php echo stripslashes(htmlspecialchars(JText::_($dSportsTypeName))); ?>" />
  842. <?php
  843. }
  844. ?>
  845. </td>
  846. </tr>
  847. <?php
  848. if (($xmlImportType!='events') && ($xmlImportType!='positions'))
  849. {
  850. ?>
  851. <tr>
  852. <td style='background-color:#EEEEEE'><?php echo JText::_('JL_ADMIN_XML_IMPORT_LEAGUE'); ?></td>
  853. <td style='background-color:#EEEEEE'>
  854. <?php
  855. if (isset($league->name))
  856. {
  857. $dLeagueName=$league->name;
  858. $leagueCountry=$league->country;
  859. }
  860. else
  861. {
  862. $dLeagueName=$proj->name;
  863. $leagueCountry='';
  864. }
  865. $dCountry=$leagueCountry;
  866. if (preg_match('=^[0-9]+$=',$dCountry))
  867. {
  868. $dCountry=$this->OldCountries[(int)$dCountry];
  869. }
  870. ?>
  871. <select name='league' id='league'>
  872. <option selected value="0"><?php echo JText::_('JL_ADMIN_XML_IMPORT_LEAGUE_SELECT'); ?></option>
  873. <?php
  874. if (count($this->leagues) > 0)
  875. {
  876. foreach ($this->leagues AS $row)
  877. {
  878. echo '<option ';
  879. //if ($row->name==$dLeagueName){echo "selected='selected' ";}
  880. if (($row->name==$dLeagueName)||(count($this->leagues)==1)){echo "selected='selected' ";}
  881. echo "'value='$row->id;'>";
  882. echo $row->name;
  883. echo '</option>';
  884. }
  885. }
  886. ?>
  887. </select>
  888. <br />
  889. <?php
  890. if (count($this->leagues) < 1)
  891. {
  892. ?>
  893. <input checked='checked' type='checkbox' name='newLeagueCheck' value="1"
  894. onclick='this.checked=true;' /><?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_NEW'); ?>
  895. <input type='text' name='leagueNew' size='90' maxlength='75' id='leagueNew' value="<?php echo stripslashes(htmlspecialchars($dLeagueName)); ?>" disabled='disabled' />
  896. <script type="text/javascript">
  897. document.adminForm.newLeagueCheck.value=1;
  898. document.adminForm.league.disabled=true;
  899. document.adminForm.leagueNew.disabled=false;
  900. document.adminForm.leagueNew.value=document.adminForm.leagueNew.value;
  901. </script>
  902. <?php
  903. }
  904. else
  905. {
  906. ?>
  907. <input type='checkbox' name='newLeagueCheck' value="1"
  908. onclick="
  909. if (this.checked) {
  910. document.adminForm.league.disabled=true;
  911. document.adminForm.leagueNew.disabled=false;
  912. document.adminForm.leagueNew.value=document.adminForm.leagueNew.value;
  913. } else {
  914. document.adminForm.league.disabled=false;
  915. document.adminForm.leagueNew.disabled=true;
  916. }" /><?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_NEW'); ?>
  917. <input type='text' name='leagueNew' size='90' maxlength='75' id='leagueNew' value="<?php echo stripslashes(htmlspecialchars($dLeagueName)); ?>" disabled='disabled' />
  918. <?php
  919. }
  920. ?>
  921. </td>
  922. </tr>
  923. <tr>
  924. <td style='background-color:#DDDDDD'><?php echo JText::_('JL_ADMIN_XML_IMPORT_SEASON'); ?></td>
  925. <td style='background-color:#DDDDDD'>
  926. <?php
  927. if (isset($season->name))
  928. {
  929. $dSeasonName=$season->name;
  930. }
  931. else
  932. {
  933. $dSeasonName=$proj->name;
  934. }
  935. ?>
  936. <select name='season' id='season'>
  937. <option selected value="0"><?php echo JText::_('JL_ADMIN_XML_IMPORT_SEASON_SELECT'); ?></option>
  938. <?php
  939. if (count($this->seasons) > 0)
  940. {
  941. foreach ($this->seasons AS $row)
  942. {
  943. echo '<option ';
  944. //if ($row->name==$dSeasonName){echo "selected='selected' ";}
  945. if (($row->name==$dSeasonName)||(count($this->seasons)==1)){echo "selected='selected' ";}
  946. echo "value='$row->id;'>";
  947. echo $row->name;
  948. echo '</option>';
  949. }
  950. }
  951. ?>
  952. </select>
  953. <br />
  954. <?php
  955. if (count($this->leagues) < 1)
  956. {
  957. ?>
  958. <input checked='checked' type='checkbox' name='newSeasonCheck' value="1"
  959. onclick='this.checked=true;' /><?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_NEW'); ?>
  960. <input type='text' name='seasonNew' size='90' maxlength='75' id='seasonNew' value="<?php echo stripslashes(htmlspecialchars($dSeasonName)); ?>" disabled='disabled' />
  961. <script type="text/javascript">
  962. document.adminForm.newSeasonCheck.value=1;
  963. document.adminForm.season.disabled=true;
  964. document.adminForm.seasonNew.disabled=false;
  965. document.adminForm.seasonNew.value=document.adminForm.seasonNew.value;
  966. </script>
  967. <?php
  968. }
  969. else
  970. {
  971. ?>
  972. <input type='checkbox' name='newSeasonCheck' value="1"
  973. onclick="
  974. if (this.checked) {
  975. document.adminForm.season.disabled=true;
  976. document.adminForm.seasonNew.disabled=false;
  977. document.adminForm.seasonNew.value=document.adminForm.seasonNew.value;
  978. } else {
  979. document.adminForm.season.disabled=false;
  980. document.adminForm.seasonNew.disabled=true;
  981. }" /><?php echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_NEW'); ?>
  982. <input type='text' name='seasonNew' size='90' maxlength='75' id='seasonNew' value="<?php echo stripslashes(htmlspecialchars($dSeasonName)); ?>" disabled='disabled' />
  983. <?php
  984. }
  985. ?>
  986. </td>
  987. </tr>
  988. <tr>
  989. <td style='background-color:#EEEEEE'><?php echo JText::_('JL_ADMIN_XML_IMPORT_ADMIN'); ?></td>
  990. <td style='background-color:#EEEEEE'>
  991. <select name='admin' id='admin'>
  992. <?php
  993. foreach ($this->admins AS $row)
  994. {
  995. echo '<option ';
  996. if ($row->id==62){echo "selected='selected' ";}
  997. echo "value='$row->id;'>";
  998. echo $row->username;
  999. echo '</option>';
  1000. }
  1001. ?>
  1002. </select>
  1003. </td>
  1004. </tr>
  1005. <tr>
  1006. <td style='background-color:#DDDDDD'><?php echo JText::_('JL_ADMIN_XML_IMPORT_EDITOR'); ?></td>
  1007. <td style='background-color:#DDDDDD'>
  1008. <select name='editor' id='editor'>
  1009. <?php
  1010. foreach ($this->editors AS $row)
  1011. {
  1012. echo '<option ';
  1013. if ($row->id==62){echo "selected='selected' ";}
  1014. echo "value='$row->id;'>";
  1015. echo $row->username;
  1016. echo '</option>';
  1017. }
  1018. ?>
  1019. </select>
  1020. </td>
  1021. </tr>
  1022. <tr>
  1023. <td style='background-color:#EEEEEE'><?php echo JText::_('JL_ADMIN_XML_IMPORT_TEMPLATES'); ?></td>
  1024. <td style='background-color:#EEEEEE'>
  1025. <select name='copyTemplate' id='copyTemplate'>
  1026. <option value="0" selected><?php echo JText::_('JL_ADMIN_XML_IMPORT_TEMPLATES_USEOWN'); ?></option>
  1027. <?php
  1028. foreach ($this->templates AS $row)
  1029. {
  1030. echo "<option value=\"$row->id\">$row->name</option>\n";
  1031. }
  1032. ?>
  1033. </select>
  1034. </td>
  1035. </tr>
  1036. <tr>
  1037. <td style='background-color:#DDDDDD'><?php echo JText::_('TimeOffset of this project'); ?></td>
  1038. <td style='background-color:#DDDDDD'>
  1039. <?php
  1040. echo $this->lists['serveroffset'].'&nbsp;';
  1041. $output1="<input type='text' name='acttime' id='acttime' size='4' value=\"".JHTML::date(time(),'%H:%M')."\" style='font-weight: bold;' disabled='disabled' />";
  1042. echo sprintf(JText::_('JL_ADMIN_PROJECT_SERVER_ACTTIME'),$output1);
  1043. ?>
  1044. </td>
  1045. </tr>
  1046. <tr>
  1047. <td style='background-color:#EEEEEE'><?php echo JText::_('JL_ADMIN_XML_IMPORT_PUBLISH'); ?></td>
  1048. <td style='background-color:#EEEEEE'>
  1049. <input type='radio' name='publish' value="0" /><?php echo JText::_('JL_GLOBAL_NO'); ?>
  1050. <input type='radio' name='publish' value="1" checked='checked' /><?php echo JText::_('JL_GLOBAL_YES'); ?>
  1051. </td>
  1052. </tr>
  1053. <?php
  1054. }
  1055. ?>
  1056. </table>
  1057. </fieldset>
  1058. <p style='text-align:right;'><a href='#page_bottom'><?php echo JText::_('JL_ADMIN_XML_IMPORT_BOTTOM'); ?></a></p>
  1059. <?php
  1060. }
  1061. ?>
  1062. <?php
  1063. if ((isset($clubs) && count($clubs) > 0) || (isset($teams) && count($teams) > 0))
  1064. {
  1065. ?>
  1066. <fieldset>
  1067. <legend><strong><?php
  1068. if (!empty($clubs) && !empty($teams))
  1069. {
  1070. echo JText::_('JL_ADMIN_XML_IMPORT_CLUBS_TEAMS_LEGEND'); //JL_XML_IMPORT_TEAM_CLUB_LEGEND
  1071. }
  1072. elseif (!empty($clubs))
  1073. {
  1074. echo JText::_('JL_ADMIN_XML_IMPORT_CLUBS_LEGEND');
  1075. }
  1076. else
  1077. {
  1078. echo JText::_('JL_ADMIN_XML_IMPORT_TEAMS_LEGEND');
  1079. }
  1080. ?></strong></legend>
  1081. <table class='adminlist'>
  1082. <thead>
  1083. <tr>
  1084. <th width='5%' nowrap='nowrap'><?php
  1085. $checkCount=((isset($clubs) && count($clubs) > 0)) ? count($clubs) : count($teams);
  1086. echo JText::_('JL_ADMIN_XML_IMPORT_ALL_NEW').'<br />';
  1087. echo '<input type="checkbox" name="toggleTeamsClubs" value="" onclick="checkAllCustom('.$checkCount.')" />';
  1088. ?></th>
  1089. <?php if (!empty($clubs)){ ?><th><?php echo JText::_('JL_ADMIN_XML_IMPORT_TEAM_DATA'); ?></th><?php } ?>
  1090. <?php if (!empty($teams)){ ?><th><?php echo JText::_('JL_ADMIN_XML_IMPORT_CLUB_DATA'); ?></th><?php } ?>
  1091. </tr>
  1092. </thead>
  1093. <tbody>
  1094. <?php
  1095. $i=0;
  1096. $color1="#DDDDDD";
  1097. $color2="#EEEEEE";
  1098. //foreach ($teams AS $key=> $team)
  1099. foreach ($teamsClubs AS $key=> $teamClub)
  1100. {
  1101. if ($key%2==1){$color=$color1;}else{$color=$color2;}
  1102. ?>
  1103. <tr>
  1104. <td width='10' nowrap='nowrap' style='text-align:center; vertical-align:middle; background-color:<?php echo $color; ?>'>
  1105. <?php
  1106. if (count($teamsClubs) > 0)
  1107. {
  1108. ?>
  1109. <input type='checkbox' value="<?php echo $key; ?>" name='cid[]' id='tc<?php echo $i; ?>' onchange='testTeamsClubsData(this,<?php echo $key; ?>)' />
  1110. <?php
  1111. }
  1112. ?>
  1113. </td>
  1114. <?php
  1115. if (!empty($teams))
  1116. {
  1117. // Team column starts here
  1118. $color='orange';
  1119. $foundMatchingTeam=0;
  1120. $foundMatchingTeamName='';
  1121. $matchingTeam_ClubID=0;
  1122. $matchingClubName='';
  1123. if (count($this->teams) > 0)
  1124. {
  1125. foreach ($this->teams AS $row1)
  1126. {
  1127. if ($this->import_version=='OLD')
  1128. {
  1129. $teamInfo=$teamClub->description;
  1130. }
  1131. else
  1132. {
  1133. $teamInfo=$teamClub->info;
  1134. }
  1135. if (strtolower($teamClub->name)==strtolower($row1->name) &&
  1136. strtolower($teamClub->short_name)==strtolower($row1->short_name) &&
  1137. strtolower($teamClub->middle_name)==strtolower($row1->middle_name) &&
  1138. strtolower($teamInfo)==strtolower($row1->info)
  1139. )
  1140. {
  1141. $foundMatchingTeam=$row1->id;
  1142. $foundMatchingTeamName=$teamClub->name;
  1143. $matchingTeam_ClubID=$row1->club_id;
  1144. if (!empty($clubs))
  1145. {
  1146. foreach ($this->clubs AS $row2)
  1147. {
  1148. if ($row2->id==$matchingTeam_ClubID)
  1149. {
  1150. $matchingClubName=$row2->name;
  1151. break;
  1152. }
  1153. }
  1154. }
  1155. break;
  1156. }
  1157. }
  1158. }
  1159. if ($foundMatchingTeam){$color='lightgreen';}
  1160. ?>
  1161. <td width='45%' style='text-align:left; vertical-align:top; background-color:<?php echo $color; ?>' id='tetd<?php echo $key; ?>'>
  1162. <?php
  1163. if ($foundMatchingTeam)
  1164. {
  1165. $checked="checked='checked' ";
  1166. $disabled='';
  1167. }
  1168. else
  1169. {
  1170. $checked='';
  1171. $disabled="disabled='disabled' ";
  1172. }
  1173. echo "<input type='checkbox' name='chooseTeam_$key' $checked";
  1174. echo "onclick='if(this.checked)
  1175. {
  1176. document.adminForm.selectTeam_$key.checked=false;
  1177. document.adminForm.createTeam_$key.checked=false;
  1178. document.adminForm.teamName_$key.disabled=true;
  1179. document.adminForm.teamShortname_$key.disabled=true;
  1180. document.adminForm.teamInfo_$key.disabled=true;
  1181. document.adminForm.teamMiddleName_$key.disabled=true;
  1182. }
  1183. else
  1184. {
  1185. }' $disabled ";
  1186. echo "/>&nbsp;";
  1187. $output="<input type='text' name='dbTeamName_$key' size='40' maxlength='60' value=\"".stripslashes(htmlspecialchars($foundMatchingTeamName))."\" style='font-weight: bold;' disabled='disabled' />";
  1188. echo JText::sprintf('JL_ADMIN_XML_IMPORT_USE_TEAM',$output);
  1189. echo "<input type='hidden' name='dbTeamID_$key' value=\"".stripslashes(htmlspecialchars($foundMatchingTeam))."\" $disabled />";
  1190. echo '<br />';
  1191. if (count($this->teams) > 0)
  1192. {
  1193. echo "<input type='checkbox' name='selectTeam_$key' ";
  1194. echo "onclick='javascript:openSelectWindow(";
  1195. echo $foundMatchingTeam;
  1196. echo ",".$key;
  1197. echo ',"selector"';
  1198. echo ",this";
  1199. echo ",1";
  1200. echo ")' ";
  1201. echo "/>&nbsp;";
  1202. echo JText::_('JL_ADMIN_XML_IMPORT_ASSIGN_TEAM');
  1203. echo '<br />';
  1204. }
  1205. else
  1206. {
  1207. echo "<input type='hidden' name='selectTeam_$key' />";
  1208. }
  1209. if ($foundMatchingTeam)
  1210. {
  1211. $checked='';
  1212. $disabled="disabled'disabled' ";
  1213. }
  1214. else
  1215. {
  1216. $checked="checked='checked' ";
  1217. $disabled='';
  1218. }
  1219. echo "<input type='checkbox' name='createTeam_$key' $checked ";
  1220. echo "onclick='if(this.checked)
  1221. {
  1222. document.adminForm.chooseTeam_$key.checked=false;
  1223. document.adminForm.selectTeam_$key.checked=false;
  1224. document.adminForm.teamName_$key.disabled=false;
  1225. document.adminForm.teamShortname_$key.disabled=false;
  1226. document.adminForm.teamInfo_$key.disabled=false;
  1227. document.adminForm.teamMiddleName_$key.disabled=false;
  1228. }
  1229. else
  1230. {
  1231. document.adminForm.teamName_$key.disabled=true;
  1232. document.adminForm.teamShortname_$key.disabled=true;
  1233. document.adminForm.teamInfo_$key.disabled=true;
  1234. document.adminForm.teamMiddleName_$key.disabled=true;
  1235. }' ";
  1236. echo "/>&nbsp;";
  1237. echo JText::_('JL_ADMIN_XML_IMPORT_CREATE_TEAM');
  1238. if (JComponentHelper::getParams('com_joomleague')->get('show_debug_info',0)){echo ' ('.$teamClub->club_id.')';}
  1239. ?>
  1240. <br />
  1241. <table cellspacing='0' cellpadding='0'>
  1242. <tr>
  1243. <td>
  1244. <?php
  1245. echo '<b>'.JText::_('JL_ADMIN_XML_IMPORT_TEAMNAME').'</b>';
  1246. ?><br /><input type='hidden' name='teamID_<?php echo $key; ?>' value="<?php echo $key; ?>" <?php echo $disabled; ?> />
  1247. <input type='text' name='teamName_<?php echo $key; ?>' size='45' maxlength='60' value="<?php echo stripslashes(htmlspecialchars($teamClub->name)); ?>" <?php echo $disabled; ?> />
  1248. </td>
  1249. <td>
  1250. <?php
  1251. echo '<b>'.JText::_('JL_ADMIN_XML_IMPORT_TEAMSHORT').'</b>';
  1252. ?><br /><input type='text' name='teamShortname_<?php echo $key; ?>' size='20' maxlength='15' value="<?php echo stripslashes(htmlspecialchars($teamClub->short_name)); ?>" <?php echo $disabled; ?> />
  1253. </td>
  1254. </tr>
  1255. <tr>
  1256. <td>
  1257. <?php
  1258. if ($this->import_version=='OLD')
  1259. {
  1260. $teamInfo=$teamClub->description;
  1261. }
  1262. else
  1263. {
  1264. $teamInfo=$teamClub->info;
  1265. }
  1266. echo '<b>'.JText::_('Info').'</b>';
  1267. ?><br /><input type='text' name='teamInfo_<?php echo $key; ?>' size='45' maxlength='255' value="<?php echo stripslashes(htmlspecialchars($teamInfo)); ?>" <?php echo $disabled; ?> />
  1268. </td>
  1269. <td>
  1270. <?php
  1271. echo '<b>'.JText::_('Middle Name').'</b>';
  1272. ?><br /><input type='text' name='teamMiddleName_<?php echo $key; ?>' size='20' maxlength='25' value="<?php echo stripslashes(htmlspecialchars($teamClub->middle_name)); ?>" <?php echo $disabled; ?> />
  1273. </td>
  1274. </tr>
  1275. </table>
  1276. </td>
  1277. <?php
  1278. }
  1279. if (!empty($clubs))
  1280. {
  1281. // Club column starts here
  1282. $color='orange';
  1283. $clubname='';
  1284. $clubid=0;
  1285. $clubPlaygroundID=0;
  1286. $clubCountry=0;
  1287. if (!empty($teams))
  1288. {
  1289. foreach ($clubs as $club)
  1290. {
  1291. if ((int)$club->id==(int)$teamClub->club_id)
  1292. {
  1293. $clubid=$club->id;
  1294. $clubname=$club->name;
  1295. $clubCountry=$club->country;
  1296. //echo $clubname.":".$clubCountry.",";
  1297. if (preg_match('=^[0-9]+$=',$clubCountry)){$clubCountry=$this->OldCountries[(int)$clubCountry];}
  1298. $clubPlaygroundID=$club->standard_playground;
  1299. break; //only one club possible...
  1300. }
  1301. }
  1302. if (count($this->clubs) > 0)
  1303. {
  1304. foreach ($this->clubs AS $row1)
  1305. {
  1306. $clubCountry=$row1->country;
  1307. if (strtolower($clubname)==strtolower($row1->name) )
  1308. {
  1309. $color='lightgreen';
  1310. $matchingTeam_ClubID=$row1->id;
  1311. $matchingClubName=$row1->name;
  1312. $clubCountry=$row1->country;
  1313. $clubid=$club->id;
  1314. //maybe also here row1->standard_playground???
  1315. $clubPlaygroundID=$club->standard_playground;
  1316. break;
  1317. }
  1318. }
  1319. }
  1320. /**/
  1321. }
  1322. else
  1323. /**/
  1324. {
  1325. $matchingTeam_ClubID=0;
  1326. $matchingClubName='';
  1327. $club=$teamClub;
  1328. $clubid=$club->id;
  1329. $clubCountry=$club->country;
  1330. if (count($this->clubs) > 0)
  1331. {
  1332. foreach ($this->clubs AS $row1)
  1333. {
  1334. if (strtolower($club->name)==strtolower($row1->name) &&
  1335. strtolower($club->country)==strtolower($row1->country))
  1336. {
  1337. $color='lightgreen';
  1338. $matchingTeam_ClubID=$row1->id;
  1339. $matchingClubName=$teamClub->