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

/courses/health-social-care.php

https://bitbucket.org/molusc/sma-website
PHP | 276 lines | 247 code | 25 blank | 4 comment | 45 complexity | a9a7e61744a94e08fa6f9a34d16d4213 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php require_once('../Connections/bryanmadge.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  8. switch ($theType) {
  9. case "text":
  10. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  11. break;
  12. case "long":
  13. case "int":
  14. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  15. break;
  16. case "double":
  17. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  18. break;
  19. case "date":
  20. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  21. break;
  22. case "defined":
  23. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  24. break;
  25. }
  26. return $theValue;
  27. }
  28. }
  29. session_start(); ?>
  30. <?php
  31. if (!isset($_GET["catid"]))
  32. $_GET["catid"] = 21;
  33. $catid = $_GET["catid"];
  34. if (!isset($_GET["debug"]))
  35. $_GET["debug"] = 0;
  36. $debug = $_GET["debug"];
  37. mysql_select_db($database_bryanmadge, $bryanmadge);
  38. if(isset($_SESSION['company']))
  39. $query_categories = "SELECT categoryid, category.coursecategory, Count(catalog_id) AS CountOfCourseCatalogID FROM catalog, category WHERE category.id=categoryid AND category.id <> 7 GROUP BY categoryid ORDER BY category.coursecategory";
  40. else
  41. $query_categories = "SELECT categoryid, category.coursecategory, Count(catalog_id) AS CountOfCourseCatalogID FROM catalog, category WHERE category.id=categoryid GROUP BY categoryid ORDER BY category.coursecategory";
  42. $categories = mysql_query($query_categories, $bryanmadge) or die(mysql_error());
  43. $row_categories = mysql_fetch_assoc($categories);
  44. $totalRows_categories = mysql_num_rows($categories);
  45. $catid_catalog = "8";
  46. if (isset($catid)) {
  47. $catid_catalog = $catid;
  48. }
  49. mysql_select_db($database_bryanmadge, $bryanmadge);
  50. $query_catalog = sprintf("SELECT catalog.catalog_id, catalog.title, catalog.categoryid, category.coursecategory, catalog.subcategoryid, subcategory.subcategory FROM (catalog INNER JOIN category ON catalog.categoryid = category.id) LEFT JOIN subcategory ON catalog.SubCategoryid = subcategory.id WHERE (((catalog.categoryid)=%s)) ORDER BY category.coursecategory, subcategory.subcategory, catalog.title", GetSQLValueString($catid_catalog, "int"));
  51. $catalog = mysql_query($query_catalog, $bryanmadge) or die(mysql_error());
  52. $row_catalog = mysql_fetch_assoc($catalog);
  53. $totalRows_catalog = mysql_num_rows($catalog);
  54. $catid_subcategories = "7";
  55. if (isset($catid)) {
  56. $catid_subcategories = (get_magic_quotes_gpc()) ? $catid : addslashes($catid);
  57. }
  58. mysql_select_db($database_bryanmadge, $bryanmadge);
  59. $query_subcategories = sprintf("SELECT subcategory.id, subcategory.subcategory, subcategory.parentcategoryid FROM subcategory WHERE subcategory.parentcategoryid=%s ORDER BY subcategory.subcategory", $catid_subcategories);
  60. $subcategories = mysql_query($query_subcategories, $bryanmadge) or die(mysql_error());
  61. $row_subcategories = mysql_fetch_assoc($subcategories);
  62. $totalRows_subcategories = mysql_num_rows($subcategories);
  63. ?>
  64. <html><!-- InstanceBegin template="/Templates/general.dwt" codeOutsideHTMLIsLocked="false" -->
  65. <head>
  66. <LINK REL="SHORTCUT ICON" HREF="../favicon.ico">
  67. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  68. <meta name="GENERATOR" content="Dreamweaver MX">
  69. <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">
  70. <!-- #BeginEditable "doctitle" -->
  71. <title>Health &amp; Social Care Training - Symmons Madge Associates Ltd</title>
  72. <meta name="robots" content="noindex">
  73. <!-- #EndEditable -->
  74. <link rel="stylesheet" href="../bma.css" type="text/css">
  75. <link rel="stylesheet" href="../print.css" type="text/css" media="print" />
  76. <!-- InstanceParam name="OptionalPageTitle" type="boolean" value="true" --><!-- InstanceParam name="OptionalBreadcrumbs" type="boolean" value="true" --><!-- InstanceParam name="Google Analytics Code" type="boolean" value="true" -->
  77. </head>
  78. <body><div class="printhide"><!-- #BeginLibraryItem "/Library/Masthead.lbi" -->
  79. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  80. <tr>
  81. <td width="150" rowspan="2"><a href="../home.html" target="_top">
  82. <!-- <img src="../images/smalogo_sml_party_hat.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="90" border="0">
  83. -->
  84. <img src="../images/smalogo_sml.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="64" border="0"> </a></td>
  85. <td><p class="tagline"><font size="4">Training for a Successful Future</font></p></td>
  86. </tr>
  87. <tr>
  88. <td valign="bottom"><table class="masthead" width="100%" height=25 border="0" cellpadding="0" cellspacing="0">
  89. <tr>
  90. <!-- <td width="5%" bgcolor="#FFFFFF">&nbsp;</td>-->
  91. <td align="left" valign="top"><img src="/images/corner_TL.gif" width="15" height="25"></td>
  92. <td>&nbsp;&nbsp;<a
  93. href="index.php" target="_top">Courses</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  94. href="../diary/diary.php" target="_top">Course&nbsp;Diary</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  95. href="../training/training-club.php" target="_top">Regional Training</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  96. href="../consultancy/index.html" target="_top">Consultancy</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  97. href="../search/index.php" target="_top">Search</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  98. href="../links.html" target="_top">Links</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  99. href="../company/about.html" target="_top">About us</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a
  100. href="../contact.html" target="_top">Contact</a>&nbsp;&nbsp;</td>
  101. </tr>
  102. </table></td>
  103. </tr>
  104. </table>
  105. <!-- #EndLibraryItem --></div>
  106. <div class="printonly">
  107. <div align="right"><img src="../images/smalogo_sml.gif" width="124" height="64" class="floatright"></div>
  108. </div>
  109. <div id="main">
  110. <p class="breadcrumbs printhide"><!-- #BeginEditable "breadcrumbs" --> <a href="../home.html" target="_top">Home</a>&nbsp;&gt;&nbsp;<a href="../training/index.html">Training</a>&nbsp;&gt;&nbsp;Health &amp; Social Care<!-- #EndEditable --></p>
  111. <h1 class="bmapagetitle"><!-- #BeginEditable "title" --><a name="top"></a>Health &amp; Social Care Training<!-- #EndEditable --></h1>
  112. <!-- #BeginEditable "body" --> <div class="bmabody">
  113. <table width="100%" border="0" cellspacing="0" cellpadding="5">
  114. <tr>
  115. <td valign="top"><div class="bmabody">
  116. <p>We offer a wide range of courses on an in-house basis. We can also provide many other training courses to meet your specific needs. Please contact us even if the course you need is not listed or should you require a specific course developed.</p>
  117. <p>To find out more telephone: 01446 775959 or e-mail: sue.peake@symmonsmadge.co.uk</p>
  118. <?php if (1 == $debug) { // Show if debug on
  119. echo "Catid: $catid";
  120. } // Show if debug on ?>
  121. <?php if (0 <> $catid) { // show if a cateogry selected ?>
  122. <h2><?php echo $row_catalog['coursecategory']; ?></h2>
  123. <?php
  124. if (1 == $debug) { // Show if debug on ?>
  125. <p>Subcategories: <?php echo $totalRows_subcategories ?> </p>
  126. <?php } // Show if debug on ?>
  127. <?php if ($totalRows_subcategories > 0) { // Show if recordset not empty ?>
  128. <?php
  129. $i = 1;
  130. do {
  131. $subcatsarry[$i] = $row_subcategories['subcategory'];
  132. $i++;
  133. } while ($row_subcategories = mysql_fetch_assoc($subcategories));
  134. // echo print_r($subcatsarry);
  135. $numsubcats = count($subcatsarry);
  136. // echo "<br>$numsubcats";
  137. $tablerows = ceil($numsubcats/2);
  138. // echo "<br>$tablerows";
  139. ?>
  140. <h4>Subcategories:</h4>
  141. <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="bmabody">
  142. <?php
  143. $i = 1;
  144. while ($i <= $tablerows) {
  145. echo "<tr valign=\"top\">\n<td><li><a href=\"#$i\"><strong>$subcatsarry[$i]</strong></a></li></td>\n";
  146. $j = $i + $tablerows;
  147. if ($j <= $numsubcats) {
  148. echo "<td><li><a href=\"#$j\"><strong>$subcatsarry[$j]</strong></a></li></td>\n</tr>\n";
  149. }
  150. $i++;
  151. }
  152. ?>
  153. </table>
  154. <p>&nbsp;</p>
  155. <p>&nbsp;</p>
  156. <p></p>
  157. <?php } // Show if recordset not empty ?>
  158. <?php
  159. $subcategories = mysql_query($query_subcategories, $bryanmadge) or die(mysql_error());
  160. $t = 0;
  161. $i = 0;
  162. for ($k = 0; $k <= $numsubcats; $k++) {
  163. $i = $i + 1;
  164. if ($row_catalog['catalog_id'] <> null) {
  165. $n = $row_catalog['subcategoryid'];
  166. if (1 == $debug) { // Show if debug on
  167. echo 'k: ',$k,"<br>";
  168. }
  169. if (($t <> 1) AND (0 == $k) AND ($row_catalog['subcategoryid'] <> null)) {
  170. $row_subcategories = mysql_fetch_assoc($subcategories);
  171. // $k = -1;
  172. $t = 1;
  173. }
  174. if (1 == $debug) { // Show if debug on
  175. echo 'k: ',$k,"<br>";
  176. }
  177. if (0 < $k) {
  178. $row_subcategories = mysql_fetch_assoc($subcategories);
  179. }
  180. if (1 == $debug) { // Show if debug on
  181. echo 'catalog.categoryid: ',$row_catalog['categoryid'],"<br>";
  182. echo 'catalog.subcategoryid: ',$row_catalog['subcategoryid'],"<br>";
  183. echo 'subcategories.id: ',$row_subcategories['id'],"<br>";
  184. echo 'k: ',$k,"<br>";
  185. } ?>
  186. </p>
  187. <table width="100%" border="0" class="bmabody">
  188. <tr>
  189. <td><h3><a name="<?php echo $i; ?>"></a><?php echo $row_subcategories['subcategory']; ?></h3></td>
  190. </tr>
  191. <tr>
  192. <td><ul>
  193. <?php do { ?>
  194. <li><a href="course-details.php?id=<?php echo $row_catalog['catalog_id']; ?>"><?php echo $row_catalog['title']; ?></a></li>
  195. <?php
  196. if (1 == $debug) { // Show if debug on
  197. echo 'catalog.subcategoryid: ',$row_catalog['subcategoryid'],"<br>";
  198. echo 'subcategories.id: ',$row_subcategories['id'],"<br>";
  199. echo 'catalog.subcategoryid: ',$row_catalog['subcategoryid'],"<br>";
  200. }
  201. if ($row_catalog['subcategoryid'] == null) {
  202. $row_catalog['subcategoryid'] = 0;
  203. }
  204. if ($row_subcategories['id'] == null) {
  205. $row_subcategories['id'] = 0;
  206. }
  207. if (1 == $debug) { // Show if debug on
  208. echo 'catalog.subcategoryid after check: ',$row_catalog['subcategoryid'],"<br>";
  209. }
  210. ?>
  211. <?php // } while (($row_catalog = mysql_fetch_assoc($catalog)) AND ($row_catalog['subcategoryid'] = $row_subcategories['id'])); ?>
  212. <?php } while (($row_catalog = mysql_fetch_assoc($catalog)) AND $row_subcategories['id'] == $row_catalog['subcategoryid']); ?>
  213. </ul></td>
  214. </tr>
  215. <tr>
  216. <td><p align="right"><a href="#top">back to top</a></p></td>
  217. </tr>
  218. </table>
  219. <?php
  220. }
  221. }
  222. ?>
  223. <?php } // show if a cateogry selected ?>
  224. </div></td>
  225. </tr>
  226. </table>
  227. </div>
  228. <!-- #EndEditable --></div>
  229. <div class="printhide"><!-- #BeginLibraryItem "/Library/Full Footer.lbi" --><hr width="65%">
  230. <p align="center"><!-- #BeginLibraryItem "/Library/Footer.lbi" --><!-- #EndLibraryItem --></p>
  231. <!-- #EndLibraryItem --><!-- #BeginLibraryItem "/Library/Legal footer.lbi" --><div align="center" class="bmabody"><font size="1"><a href="../company/legal.html">Legal
  232. Notice</a><br>
  233. Copyright &copy; Symmons Madge Associates Ltd, All Rights Reserved</font></div>
  234. <!-- #EndLibraryItem --><!-- Start of StatCounter Code -->
  235. <script type="text/javascript" language="javascript">
  236. var sc_project=337750;
  237. var sc_partition=1;
  238. </script>
  239. <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript>
  240. <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>
  241. </noscript>
  242. <!-- End of StatCounter Code -->
  243. <!-- InstanceBeginEditable name="EditRegion1" --><!-- #BeginLibraryItem "/Library/Google Analytics PHP Include.lbi" -->
  244. <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/analyticstracking.php"); ?><!-- #EndLibraryItem --><!-- InstanceEndEditable --></div>
  245. </body>
  246. <!-- InstanceEnd --></html>
  247. <?php
  248. mysql_free_result($categories);
  249. mysql_free_result($catalog);
  250. mysql_free_result($subcategories);
  251. ?>