<?php

function submitstuff_user_handle_carraffle( $contest_name, $contest_func )
{
  $email_subject = "$contest_name Submission";
  $thankyou_title = "$contest_name";

  global $page_title;
  $page_title = $thankyou_title;

  list( $_submit_check,
        $entryname,
        $entryemail,
        $rafflequestion ) = pnVarCleanFromInput( '_submit_check',
                                                 'entryname',
                                                 'entryemail',
                                                 'rafflequestion'
                                               );

  // Create output object - this object will store all of our output so that
  // we can return it easily when required
  $output = new pnHTML();
  $output->SetInputMode(_PNH_VERBATIMINPUT);

  if ( $_submit_check == '1' )
  {
    $subject = $email_subject;

    $submitdate = date("F j, Y, g:i a");
    $submitip = getenv("REMOTE_ADDR");

    $message = "";
    $message .= $submitdate . "\n";
    $message .= $submitip . "\n";
    $message .= "\n\n";

    $message .= "Name:\n"     . $entryname      . "\n\n";
    $message .= "Email:\n"    . $entryemail     . "\n\n";
    $message .= "Question:\n" . $rafflequestion . "\n\n";


    // To send HTML mail, you can set the Content-type header.
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
    $headers .= "From: Car Raffle Question <raffle@kidspages.org>\r\n";

    // and now mail it
    @mail('contest@kidspages.org', $subject, $message, $headers);
//    @mail('home@kidspages.org', $subject, $message, $headers);

    $output->Text( '<font class="header">' . $thankyou_title . '</font><br /><br />' );
    $output->Text( '<span style="font-size:18px">Thank you for your question!</span><br /><br />' );

    $output->Text( '<a href="/index.php">Back to the home page</a>' );
    return $output->GetOutput();
  }
  else
  {
    // send a message about a page view
    $subject = "Car Raffle Page View";

    $submitdate = date("F j, Y, g:i a");
    $submitip = getenv("REMOTE_ADDR");

    $message = "";
    $message .= $submitdate . "\n";
    $message .= $submitip . "\n";
    $message .= "\n\n";

    // To send HTML mail, you can set the Content-type header.
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
    $headers .= "From: Car Raffle Page View <raffle@kidspages.org>\r\n";

    // and now mail it
    @mail('contest@kidspages.org', $subject, $message, $headers);
//    @mail('home@kidspages.org', $subject, $message, $headers);
  }




  $entryname      = htmlentities( $entryname );
  $entryemail     = htmlentities( $entryemail );
  $rafflequestion = htmlentities( $rafflequestion );

$output->Text(
<<<EOT
<style type="text/css">
div.class-container {
  border: 2px dashed #fff;
  background-color: #fff;
/*    padding-left:15px; */
/*    padding-right:15px; */
/*    padding-top:15px; */
/*    padding-bottom:0px; */
  font-family: geneva, verdana, trebuchet MS, trebuchet, verdana, arial, sans-serif;
  font-size: 15px;
/*  font-weight:bold; */
  }

div.class-container table {
  font-size: 15px
}

#kp-article {
  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  font-size: 13px;
}

#kp-article .image-right {
  float:right;
  padding:10px;
}

#kp-article .image-left {
  float:left;
  padding-right:10px;
  padding-top:10px;
  padding-bottom:10px;
}

#kp-article p {
  margin: 0px 0px 8px 0px;
  line-height:125%;
}

#kp-article ul {
  padding-top:0px;
  margin-top:0px;
  margin-left:0px;
  padding-left:20px;
}

#kp-article h2 {
  color: #ed1c24;
  font-size: 20px;
  font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold;
  font-weight: bold;
  padding-top: 10px;
  padding-bottom: 0px;
  margin: 0px;
}

#kp-article h1 {
  color: #044a69;
  font-size: 32px;
  font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold;
}

#kp-article .address-block a         { color:#516337; }
#kp-article .address-block a:link    { font-weight: bold; text-decoration: none; }
#kp-article .address-block a:hover   { font-weight: bold; text-decoration: underline; }
#kp-article .address-block a:active  { font-weight: bold; text-decoration: none; }

</style>

<div style="width:785px;">

<div id="kp-article">

