'type' => 'text',
'name' => 'lname',
'label' => 'Last Name',
- 'grid' => 5
+ 'grid' => 5,
+ 'req' => true
];
$mname = [
'type' => 'text',
'name' => 'mname',
'label' => 'Middle Name',
- 'grid' => 2
+ 'grid' => 2,
+ 'req' => true
];
$street = [
'type' => 'text',
'name' => 'street',
'label' => 'Street',
- 'grid' => 3
+ 'grid' => 3,
+ 'req' => true
];
$city = [
'type' => 'text',
'name' => 'city',
'label' => 'City',
- 'grid' => 3
+ 'grid' => 3,
+ 'req' => true
];
$state = [
'type' => 'text',
'name' => 'state',
'label' => 'State',
- 'grid' => 3
+ 'grid' => 3,
+ 'req' => true
];
$zip = [
'type' => 'text',
'name' => 'zip',
'label' => 'ZIP',
- 'grid' => 3
+ 'grid' => 3,
+ 'req' => true
];
$phone = [
[$employment_title_sub4, $employment_dates_to4, $employment_supervisor4, $employment_salary_end4,$employment_position_sub4, $employment_reason_sub4],
[$may_we_contact, $who_to_not_contact],
+ ['type' => 'header', 'label' => 'Education & Training'],
[$edu_titleHdr, $edu_schoolHdr, $edu_yearsHdr, $edu_gradHdr, $edu_subjectHdr],
[$edu_title2Hdr, $edu_school2Hdr, $edu_years2Hdr, $edu_grad_degreeHdr, $edu_grad_certificateHdr, $edu_subject2Hdr],
[$edu_title1, $edu_school1, $edu_years1, $edu_grad_degree1, $edu_grad_certificate1, $edu_subject1],
$military_date_entered = [
'type' => 'text',
'name' => 'military_date_entered',
- 'label' => 'Date Entered?',
+ 'label' => 'Date Entered',
+ 'grid' => 4,
+ 'req' => false
+];
+$military_rank = [
+ 'type' => 'text',
+ 'name' => 'military_rank',
+ 'label' => 'Rank at Discharge',
+ 'grid' => 4,
+ 'req' => false
+];
+$military_discharge_date = [
+ 'type' => 'text',
+ 'name' => 'military_discharge_date',
+ 'label' => 'Date of Discharge',
+ 'grid' => 4,
+ 'req' => false
+];
+$military_reserves = [
+ 'type' => 'radio',
+ 'name' => 'military_reserves',
+ 'label' => 'Are you in the reserves?',
+ 'grid' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'military_reserves_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'military_reserves_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$military_reserves_end = [
+ 'type' => 'text',
+ 'name' => 'military_reserves_end',
+ 'label' => 'If yes, date obligation ends?',
'grid' => 6,
'req' => false
];
+$military_training = [
+ 'type' => 'textarea',
+ 'name' => 'military_training',
+ 'label' => 'Special/technical training',
+ 'grid' => 12,
+ 'req' => false
+];
+$crimes_in_past_7_years = [
+ 'type' => 'radio',
+ 'name' => 'crimes_in_past_7_years',
+ 'label' => 'Have you ever been convicted of a crime in the past seven years?',
+ 'grid' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'crimes_in_past_7_years_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'crimes_in_past_7_years_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$crimes_explain = [
+ 'type' => 'text',
+ 'name' => 'crimes_explain',
+ 'label' => 'If so, where, when ,and nature of offense?',
+ 'grid' => 6,
+ 'req' => false
+];
+$training_skills = [
+ 'type' => 'textarea',
+ 'name' => 'training_skills',
+ 'label' => 'Please provide any addional information such as special skills, '
+ . 'training, management experiences, equipment operation or qualifications '
+ . 'you feel will be helpful to us in considering your application',
+ 'grid' => 12,
+ 'req' => false
+];
+$additional_info = [
+ 'type' => 'textarea',
+ 'name' => 'additinal_info',
+ 'label' => 'State any additional information that you feel may be helpful '
+ . 'to us in considering your application.',
+ 'grid' => 12,
+ 'req' => false
+];
+$referenceReq = false;
+$nameHdr = [
+ 'type' => 'static',
+ 'label' => 'Name',
+ 'grid' => 3,
+ 'req' => $referenceReq
+];
+$addressHdr = [
+ 'type' => 'static',
+ 'label' => 'Address and Telephone',
+ 'grid' => 3,
+ 'req' => $referenceReq
+];
+$relationshipHdr = [
+ 'type' => 'static',
+ 'label' => 'Relationship',
+ 'grid' => 3,
+ 'req' => $referenceReq
+];
+$yearHdr = [
+ 'type' => 'static',
+ 'label' => 'Years Acquainted',
+ 'grid' => 3,
+ 'req' => $referenceReq
+];
+for ($i = 1; $i <= 3; ++$i) {
+ $referenceReq = false;
+ ${'name'.$i} = [
+ 'type' => 'text',
+ 'name' => 'name' . $i,
+ 'label' => '',
+ 'grid' => 3,
+ 'req' => $referenceReq
+ ];
+ ${'address'.$i} = [
+ 'type' => 'text',
+ 'name' => 'address' . $i,
+ 'label' => '',
+ 'grid' => 3,
+ 'req' => $referenceReq
+ ];
+ ${'relationship'.$i} = [
+ 'type' => 'text',
+ 'name' => 'relationship' . $i,
+ 'label' => '',
+ 'grid' => 3,
+ 'req' => $referenceReq
+ ];
+ ${'year'.$i} = [
+ 'type' => 'text',
+ 'name' => 'years' . $i,
+ 'label' => '',
+ 'grid' => 3,
+ 'req' => $referenceReq
+ ];
+}
$form = [
- ['type' => 'header', 'label' => 'page 4'],
- [$military_experience, $military_branch]
+ ['type' => 'header', 'label' => 'Military Service Record'],
+ [$military_experience, $military_branch],
+ [$military_date_entered, $military_rank, $military_discharge_date],
+ [$military_reserves, $military_reserves_end],
+ [$military_training],
+ ['type' => 'header', 'label' => 'Additional Information'],
+ [$crimes_in_past_7_years, $crimes_explain],
+ [$training_skills],
+ [$additional_info],
+ ['type' => 'header', 'label' => 'References'],
+ [$nameHdr, $addressHdr, $relationshipHdr, $yearHdr],
+ [$name1, $address1, $relationship1, $year1],
+ [$name2, $address2, $relationship2, $year2],
+ [$name3, $address3, $relationship3, $year3],
];
{
// class properties
public $pluginDirName;
+ public $viewDir;
+ public $adminViewDir;
+ public $frontViewDir;
public $formSuccess;
public $formFail;
public $formSubmitted;
// class constants
const FORM_VAR = 'applyOnline';
const FORM_SETTINGS_DIR = 'config';
+ const FORM_VIEW_DIR = 'views';
+ const FINAL_FORM = 5;
+ const FORM_TEMPLATE = 'formTemplate.php';
+ const SUCCESS_TEMPLATE = 'thankYou.php';
/**
* Register Hooks and Actions
$this->formTable = $wpdb->prefix . GLM_EMP_FORM_TABLE;
$this->appTable = $wpdb->prefix . GLM_EMP_APPLICATION_TABLE;
add_action('init', array($this, 'startJobSession'));
+ $this->viewDir = $this->pluginDirName . self::FORM_VIEW_DIR;
+ $this->adminViewDir = $this->viewDir . '/admin';
+ $this->frontViewDir = $this->viewDir . '/front';
}
public function set_form_state()
$setting_file = $this->pluginDirName . self::FORM_SETTINGS_DIR
. "/settings{$form_part}.php";
include $setting_file;
- return (is_array($form)) ? $form : array();
+ return $form;
}
public function show_apply_form()
$formPart = (isset($_REQUEST['form_part']))
? filter_var($_REQUEST['form_part'], FILTER_VALIDATE_INT)
: false;
+
// form Action
$formAction = '';
+// echo '<pre>'.print_r($formPart, true).'</pre>';
switch ($formPart) {
- default:
- unset($_SESSION['glmJobsApplication'], $_SESSION['glmJobsAppForm']);
- $form = $this->load_form_settings(1);
- $formPart = 1;
- include $this->pluginDirName . 'views/front/form_1.php';
- break;
-
case 1:
- if ($this->formSubmitted) {
- $form = $this->load_form_settings(1);
- $this->form_process($form, 1);
- $this->appId = $appId = filter_var($_REQUEST['appId'], FILTER_VALIDATE_INT);
- if (!$appId) {
- // insert new application and form data
- if ($this->fname) {
- $this->store_application_data($form);
- }
- if ($this->appId) {
- $this->store_form_data($form, 1);
- }
- } else {
- // need to update form data
- }
- if ($this->errorCount > 0) {
- include $this->pluginDirName . 'views/front/form_1.php';
- } else {
- // next form part
- $formPart = 2;
- $appId = $this->appId;
- $form = $this->load_form_settings(2);
- include $this->pluginDirName . 'views/front/form_1.php';
- }
- } else {
- wp_die('An Error!:(');
- }
- break;
-
case 2:
case 3:
case 4:
if ($this->formSubmitted) {
- $form = $this->load_form_settings($formPart);
- $this->form_process($form, $formPart);
-
+// $form = $this->load_form_settings($formPart);
$this->appId = $appId = filter_var($_REQUEST['appId'], FILTER_VALIDATE_INT);
+ $form = $this->form_process($formPart);
+// echo '<pre>'.print_r('appId:' . $this->appId, true).'</pre>';
+// echo '<pre>'.print_r($_POST, true).'</pre>';
+// echo '<pre>'.print_r('fname:' . $this->fname, true).'</pre>';
+// echo '<pre>'.print_r('form:' . $form, true).'</pre>';
+// wp_die('test');
+ if (!$this->appId && $this->fname) {
+ // insert new application and form data
+ $appId = $this->store_application_data($form);
+ }
+ //check for errors
if ($this->errorCount > 0) {
- include $this->pluginDirName . 'views/front/form_1.php';
+ include $this->frontViewDir . self::FORM_TEMPLATE;
} else {
$this->store_form_data($form, $formPart);
// next form part
++$formPart;
- $form = $this->load_form_settings($formPart);
- include $this->pluginDirName . 'views/front/form_1.php';
+ if ($formPart == self::FINAL_FORM) {
+ include $this->frontViewDir . self::SUCCESS_TEMPLATE;
+ unset($_SESSION['glmJobsApplication'], $_SESSION['glmJobsAppForm']);
+ } else {
+ $form = $this->load_form_settings($formPart);
+ include $this->frontViewDir . self::FORM_TEMPLATE;
+ }
}
} else {
wp_die('An Error!:(');
}
break;
+ default:
+ unset($_SESSION['glmJobsApplication'], $_SESSION['glmJobsAppForm']);
+ $formPart = 1;
+ $form = $this->load_form_settings($formPart);
+ include $this->frontViewDir . self::FORM_TEMPLATE;
+ break;
}
- echo '<pre>'.print_r($_SESSION, true).'</pre>';
+// echo '<pre>'.print_r($_SESSION, true).'</pre>';
}
public function store_application_data($form)
{
if ($this->appId = filter_var($_REQUEST['appId'], FILTER_VALIDATE_INT)) {
- return;
+ return $this->appId;
} else if ($this->appId = filter_var($_SESSION['glmJobsApplication'], FILTER_VALIDATE_INT)) {
- return;
+ return $this->appId;
}
$this->wpdb->insert(
$this->appTable,
);
$this->appId = $this->wpdb->insert_id;
$_SESSION['glmJobsApplication'] = $this->appId;
+ return $this->appId;
}
public function store_form_data($form, $form_part)
{
// check if there's one stored first
+ if (!$this->appId) {
+ return false;
+ }
$sql = "
SELECT id
FROM {$this->formTable}
);
}
- public function form_process(&$form, $part)
+ public function form_process($part)
{
$this->clean_post();
- $form = $this->load_form_settings($form, $part);
+ $form = $this->load_form_settings($part);
foreach ($form as $rowKey => $row) {
if ($row['type'] != 'header') {
}
}
}
+ return $form;
}
public function clean_post()
$applyOnlineHref = $current_url
. ((strpos($current_url, '?')) ? '&' : '?')
. self::FORM_VAR . "=1&job=" . $job->ID;
- include $this->pluginDirName . 'views/front/jobDetail.php';
+ include $this->frontViewDir . '/jobDetail.php';
return;
}
. ((strpos($current_url, '?')) ? '&' : '?')
. "job=" . $job->ID;
}
- include $this->pluginDirName . 'views/front/jobList.php';
+ include $this->frontViewDir . '/jobList.php';
return;
}
);
$form_url = home_url() . '/searchJobs/?search=1';
$categories = get_terms('glm_jobscategory');
- include $this->pluginDirName . 'views/front/jobSearch.php';
+ include $this->frontViewDir . '/jobSearch.php';
}
public function setPluginDir($dir)
+++ /dev/null
-<?php
-
-/**
- * builder.php
- *
- * PHP version 5.3
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @version SVN: (0.1)
- * @link <>
- */
-
-/**
- * Toolkit_Package_builder
- *
- * Description of builder
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @release Release: (0.1)
- * @link <>
- */
-class builder
-{
- public function buildForm($formData)
- {
- $form = '';
- if (isset($formData) && is_array($formData) && !empty($formData)) {
- foreach ($formData as $rows) {
- foreach ($row as $fields) {
-
- }
- }
- } else {
- return false;
- }
- }
-}
+++ /dev/null
-<?php
-
-/**
- * element.php
- *
- * PHP version 5.3
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @version SVN: (0.1)
- * @link <>
- */
-
-/**
- * Toolkit_Package_element
- *
- * Description of element
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @release Release: (0.1)
- * @link <>
- */
-abstract class elementAbstract
-{
- public $name;
- public $required;
- public $validation;
- public $label;
- public $value;
- public $filter;
-
- public function __construct($config)
- {
- foreach ($config as $prop => $value) {
- if (isset($this->$prop)) {
- $this->$prop = $value;
- } else {
- die('error: ' . $prop . ' not defined in object');
- }
-
- }
- }
-}
+++ /dev/null
-<?php
-
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- *
- * @author steve
- */
-interface elementInterface
-{
- public function toString();
- public function toArray();
-}
+++ /dev/null
-; this is an INI file
-[section]
-key = value
+++ /dev/null
-<?php
-
-/**
- * form1.php
- *
- * PHP version 5.3
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @version SVN: (0.1)
- * @link <>
- */
-
-/**
- * Toolkit_Package_form1
- *
- * Description of form1
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @release Release: (0.1)
- * @link <>
- */
-class form1
-{
- public $rows = array();
-
- public function __construct()
- {
-
- }
-}
+++ /dev/null
-<?php
-
-/**
- * text.php
- *
- * PHP version 5.3
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @version SVN: (0.1)
- * @link <>
- */
-
-/**
- * Toolkit_Package_text
- *
- * Description of text
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @release Release: (0.1)
- * @link <>
- */
-class text extends elementAbstract implements elementInterface
-{
-
- public function toArray()
- {
-
- }
-
- public function toString()
- {
-
- }
-}
+++ /dev/null
-<?php
-
-/**
- * textarea.php
- *
- * PHP version 5.3
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @version SVN: (0.1)
- * @link <>
- */
-
-/**
- * Toolkit_Package_textarea
- *
- * Description of textarea
- *
- * @category Toolkit
- * @package Package
- * @author Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
- * @license Gaslight Media
- * @release Release: (0.1)
- * @link <>
- */
-class textarea implements elementInterface
-{
- public function toArray()
- {
-
- }
-
- public function toString()
- {
-
- }
-
-}
+++ /dev/null
-<div class="row">
- <div class="small-12 columns">
- <h1>Online Application Form</h1>
- <form method="post">
- <input type="hidden" name="applyOnline" value="2" />
- <h3>Name</h3>
- <div class="row">
- <div class="small-12 large-5 columns">
- <label>Last Name <input name="lname" type="text" value="<?php echo $lname;?>" />
- </label>
- </div>
- <div class="small-12 large-5 columns">
- <label>First Name <input name="fname" type="text" value="<?php echo $fname;?>" />
- </label>
- </div>
- <div class="small-12 large-2 columns">
- <label>Middle Name <input name="mname" type="text" value="<?php echo $mname;?>" />
- </label>
- </div>
- </div>
-
- <h3>Current Address</h3>
- <div class="row">
- <div class="small-12 large-3 columns">
- <label>Street <input name="street" type="text" value="<?php echo $street;?>" />
- </label>
- </div>
- <div class="small-12 large-3 columns">
- <label>City <input name="city" type="text" value="<?php echo $city;?>" />
- </label>
- </div>
- <div class="small-12 large-3 columns">
- <label>State <input name="state" type="text" value="<?php echo $state;?>" />
- </label>
- </div>
- <div class="small-12 large-3 columns">
- <label>Zip <input name="zip" type="text" value="<?php echo $zip;?>" />
- </label>
- </div>
- </div>
-
- <h3>Telephone#</h3>
- <div class="row">
- <div class="small-12 large-4 columns">
- <label>Home <input name="home_phone" type="text" value="<?php echo $home_phone;?>" />
- </label>
- </div>
- <div class="small-12 large-4 columns">
- <label>Alternative# <input name="alt_phone" type="text" value="<?php echo $alt_phone;?>" />
- </label>
- </div>
- <div class="small-12 large-4 columns">
- <label>Email <input name="email" type="text" value="<?php echo $email;?>" />
- </label>
- </div>
- </div>
-
- <div class="row">
- <div class="small-12 large-6 columns">
- <label>Are you 18 Years or older?</label>
- <input id="over_18_yes" name="over_18" type="radio" value="1" <?php if (isset($over_18) && $over_18 == '1') { echo 'checked';}?> />
- <label for="over_18_yes">Yes</label>
- <input id="over_18_no" name="over_18" type="radio" value="0" <?php if (isset($over_18) && $over_18 == '0') { echo 'checked';}?> />
- <label for="over_18_no">No</label>
- </div>
- <div class="small-12 large-6 columns">
- <label>Are you an U.S. citizen?</label>
- <input id="us_citizen_yes" name="us_citizen" type="radio" value="1" <?php if (isset($us_citizen) && $us_citizen == '1') { echo 'checked';}?> />
- <label for="us_citizen_yes">Yes</label>
- <input id="us_citizen_no" name="us_citizen" type="radio" value="0" <?php if (isset($us_citizen) && $us_citizen == '0') { echo 'checked';}?> />
- <label for="us_citizen_no">No</label>
- </div>
- </div>
-
- <div class="row">
- <div class="small-12 columns">
- <label>Are you authorized to work in the United States?</label>
- <input id="us_auth_yes" name="us_auth" type="radio" value="1" <?php if (isset($us_auth) && $us_auth == '1') { echo 'checked';}?> />
- <label for="us_auth_yes">Yes</label>
- <input id="us_auth_no" name="us_auth" type="radio" value="0" <?php if (isset($us_auth) && $us_auth == '0') { echo 'checked';}?> />
- <label for="us_auth_no">No</label>
- </div>
- </div>
- <div class="row">
- <div class="small-12 large-6 columns">
- <label>Have you been previously employed here?</label>
- <input id="employed_before_yes" name="employed_before" type="radio" value="1" <?php if (isset($employed_before) && $employed_before == '1') { echo 'checked';}?> />
- <label for="employed_before_yes">Yes</label>
- <input id="employed_before_no" name="employed_before" type="radio" value="0" <?php if (isset($employed_before) && $employed_before == '0') { echo 'checked';}?> />
- <label for="employed_before_no">No</label>
- </div>
- <div class="small-12 large-6 columns">
- <label>If yes, date(s)
- <input name="employed_before_dates" type="text" value="<?php echo $employed_before_dates;?>" />
- </label>
- </div>
- </div>
-
- <div class="row">
- <div>
- <input type="submit" class="button" value="Continue">
- </div>
- </div>
- </form>
- </div>
-
-</div>
--- /dev/null
+<style>
+ div.static {
+ text-align:left;
+ padding-top: 5px;
+ }
+</style>
+<div class="row">
+ <div class="small-12 columns">
+ <h1><?php echo $formTitle;?></h1>
+ <form method="post" action="<?php echo $formAction;?>">
+ <input type="hidden" name="<?php echo self::FORM_VAR;?>" value="1">
+ <input type="hidden" name="form_part" value="<?php echo $formPart;?>" />
+ <?php if ($appId):?>
+ <input type="hidden" name="appId" value="<?php echo $appId;?>">
+ <?php endif;?>
+ <?php foreach($form as $row):?>
+ <?php if ($row['type'] == 'header') :?>
+ <h3><?php echo $row['label'];?></h3>
+ <?php if ($row['subheader']) {?>
+ <h4 class="subheader"><?php echo $row['subheader'];?></h4>
+ <?php }?>
+ <?php if ($row['notes']) {?>
+ <p><?php echo $row['notes'];?></p>
+ <?php }?>
+ <?php else:?>
+ <div class="row<?php echo ($row[0]['rcoll'])?' collapse':'';?>">
+ <?php foreach($row as $field) :?>
+ <div class="small-<?php echo $field['grid'];?> columns">
+ <label<?php if ($field['req']):?> class="error"<?php endif;?>>
+ <?php echo $field['label'];?>
+ </label>
+ <?php switch($field['type']) :
+ case 'text':?>
+ <input
+ <?php if ($field['placeholder']) {echo ' placeholder="'.$field['placeholder'].'"';}?>
+ <?php if ($field['error']){echo 'class="error"';}?>
+ <?php if ($field['req']){echo 'required';}?>
+ <?php if ($field['pat']):?>
+ pattern="<?php echo $field['pat'];?>"
+ <?php endif;?>
+ name="<?php echo $field['name'];?>"
+ type="text"
+ value="<?php echo $field['value'];?>" />
+ <?php break;?>
+ <?php case 'tel':?>
+ <input
+ <?php if ($field['error']){echo 'class="error"';}?>
+ <?php if ($field['req']){echo 'required';}?>
+ <?php if ($field['pat']):?>
+ pattern="<?php echo $field['pat'];?>"
+ <?php endif;?>
+ name="<?php echo $field['name'];?>"
+ type="tel"
+ value="<?php echo $field['value'];?>" />
+ <?php break;?>
+ <?php case 'email':?>
+ <input
+ <?php if ($field['error']){echo 'class="error"';}?>
+ <?php if ($field['req']){echo 'required';}?>
+ <?php if ($field['pat']):?>
+ pattern="<?php echo $field['pat'];?>"
+ <?php endif;?>
+ name="<?php echo $field['name'];?>"
+ type="email"
+ value="<?php echo $field['value'];?>" />
+ <?php break;?>
+ <?php case 'static':?>
+ <?php echo $field['value'];?>
+ <?php break;?>
+ <?php case 'textarea':?>
+ <textarea
+ <?php if ($field['error']){echo 'class="error"';}?>
+ <?php if ($field['req']){echo 'required';}?>
+ name="<?php echo $field['name'];?>"
+ value="<?php echo $field['value'];?>"><?php echo $field['value'];?></textarea>
+ <?php break;?>
+ <?php case 'radio':?>
+ <?php foreach($field['opts'] as $option) :?>
+ <input
+ <?php if ($field['error']){echo 'class="error"';}?>
+ <?php if ($field['req']){echo 'required';}?>
+ <?php if ($field['pat']):?>
+ pattern="<?php echo $field['pat'];?>"
+ <?php endif;?>
+ id="<?php echo $option['name'];?>"
+ name="<?php echo $field['name'];?>"
+ type="radio"
+ value="<?php echo $option['value'];?>"
+ <?php if ($field['value'] === $option['value']) {
+ echo 'checked';
+ }?> />
+ <label for="<?php echo $option['name'];?>"><?php echo $option['label'];?></label>
+ <?php endforeach;?>
+ <?php break;?>
+ <?php case 'checkbox':?>
+ <?php foreach($field['opts'] as $option) :?>
+ <input
+ <?php if ($field['error']){echo 'class="error"';}?>
+ <?php if ($field['req']){echo 'required';}?>
+ <?php if ($field['pat']):?>
+ pattern="<?php echo $field['pat'];?>"
+ <?php endif;?>
+ id="<?php echo $option['name'];?>"
+ name="<?php echo $option['name'];?>"
+ type="checkbox"
+ value="<?php echo $option['value'];?>"
+ <?php if ($option['checked']) {
+ echo 'checked';
+ }?> />
+ <label for="<?php echo $option['name'];?>"><?php echo $option['label'];?></label>
+ <?php endforeach;?>
+ <?php break;?>
+ <?php endswitch;?>
+ <?php if ($field['error']):?>
+ <small class="error"><?php echo $field['error'];?></small>
+ <?php endif;?>
+ </div>
+ <?php endforeach;?>
+ </div>
+ <?php endif;?>
+ <?php endforeach;?>
+ <div class="row">
+ <div>
+ <input type="submit" class="button" value="Continue">
+ </div>
+ </div>
+ </form>
+ </div>
+
+</div>
+++ /dev/null
-<style>
- div.static {
- text-align:left;
- padding-top: 5px;
- }
-</style>
-<div class="row">
- <div class="small-12 columns">
- <h1><?php echo $formTitle;?></h1>
- <form method="post" action="<?php echo $formAction;?>">
- <input type="hidden" name="<?php echo self::FORM_VAR;?>" value="1">
- <input type="hidden" name="form_part" value="<?php echo $formPart;?>" />
- <?php if ($appId):?>
- <input type="hidden" name="appId" value="<?php echo $appId;?>">
- <?php endif;?>
- <?php foreach($form as $row):?>
- <?php if ($row['type'] == 'header') :?>
- <h3><?php echo $row['label'];?></h3>
- <?php if ($row['subheader']) {?>
- <h4 class="subheader"><?php echo $row['subheader'];?></h4>
- <?php }?>
- <?php if ($row['notes']) {?>
- <p><?php echo $row['notes'];?></p>
- <?php }?>
- <?php else:?>
- <div class="row<?php echo ($row[0]['rcoll'])?' collapse':'';?>">
- <?php foreach($row as $field) :?>
- <div class="small-<?php echo $field['grid'];?> columns">
- <label<?php if ($field['req']):?> class="error"<?php endif;?>>
- <?php echo $field['label'];?>
- </label>
- <?php switch($field['type']) :
- case 'text':?>
- <input
- <?php if ($field['placeholder']) {echo ' placeholder="'.$field['placeholder'].'"';}?>
- <?php if ($field['error']){echo 'class="error"';}?>
- <?php if ($field['req']){echo 'required';}?>
- <?php if ($field['pat']):?>
- pattern="<?php echo $field['pat'];?>"
- <?php endif;?>
- name="<?php echo $field['name'];?>"
- type="text"
- value="<?php echo $field['value'];?>" />
- <?php break;?>
- <?php case 'tel':?>
- <input
- <?php if ($field['error']){echo 'class="error"';}?>
- <?php if ($field['req']){echo 'required';}?>
- <?php if ($field['pat']):?>
- pattern="<?php echo $field['pat'];?>"
- <?php endif;?>
- name="<?php echo $field['name'];?>"
- type="tel"
- value="<?php echo $field['value'];?>" />
- <?php break;?>
- <?php case 'email':?>
- <input
- <?php if ($field['error']){echo 'class="error"';}?>
- <?php if ($field['req']){echo 'required';}?>
- <?php if ($field['pat']):?>
- pattern="<?php echo $field['pat'];?>"
- <?php endif;?>
- name="<?php echo $field['name'];?>"
- type="email"
- value="<?php echo $field['value'];?>" />
- <?php break;?>
- <?php case 'static':?>
- <?php echo $field['value'];?>
- <?php break;?>
- <?php case 'textarea':?>
- <textarea
- <?php if ($field['error']){echo 'class="error"';}?>
- <?php if ($field['req']){echo 'required';}?>
- name="<?php echo $field['name'];?>"
- value="<?php echo $field['value'];?>"><?php echo $field['value'];?></textarea>
- <?php break;?>
- <?php case 'radio':?>
- <?php foreach($field['opts'] as $option) :?>
- <input
- <?php if ($field['error']){echo 'class="error"';}?>
- <?php if ($field['req']){echo 'required';}?>
- <?php if ($field['pat']):?>
- pattern="<?php echo $field['pat'];?>"
- <?php endif;?>
- id="<?php echo $option['name'];?>"
- name="<?php echo $field['name'];?>"
- type="radio"
- value="<?php echo $option['value'];?>"
- <?php if ($field['value'] === $option['value']) {
- echo 'checked';
- }?> />
- <label for="<?php echo $option['name'];?>"><?php echo $option['label'];?></label>
- <?php endforeach;?>
- <?php break;?>
- <?php case 'checkbox':?>
- <?php foreach($field['opts'] as $option) :?>
- <input
- <?php if ($field['error']){echo 'class="error"';}?>
- <?php if ($field['req']){echo 'required';}?>
- <?php if ($field['pat']):?>
- pattern="<?php echo $field['pat'];?>"
- <?php endif;?>
- id="<?php echo $option['name'];?>"
- name="<?php echo $option['name'];?>"
- type="checkbox"
- value="<?php echo $option['value'];?>"
- <?php if ($option['checked']) {
- echo 'checked';
- }?> />
- <label for="<?php echo $option['name'];?>"><?php echo $option['label'];?></label>
- <?php endforeach;?>
- <?php break;?>
- <?php endswitch;?>
- <?php if ($field['error']):?>
- <small class="error"><?php echo $field['error'];?></small>
- <?php endif;?>
- </div>
- <?php endforeach;?>
- </div>
- <?php endif;?>
- <?php endforeach;?>
- <div class="row">
- <div>
- <input type="submit" class="button" value="Continue">
- </div>
- </div>
- </form>
- </div>
-
-</div>
--- /dev/null
+<div class="alert-box success">
+ Thank you for your time.
+</div>