<html>
<head>
</head>

<body><font face="verdana, arial">
<table><tr><td><IMG ALIGN="left" ALT="[Logo]" SRC="http://www.spssusers.co.uk/Images/assesslogo.gif" WIDTH="200" ></td>
<td><h3><em>ASSESS: SPSS/PASW USERS' GROUP<br>WORKSHOPS JULY 2010<br>UNIVERSITY OF CARDIFF</em></h3></td></tr></table>
<h2>BOOKING FORM<br>
<h3>WORKSHOP:WRITING AND USING SPSS (PASW) SYNTAX<br>
<font size="-1">Thursday 8th July 2010 (University of Cardiff)</font></h3>
<h3>WORKSHOP:WRITING AND USING SPSS (PASW) MACROS & OMS<br>
<font size="-1">Friday 9th July  2010 (University of Cardiff)</font></h3>
<p><strong><em>Important:</em></strong></br>
Bookings will not be treated as firm until a cheque or official (company) order, payable to ASSESS, is received. Payment can also be made by BACS - details on request. Please indicate if you require a receipt. Please note we reserve the right to cancel the workshops if there are insufficient numbers.</p>

<?php
function radioset($field,$default) {
	$def1 = ""; $def2 = ""; $def12 = "";
	if ($default == 1) $def1 = "checked=\"checked\"";
	if ($default == 2) $def2 = "checked=\"checked\"";
	if ($default == 12) $def12 = "checked=\"checked\"";
	print("<input type=\"radio\" name=\"$field\" value=\"1\" $def1 />Syntax &nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"$field\" value=\"2\" $def2 />Macros & OMS &nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"$field\" value=\"12\" $def12 />Both");
}
$bgnm = ""; $bgem = ""; $bga1 = ""; $bga2 = ""; $bgpc = ""; $bgw1 = "";   $bgbt = "";
#print("<font color='yellow'>"); print_r($_POST);print("</font>");

$oops = 0; $sent = 0;

