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

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

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