<?php
// PHP Script: index
// Description: EKerner 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/ServiceOrder.php');

class webpage extends EKerner_WebApp_PostValidating_ServiceOrder
{

  public function __construct()
  {
    parent::__construct();
    $this->formTitle               = 'Order/Quote Form';
    $this->displayServices         = array(
      'office_computer',
      'management_software',
      'internet_connect',
      'network_setup',
      'network_connection',
      'freecall_phone',
      'office_phone',
      'domain_name',
      'website',
      'webpage',
      'webhost',
      'email_host',
      'branding',
      'print_design',
      'bizcards',
      'flyers',
      'signage',
      'printing',
      'mail_list',
      'mail_merge',
      'mail_delivery'
    );
    if (isset($_GET['applicant'])) setcookie('leftAccordion', ucfirst($_GET['applicant']), time()+31556926, '/');
    if (isset($_GET['type'])) {
      setcookie('market_focus', $_GET['type'], time()+31556926, '/');
      $this->market_focus = $_GET['type'];
    } elseif (isset($_COOKIE['market_focus'])) {
      $this->market_focus = $_COOKIE['market_focus'];
    } else {
      $this->market_focus = '';
    }
  }
  
  public function render()
  {
    // html meta data ...
    $this->siteDetails->metaTitle       = 'IT Bundles for your Enterprise &middot; ' . $this->siteDetails->company . ' &middot; ' . $this->siteDetails->caption;
    $this->siteDetails->metaDescription = $this->siteDetails->company . ' can bundle a package to suit you. customized business starter bundles, enterprise growth bundles, and organisation sustainability plans.';
    $this->siteDetails->metaKeywords    = $this->siteDetails->company . ', application developer, application, developer, app, software, Australia, AU, AUS, OZ, AUD, ' .
                                          'information technology, connect, connection, communications, bundle, package, business, starter, enterprise, growth, websites, email, hardcopy, martketing, phone, network';
    $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>' . "\n    " .
      '<script type="text/javascript" src="/js/BundlesConfig.js"></script>' . "\n    " .
      '<script type="text/javascript" src="/js/BundleForm.jq"></script>' 
    );
    $this->panes->onload->append('content', 
      "menu.init('mainMenu', ['Home', 'Bundle', 'Orders']);\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/package.png" alt="Package" width="118px" height="100px" />
                      <h2><img src="/images/icons/bundle.png" alt="Bundle Icon" width="25" height="25" />Custom Services Bundles</h2>
                      <p>
                        Recieve discounts by bundling only the services your require.<br />
                        Simply select the services you want to recieve an instant quote.<br />
                        Once you are happy you can place your order by submitting the order form at the bottom.
                      </p>
                      <p class="alignRight">
                         <a href="/">home page &raquo;</a>
                      </p>
    ');
    $this->panes->main->append('content', '
                        <h3><img src="/images/icons/letter_icon.png" alt="Letter Icon" width="25" height="25" />Custom Services Bundle Packager</h3>
                        <p>
                          Please use the facilities on this page to customize and request your services bundle.<br />
                          If you have any problems you may also create your bundle via phone on <b>' . $this->siteDetails->getPreferredPhoneNumber() . '</b>.
                        </p>
    ');
    //$this->panes->main->append('template', $this->draughtPageRequest());
    $tmplt = $this->draughtPageRequest();
    if (preg_match('/(success|failure)/', $tmplt)) $this->panes->main->append('template', $tmplt);
    $this->panes->main->append('template', 'templates/bundle/form.php');
    $this->panes->right->append('widget', 'BlockLinks');
    $this->panes->bottom->append('widget', 'Footer');

    $this->write();
  }

}


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

?>
