<?php
// PHP Script: index.asp
// Description: *.com index page
// DATE: 26-11-2009
// AUTHOR: 'Eugene Kerner' <ekerner@ekerner.com>
// REVISION: 1.0

require_once('../config/SetEnv.php');
require_once('EKerner/WebApp/PostValidating.php');

class webpage extends EKerner_WebApp_PostValidating
{

  public function render()
  {
    // html meta data ...
    $this->setMetaDataByActionSwitch($_GET['action']);
    
    $this->panes->head->append('content',
      '<link rel="stylesheet" type="text/css" href="/css/accordion.css" />' . "\n    " .
      '<script type="text/javascript" src="/js/accordion.jq"></script>'

    );
    $this->panes->onload->append('content', 
      "menu.init('mainMenu', ['Contact', 'Testimonials']);\n" . 
      $this->validator->getKeypressHandlerJq()
    );
    
    // page content ...
    $this->panes->banner->append('widget', 'ContactLinks');
    $this->panes->left->append('widget', 'GenreMenu');
    $this->panes->heading->append('content', '
                      <img class="floatRight headingImage" src="/images/content/thumbs_up.png" alt="Thumbs Up" title="Great Job!" style="cursor:help;" width="118px" height="100px" />
                      <h2><img src="/images/icons/letter_icon.png" alt="Letter Icon" width="25" height="25" />' . $this->title . '</h2>
                      <p>We appreciate your testimony to the quality of our products and/or services.</p>
                      <p>Please note that we may publish your tesimonial to our website and/or brochures.</p>
                      <p>Related information: 
                         <a href="http://www.acma.gov.au/WEB/STANDARD/pc=PC_310294" onclick="window.open(\'http://www.acma.gov.au/WEB/STANDARD/pc=PC_310294\'); return false;" title="SPAM is Illegal">Australian SPAM Law</a> | 
                         <a href="/terms" title="Terms &amp; Conditions">Our Terms &amp; Conditions</a></p>
                      <p class="alignRight"><a href="/contact">all contact meduim &raquo;</a></p>
    ');
    $this->panes->main->append('content', '
                      <div class="p">
                        <h4>Online Contact Form</h4>
                        <p>
                          Word of mouth marketing is the best kind.<br />
                          We can tell our prospective clients you how great we are,
                           however everyone seems to prefer that our existing clients share their experiences instead.<br />
                          If we pleased you and helped you to grow you enterprise,
                           then please help us to share the love and grow our enterprise ...<br /><br />
                        </p>
    ');
    $this->panes->main->append('template', $this->draughtPageRequest());
    $this->panes->main->append('content', '
                      </div>
    ');
    $this->panes->right->append('widget', 'BlockLinks');
    $this->panes->bottom->append('widget', 'Footer');

    $this->write();
  }
  
  private function setMetaDataByActionSwitch($action = '')
  {
    if ($action === 'send') {
      $this->title = 'Thankyou for Your Testimony';
      $this->siteDetails->metaDescription = $this->siteDetails->company . ' thank you for your testimony to the quality of our products and/or services';
      $this->siteDetails->metaKeywords    = $this->siteDetails->company . ', application developer, application, developer, app, software, Australia, AU, AUS, OZ, AUD, information technology, ' .
                                            'testimony, testimonial, sent, thankyou, thank you';
    } else {
      $this->title = 'Offer Your Testimony';
      $this->siteDetails->metaDescription = $this->siteDetails->company . ' testimony form. Please use the below form to send us your testimony to the quality of our products and/or services.';
      $this->siteDetails->metaKeywords    = $this->siteDetails->company . ', application developer, application, developer, app, software, Australia, AU, AUS, OZ, AUD, information technology, ' .
                                            'testimony, testimonial, quality';
    }
    $this->siteDetails->metaTitle       = $this->title . ' &middot; ' . $this->siteDetails->company . ' &middot; ' . $this->siteDetails->caption;
  }
    
  protected function formFieldsValid()
  {
    return ($_POST['comments'] && $_POST['fullName']);
  }
    
}


try {
  $webpage = new webpage();
  $webpage->render();
} catch (Exception $e) {
  die($e->getMessage());
}

?>
