PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/com_joomleague/components/com_joomleague/views/player/tmpl/default_status.php

https://gitlab.com/julienv/joomleague
PHP | 346 lines | 324 code | 19 blank | 3 comment | 34 complexity | 4c8456bfbcc70b8c935ad8b72cc3d7be MD5 | raw file
  1. <?php defined( '_JEXEC' ) or die( 'Restricted access' );
  2. if ( ( isset($this->teamPlayer->injury) && $this->teamPlayer->injury > 0 ) ||
  3. ( isset($this->teamPlayer->suspension) && $this->teamPlayer->suspension > 0 ) ||
  4. ( isset($this->teamPlayer->away) && $this->teamPlayer->away > 0 ) )
  5. {
  6. $today = JHtml::date('now' .' UTC',
  7. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  8. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  9. ?>
  10. <h2><?php echo JText::_('COM_JOOMLEAGUE_PERSON_STATUS'); ?></h2>
  11. <table class="status">
  12. <?php
  13. if ($this->teamPlayer->injury > 0)
  14. {
  15. $injury_date = "";
  16. $injury_end = "";
  17. $injury_date = JHtml::date($this->teamPlayer->injury_date .' UTC',
  18. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  19. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  20. if(isset($this->teamPlayer->rinjury_from))
  21. $injury_date .= " - ".$this->teamPlayer->rinjury_from;
  22. //injury end
  23. $injury_end = JHtml::date($this->teamPlayer->injury_end .' UTC',
  24. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  25. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  26. if(isset($this->teamPlayer->rinjury_to))
  27. $injury_end .= " - ".$this->teamPlayer->rinjury_to;
  28. if ($this->teamPlayer->injury_date == $this->teamPlayer->injury_end)
  29. {
  30. ?>
  31. <tr>
  32. <td class="label">
  33. <?php
  34. $imageTitle = JText::_( 'COM_JOOMLEAGUE_PERSON_INJURED' );
  35. echo "&nbsp;&nbsp;" . JHtml::image( 'images/com_joomleague/database/events/'.$this->project->fs_sport_type_name.'/injured.gif',
  36. $imageTitle,
  37. array( 'title' => $imageTitle,
  38. 'style' => 'padding-right: 10px; vertical-align: middle;' ) );
  39. echo JText::_( 'COM_JOOMLEAGUE_PERSON_INJURED' );
  40. ?>
  41. </td>
  42. <td class="data">
  43. <?php
  44. if ($injury_end != $today)
  45. {
  46. echo $injury_end;
  47. }
  48. ?>
  49. </td>
  50. </tr>
  51. <?php
  52. }
  53. else
  54. {
  55. ?>
  56. <tr>
  57. <td class="label" colspan="2">
  58. <?php
  59. $imageTitle = JText::_( 'COM_JOOMLEAGUE_PERSON_INJURED' );
  60. echo "&nbsp;&nbsp;" . JHtml::image( 'images/com_joomleague/database/events/'.$this->project->fs_sport_type_name.'/injured.gif',
  61. $imageTitle,
  62. array( 'title' => $imageTitle ) );
  63. ?>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td class="label">
  68. <?php
  69. echo JText::_( 'COM_JOOMLEAGUE_PERSON_INJURY_DATE' );
  70. ?>
  71. </td>
  72. <td class="data">
  73. <?php
  74. echo $injury_date;
  75. ?>
  76. </td>
  77. </tr>
  78. <?php
  79. if ($injury_end != $today)
  80. {
  81. ?>
  82. <tr>
  83. <td class="label">
  84. <?php
  85. echo JText::_( 'COM_JOOMLEAGUE_PERSON_INJURY_END' );
  86. ?>
  87. </td>
  88. <td class="data">
  89. <?php
  90. echo $injury_end;
  91. ?>
  92. </td>
  93. </tr>
  94. <?php
  95. }
  96. }
  97. if (!empty($this->teamPlayer->injury_detail))
  98. {
  99. ?>
  100. <tr>
  101. <td class="label">
  102. <?php
  103. echo JText::_( 'COM_JOOMLEAGUE_PERSON_INJURY_TYPE' );
  104. ?>
  105. </td>
  106. <td class="data">
  107. <?php
  108. printf( "%s", htmlspecialchars( $this->teamPlayer->injury_detail ) );
  109. ?>
  110. </td>
  111. </tr>
  112. <?php
  113. }
  114. }
  115. if ($this->teamPlayer->suspension > 0)
  116. {
  117. $suspension_date = "";
  118. $suspension_end = "";
  119. //suspension start
  120. $suspension_date = JHtml::date($this->teamPlayer->suspension_date .' UTC',
  121. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  122. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  123. if(isset($this->teamPlayer->rsusp_from))
  124. $suspension_date .= " - ".$this->teamPlayer->rsusp_from;
  125. $suspension_end = JHtml::date($this->teamPlayer->suspension_end .' UTC',
  126. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  127. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  128. if(isset($this->teamPlayer->rsusp_to))
  129. $suspension_end .= " - ".$this->teamPlayer->rsusp_to;
  130. if ($this->teamPlayer->suspension_date == $this->teamPlayer->suspension_end)
  131. {
  132. ?>
  133. <tr>
  134. <td class="label">
  135. <?php
  136. $imageTitle = JText::_( 'Suspended' );
  137. echo "&nbsp;&nbsp;" . JHtml::image( 'images/com_joomleague/database/events/'.$this->project->fs_sport_type_name.'/suspension.gif',
  138. $imageTitle,
  139. array( 'title' => $imageTitle,
  140. 'style' => 'padding-right: 10px; vertical-align: middle;' ) );
  141. echo JText::_( 'COM_JOOMLEAGUE_PERSON_SUSPENDED' );
  142. ?>
  143. </td>
  144. <td class="data">
  145. <?php
  146. if ($suspension_end != $today)
  147. {
  148. echo $suspension_end;
  149. }
  150. ?>
  151. </td>
  152. </tr>
  153. <?php
  154. }
  155. else
  156. {
  157. ?>
  158. <tr>
  159. <td class="label" colspan="2">
  160. <?php
  161. $imageTitle = JText::_( 'Suspended' );
  162. echo "&nbsp;&nbsp;" . JHtml::image( 'images/com_joomleague/database/events/'.$this->project->fs_sport_type_name.'/suspension.gif',
  163. $imageTitle,
  164. array( 'title' => $imageTitle ) );
  165. ?>
  166. </td>
  167. </tr>
  168. <tr>
  169. <td class="label">
  170. <?php
  171. echo JText::_( 'COM_JOOMLEAGUE_PERSON_SUSPENSION_DATE' );
  172. ?>
  173. </td>
  174. <td class="data">
  175. <?php
  176. echo $suspension_date;
  177. ?>
  178. </td>
  179. </tr>
  180. <?php
  181. if ($suspension_end != $today)
  182. {
  183. ?>
  184. <tr>
  185. <td class="label">
  186. <?php
  187. echo JText::_( 'COM_JOOMLEAGUE_PERSON_SUSPENSION_END' );
  188. ?>
  189. </td>
  190. <td class="data">
  191. <?php
  192. echo $suspension_end;
  193. ?>
  194. </td>
  195. </tr>
  196. <?php
  197. }
  198. }
  199. if (!empty($this->teamPlayer->suspension_detail))
  200. {
  201. ?>
  202. <tr>
  203. <td class="label">
  204. <b>
  205. <?php
  206. echo JText::_( 'COM_JOOMLEAGUE_PERSON_SUSPENSION_REASON' );
  207. ?>
  208. </b>
  209. </td>
  210. <td class="data">
  211. <?php
  212. printf( "%s", htmlspecialchars( $this->teamPlayer->suspension_detail ) );
  213. ?>
  214. </td>
  215. </tr>
  216. <?php
  217. }
  218. }
  219. if ($this->teamPlayer->away > 0)
  220. {
  221. $away_date = "";
  222. $away_end = "";
  223. //suspension start
  224. $away_date = JHtml::date($this->teamPlayer->away_date .' UTC',
  225. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  226. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  227. if(isset($this->teamPlayer->raway_from))
  228. $away_date .= " - ".$this->teamPlayer->raway_from;
  229. $away_end = JHtml::date($this->teamPlayer->away_end .' UTC',
  230. JText::_('COM_JOOMLEAGUE_GLOBAL_MATCHDAYDATE'),
  231. JoomleagueHelper::getTimezone($this->project, $this->overallconfig));
  232. if(isset($this->teamPlayer->raway_to))
  233. $away_end .= " - ".$this->teamPlayer->raway_to;
  234. if ($this->teamPlayer->away_date == $this->teamPlayer->away_end)
  235. {
  236. ?>
  237. <tr>
  238. <td class="label">
  239. <?php
  240. $imageTitle = JText::_( 'Away' );
  241. echo "&nbsp;&nbsp;" . JHtml::image('images/com_joomleague/database/events/'.$this->project->fs_sport_type_name.'/away.gif',
  242. $imageTitle,
  243. array( 'title' => $imageTitle,
  244. 'style' => 'padding-right: 10px; vertical-align: middle;' ) );
  245. echo JText::_( 'COM_JOOMLEAGUE_PERSON_AWAY' );
  246. ?>
  247. </td>
  248. <td class="data">
  249. <?php
  250. if ($away_end != $today)
  251. {
  252. echo $away_end;
  253. }
  254. ?>
  255. </td>
  256. </tr>
  257. <?php
  258. }
  259. else
  260. {
  261. ?>
  262. <tr>
  263. <td class="label" colspan="2">
  264. <?php
  265. $imageTitle = JText::_( 'Away' );
  266. echo "&nbsp;&nbsp;" . JHtml::image( 'images/com_joomleague/database/events/'.$this->project->fs_sport_type_name.'/away.gif',
  267. $imageTitle,
  268. array( 'title' => $imageTitle ) );
  269. ?>
  270. </td>
  271. </tr>
  272. <tr>
  273. <td class="label">
  274. <b>
  275. <?php
  276. echo JText::_( 'COM_JOOMLEAGUE_PERSON_AWAY_DATE' );
  277. ?>
  278. </b>
  279. </td>
  280. <td class="data">
  281. <?php
  282. echo $away_date;
  283. ?>
  284. </td>
  285. </tr>
  286. <?php
  287. if ($away_end != $today)
  288. {
  289. ?>
  290. <tr>
  291. <td class="label">
  292. <?php
  293. echo JText::_( 'COM_JOOMLEAGUE_PERSON_AWAY_END' );
  294. ?>
  295. </td>
  296. <td class="data">
  297. <?php
  298. echo $away_end;
  299. ?>
  300. </td>
  301. </tr>
  302. <?php
  303. }
  304. }
  305. if (!empty($this->teamPlayer->away_detail))
  306. {
  307. ?>
  308. <tr>
  309. <td class="label">
  310. <?php
  311. echo JText::_( 'COM_JOOMLEAGUE_PERSON_AWAY_REASON' );
  312. ?>
  313. </td>
  314. <td class="data">
  315. <?php
  316. printf( "%s", htmlspecialchars( $this->teamPlayer->away_detail ) );
  317. ?>
  318. </td>
  319. </tr>
  320. <?php
  321. }
  322. }
  323. ?>
  324. </table>
  325. <?php
  326. }
  327. ?>