<?php
/*==========================================================================================================================
| CONTACT US FORM
|
| Author:    Aaron Sargent, (agsarge@u.washington.edu)
| Client:    Seattle STD/HIV Prevention Training Center
| Project:   Contact Us Form
|
| Purpose:   Form for users to send emails to Seattle STD/HIV Prevention Training Center
|
*>=========================================================================================================================
| Revisions  Date        Author          Comments
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|            03.09.06    Aaron Sargent   Initial creation.
\-------------------------------------------------------------------------------------------------------------------------*/
/*==========================================================================================================================
| SESSION START
\=========================================================================================================================*/
  session_start();

/*==========================================================================================================================
| INCLUDES
\=========================================================================================================================*/
  require("/hw00/d32/seaptc/global.php");

/*==========================================================================================================================
| VARIABLES
\=========================================================================================================================*/
  $strFrom                            = "";
  $strSubject                         = "";
  $strBody                            = "";
  $strBcc                             = "";

/*==========================================================================================================================
| PROCESS
\=========================================================================================================================*/
  if ($_POST["submit_form"])
  {
    $_SESSION["first_name"]             = $_POST["first_name"];
    $_SESSION["last_name"]              = $_POST["last_name"];
    $_SESSION["email"]                  = $_POST["email"];
    $_SESSION["subject"]                = $_POST["subject"];
    $_SESSION["body"]                   = $_POST["body"];
    
    $intError                           = validate_email($_POST["email"], "");
    $intError                          .= validate("First Name", $_SESSION["first_name"], "");
    $intError                          .= validate("Last Name", $_SESSION["last_name"], "");
    $intError                          .= validate("Subject", $_SESSION["subject"], "");


    if (!$intError)
    {
      $strFrom                          = $_POST["first_name"] . " " . $_POST["last_name"] . " <" . $_POST["email"] . ">";
      $strSubject                       = $_POST["subject"];                  
      $strBody                          = stripslashes_deep($_POST["body"]);

    //Send email to administrator
      $bitSuccess                       = send_email(ADMIN_EMAIL, $strSubject, $strBody, $strFrom, $strBCC);

      if ($bitSuccess)
      {
        $strNotify                      = notify("Thank you.  Your message has been sent.");
        session_destroy();
      }
    }
    else
    {
      $strNotify                        = $intError;
    }
  }

/*==========================================================================================================================
| START HTML OUTPUT
\=========================================================================================================================*/
  require("/hw00/d32/seaptc/includes/internal_top.inc");
  require("/hw00/d32/seaptc/includes/nav_home.inc");
?>

        <form name="contact_us" method="post" action="contact_us.php">
       
        <table width="500" cellpadding="2" cellspacing="0" border="0" class="content">
          <tr>
            <td width="500"><h3>Contact Us</h3></td>
          </tr>
        </table>
        
        <table border="0" cellpadding="7" cellspacing="0" align="right" style="border: 1px black solid">
        <tr><td bgcolor="#EAEAEB"><p style="font-size:0.70em; line-height:1.20em;">Seattle STD/HIV PTC<br>
          Harborview Medical Center<br>
          Box 359932<br />
          325 9th Ave.<br>
          Seattle, WA 98104<br>
          p : 206.685.9850<br>
          f : 206.221.4945<br>
          <A HREF="mailto:seaptc@u.washington.edu">seaptc@u.washington.edu</A>
          </p>
            </td></tr>
        </table>

        <span class="content"><p>We'd love to hear from you! If you have any questions about the Center or have an inquiry about one of our courses, drop us a line by filling out the form below.</p>
        <p><i>We will not use your information for anything other than contacting you with information about the Seattle STD/HIV PTC.</i></p></span>
                <?php print $strNotify; ?>
        <br>
        <h4>Send Your Inquiry:</h4>
        <table width="500" cellpadding="2" cellspacing="0" border="0" class="form_bg content">
          <tr>
            <td width="30" rowspan="7"><img width="30" src="images/spacer.gif"></td>
            <td colspan="4" width="440"><img width="440" height="7" src="images/spacer.gif"></td>
            <td width="30" rowspan="7"><img width="30" src="images/spacer.gif"></td>
          </tr>
          <tr class="form_margin">
            <td width="80">First Name:</td>
            <td width="140"><input type="text" name="first_name" value="<? print $_SESSION['first_name']?>"></td>
            <td width="80">Last Name:</td>
            <td width="140"><input type="text" name="last_name" value="<? print $_SESSION['last_name']?>"></td>
          </tr>
          <tr>
            <td colspan="4" width="440"><img width="440" height="7" src="images/spacer.gif"></td>
          </tr>
          <tr class="form_margin">
            <td width="80">Email:</td>
            <td width="140"><input type="text" name="email" value="<? print $_SESSION['email']?>"></td>
            <td width="80">Subject:</td>
            <td width="140"><input type="text" name="subject" value="<? print $_SESSION['subject']?>"></td>
          </tr>
          <tr>
            <td colspan="4" width="440"><img width="440" height="7" src="images/spacer.gif"></td>
          </tr>
          <tr class="form_margin">
            <td width="440" colspan="4">Comments:<br><textarea cols="52" rows="7" name="body" value="<? print $_SESSION['body']?>"></textarea></td>
          </tr>
          <tr>
            <td colspan="4" width="440"><img width="440" height="7" src="images/spacer.gif"></td>
          </tr>
        </table>
        <p>
        <input type="submit" name="submit_form" value=">> Submit <<" class="content">
        
        </form>
<?php
  require("/hw00/d32/seaptc/includes/footer.inc");
?>