if ($_POST[submit] == "Send") {
	$sent = 1;
	$name 		= $_POST['name'];			if ($name == "") { $oops +=1; $bgnm = "red";}
	$phone		= $_POST['phone'];
	$email		= $_POST['email'];			if ($email == "") { $oops +=1; $bgem = "red";}
	$fax		= $_POST['fax'];
	$jobtitle	= $_POST['jobtitle'];
	$org		- $_POST['org'];
	$address1	= $_POST['address1'];		if ($address1 == "") { $oops +=1; $bga1 = "red";}
	$address2	= $_POST['address2'];		if ($address2 == "") { $oops +=1; $bga2 = "red";}
	$address3	= $_POST['address3'];
	$address4	= $_POST['address4'];
	$postcode	= $_POST['postcode'];		if ($postcode == "") { $oops +=1; $bgpc = "red";}
	$which1		= $_POST['which1'];			if (!$which1) { $oops +=1; $bgw1 = "red";}
	$corpatt1	= $_POST['corpatt1'];
	$corpatt2	= $_POST['corpatt2'];
	$corpatt3	= $_POST['corpatt3'];
	$which2		= $_POST['which2'];			if ($corpatt1 != "" && !$which2) { $oops +=1; $bgw2 = "red";}
	$which3		= $_POST['which3'];			if ($corpatt2 != "" && !$which3) { $oops +=1; $bgw3 = "red";}
	$which4		= $_POST['which4'];			if ($corpatt3 != "" && !$which4) { $oops +=1; $bgw4 = "red";}
	$dietreq	= $_POST['dietreq'];
	$booktype	= $_POST['booktype'];		if (!$booktype) { $oops +=1; $bgbt = "red"; }
	$invaddress = $_POST['invaddress'];

	$totaldue=0;
	$which1val = 1; if ($which1==12) $which1val=2;
	$which2val=0; $which3val=0; $which4val=0;
	if ($which2) { $which2val = 1; if ($which2==12) $which2val=2; }
	if ($which3) { $which3val = 1; if ($which3==12) $which3val=2; }
	if ($which4) { $which4val = 1; if ($which4==12) $which4val=2; }
	$totalplaces = $which1val + $which2val + $which3val + $which4val;
	switch ($booktype) {
		case "student"; $totaldue = $which1val * 75; break;
		case "indiv"; $totaldue = $which1val * 150; break;
		case "corp"; $totaldue = $which1val * 150 + ($which2val + $which3val + $which4val) * 125; break;
	}

	$booking = implode("\", \"",$_POST);
	$booking = "\"" . $booking . "\"";
	#print("<font color='red'>The number of missing fields is: [$oops]</font>");
	if ($oops == 0) {
	#peter.watson@mrc-cbu.cam.ac.uk
	mail('peter.watson@mrc-cbu.cam.ac.uk', 'July 2010 workshop booking', $booking) or die("Could not register your booking");
	print("<h4><font color='acqua'>Thank you - your booking has been recorded. Please print this form and send it with your cheque or official purchase order to the address below.</font></h4>");
	} else {

	print("<h4><font color=\"red\">Sorry, you have omitted some key information. Please try again.</font></h4>");
	}
} else {
	print("<p><font color='red'>Fields indicated with an asterisk are mandatory.</font></p>");}
	$bktyp1 = ""; $bktyp2 = ""; $bktyp3 = "";
	if ($booktype == 'indiv') $bktyp1 = "checked=\"checked\"";
	if ($booktype == 'corp') $bktyp2 = "checked=\"checked\"";
	if ($booktype == 'student') $bktyp3 = "checked=\"checked\"";
	print("\n<form action=\"bookingform_workshopsJuly2010.php\" method=\"post\">");
	print("<table border=\"0\" width=\875\" cellpadding=\"5\">");
	print("\n<tr><td width=\"100\" align='right'>Name:</td><td width=\"450\" bgcolor=\"$bgnm\">* <input type=\"text\" size=\"60\" name=\"name\" value=\"$name\"</></td>");
	print("<td width=\"100\" align=\"right\">Tel:</td><td><input type=\"text\" size=\"20\" name=\"phone\" value=\"$phone\"</></td></tr>");
	print("\n<tr><td align='right'>Email:</td><td bgcolor=\"$bgem\">* <input type=\"text\" size=\"60\" name=\"email\" value=\"$email\"</></td>");
	print("<td align=\"right\">Fax:</td><td><input type=\"text\" size=\"20\" name=\"fax\" value=\"$fax\"</></td></tr>");
	print("\n<tr><td align='right'>Job title:</td><td colspan=\"3\"><input type=\"text\" size=\"111\" name=\"jobtitle\" value=\"$jobtitle\"</>");
	print("\n<tr><td align='right'>Organisation:</td><td colspan=\"3\"><input type=\"text\" size=\"111\" name=\"org\" value=\"$org\"</>");
	print("\n<tr><td valign=\"top\" rowspan=\"4\" align='right'>Address:</td><td colspan=\"3\" bgcolor=$bga1>* <input type=\"text\" size=\"109\" name=\"address1\" value=\"$address1\"</></td></tr>");
	print("\n<tr><td colspan=\"3\" bgcolor=\"$bga2\">* <input type=\"text\" size=\"109\" name=\"address2\" value=\"$address2\"</></td></tr>");
	print("\n<tr><td colspan=\"3\"><input type=\"text\" size=\"111\" name=\"address3\" value=\"$address3\"</></td></tr>");
	print("\n<tr><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"address4\" value=\"$address4\"</></td>");
	print("\n<td align='right'>Postcode:</td><td bgcolor=\"$bgpc\">* <input type=\"text\" size=\"18\" name=\"postcode\" value='$_POST[postcode]'</></td></tr>");
	#print("<tr><td colspan=\"4\"></td></tr>");
	print("<tr><td>&nbsp;</td><td colspan='3' bgcolor=\"$bgw1\">Which workshop(s) are you interested in attending?<br>"); 	radioset("which1",$which1);
	#print("<tr><td colspan=\"4\"></td></tr>");
	print("\n<tr><td bgcolor=\"$bgbt\"><input type=\"radio\" name=\"booktype\" value=\"indiv\" $bktyp1></td><td colspan=\"3\"><strong>INDIVIDUAL BOOKING</strong> Please reserve a place for me at a cost of £150 per day.</td></tr>");
	#print("<tr><td colspan=\"4\"></td></tr>");
	print("\n<tr><td bgcolor=\"$bgbt\"><input type=\"radio\" name=\"booktype\" value=\"student\" $bktyp3></td><td colspan=\"3\"><strong>STUDENT (POSTGRADUATE) BOOKING</strong> (Send photocopied evidence of status for 2009-2010 or 2010-2011 academic years) Please reserve one of the student places at a cost of £75 per day.</td></tr>");
	#print("<tr><td colspan=\"4\"></td></tr>");
	print("\n<tr><td bgcolor=\"$bgbt\"><input type=\"radio\" name=\"booktype\" value=\"corp\" $bktyp2></td><td colspan=\"3\"><strong>CORPORATE BOOKING</strong> <br>Please reserve additional place(s) <strong>at a cost of £125 for each subsequent person per day.</strong></td></tr>");
	print("\n<tr><td rowspan=\"3\" valign=\"top\" align='right'>Names of attendees:</td><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"corpatt1\" value=\"$corpatt1\"</></td>");
	print("<td colspan='2' bgcolor=\"$bgw2\">"); radioset("which2",$which2); print("</td></tr>");
	print("\n<tr><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"corpatt2\" value=\"$corpatt2\"</></td>");
	print("<td colspan='2' bgcolor=\"$bgw3\">"); radioset("which3",$which3); print("</td></tr>");
	print("\n<tr><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"corpatt3\" value=\"$corpatt3\"</></td>");
	print("<td colspan='2' bgcolor=\"$bgw4\">"); radioset("which4",$which4); print("</td></tr>");
	print("<tr><td colspan=\"4\"></td></tr>");
	print("\n<tr><td colspan=\"4\">Please specify vegetarian or other dietary requirements: <input type=\"text\" size=\"70\" name=\"dietreq\" value=\"$dietreq\"</></td></tr>");
	print("<tr><td colspan=\"4\"></td></tr>");
	print("\n<tr><td colspan=\"4\">For official orders, please give the address for invoicing:<br><input type=\"text\" size=\"129\" name=\"invaddress\" value=\"$invaddress\"</></td></tr>");
	#print("<tr><td colspan=\"4\"</td></tr>");
	if ($sent ==0 || ($sent == 1 && $oops>0)) print("\n<tr><td colspan=\"4\"><input type=\"submit\" name=\"submit\" value=\"Send\" /></td></tr>");
	print("</table></form>");
	if ($sent==1 && $oops ==0) print("<h4><font color='acqua'>Total amount due is: £$totaldue.</font> </h4>");
?>
<hr><strong><font size = '-1' face="verdana, arial"><p>Return completed forms to Peter Watson, ASSESS, 15 Chaucer Road, Cambridge CB2 7EF by FRIDAY 18th JUNE 2010.</p></strong>
<p>Telephone enquiries about bookings: 01233 355294 x801 (with answerphone).</br>E-mail enquiries: peter.watson@mrc-cbu.cam.ac.uk <strong>(Important: put 'ASSESS' in the Subject field)</strong></font></p>

</body>
</html>