PageRenderTime 51ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/diary/diary.php

https://bitbucket.org/molusc/sma-website
PHP | 150 lines | 129 code | 9 blank | 12 comment | 5 complexity | 59f694156b51a07676a517cc8d9f23fb MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php session_start(); ?>
  2. <?php require_once('../Connections/bryanmadge.php'); ?>
  3. <?php
  4. mysql_select_db($database_bryanmadge, $bryanmadge);
  5. if(isset($_SESSION['company']))
  6. $query_Diary = "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 FROM schedule INNER JOIN catalog ON schedule.course_title_id = catalog.catalog_id WHERE (course_date >= NOW()) AND categoryid NOT IN(7,21) ORDER BY course_date";
  7. else
  8. $query_Diary = "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 FROM schedule INNER JOIN catalog ON schedule.course_title_id = catalog.catalog_id WHERE (course_date >= NOW()) AND categoryid NOT IN(21) ORDER BY course_date";
  9. $Diary = mysql_query($query_Diary, $bryanmadge) or die(mysql_error());
  10. // $row_Diary = mysql_fetch_assoc($Diary);
  11. $totalRows_Diary = mysql_num_rows($Diary);
  12. ?>
  13. <html><!-- InstanceBegin template="/Templates/general.dwt" codeOutsideHTMLIsLocked="false" -->
  14. <head>
  15. <LINK REL="SHORTCUT ICON" HREF="../favicon.ico">
  16. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  17. <meta name="GENERATOR" content="Dreamweaver MX">
  18. <meta name="keywords" content="CDM Regulations, CESMM, civil engineering, construction management, contract administration, contract procedures, courses, environmental awareness, geotechnical, Health and safety, ICE Conditions of Contract, ICE Professional Review, JCT Form of Contract, Method of Measurement for Highway Works, MMHW, NEC New Engineering and Construction Contract, Project management, report writing, site supervision, Standard Forms of Contract, training, AMPR, CET, CPD, TMPR, Eurocodes">
  19. <!-- #BeginEditable "doctitle" -->
  20. <title>Course Diary - Symmons Madge Associates Ltd</title>
  21. <!-- #EndEditable -->
  22. <link rel="stylesheet" href="../bma.css" type="text/css">
  23. <link rel="stylesheet" href="../print.css" type="text/css" media="print" />
  24. <!-- InstanceParam name="OptionalPageTitle" type="boolean" value="true" --><!-- InstanceParam name="OptionalBreadcrumbs" type="boolean" value="true" --><!-- InstanceParam name="Google Analytics Code" type="boolean" value="true" -->
  25. </head>
  26. <body><div class="printhide"><!-- #BeginLibraryItem "/Library/Masthead.lbi" -->
  27. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  28. <tr>
  29. <td width="150" rowspan="2"><a href="../home.html" target="_top">
  30. <!-- <img src="../images/smalogo_sml_party_hat.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="90" border="0">
  31. -->
  32. <img src="../images/smalogo_sml.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="64" border="0"> </a></td>
  33. <td><p class="tagline"><font size="4">Training for a Successful Future</font></p></td>
  34. </tr>
  35. <tr>
  36. <td valign="bottom"><table class="masthead" width="100%" height=25 border="0" cellpadding="0" cellspacing="0">
  37. <tr>
  38. <!-- <td width="5%" bgcolor="#FFFFFF">&nbsp;</td>-->
  39. <td align="left" valign="top"><img src="/images/corner_TL.gif" width="15" height="25"></td>
  40. <td>&nbsp;&nbsp;<a
  41. href="../courses/index.php" target="_top">Courses</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  42. href="diary.php" target="_top">Course&nbsp;Diary</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  43. href="../training/training-club.php" target="_top">Regional Training</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  44. href="../consultancy/index.html" target="_top">Consultancy</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  45. href="../search/index.php" target="_top">Search</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  46. href="../links.html" target="_top">Links</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  47. href="../company/about.html" target="_top">About us</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  48. href="../contact.html" target="_top">Contact</a>&nbsp;&nbsp;</td>
  49. </tr>
  50. </table></td>
  51. </tr>
  52. </table>
  53. <!-- #EndLibraryItem --></div>
  54. <div class="printonly">
  55. <div align="right"><img src="../images/smalogo_sml.gif" width="124" height="64" class="floatright"></div>
  56. </div>
  57. <div id="main">
  58. <p class="breadcrumbs printhide"><!-- #BeginEditable "breadcrumbs" --><a href="../home.html" target="_top">Home</a>&nbsp;&gt;&nbsp;Course Diary <!-- #EndEditable --></p>
  59. <h1 class="bmapagetitle"><!-- #BeginEditable "title" -->Course Diary<!-- #EndEditable --></h1>
  60. <!-- #BeginEditable "body" -->
  61. <div id="main" class="bmabody">
  62. <p> For further details and bookings please <a href="../booking_form.php" target="_self">click
  63. here</a> or phone us on (01446) 775959 or e-mail <a href="mailto:admin@symmonsmadge.co.uk">admin@symmonsmadge.co.uk</a>.</p>
  64. <!-- <p>There are <?php echo $totalRows_Diary ?> courses in the table</p>
  65. --> <table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="bmabody">
  66. <?php
  67. while ($row_Diary = mysql_fetch_assoc($Diary)) {
  68. // set $month
  69. $dt = $row_Diary['course_date'];
  70. $month = (int) date('n', $dt);
  71. // echo 'start month: ',$month,'<br>'; //debug
  72. // echo 'start current: ',$current,'<br>'; //debug
  73. ?>
  74. <?php if ($month <> $current) { // if first of new month ?>
  75. <tr valign="bottom">
  76. <td height=50 class="diarymonth" colspan="3">
  77. <?php
  78. // print month header
  79. $dt = $row_Diary['course_date'];
  80. echo date('F Y', $dt);
  81. ?>
  82. </td>
  83. </tr>
  84. <?php
  85. } ?>
  86. <tr>
  87. <td width="30" valign=top> <p>
  88. <?php
  89. // print course date
  90. $dt = $row_Diary['course_date'];
  91. $current = (int) date('n', $row_Diary['course_date']);
  92. // echo date('jS F Y', $dt);
  93. echo date('jS', $dt);
  94. ?>
  95. </p></td>
  96. <td valign=top> <p>
  97. <?php echo "<a href=\"/courses/course-details.php?id=",$row_Diary['course_title_id'],"\">",$row_Diary['title'],"</a>";
  98. ?>
  99. </p></td>
  100. <td valign=top> <div align="center">
  101. <?php echo $row_Diary['course_town']; ?>
  102. </div></td>
  103. <td valign="top" bgcolor="#ffffff"><font SIZE="-1"><?php echo "<a href=\"../booking_form.php?id=",$row_Diary['course_title_id'],"&venue=",rawurlencode($row_Diary['course_town']),"&date=",rawurlencode(date('jS F Y', $dt)),"&title=",rawurlencode($row_Diary['title']),"\">Book</a>"; ?></font></td>
  104. </tr>
  105. <?php
  106. // echo "<td>month: $month</td>"; //debug
  107. // echo "<td>current: ",(int) date('n', $row_Diary['course_date']),"</td>"; //debug
  108. ?>
  109. <?php
  110. $dt = $row_Diary['course_date']; //debug
  111. // $month = date('n', $dt); //debug
  112. // echo 'end month: ',$month,'<br>'; //debug
  113. // echo 'end current: ',$current,'<br>'; //debug
  114. } ?>
  115. </table>
  116. <p>Our Written Exercise and Study Day courses are offered in the Spring and Autumn each year. </p>
  117. <p>For further details and bookings please <a href="../booking_form.php" target="_self">click
  118. here</a> or phone us on (01446) 775959 or e-mail <a href="mailto:admin@symmonsmadge.co.uk">admin@symmonsmadge.co.uk</a>.
  119. </div>
  120. <!-- #EndEditable --></div>
  121. <div class="printhide"><!-- #BeginLibraryItem "/Library/Full Footer.lbi" --><hr width="65%">
  122. <p align="center"><!-- #BeginLibraryItem "/Library/Footer.lbi" --><!-- #EndLibraryItem --></p>
  123. <!-- #EndLibraryItem --><!-- #BeginLibraryItem "/Library/Legal footer.lbi" --><div align="center" class="bmabody"><font size="1"><a href="../company/legal.html">Legal
  124. Notice</a><br>
  125. Copyright &copy; Symmons Madge Associates Ltd, All Rights Reserved</font></div>
  126. <!-- #EndLibraryItem --><!-- Start of StatCounter Code -->
  127. <script type="text/javascript" language="javascript">
  128. var sc_project=337750;
  129. var sc_partition=1;
  130. </script>
  131. <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript>
  132. <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>
  133. </noscript>
  134. <!-- End of StatCounter Code -->
  135. <!-- InstanceBeginEditable name="EditRegion1" --><!-- #BeginLibraryItem "/Library/Google Analytics PHP Include.lbi" -->
  136. <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/analyticstracking.php"); ?><!-- #EndLibraryItem --><!-- InstanceEndEditable --></div>
  137. </body>
  138. <!-- InstanceEnd --></html>
  139. <?php
  140. mysql_free_result($Diary);
  141. ?>