<?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', 'Consultations']);\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/workshop.png" alt="Whiteboar Workshop" title="Solutions Made Easy!" 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>Please use the below form to book a consultation to discuss your requirements.</p>
                      <p>One of our IT professionals will meet with you to help design your solutions.</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>
                          Sit down with one of our IT professionals and shed some light on your project.<br />
                          In your first consultation we expect to give direction to your project and design the steps toward your solution.<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 Booking';
      $this->siteDetails->metaDescription = $this->siteDetails->company . ' One of our IT professionals will contact you shortly.';
      $this->siteDetails->metaKeywords    = $this->siteDetails->company . ', application developer, application, developer, app, software, Australia, AU, AUS, OZ, AUD, information technology, ' .
                                            'booking, consultation, project, design, sent, thankyou, thank you';
    } else {
      $this->title = 'Book a Consultation';
      $this->siteDetails->metaDescription = $this->siteDetails->company . ' booking form. Sit down with one of our IT professionals, give direction to your project, and design the steps toward your solution.';
      $this->siteDetails->metaKeywords    = $this->siteDetails->company . ', application developer, application, developer, app, software, Australia, AU, AUS, OZ, AUD, information technology, ' .
                                            'booking, IT professionals, professional, IT, solution, consultation, project, design';
    }
    $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());
}

?>