<div align="center"><img src="/images/raffle/car-2008-03/VW-TopDown.jpg" width="610" height="273" border="0"></div>
<h1 style="text-align:center; padding: 0px 0px 3px 0px;">Win This VW Convertible!</h1>


<div style="text-align:center;">
  <div style="width:610px;yellow;margin:0 auto;text-align: left;">

    <div style="text-align:center;">
      <div style="font-size:20px;font-weight:bold;color:red;">
        Your odds of winning are fabulous!<br /><br />
        Buy two tickets and get the third ticket FREE!<br /><br />
        Don't delay! Time is running out<br />
        on this amazing opportunity!<br />
        Purchase your tickets today.<br />&nbsp;
      </div>
      <div style="font-size:20px;font-weight:bold;">Only 750 tickets will be sold!</div>
      <div style="font-size:15px;font-weight:bold;">$100 each</div>
      Drawing Date: Thursday, July 3<br />
      Need not be present to win<br />
    </div>

    <br />

    <div style="font-size:18px;font-weight:bold;text-align:center;">
      Gorgeous 2008 VW Beetle Convertible SE Automatic<br />
      <br />

      <img src="/images/raffle/car-2008-03/VW-Interior2.jpg" width="500" height="304"><br /><br />

      Harvest Moon Beige with a Black top.<br />
      <br />
      Rear glass window with defogger,<br />Cream interior,<br />Heated front seats.<br />
      <br />

      <img src="/images/raffle/car-2008-03/VW-Interior1.jpg" width="500" height="333"><br /><br />

      Air conditioning, Cruise control,<br />CD Radio with MP3 format capability,<br /> SIRIUS&reg; satellite radio.<br />
      <br />
      4 year/50,000 24-hour Roadside Assistance.<br />
      <br />
      MSRP: $26,871.00<br />
    </div>

    <br />

    <img src="/images/raffle/car-2008-03/VW-TopUp.jpg" width="610" height="273"><br />

    <br />
    <div>
      <b>Mail check or money order to:</b><br />
      Kids' Pages Cares Inc.<br />
      PO Box 745219<br />
      Arvada, CO 80006<br />
    </div>

    <br />

    <ul>
      <li>Must be 18 years old to purchase tickets</li>
      <li>Winner need not be present to win</li>
      <li>Void where prohibited</li>
      <li>Insurance, vehicle sales tax, license, and all other costs of owning the vehicle are the responsibility of the winner</li>
      <li>Winner will be notified by mail if not present at the drawing</li>
      <li>Prize must be claimed within two weeks of drawing</li>
    </ul>

    <br />
    
    Kids'&nbsp;Pages&nbsp;Cares&nbsp;Inc. is a 501(c)(3) non-profit organization.<br />


  <div class="class-container">
    <br />
    For more information call: 303-277-0053<br />
    <br />
    Or send us a question below:

    <br />
    <form action="/index.php" method="post">
      <input type="hidden" name="module" value="SubmitStuff">
      <input type="hidden" name="func" value="$contest_func">
      <input type="hidden" name="_submit_check" value="1"/>
      <table border="0">
        <tr><td>Name:</td><td><input name="entryname" size="50" maxlength="50" value="$entryname"></td></tr>
        <tr><td>E-Mail:</td><td><input name="entryemail" size="50" maxlength="50" value="$entryemail"></td></tr>
        <tr><td colspan="2">&nbsp;</td></tr>

        <tr><td valign="top">Question:</td><td><textarea name="rafflequestion" cols="50" rows="10">$rafflequestion</textarea></td></tr>

        <tr><td colspan="2">&nbsp;</td></tr>
        <tr><td colspan="2"><input type="submit" name="submit" value="Send It!"></td></tr>
      </table>
    </form>
  </div>



  </div>
</div>

</div>







</div>

EOT
);

  global $pnuser_googleAd;
  $output->Text( $pnuser_googleAd );

  return $output->GetOutput();
}


function submitstuff_user_viewcarraffle()
{
  $contest_name = "Kids' Pages Cares Car Raffle";
  $contest_func = "viewcarraffle";

  return submitstuff_user_handle_carraffle( $contest_name, $contest_func );
}

?>
