<?php
  if(defined($_POST['submitted'])) {
    if( ($_POST['NAME'] != "") && ($_POST['EMAIL'] != "") )
      $posted = 1;
  }

  if($posted) {

    $attend = "";
    if($_POST['SPEAKER'])
        $attend .= "Speaker ";
    if($_POST['SPONSOR'])
        $attend .= "Sponsor ";
    if($_POST['FCMEMB'])
        $attend .= "FC representative ";
    if($_POST['PCMEMB'])
        $attend .= "PC member";

    $badge = "No";
    if($_POST['BADGE'])
        $badge = "Yes";
    $pgpsess = "No";
    if($_POST['PGPSESS'])
        $pgpsess = "Yes";

    $body =     "Name:                      ".$_POST['NAME']."\n".
                "Email:                     ".$_POST['EMAIL']."\n".
                "Organisation:              ".$_POST['ORGNAME']."\n".
                "Address1:                  ".$_POST['ADDRESS1']."\n".
                "Address2:                  ".$_POST['ADDRESS2']."\n".
                "City:                      ".$_POST['CITY']."\n".
                "County/State:              ".$_POST['STATE']."\n".
                "Country:                   ".$_POST['COUNTRY']."\n".
                "Post Code:                 ".$_POST['POSTCODE']."\n".
                "Phone:                     ".$_POST['PHONE']."\n".
                "\n".
                "Attendance:                ".$attend."\n".
                "Badge:                     ".$badge."\n".
                "PGP Signing:               ".$pgpsess."\n";

    $ackbody =  "Thank you for registering for UKNOF7\n\n".
                "Attendance:                ".$attend."\n".
                "Badge required:            ".$badge."\n".
                "PGP Signing:               ".$pgpsess."\n";

    $pgpbody =  "Name:                      ".$_POST['NAME']."\n".
                "Email:                     ".$_POST['EMAIL']."\n".
                "PGP Signing:               ".$pgpsess."\n".
                "PGP Fingerprint:           ".$_POST['PGPFING']."\n";

    mail("register@uknof.org.uk",
         "UKNOF7 Registration: " . $_POST['NAME'],
         $body,
         "From: Registration PHP <admin@uknof.org.uk>");

    echo "Thank you for your registration !<BR>\n";
    echo "You submitted details as follows:<BR>\n<PRE>\n" . $body . "</PRE>";

    mail($_POST['EMAIL'],
	 "UKNOF7 Registration Confirmation: " . $_POST['NAME'],
         $ackbody,
         "From: Registration PHP <admin@uknof.org.uk>");

    if($pgpsess == "Yes") {
        mail("pgpsign@uknof.org.uk",
           "UKNOF7 PGP Signing: " . $_POST['NAME'],
           $pgpbody,
           "From: Registration PHP <admin@uknof.org.uk>");

        echo "<BR>\n<PRE>\n" . $pgpbody . "</PRE>";
    }

  }
  else {
?>


<TITLE>UKNOF7 Meeting Registration</TITLE>

<TABLE ALIGN=RIGHT><TR>
<TD><A HREF="http://www.uknof.org.uk"><IMG SRC="/images/uknof_logo.jpg" width=200></A></TD>
</TR></TABLE>

<H2><A HREF="index.html">UKNOF7</A> Meeting Registration</H2>

<BR><BR><P>
Thanks to our sponsors, attendance at UKNOF meetings is free. In order to keep it this
way, please help us by registering if you plan to attend. This helps us keep costs under
control, and makes it easier to attract future sponsors.
</P>
<CENTER>

<FORM NAME="UKNOFRegistration" action="register.php" method="POST">

<H3>Your details</h3>

<TABLE BORDER="0" WIDTH="100%" CELLSPACING="5" CELLPADDING="0">
  <COL WIDTH="30%"><COL WIDTH="70%">
  <TR><TD ALIGN="RIGHT">Name:
        </TD><TD><INPUT TYPE="text" NAME="NAME" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">Email Address:</TD>
        <TD><INPUT TYPE="text" NAME="EMAIL" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">Organisation:</TD>
        <TD><INPUT TYPE="text" NAME="ORGNAME" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">Address:
        </TD><TD><INPUT TYPE="text" NAME="ADDRESS1" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">
        </TD><TD><INPUT TYPE="text" NAME="ADDRESS2" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">City:
        </TD><TD><INPUT TYPE="text" NAME="CITY" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">County/State:
        </TD><TD><INPUT TYPE="text" NAME="STATE" SIZE="30" MAXLENGTH="70"></TD></TR>
    <TR><TD ALIGN="RIGHT">Country:</TD>
  <TD><SELECT NAME="COUNTRY">
        <option value=UK selected> United Kingdom</option>
        <option value=ENG> England</option>
        <option value=NIR> Northern Ireland</option>
        <option value=SCO> Scotland</option>
        <option value=WAL> Wales</option>
        <option value=DE> Germany</option>
        <option value=ES> Spain</option>
        <option value=IE> Ireland</option>
        <option value=NL> Netherlands</option>
        <option value=EU> Other EU/EEA</option>
        <option value=US> United States</option>
        <option value=OTH> Other</option>
  </select>
<BR>
    <TR><TD ALIGN="RIGHT">Post Code:</TD>
        <TD><INPUT TYPE="text" NAME="POSTCODE" SIZE="20" MAXLENGTH="25"></TD></TR>
    <TR><TD ALIGN="RIGHT">Phone:</TD>
        <TD><INPUT TYPE="text" NAME="PHONE" SIZE="25" MAXLENGTH="25"></TD></TR>
<TR><TD COLSPAN=2 WIDTH="50%" ALIGN=CENTER>
<P>

</TABLE>

<h3>Attendance</h3>

<p>
Please check all that apply. Note:
<UL>
<LI>If you have a UKNOF attendee badge from a previous meeting, please bring it again.
</p>

<table width=50% cols=2 bgcolor="#FFFFDF" border=1 cellpadding=0 cellspacing=0>
 <tr>
  <td width=30%>Name Badge Required</td>
  <td width=5% align=center><INPUT TYPE="checkbox" NAME="BADGE"></td>
 </tr>
 <tr>
  <td width=30%>Speaker</td>
  <td width=5% align=center><INPUT TYPE="checkbox" NAME="SPEAKER"></td>
 </tr>
 <tr>
  <td width=30%>Sponsor</td>
  <td width=5% align=center><INPUT TYPE="checkbox" NAME="SPONSOR"></td>
 </tr>
 <tr>
  <td width=30%>Funding Council Representative</td>
  <td width=5% align=center><INPUT TYPE="checkbox" NAME="FCMEMB"></td>
 </tr>
 <tr>
  <td width=30%>Programme Committee Member</td>
  <td width=5% align=center><INPUT TYPE="checkbox" NAME="PCMEMB"></td>
 </tr>
</table>

<h3>PGP Signing</h3>

<p>

<table width=50% cols=2 bgcolor="#FFFFDF" border=1 cellpadding=0 cellspacing=0>
 <tr>
  <td width=30%>I wish to take part in the PGP Signing</td>
  <td width=5% align=center><INPUT TYPE="checkbox" NAME="PGPSESS"></td>
 </tr>
</table>
<p>
If yes, please supply your PGP key fingerprint below, 
<br>and bring your PGP key details and
<br>recognised photo ID with you to the meeting.
</p>
<TABLE>
 <TR>
  <TD ALIGN="RIGHT">PGP Key Fingerprint:</TD>
  <TD><INPUT TYPE="text" NAME="PGPFING" SIZE="50" MAXLENGTH="64"></TD>
 </TR>
</table>

<input type="hidden" name="submitted" value="true" />

<CENTER><INPUT TYPE="submit" VALUE="Submit">
        <INPUT TYPE="reset" VALUE="Clear Form"></CENTER>
</FORM>

<p>
For further information on the UKNOF7 event, speakers, agenda,
<br>any other questions, or if you need to cancel your registration, please e-mail
<br><A HREF="mailto:admin@uknof.org.uk">&lt;admin@uknof.org.uk&gt;</A>
</p>

<?php
 }
?>
