PageRenderTime 44ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/courses/course-details.php

https://bitbucket.org/molusc/sma-website
PHP | 158 lines | 151 code | 4 blank | 3 comment | 10 complexity | f9cbe8adfa72e41a5c7b89c6ee5e8cee MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php session_start(); ?>
  2. <?php //setup and error-check database connection
  3. $location = "localhost";
  4. $username = "wf-c32a-0dfcce";
  5. $password = "bma";
  6. $database = "wf-c32a-0dfcce";
  7. $conn = mysql_connect("$location","$username","$password");
  8. if (!$conn) die ("Could not connect MySQL");
  9. mysql_select_db($database,$conn) or die ("Could not open database");
  10. $courseidnum = $_GET["id"];
  11. $query = "SELECT *
  12. FROM catalog
  13. WHERE (catalog_id=$courseidnum);";
  14. //echo $query;
  15. if ($result = mysql_query($query)) {
  16. $row = mysql_fetch_array($result);
  17. ?>
  18. <html>
  19. <head>
  20. <LINK REL="SHORTCUT ICON" HREF="../favicon.ico">
  21. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  22. <meta name="GENERATOR" content="Dreamweaver MX">
  23. <meta name="keywords" content="<?php echo "$row[keywords]"; ?>">
  24. <title><?php echo "$row[title]"; ?></title>
  25. <link rel="stylesheet" href="/print.css" type="text/css" media="print" />
  26. <link rel="stylesheet" href="/bma.css" type="text/css">
  27. <link rel="stylesheet" href="/print.css" type="text/css" media="print" />
  28. </head>
  29. <body>
  30. <a href="index.php?catid=6#5">Training Courses - Symmons Madge Associates Ltd</a>
  31. <div class="printhide"><!-- #BeginLibraryItem "/Library/Masthead.lbi" -->
  32. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  33. <tr>
  34. <td width="150" rowspan="2"><a href="../home.html" target="_top">
  35. <!-- <img src="../images/smalogo_sml_party_hat.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="90" border="0">
  36. -->
  37. <img src="../images/smalogo_sml.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="64" border="0"> </a></td>
  38. <td><p class="tagline"><font size="4">Training for a Successful Future</font></p></td>
  39. </tr>
  40. <tr>
  41. <td valign="bottom"><table class="masthead" width="100%" height=25 border="0" cellpadding="0" cellspacing="0">
  42. <tr>
  43. <!-- <td width="5%" bgcolor="#FFFFFF">&nbsp;</td>-->
  44. <td align="left" valign="top"><img src="/images/corner_TL.gif" width="15" height="25"></td>
  45. <td>&nbsp;&nbsp;<a
  46. href="index.php" target="_top">Courses</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  47. href="../diary/diary.php" target="_top">Course&nbsp;Diary</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  48. href="../training/training-club.php" target="_top">Regional Training</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  49. href="../consultancy/index.html" target="_top">Consultancy</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  50. href="../search/index.php" target="_top">Search</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  51. href="../links.html" target="_top">Links</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  52. href="../company/about.html" target="_top">About us</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  53. href="../contact.html" target="_top">Contact</a>&nbsp;&nbsp;</td>
  54. </tr>
  55. </table></td>
  56. </tr>
  57. </table>
  58. <!-- #EndLibraryItem --></div>
  59. <div class="printonly">
  60. <div align="right"><img src="../images/smalogo_sml.gif" width="124" height="64" class="floatright"></div>
  61. </div>
  62. <div id="main">
  63. <p class="breadcrumbs printhide"><a href="../home.html" target="_top">Home</a>&nbsp;&gt;&nbsp;<a href="../training/index.html" target="_top">Training</a>&nbsp;&gt;&nbsp;<a href="index.php">Courses</a>&nbsp;&gt;&nbsp; <?php echo "$row[title]"; ?></p>
  64. <h1 class="bmapagetitle"> <strong><font face="arial" size="4">&nbsp;</font></strong>
  65. </h1>
  66. <div class="bmabody" id="main">
  67. <h1 class="coursetitle"><a name="top"></a><?php echo "$row[title]"; ?> <span class="bmapagetitle"><strong><font face="arial" size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></strong></span><span class="bmapagetitle"><strong><font face="arial" size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong><font face="arial" size="4"><strong><font face="arial" size="4"><font face="arial" size="1"></font></font></strong></font></strong></font></strong></span></h1>
  68. <h2 class="coursesubtitle"><?php echo "$row[subtitle]"; ?></h2>
  69. <?php echo "$row[description]"; ?> <?php echo "$row[objectives]"; ?>
  70. <?php echo "$row[outline]"; ?>
  71. <?php echo "$row[modeofdelivery]"; ?>
  72. <?php echo "$row[benefitsperceived]"; ?>
  73. <?php echo "$row[intended_for]"; ?>
  74. <?php echo "$row[precourserequirements]"; ?>
  75. <?php echo "$row[duration]"; ?>
  76. <h3>Locations:</h3>
  77. <?php
  78. $query2 = "SELECT course_title_id, UNIX_TIMESTAMP(schedule.course_date) AS course_date, course_town
  79. FROM schedule
  80. WHERE (course_title_id=$courseidnum) and (course_date >= NOW()) ORDER BY course_date;";
  81. // echo $query2;
  82. if ($result2 = mysql_query($query2)) {
  83. $numrows2 = mysql_num_rows($result2);
  84. // echo "<p>The course is scheduled $numrows2 times:</p>";
  85. if ($numrows2 < 1) {
  86. echo "<p>This course is currently only being provided on an In-house basis but will
  87. be offered as an open course immediately sufficient numbers have registered
  88. their interest.</p>
  89. <p>To register your interest go to <a href=/contact.html>Contact Us</a> and
  90. fill in the email form or telephone 01446 775959<br>
  91. </p>";
  92. } else {
  93. ?>
  94. <table BORDER="0" CELLPADDING="2" CELLSPACING="3">
  95. <tr bgcolor="#000066">
  96. <td width="90"><div align="left"><font color="#FFFFFF" SIZE="-1"><strong>Date</strong></font></div></td>
  97. <td width="90"><div align="left"><font color="#FFFFFF" SIZE="-1"><strong>Venue</strong></font></div></td>
  98. </tr>
  99. <?php
  100. While ($row2 = mysql_fetch_array($result2)) { ?>
  101. <tr bgcolor="#CCCCCC">
  102. <td> <font SIZE="-1">
  103. <?php
  104. $dt = $row2[course_date];
  105. $dt = date('jS F Y', $dt);
  106. echo $dt;
  107. ?>
  108. &nbsp;&nbsp;</font> </td>
  109. <td><font SIZE="-1"><?php echo "$row2[course_town]"; ?></font></td>
  110. <td bgcolor="#ffffff"><font SIZE="-1"><?php echo "<a href=\"../booking_form.php?id=",$row2['course_title_id'],"&venue=",rawurlencode($row2[course_town]),"&date=",rawurlencode($dt),"&title=",rawurlencode($row[title]),"\">Book</a>"; ?></font></td>
  111. </tr>
  112. <?php
  113. }
  114. ?>
  115. </table>
  116. <p>
  117. <?php
  118. }
  119. ?>
  120. <?php
  121. } else {
  122. echo "Sorry, there was a Database error - cannot display course schedule.<br> Please contact us for information.";
  123. }
  124. } else {
  125. echo "<p>Sorry, there was a Database error - cannot display course details.</p><p>Please contact us</a> for information.</p>";
  126. }
  127. ?>
  128. <?php echo "$row[fee]"; ?>
  129. </p>
  130. <p><!-- #BeginLibraryItem "/Library/Legal footer.lbi" --><div align="center" class="bmabody"><font size="1"><a href="../company/legal.html">Legal
  131. Notice</a><br>
  132. Copyright &copy; Symmons Madge Associates Ltd, All Rights Reserved</font></div>
  133. <!-- #EndLibraryItem -->
  134. <!-- Start of StatCounter Code -->
  135. </p>
  136. </div>
  137. </div>
  138. <div class="printhide">
  139. <script type="text/javascript" language="javascript">
  140. var sc_project=337750;
  141. var sc_partition=1;
  142. </script>
  143. <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script>
  144. <noscript>
  145. <a href="http://www.statcounter.com/" target="_blank"><img src="http://c2.statcounter.com/counter.php?sc_project=337750&amp;java=0" alt="counter stats" border="0"></a>
  146. </noscript>
  147. <!-- End of StatCounter Code -->
  148. </div>
  149. <!-- #BeginLibraryItem "/Library/Google Analytics PHP Include.lbi" -->
  150. <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/analyticstracking.php"); ?><!-- #EndLibraryItem --></body>
  151. </html>
  152. <?php
  153. mysql_free_result($result);
  154. ?>