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

/includes/functions.php

https://bitbucket.org/molusc/sma-website
PHP | 36 lines | 31 code | 5 blank | 0 comment | 1 complexity | 48cbaf3c8d4f2ba5345566f3b6a207ac MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. function getUpcomingCourses($TrainingCentre = 0) {
  3. $html = "";
  4. mysql_select_db($database_bryanmadge, $bryanmadge);
  5. $query_TrainingClub = "SELECT schedule.course_id, schedule.course_title_id, catalog.title, UNIX_TIMESTAMP(schedule.course_date) AS course_date, schedule.course_town, schedule.course_venue_id, schedule.course_classification
  6. FROM schedule INNER JOIN catalog ON schedule.course_title_id = catalog.catalog_id
  7. WHERE schedule.course_classification Like '$clubprefix%' ORDER BY $sortorder";
  8. $TrainingClub = mysql_query($query_TrainingClub, $bryanmadge) or die(mysql_error());
  9. $row_TrainingClub = mysql_fetch_assoc($TrainingClub);
  10. $totalRows_TrainingClub = mysql_num_rows($TrainingClub);
  11. $html = '<table BORDER="0" CELLPADDING="2" CELLSPACING="3">
  12. <tr>
  13. <td COLSPAN=2><div align="right" class="bmabody"><font size="-1">Sort by: <a href="training-club-schedule.php?orderby=course_date&club=';
  14. $html .= $clubprefix;
  15. ?>">Date</a> or <a href="training-club-schedule.php?orderby=title&club=<? echo $clubprefix ?>">Course Title</a></font></div></td>
  16. </tr>
  17. <tr bgcolor="#000066"><td class="bmatableheaderlink"><div align="left"><font color="#FFFFFF" SIZE="-1"><strong><a href="training-club-schedule.php?orderby=course_date&club=<? echo $clubprefix ?>">Date</a></strong></font></div></td>
  18. <td class="bmatableheaderlink"><div align="left"><font color="#FFFFFF" SIZE="-1"><strong><a href="training-club-schedule.php?orderby=title&club=<? echo $clubprefix ?>">Course Title </a></strong></font></div></td>
  19. </tr>
  20. <?php do { ?>
  21. <tr bgcolor="#E5E5E5"><td><div align="right"><font size="-1">
  22. <?php $dt = $row_TrainingClub['course_date'];
  23. echo date('jS F Y', $dt);
  24. ?>
  25. </font></div></td>
  26. <td><font size="-1"><?php echo "<a href=\"/courses/course-details.php?id=",$row_TrainingClub['course_title_id'],"\">",$row_TrainingClub['title'],"</a>"; ?></font></td>
  27. </tr>
  28. <?php } while ($row_TrainingClub = mysql_fetch_assoc($TrainingClub)); ?>
  29. </table>
  30. }
  31. ?>