sma-website /diary/diary.php

Language PHP Lines 150
MD5 Hash 59f694156b51a07676a517cc8d9f23fb Estimated Cost $609 (why?)
Repository https://bitbucket.org/molusc/sma-website.git View Raw File
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php session_start();  ?>
<?php require_once('../Connections/bryanmadge.php'); ?>
	<?php
	mysql_select_db($database_bryanmadge, $bryanmadge);

  	if(isset($_SESSION['company']))
		$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";
	else
		$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";

	$Diary = mysql_query($query_Diary, $bryanmadge) or die(mysql_error());
//	$row_Diary = mysql_fetch_assoc($Diary);
	$totalRows_Diary = mysql_num_rows($Diary);
?>
<html><!-- InstanceBegin template="/Templates/general.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<LINK REL="SHORTCUT ICON" HREF="../favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Dreamweaver MX">
<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">
<!-- #BeginEditable "doctitle" -->
<title>Course Diary - Symmons Madge Associates Ltd</title>
<!-- #EndEditable -->
<link rel="stylesheet" href="../bma.css" type="text/css">
<link rel="stylesheet" href="../print.css" type="text/css" media="print" />
<!-- InstanceParam name="OptionalPageTitle" type="boolean" value="true" --><!-- InstanceParam name="OptionalBreadcrumbs" type="boolean" value="true" --><!-- InstanceParam name="Google Analytics Code" type="boolean" value="true" -->
</head>

<body><div class="printhide"><!-- #BeginLibraryItem "/Library/Masthead.lbi" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="150" rowspan="2"><a href="../home.html" target="_top">
      <!--        	<img src="../images/smalogo_sml_party_hat.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="90" border="0">
-->
      <img src="../images/smalogo_sml.gif" ALT="Symmons Madge Associates Ltd home" width="124" height="64" border="0"> </a></td>
    <td><p class="tagline"><font size="4">Training for a Successful Future</font></p></td>
  </tr>
  <tr>
    <td valign="bottom"><table class="masthead" width="100%" height=25 border="0" cellpadding="0" cellspacing="0">
      <tr>
        <!--  	<td width="5%" bgcolor="#FFFFFF">&nbsp;</td>-->
        <td align="left" valign="top"><img src="/images/corner_TL.gif" width="15" height="25"></td>
        <td>&nbsp;&nbsp;<a 		  
						href="../courses/index.php" target="_top">Courses</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
						href="diary.php" target="_top">Course&nbsp;Diary</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
						href="../training/training-club.php" target="_top">Regional Training</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
						href="../consultancy/index.html" target="_top">Consultancy</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
						href="../search/index.php" target="_top">Search</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
                        href="../links.html" target="_top">Links</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
						href="../company/about.html" target="_top">About us</a> &nbsp;<FONT color=#909090>:</FONT>&nbsp;&nbsp;<a 
						href="../contact.html" target="_top">Contact</a>&nbsp;&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<!-- #EndLibraryItem --></div>
<div class="printonly">
  <div align="right"><img src="../images/smalogo_sml.gif" width="124" height="64" class="floatright"></div>
</div>
<div id="main"> 
  <p class="breadcrumbs printhide"><!-- #BeginEditable "breadcrumbs" --><a href="../home.html" target="_top">Home</a>&nbsp;&gt;&nbsp;Course Diary <!-- #EndEditable --></p>
  <h1 class="bmapagetitle"><!-- #BeginEditable "title" -->Course Diary<!-- #EndEditable --></h1>
  <!-- #BeginEditable "body" -->
  <div id="main" class="bmabody">
    <p> For further details and bookings please <a href="../booking_form.php" target="_self">click
		here</a> or phone us on (01446) 775959 or e-mail <a href="mailto:admin@symmonsmadge.co.uk">admin@symmonsmadge.co.uk</a>.</p>
    <!-- 	<p>There are <?php echo $totalRows_Diary ?> courses in the table</p>
 -->	<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="bmabody">
<?php
	while ($row_Diary = mysql_fetch_assoc($Diary)) {
		// set $month
		$dt = $row_Diary['course_date'];
		$month = (int) date('n', $dt);
//		echo 'start month: ',$month,'<br>'; //debug
//		echo 'start current: ',$current,'<br>'; //debug
		?>

		<?php if ($month <> $current) { // if first of new month ?>
			<tr valign="bottom">
				<td height=50 class="diarymonth" colspan="3">
					<?php
						// print month header
						$dt = $row_Diary['course_date'];
						echo date('F Y', $dt);
					?>
				</td>
			</tr>
		<?php
		} ?>

		<tr>
			<td width="30" valign=top> <p>
				<?php
					// print course date
					$dt = $row_Diary['course_date'];
					$current = (int) date('n', $row_Diary['course_date']);
					// echo date('jS F Y', $dt);
					echo date('jS', $dt);
				?>
				</p></td>
			<td valign=top> <p>
				<?php echo "<a href=\"/courses/course-details.php?id=",$row_Diary['course_title_id'],"\">",$row_Diary['title'],"</a>";
				?>
				</p></td>
			<td valign=top> <div align="center">
				<?php echo $row_Diary['course_town']; ?>
				</div></td>
            <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>
	  </tr>
		<?php
//			echo "<td>month: $month</td>"; //debug
//			echo "<td>current: ",(int) date('n', $row_Diary['course_date']),"</td>"; //debug
		?>


		<?php
		$dt = $row_Diary['course_date']; //debug
//		$month = date('n', $dt); //debug
//		echo 'end month: ',$month,'<br>'; //debug
//		echo 'end current: ',$current,'<br>'; //debug
	} ?>
		</table>
	<p>Our Written Exercise and Study Day courses are offered in the Spring and Autumn each year. </p>
    <p>For further details and bookings please <a href="../booking_form.php" target="_self">click 
    here</a> or phone us on (01446) 775959 or e-mail <a href="mailto:admin@symmonsmadge.co.uk">admin@symmonsmadge.co.uk</a>. 
</div>
<!-- #EndEditable --></div>
<div class="printhide"><!-- #BeginLibraryItem "/Library/Full Footer.lbi" --><hr width="65%">
<p align="center"><!-- #BeginLibraryItem "/Library/Footer.lbi" --><!-- #EndLibraryItem --></p>

<!-- #EndLibraryItem --><!-- #BeginLibraryItem "/Library/Legal footer.lbi" --><div align="center" class="bmabody"><font size="1"><a href="../company/legal.html">Legal
      Notice</a><br>
  Copyright &copy; Symmons Madge Associates Ltd, All Rights Reserved</font></div>
<!-- #EndLibraryItem --><!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=337750; 
var sc_partition=1; 
</script>

<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript>
<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>
</noscript>
<!-- End of StatCounter Code -->
<!-- InstanceBeginEditable name="EditRegion1" --><!-- #BeginLibraryItem "/Library/Google Analytics PHP Include.lbi" -->
	<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/analyticstracking.php"); ?><!-- #EndLibraryItem --><!-- InstanceEndEditable --></div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($Diary);
?>
Back to Top