Subversion Repositories php_library

Rev

Rev 1 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php session_start(); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <title>Contact Us</title>
     <meta name="GENERATOR" content="Quanta Plus" />
     <meta name="AUTHOR" content="Daily Data, Inc." />
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
     <link href="/contact_us.css" rel="stylesheet" type="text/css" />
     <script language="javascript" type="text/javascript">
     // <!--
        function resizeOuterTo(w,h) {
        if (parseInt(navigator.appVersion)>3) {
          if (navigator.appName=="Netscape") {
            top.outerWidth=w;
            top.outerHeight=h;
          }
          else top.resizeTo(w,h);
        }
        window.self.menubar = 0;
        }
     // -->
     </script>
   </head>
   <body>
      <?php
            if ( strlen (  $_SESSION['contact_us home'] ) == 0 ) {
               $whocalled = parse_url($_SERVER['HTTP_REFERER']);
               if ($whocalled['scheme'])  $callback .= $whocalled['scheme'] . '://';
               if ($whocalled['host'])  $callback .= $whocalled['host'];
               if ($whocalled['port'])  $callback .= ':' . $whocalled['port'];
               if ($whocalled['path'])  $callback .= dirname($whocalled['path']) . '/';
               $callback .= 'contact_us_local.php';
               $_SESSION['contact_us home'] = $_SERVER['DOCUMENT_ROOT'] . dirname($whocalled['path']) . '/' . 'contact_us_local.php';
            }
            include_once( $_SESSION['contact_us home'] );
            //include_once( $_SERVER['DOCUMENT_ROOT'] . "/contact_us_local.php");
            include_once("contact_us_lib.php");
      ?>
      <div id='everything'> <!--This is a box around everything so we can block it in-->
        <div id="header">
          <?php print $HEADER; ?>
        </div> <!-- id="header" -->
        <div id="content">
          <div class="main-text">
              <?php
                if ( verifyForm( $FIELDS ) ) {
                    unset($_SESSION['in_contact_us']); // so if they want to try again, they can
                    if ( SEND_EMAIL ) {
                      if (! sendMessage( $CATEGORIES, $FIELDS ) ) {
                          print $FAILURE_MESSAGE;
                      } else { // following is text for a message successfully sent
                          print $SUCCESS_MESSAGE;
                      } // end else, ie we successfully sent the message
                    } // if defined SEND_EMAIL
                    if (defined('DATABASE') ) {
                      storeMessage( $CATEGORIES, $FIELDS );
                      echo ('You can close this window now');
                    }
                } else { // we did not get a from_address, so display the form for the user to fill out
                  // this code will execute unless the paramter "no resize" is set on the URL or in a post.
                  // it will resize the window to the parameters stored in contact_us_local.php
                  if (!( $_GET['no_resize'] || $_POST['no_resize'] || $_SESSION['no_resize']) ) {
                      $_SESSION['no_resize'] = 1;
              ?>
                  <script language="javascript" type="text/javascript">
                    // <!--
                    resizeOuterTo(<?php print "$WINDOW_WIDTH,$WINDOW_HEIGHT"; ?>);
                    // -->
                </script>
              <?php } //else
                  if ($_SESSION['in_contact_us']) {
              ?>
                 <p class='missing_information'>Please fill out the required information before submitting the form</p>
              <?php
                  }
                  $_SESSION['in_contact_us'] = true;
              ?>
                <form action="<?php print $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
                  <table class="form-table">
                      <tbody>
                        <tr>
                            <?php if (count($CATEGORIES) > 1 ) { ?>
                            <td>Category</td>
                            <td>
                              <select name="category" class="select">
                                  <?php print getAvailableCategoryList( $CATEGORIES ); ?>
                              </select>
                            </td>
                            <?php } ?>
                        </tr>
                        <?php print makeForm($FIELDS, $MAX_DISPLAY_WIDTH); ?>
                        <tr>
                            <td width="100%" colspan="2">
                              <table width="100%">
                                  <tr>
                                    <td width="50%" align="center">
                                        <input type="submit" value="Send" class="button">
                                    </td>
                                    <td width="50%" align="center">
                                        <input type="reset" class="button">
                                    </td>
                                  </tr>
                              </table>
                            </td>
                        </tr>
                      </tbody>
                      </table>
                  </form>
                <!--End of form to be filled out-->
              <?php
                } // end else
              ?>
          <!--Common footer HTML should go here-->
          </p><!-- class="main-text"-->
        </div><!-- id="content" -->
      </div> <!-- id=everything-->
   </body>
</html>