/pages/tour.php

https://github.com/anodyne/sms · PHP · 175 lines · 114 code · 36 blank · 25 comment · 18 complexity · 45ee222761c4fe3b9ace39879c70cf81 MD5 · raw file

  1. <?php
  2. /**
  3. This is a necessary system file. Do not modify this page unless you are highly
  4. knowledgeable as to the structure of the system. Modification of this file may
  5. cause SMS to no longer function.
  6. Author: David VanScott [ davidv@anodyne-productions.com ]
  7. File: pages/tour.php
  8. Purpose: Page to display the tour items
  9. System Version: 2.6.3
  10. Last Modified: 2008-08-31 1201 EST
  11. **/
  12. /* define the page class and vars */
  13. $pageClass = "ship";
  14. if(isset($_GET['id']) && is_numeric($_GET['id']))
  15. {
  16. $tour = $_GET['id'];
  17. }
  18. else
  19. {
  20. $tour = "";
  21. }
  22. /* pull in the menu */
  23. if( isset( $sessionCrewid ) ) {
  24. include_once( 'skins/' . $sessionDisplaySkin . '/menu.php' );
  25. } else {
  26. include_once( 'skins/' . $skin . '/menu.php' );
  27. }
  28. ?>
  29. <script type="text/javascript">
  30. $(document).ready(function(){
  31. var options = {
  32. resizeLgImages: true,
  33. displayNav: true,
  34. handleUnsupported: 'remove',
  35. keysClose: ['c', 27] // c or esc
  36. };
  37. Shadowbox.init(options);
  38. });
  39. </script>
  40. <div class="body">
  41. <?php
  42. /* if there is an id in the URL, pull that specific entry */
  43. if( !empty( $tour ) ) {
  44. $getTour = "SELECT * FROM sms_tour WHERE tourid = '$tour' LIMIT 1";
  45. $getTourResult = mysql_query( $getTour );
  46. /* Start pulling the array and populate the variables */
  47. while( $tour = mysql_fetch_array( $getTourResult ) ) {
  48. extract( $tour, EXTR_OVERWRITE );
  49. }
  50. echo "<span class='fontTitle'>Tour of ";
  51. printText( $tourName );
  52. echo "</span>";
  53. /*
  54. if the person is logged in and has level 5 access, display an icon
  55. that will take them to edit the entry
  56. */
  57. if(isset($sessionCrewid) && in_array("m_tour", $sessionAccess)) {
  58. echo "&nbsp;&nbsp;&nbsp;&nbsp;";
  59. echo "<a href='" . $webLocation . "admin.php?page=manage&sub=tour' class='image'>";
  60. echo "<img src='" . $webLocation . "images/edit.png' alt='Edit' border='0' />";
  61. echo "</a>";
  62. }
  63. if( !empty( $tourPicture1 ) || !empty( $tourPicture2 ) || !empty( $tourPicture3 ) ) {
  64. ?>
  65. <br /><br />
  66. <div id="gallery">
  67. <table>
  68. <tr height="110">
  69. <? if( !empty( $tourPicture1 ) ) { ?>
  70. <td valign="top" width="10%">
  71. <a href="<?=$webLocation . "images/tour/" . $tourPicture1;?>" rel="shadowbox[Tour]" class="image">
  72. <img src="<?=$webLocation . "images/tour/" . $tourPicture1;?>" border="0" alt="" height="90" class="image reflect rheight30 ropacity40" />
  73. </a>
  74. </td>
  75. <? } ?>
  76. <? if( !empty( $tourPicture2 ) ) { ?>
  77. <td width="10">&nbsp;</td>
  78. <td valign="top" width="10%">
  79. <a href="<?=$webLocation . "images/tour/" . $tourPicture2;?>" rel="shadowbox[Tour]" class="image">
  80. <img src="<?=$webLocation . "images/tour/" . $tourPicture2;?>" border="0" alt="" height="90" class="image reflect rheight30 ropacity40" />
  81. </a>
  82. </td>
  83. <? } ?>
  84. <? if( !empty( $tourPicture3 ) ) { ?>
  85. <td width="10">&nbsp;</td>
  86. <td valign="top" width="10%">
  87. <a href="<?=$webLocation . "images/tour/" . $tourPicture3;?>" rel="shadowbox[Tour]" class="image">
  88. <img src="<?=$webLocation . "images/tour/" . $tourPicture3;?>" border="0" alt="" height="90" class="image reflect rheight30 ropacity40" />
  89. </a>
  90. </td>
  91. <? } ?>
  92. <td width="70%"></td>
  93. </tr>
  94. </table>
  95. </div>
  96. <? } ?>
  97. <br />
  98. <b class="fontMedium">Location: <? printText( $tourLocation ); ?></b><br />
  99. <? printText( $tourDesc ); ?>
  100. <br /><br />
  101. <b class="fontMedium"><a href="<?=$webLocation;?>index.php?page=tour">&laquo; Back to Tour Index</a></b>
  102. <?
  103. } else {
  104. echo "<span class='fontTitle'><i>";
  105. printText( $shipPrefix . " " . $shipName );
  106. echo "</i> Tour</span>";
  107. /*
  108. if the person is logged in and have level 5 access, display
  109. an icon that will take them to edit the tour
  110. */
  111. if( isset( $sessionCrewid ) && in_array( "m_tour", $sessionAccess ) ) {
  112. echo "&nbsp;&nbsp;&nbsp;&nbsp;";
  113. echo "<a href='" . $webLocation . "admin.php?page=manage&sub=tour' class='image'>";
  114. echo "<img src='" . $webLocation . "images/edit.png' alt='Edit' border='0' />";
  115. echo "</a>";
  116. }
  117. echo "<br /><br />";
  118. $getTour = "SELECT * FROM sms_tour WHERE tourDisplay = 'y' ORDER BY tourOrder ASC";
  119. $getTourResult = mysql_query( $getTour );
  120. /* Start pulling the array and populate the variables */
  121. while( $tour = mysql_fetch_array( $getTourResult ) ) {
  122. extract( $tour, EXTR_OVERWRITE );
  123. echo "<span class='fontMedium'><b>";
  124. echo "<a href='" . $webLocation . "index.php?page=tour&id=" . $tourid . "'>";
  125. printText( $tourName );
  126. echo "</a>";
  127. echo "</b></span><br />";
  128. if( empty( $tourSummary ) ) {
  129. printText( $tourDesc );
  130. } else {
  131. printText( $tourSummary );
  132. }
  133. echo "<br /><br />";
  134. }
  135. }
  136. ?>
  137. </div> <!-- close .body -->