attachment:new.php of FAQ/php - CBU statistics Wiki
location: attachment:new.php of FAQ/php

Attachment 'new.php'

Download

   1 <html>
   2 <head>
   3 </head>
   4 
   5 <body><font face="verdana, arial">
   6 <table><tr><td><IMG ALIGN="left" ALT="[Logo]" SRC="http://www.spssusers.co.uk/Images/assesslogo.gif" WIDTH="200" ></td>
   7 <td><h3><em>ASSESS: SPSS/PASW USERS' GROUP<br>WORKSHOPS JULY 2010<br>UNIVERSITY OF CARDIFF</em></h3></td></tr></table>
   8 <h2>BOOKING FORM<br>
   9 <h3>WORKSHOP:WRITING AND USING SPSS (PASW) SYNTAX<br>
  10 <font size="-1">Thursday 8th July 2010 (University of Cardiff)</font></h3>
  11 <h3>WORKSHOP:WRITING AND USING SPSS (PASW) MACROS & OMS<br>
  12 <font size="-1">Friday 9th July  2010 (University of Cardiff)</font></h3>
  13 <p><strong><em>Important:</em></strong></br>
  14 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>
  15 
  16 <?php
  17 function radioset($field,$default) {
  18 	$def1 = ""; $def2 = ""; $def12 = "";
  19 	if ($default == 1) $def1 = "checked=\"checked\"";
  20 	if ($default == 2) $def2 = "checked=\"checked\"";
  21 	if ($default == 12) $def12 = "checked=\"checked\"";
  22 	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");
  23 }
  24 $bgnm = ""; $bgem = ""; $bga1 = ""; $bga2 = ""; $bgpc = ""; $bgw1 = "";   $bgbt = "";
  25 #print("<font color='yellow'>"); print_r($_POST);print("</font>");
  26 
  27 $oops = 0; $sent = 0;
  28 
  29 if ($_POST[submit] == "Send") {
  30 	$sent = 1;
  31 	$name 		= $_POST['name'];			if ($name == "") { $oops +=1; $bgnm = "red";}
  32 	$phone		= $_POST['phone'];
  33 	$email		= $_POST['email'];			if ($email == "") { $oops +=1; $bgem = "red";}
  34 	$fax		= $_POST['fax'];
  35 	$jobtitle	= $_POST['jobtitle'];
  36 	$org		- $_POST['org'];
  37 	$address1	= $_POST['address1'];		if ($address1 == "") { $oops +=1; $bga1 = "red";}
  38 	$address2	= $_POST['address2'];		if ($address2 == "") { $oops +=1; $bga2 = "red";}
  39 	$address3	= $_POST['address3'];
  40 	$address4	= $_POST['address4'];
  41 	$postcode	= $_POST['postcode'];		if ($postcode == "") { $oops +=1; $bgpc = "red";}
  42 	$which1		= $_POST['which1'];			if (!$which1) { $oops +=1; $bgw1 = "red";}
  43 	$corpatt1	= $_POST['corpatt1'];
  44 	$corpatt2	= $_POST['corpatt2'];
  45 	$corpatt3	= $_POST['corpatt3'];
  46 	$which2		= $_POST['which2'];			if ($corpatt1 != "" && !$which2) { $oops +=1; $bgw2 = "red";}
  47 	$which3		= $_POST['which3'];			if ($corpatt2 != "" && !$which3) { $oops +=1; $bgw3 = "red";}
  48 	$which4		= $_POST['which4'];			if ($corpatt3 != "" && !$which4) { $oops +=1; $bgw4 = "red";}
  49 	$dietreq	= $_POST['dietreq'];
  50 	$booktype	= $_POST['booktype'];		if (!$booktype) { $oops +=1; $bgbt = "red"; }
  51 	$invaddress = $_POST['invaddress'];
  52 
  53 	$totaldue=0;
  54 	$which1val = 1; if ($which1==12) $which1val=2;
  55 	$which2val=0; $which3val=0; $which4val=0;
  56 	if ($which2) { $which2val = 1; if ($which2==12) $which2val=2; }
  57 	if ($which3) { $which3val = 1; if ($which3==12) $which3val=2; }
  58 	if ($which4) { $which4val = 1; if ($which4==12) $which4val=2; }
  59 	$totalplaces = $which1val + $which2val + $which3val + $which4val;
  60 	switch ($booktype) {
  61 		case "student"; $totaldue = $which1val * 75; break;
  62 		case "indiv"; $totaldue = $which1val * 150; break;
  63 		case "corp"; $totaldue = $which1val * 150 + ($which2val + $which3val + $which4val) * 125; break;
  64 	}
  65 
  66 	$booking = implode("\", \"",$_POST);
  67 	$booking = "\"" . $booking . "\"";
  68 	#print("<font color='red'>The number of missing fields is: [$oops]</font>");
  69 	if ($oops == 0) {
  70 	#peter.watson@mrc-cbu.cam.ac.uk
  71 	mail('peter.watson@mrc-cbu.cam.ac.uk', 'July 2010 workshop booking', $booking) or die("Could not register your booking");
  72 	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>");
  73 	} else {
  74 
  75 	print("<h4><font color=\"red\">Sorry, you have omitted some key information. Please try again.</font></h4>");
  76 	}
  77 } else {
  78 	print("<p><font color='red'>Fields indicated with an asterisk are mandatory.</font></p>");}
  79 	$bktyp1 = ""; $bktyp2 = ""; $bktyp3 = "";
  80 	if ($booktype == 'indiv') $bktyp1 = "checked=\"checked\"";
  81 	if ($booktype == 'corp') $bktyp2 = "checked=\"checked\"";
  82 	if ($booktype == 'student') $bktyp3 = "checked=\"checked\"";
  83 	print("\n<form action=\"bookingform_workshopsJuly2010.php\" method=\"post\">");
  84 	print("<table border=\"0\" width=\875\" cellpadding=\"5\">");
  85 	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>");
  86 	print("<td width=\"100\" align=\"right\">Tel:</td><td><input type=\"text\" size=\"20\" name=\"phone\" value=\"$phone\"</></td></tr>");
  87 	print("\n<tr><td align='right'>Email:</td><td bgcolor=\"$bgem\">* <input type=\"text\" size=\"60\" name=\"email\" value=\"$email\"</></td>");
  88 	print("<td align=\"right\">Fax:</td><td><input type=\"text\" size=\"20\" name=\"fax\" value=\"$fax\"</></td></tr>");
  89 	print("\n<tr><td align='right'>Job title:</td><td colspan=\"3\"><input type=\"text\" size=\"111\" name=\"jobtitle\" value=\"$jobtitle\"</>");
  90 	print("\n<tr><td align='right'>Organisation:</td><td colspan=\"3\"><input type=\"text\" size=\"111\" name=\"org\" value=\"$org\"</>");
  91 	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>");
  92 	print("\n<tr><td colspan=\"3\" bgcolor=\"$bga2\">* <input type=\"text\" size=\"109\" name=\"address2\" value=\"$address2\"</></td></tr>");
  93 	print("\n<tr><td colspan=\"3\"><input type=\"text\" size=\"111\" name=\"address3\" value=\"$address3\"</></td></tr>");
  94 	print("\n<tr><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"address4\" value=\"$address4\"</></td>");
  95 	print("\n<td align='right'>Postcode:</td><td bgcolor=\"$bgpc\">* <input type=\"text\" size=\"18\" name=\"postcode\" value='$_POST[postcode]'</></td></tr>");
  96 	#print("<tr><td colspan=\"4\"></td></tr>");
  97 	print("<tr><td>&nbsp;</td><td colspan='3' bgcolor=\"$bgw1\">Which workshop(s) are you interested in attending?<br>"); 	radioset("which1",$which1);
  98 	#print("<tr><td colspan=\"4\"></td></tr>");
  99 	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>");
 100 	#print("<tr><td colspan=\"4\"></td></tr>");
 101 	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>");
 102 	#print("<tr><td colspan=\"4\"></td></tr>");
 103 	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>");
 104 	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>");
 105 	print("<td colspan='2' bgcolor=\"$bgw2\">"); radioset("which2",$which2); print("</td></tr>");
 106 	print("\n<tr><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"corpatt2\" value=\"$corpatt2\"</></td>");
 107 	print("<td colspan='2' bgcolor=\"$bgw3\">"); radioset("which3",$which3); print("</td></tr>");
 108 	print("\n<tr><td colspan=\"1\"><input type=\"text\" size=\"65\" name=\"corpatt3\" value=\"$corpatt3\"</></td>");
 109 	print("<td colspan='2' bgcolor=\"$bgw4\">"); radioset("which4",$which4); print("</td></tr>");
 110 	print("<tr><td colspan=\"4\"></td></tr>");
 111 	print("\n<tr><td colspan=\"4\">Please specify vegetarian or other dietary requirements: <input type=\"text\" size=\"70\" name=\"dietreq\" value=\"$dietreq\"</></td></tr>");
 112 	print("<tr><td colspan=\"4\"></td></tr>");
 113 	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>");
 114 	#print("<tr><td colspan=\"4\"</td></tr>");
 115 	if ($sent ==0 || ($sent == 1 && $oops>0)) print("\n<tr><td colspan=\"4\"><input type=\"submit\" name=\"submit\" value=\"Send\" /></td></tr>");
 116 	print("</table></form>");
 117 	if ($sent==1 && $oops ==0) print("<h4><font color='acqua'>Total amount due is: £$totaldue.</font> </h4>");
 118 ?>
 119 <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>
 120 <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>
 121 
 122 </body>
 123 </html>

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2014-04-29 09:26:55, 9.1 KB) [[attachment:new.php]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.