<?php

function submitstuff_user_handle_gasraffle( $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: Gas Card 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="/oldkpindex.php">Back to the home page</a>' );
    return $output->GetOutput();
  }
  else
  {
    // send a message about a page view
    $subject = "Gas Card 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: Gas Card 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/gas-2008-07/GasRaffleTicket-display.gif" width="600" height="600" border="0"></div>
<h1 style="text-align:center; padding: 0px 0px 3px 0px;">Win a $500 Gas Card!</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 />
        The Winner will be chosen after 400 tickets are sold.<br />
        <br />
        Purchase your tickets today.<br />&nbsp;
      </div>
    </div>

    <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>Void where prohibited</li>
      <li>Winner will be notified by mail</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="/oldkpindex.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_viewgasraffle()
{
  $contest_name = "Kids' Pages Cares Gas Card Raffle";
  $contest_func = "viewgasraffle";

  return submitstuff_user_handle_gasraffle( $contest_name, $contest_func );
}

?>
