Setting up Admin and Front views.
Form1
view page in admin
<?php
-namespace Glm\Employment\Controller;
-use Glm\Employment\Model as Model;
-
defined('ABSPATH') or die();
/**
*
* Controller for all of the admin functionality
*/
-class AdminController
+class glm_employment_admin
{
public $pluginDirName;
+ public $wpdb;
/**
* Register Hooks and Actions
*/
- public function __construct($path)
+ public function __construct($path, $wpdb)
{
$this->pluginDirName = $path;
-// \add_shortcode('glmjobs', array($this, 'glm_jobs'));
- $jobs = new Model\Job($path);
+ $this->wpdb = $wpdb;
+ $jobs = new glm_employment_job($path);
+ add_action('admin_menu', array($this, 'add_job_menus'));
+ }
+
+ public function add_job_menus()
+ {
+ add_submenu_page(
+ 'edit.php?post_type=' . GLM_EMP_POST_TYPE,
+ 'applications',
+ 'Applications',
+ 'manage_options',
+ 'applications',
+ array($this, 'get_applications')
+ );
+ add_submenu_page(
+ 'edit.php?post_type=' . GLM_EMP_POST_TYPE,
+ 'settings',
+ 'Settings',
+ 'manage_options',
+ 'job_settings',
+ array($this, 'show_job_settings')
+ );
+ }
+
+ public function show_job_settings()
+ {
+ echo '<p>Job Settings</p>';
+ }
+
+ public function get_applications()
+ {
+ $action = filter_var($_GET['action'], FILTER_SANITIZE_STRING);
+ switch ($action) {
+ case 'view':
+ $this->view_application();
+ break;
+ default:
+ $this->show_applications();
+ break;
+ }
+ }
+
+ public function view_application()
+ {
+ wp_enqueue_script(
+ 'foundation',
+ get_template_directory_uri() . '/js/app.js',
+ 'jquery',
+ '1.0',
+ true
+ );
+ wp_enqueue_style('foundation',
+ get_template_directory_uri() . '/css/app.js');
+ $id = filter_var($_REQUEST['application'], FILTER_VALIDATE_INT);
+ $sql = "
+ SELECT *
+ FROM " . $this->wpdb->prefix . GLM_EMP_APPLICATION_TABLE . "
+ WHERE id = $id";
+ $data = $this->wpdb->get_row($sql, ARRAY_A);
+ if ($data) {
+ $sql = "
+ SELECT *
+ FROM " . $this->wpdb->prefix . GLM_EMP_FORM_TABLE . "
+ WHERE application = $id";
+ $formData = $this->wpdb->get_results($sql, ARRAY_A);
+ }
+ echo '<div class="wrap">';
+ $viewPath = $this->pluginDirName . 'views/admin/';
+ $form1 = unserialize($formData[0]['form_data']);
+ include $viewPath . 'view-application.php';
+ echo '</div>';
+ }
+
+ public function show_applications()
+ {
+ $path = plugin_dir_path(GLM_EMP_PLUGIN_PATH_FILE);
+ include $path . 'models/class-glm-list-table.php';
+ include $path . 'models/list-applications.php';
+ $applicationList = new List_Applications($this->wpdb);
+ include $this->pluginDirName . 'views/admin/applicationList.php';
}
public function glm_jobs($atts)
{
- extract(\shortcode_atts(array('limit' => '10'), $atts));
+ extract(shortcode_atts(array('limit' => '10'), $atts));
global $wpdb;
- $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'glm_jobs'";
+ $sql = "SELECT * FROM $wpdb->posts WHERE post_type = '"
+ . GLM_EMP_POST_TYPE . "'";
$jobs = $wpdb->get_results($sql, OBJECT);
- \ob_start();
- include $this->pluginDirName . 'views/jobList.php';
- $out = \ob_get_contents();
- \ob_end_clean();
+ ob_start();
+ include $this->pluginDirName . 'views/front/jobList.php';
+ $out = ob_get_contents();
+ ob_end_clean();
return $out;
}
<?php
-namespace Glm\Employment\Controller;
-use Glm\Employment\Model as Model;
-
defined('ABSPATH') or die();
/**
*
* Controller for all of the admin functionality
*/
-class FrontController
+class glm_employment_front
{
public $pluginDirName;
+ public $formSuccess;
+ public $formFail;
+ public $formSubmitted;
+ public $errorCount = 0;
+ public $wpdb;
+ public $formTable;
+ public $appTable;
+ public $fname;
+ public $lname;
+ public $mname;
+ public $resume;
+ public $appId;
+ public $formId;
+
+ const FORM_VAR = 'applyOnline';
/**
* Register Hooks and Actions
*/
- public function __construct($path)
+ public function __construct($path, $wpdb)
{
$this->pluginDirName = $path;
- \add_shortcode('glmjobs', array($this, 'glm_jobs_shortcode'));
- $jobs = new Model\Job($path);
+ $this->wpdb = $wpdb;
+ add_shortcode('glmjobs', array($this, 'glm_jobs_shortcode'));
+ $jobs = new glm_employment_job($path);
+ $this->set_form_state();
+ $this->formTable = $wpdb->prefix . GLM_EMP_FORM_TABLE;
+ $this->appTable = $wpdb->prefix . GLM_EMP_APPLICATION_TABLE;
+ }
+
+ public function set_form_state()
+ {
+ $this->formSubmitted = isset($_POST[self::FORM_VAR]);
}
public function glm_jobs_shortcode($atts)
{
- extract(\shortcode_atts(array('limit' => '10'), $atts));
- global $wpdb;
- $midnight = strtotime(date('Y-m-d',time()).' 00:00:00');
- $querystr = "
- SELECT *
- FROM $wpdb->posts wposts, $wpdb->postmeta metastart, $wpdb->postmeta metaend
- WHERE (wposts.ID = metastart.post_id AND wposts.ID = metaend.post_id)
- AND (metaend.meta_key = 'glm_jobs_enddate' AND metaend.meta_value > $midnight )
- AND (metastart.meta_key = 'glm_jobs_startdate' AND metastart.meta_value < $midnight )
- AND wposts.post_type = 'glm_jobs'
- AND wposts.post_status = 'publish'
- ORDER BY wposts.post_title ASC LIMIT $limit
- ";
-
- $jobs = $wpdb->get_results($querystr, OBJECT);
+ extract(shortcode_atts(array('limit' => '10'), $atts));
+ $applyOnline = (isset($_REQUEST[self::FORM_VAR]))
+ ? filter_var($_REQUEST[self::FORM_VAR], FILTER_VALIDATE_INT)
+ : false;
+ $job_id = (isset($_REQUEST['job']))
+ ? filter_var($_REQUEST['job'], FILTER_VALIDATE_INT)
+ : false;
+ if ($applyOnline) {
+ $this->show_apply_form();
+ } else if ($job_id) {
+ $this->show_job($job_id);
+ } else {
+ $this->search_form();
+ $this->list_jobs();
+ }
+ }
+
+ public function show_apply_form()
+ {
+ $applyOnline = (isset($_REQUEST[self::FORM_VAR]))
+ ? filter_var($_REQUEST[self::FORM_VAR], FILTER_VALIDATE_INT)
+ : false;
+ switch ($applyOnline) {
+ case 1:
+ include $this->pluginDirName . 'models/forms/settings.php';
+ include $this->pluginDirName . 'views/front/form_1.php';
+ break;
+ case 2:
+ if ($this->formSubmitted) {
+ include $this->pluginDirName . 'models/forms/settings.php';
+ $this->form_process(1, $form1);
+ var_dump($this->fname);
+ if ($this->fname) {
+ $this->store_application_data($form1);
+ }
+ if ($this->appId) {
+ $this->store_form_data($form1, 1);
+ }
+ echo '<pre>'.print_r($this->appId, true).'</pre>';
+ echo '<pre>'.print_r($this->formId, true).'</pre>';
+// echo '<pre>'.print_r($form1, true).'</pre>';
+// echo '<pre>'.print_r($_POST, true).'</pre>';
+// extract($_POST);
+ if ($this->errorCount > 0) {
+ include $this->pluginDirName . 'views/front/form_1.php';
+ } else {
+
+ }
+ }
+ break;
+ case 3:
+ break;
+ }
+ }
+
+ public function store_application_data($form)
+ {
+ var_dump($this->appTable);
+ $this->wpdb->insert(
+ $this->appTable,
+ array(
+ 'create_time' => date('Y-m-d, h:i:s a'),
+ 'fname' => $this->fname,
+ 'lname' => $this->lname,
+ 'mname' => $this->mname
+ ),
+ array(
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ )
+ );
+ $this->appId = $this->wpdb->insert_id;
+ }
+
+ public function store_form_data($form, $form_part)
+ {
+ $this->wpdb->insert(
+ $this->formTable,
+ array(
+ 'create_time' => date('Y-m-d, h:i:s a'),
+ 'application' => $this->appId,
+ 'form_data' => serialize($form),
+ 'form_part' => $form_part
+ ),
+ array(
+ '%s',
+ '%d',
+ '%s',
+ '%d'
+ )
+ );
+ $this->formId = $this->wpdb->insert_id;
+ }
+
+ public function form_process($part, &$form)
+ {
+ $this->clean_post();
+ switch($part) {
+ case 1:
+ include $this->pluginDirName . 'models/forms/settings.php';
+ foreach ($form1 as $rowKey => $row) {
+ if ($row['type'] != 'header') {
+ foreach ($row as $fieldKey => $field) {
+ $form[$rowKey][$fieldKey]['value']
+ = filter_var($_REQUEST[$field['name']], FILTER_SANITIZE_STRING);
+ if (in_array($field['name'], array('fname', 'lname', 'mname'))) {
+ $this->$field['name'] = $form[$rowKey][$fieldKey]['value'];
+ }
+ if ( $field['type'] == 'checkbox'
+ && isset($field['opts'])
+ && !empty($field['opts'])
+ ) {
+ foreach ($field['opts'] as $opKey => $option) {
+ if (isset($_POST[$option['name']])) {
+ $form[$rowKey][$fieldKey]['opts'][$opKey]['checked'] = true;
+ }
+ }
+ }
+ if ( isset($field['req'])
+ && $field['req'] == true
+ && $_POST[$field['name']] == ''
+ ) {
+ $form[$rowKey][$fieldKey]['error'] = $field['label'] . ' is required!';
+ ++$this->errorCount;
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ public function clean_post()
+ {
+ foreach ($_POST as $key => $val) {
+ $_POST[$key] = trim($val);
+ }
+ }
+
+ public function show_job($job_id)
+ {
+ global $wpdb, $wp;
+ $job = get_post($job_id);
+ $custom = get_post_custom($job->ID);
+ $job->glm_jobs_startdate = $custom['glm_jobs_startdate'][0];
+ $job->glm_jobs_enddate = $custom['glm_jobs_enddate'][0];
+ $job->glm_jobs_contact = $custom['glm_jobs_contact'][0];
+ $job->glm_jobs_status = $custom['glm_jobs_status'][0];
+ $job->glm_jobs_pay_grade = $custom['glm_jobs_pay_grade'][0];
+ $job->glm_jobs_shift = $custom['glm_jobs_shift'][0];
+ $job->glm_jobs_email = $custom['glm_jobs_email'][0];
+ $job->glm_jobs_comments = $custom['glm_jobs_comments'][0];
+ $job->glm_jobs_code = $custom['glm_jobs_code'][0];
+ $current_url = add_query_arg($wp->query_string, '',
+ home_url($wp->request));
+ $applyOnlineHref = $current_url
+ . ((strpos($current_url, '?')) ? '&' : '?')
+ . self::FORM_VAR . "=1";
+ include $this->pluginDirName . 'views/front/jobDetail.php';
+ return;
+ }
+
+ public function list_jobs()
+ {
+ global $wpdb, $wp;
+ $midnight = strtotime(date('Y-m-d',time()).' 00:00:00');
+ $glm_jobscategory = (isset($_REQUEST['glm_jobscategory']))
+ ? filter_var($_REQUEST['glm_jobscategory'])
+ : false;
+ $glm_jobsdepartment = (isset($_REQUEST['glm_jobsdepartment']))
+ ? filter_var($_REQUEST['glm_jobsdepartment'])
+ : false;
+ $args = array(
+ 'post_type' => GLM_EMP_POST_TYPE,
+ 'meta_query' => array(
+ array(
+ 'key' => 'glm_jobs_enddate',
+ 'value' => $midnight,
+ 'compare' => '>='
+ ),
+ array(
+ 'key' => 'glm_jobs_startdate',
+ 'value' => $midnight,
+ 'compare' => '<='
+ )
+ )
+ );
+ if ($glm_jobscategory || $glm_jobsdepartment) {
+ $args['tax_query'] = array(
+ 'relation' => 'AND'
+ );
+ if ($glm_jobscategory) {
+ $args['tax_query'][] = array(
+ 'taxonomy' => 'glm_jobscategory',
+ 'field' => 'id',
+ 'terms' => $glm_jobscategory
+ );
+ }
+ if ($glm_jobsdepartment) {
+ $args['tax_query'][] = array(
+ 'taxonomy' => 'glm_jobsdepartment',
+ 'field' => 'id',
+ 'terms' => $glm_jobsdepartment
+ );
+ }
+ }
+ $jobs = get_posts($args);
+ $current_url = add_query_arg($wp->query_string, '', home_url($wp->request));
foreach ($jobs as $job) {
$custom = get_post_custom($job->ID);
$job->glm_jobs_startdate = $custom['glm_jobs_startdate'][0];
$job->glm_jobs_email = $custom['glm_jobs_email'][0];
$job->glm_jobs_comments = $custom['glm_jobs_comments'][0];
$job->glm_jobs_code = $custom['glm_jobs_code'][0];
+ $job->href = $current_url
+ . ((strpos($current_url, '?')) ? '&' : '?')
+ . "job=" . $job->ID;
}
+ include $this->pluginDirName . 'views/front/jobList.php';
+ return;
+ }
- \ob_start();
- include $this->pluginDirName . 'views/jobList.php';
- $out = \ob_get_contents();
- \ob_end_clean();
- return $out;
+ public function search_form()
+ {
+ $glm_jobscategory = (isset($_REQUEST['glm_jobscategory']))
+ ? filter_var($_REQUEST['glm_jobscategory'], FILTER_VALIDATE_INT)
+ : false;
+ $cat_args = array(
+ 'show_option_all' => 'Show All',
+ 'show_option_none' => '',
+ 'orderby' => 'name',
+ 'order' => 'ASC',
+ 'show_count' => 0,
+ 'hide_empty' => 1,
+ 'child_of' => 0,
+ 'exclude' => '',
+ 'echo' => 1,
+ 'selected' => $glm_jobscategory,
+ 'hierarchical' => 0,
+ 'name' => 'glm_jobscategory',
+ 'id' => '',
+ 'class' => 'postform',
+ 'depth' => 0,
+ 'tab_index' => 0,
+ 'taxonomy' => 'glm_jobscategory',
+ 'hide_if_empty' => false,
+ );
+ $glm_jobsdepartment = (isset($_REQUEST['glm_jobsdepartment']))
+ ? filter_var($_REQUEST['glm_jobsdepartment'], FILTER_VALIDATE_INT)
+ : false;
+ $dep_args = array(
+ 'show_option_all' => 'Show All',
+ 'show_option_none' => '',
+ 'orderby' => 'name',
+ 'order' => 'ASC',
+ 'show_count' => 0,
+ 'hide_empty' => 1,
+ 'child_of' => 0,
+ 'exclude' => '',
+ 'echo' => 1,
+ 'selected' => $glm_jobsdepartment,
+ 'hierarchical' => 0,
+ 'name' => 'glm_jobsdepartment',
+ 'id' => '',
+ 'class' => 'postform',
+ 'depth' => 0,
+ 'tab_index' => 0,
+ 'taxonomy' => 'glm_jobsdepartment',
+ 'hide_if_empty' => false,
+ );
+ $form_url = home_url() . '/searchJobs/?search=1';
+ $categories = get_terms('glm_jobscategory');
+ include $this->pluginDirName . 'views/front/jobSearch.php';
}
public function setPluginDir($dir)
--- /dev/null
+meta.foundation-version {
+ font-family: "/5.4.7/"; }
+
+meta.foundation-mq-small {
+ font-family: "/only screen/";
+ width: 0em; }
+
+meta.foundation-mq-medium {
+ font-family: "/only screen and (min-width:40.063em)/";
+ width: 40.063em; }
+
+meta.foundation-mq-large {
+ font-family: "/only screen and (min-width:64.063em)/";
+ width: 64.063em; }
+
+meta.foundation-mq-xlarge {
+ font-family: "/only screen and (min-width:90.063em)/";
+ width: 90.063em; }
+
+meta.foundation-mq-xxlarge {
+ font-family: "/only screen and (min-width:120.063em)/";
+ width: 120.063em; }
+
+meta.foundation-data-attribute-namespace {
+ font-family: false; }
+
+html, body {
+ height: 100%; }
+
+*,
+*:before,
+*:after {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box; }
+
+html,
+body {
+ font-size: 100%; }
+
+body {
+ /*background: white;*/
+ /*color: #222222;*/
+ padding: 0;
+ margin: 0;
+ font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
+ font-weight: normal;
+ font-style: normal;
+ line-height: 1.5;
+ position: relative;
+ cursor: auto; }
+
+a:hover {
+ cursor: pointer; }
+
+img {
+ max-width: 100%;
+ height: auto; }
+
+img {
+ -ms-interpolation-mode: bicubic; }
+
+#map_canvas img,
+#map_canvas embed,
+#map_canvas object,
+.map_canvas img,
+.map_canvas embed,
+.map_canvas object {
+ max-width: none !important; }
+
+.left {
+ float: left !important; }
+
+.right {
+ float: right !important; }
+
+.clearfix:before, .clearfix:after {
+ content: " ";
+ display: table; }
+.clearfix:after {
+ clear: both; }
+
+.hide {
+ display: none !important;
+ visibility: hidden; }
+
+.invisible {
+ visibility: hidden; }
+
+.antialiased {
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale; }
+
+img {
+ display: inline-block;
+ vertical-align: middle; }
+
+textarea {
+ height: auto;
+ min-height: 50px; }
+
+select {
+ width: 100%; }
+
+.row {
+ width: 100%;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 0;
+ margin-bottom: 0;
+ max-width: 62.5em; }
+ .row:before, .row:after {
+ content: " ";
+ display: table; }
+ .row:after {
+ clear: both; }
+ .row.collapse > .column,
+ .row.collapse > .columns {
+ padding-left: 0;
+ padding-right: 0; }
+ .row.collapse .row {
+ margin-left: 0;
+ margin-right: 0; }
+ .row .row {
+ width: auto;
+ margin-left: -0.9375em;
+ margin-right: -0.9375em;
+ margin-top: 0;
+ margin-bottom: 0;
+ max-width: none; }
+ .row .row:before, .row .row:after {
+ content: " ";
+ display: table; }
+ .row .row:after {
+ clear: both; }
+ .row .row.collapse {
+ width: auto;
+ margin: 0;
+ max-width: none; }
+ .row .row.collapse:before, .row .row.collapse:after {
+ content: " ";
+ display: table; }
+ .row .row.collapse:after {
+ clear: both; }
+
+.column,
+.columns {
+ padding-left: 0.9375em;
+ padding-right: 0.9375em;
+ width: 100%;
+ float: left; }
+
+[class*="column"] + [class*="column"]:last-child {
+ float: right; }
+
+[class*="column"] + [class*="column"].end {
+ float: left; }
+
+@media only screen {
+ .small-push-0 {
+ position: relative;
+ left: 0%;
+ right: auto; }
+
+ .small-pull-0 {
+ position: relative;
+ right: 0%;
+ left: auto; }
+
+ .small-push-1 {
+ position: relative;
+ left: 8.33333%;
+ right: auto; }
+
+ .small-pull-1 {
+ position: relative;
+ right: 8.33333%;
+ left: auto; }
+
+ .small-push-2 {
+ position: relative;
+ left: 16.66667%;
+ right: auto; }
+
+ .small-pull-2 {
+ position: relative;
+ right: 16.66667%;
+ left: auto; }
+
+ .small-push-3 {
+ position: relative;
+ left: 25%;
+ right: auto; }
+
+ .small-pull-3 {
+ position: relative;
+ right: 25%;
+ left: auto; }
+
+ .small-push-4 {
+ position: relative;
+ left: 33.33333%;
+ right: auto; }
+
+ .small-pull-4 {
+ position: relative;
+ right: 33.33333%;
+ left: auto; }
+
+ .small-push-5 {
+ position: relative;
+ left: 41.66667%;
+ right: auto; }
+
+ .small-pull-5 {
+ position: relative;
+ right: 41.66667%;
+ left: auto; }
+
+ .small-push-6 {
+ position: relative;
+ left: 50%;
+ right: auto; }
+
+ .small-pull-6 {
+ position: relative;
+ right: 50%;
+ left: auto; }
+
+ .small-push-7 {
+ position: relative;
+ left: 58.33333%;
+ right: auto; }
+
+ .small-pull-7 {
+ position: relative;
+ right: 58.33333%;
+ left: auto; }
+
+ .small-push-8 {
+ position: relative;
+ left: 66.66667%;
+ right: auto; }
+
+ .small-pull-8 {
+ position: relative;
+ right: 66.66667%;
+ left: auto; }
+
+ .small-push-9 {
+ position: relative;
+ left: 75%;
+ right: auto; }
+
+ .small-pull-9 {
+ position: relative;
+ right: 75%;
+ left: auto; }
+
+ .small-push-10 {
+ position: relative;
+ left: 83.33333%;
+ right: auto; }
+
+ .small-pull-10 {
+ position: relative;
+ right: 83.33333%;
+ left: auto; }
+
+ .small-push-11 {
+ position: relative;
+ left: 91.66667%;
+ right: auto; }
+
+ .small-pull-11 {
+ position: relative;
+ right: 91.66667%;
+ left: auto; }
+
+ .column,
+ .columns {
+ position: relative;
+ padding-left: 0.9375em;
+ padding-right: 0.9375em;
+ float: left; }
+
+ .small-1 {
+ width: 8.33333%; }
+
+ .small-2 {
+ width: 16.66667%; }
+
+ .small-3 {
+ width: 25%; }
+
+ .small-4 {
+ width: 33.33333%; }
+
+ .small-5 {
+ width: 41.66667%; }
+
+ .small-6 {
+ width: 50%; }
+
+ .small-7 {
+ width: 58.33333%; }
+
+ .small-8 {
+ width: 66.66667%; }
+
+ .small-9 {
+ width: 75%; }
+
+ .small-10 {
+ width: 83.33333%; }
+
+ .small-11 {
+ width: 91.66667%; }
+
+ .small-12 {
+ width: 100%; }
+
+ .small-offset-0 {
+ margin-left: 0% !important; }
+
+ .small-offset-1 {
+ margin-left: 8.33333% !important; }
+
+ .small-offset-2 {
+ margin-left: 16.66667% !important; }
+
+ .small-offset-3 {
+ margin-left: 25% !important; }
+
+ .small-offset-4 {
+ margin-left: 33.33333% !important; }
+
+ .small-offset-5 {
+ margin-left: 41.66667% !important; }
+
+ .small-offset-6 {
+ margin-left: 50% !important; }
+
+ .small-offset-7 {
+ margin-left: 58.33333% !important; }
+
+ .small-offset-8 {
+ margin-left: 66.66667% !important; }
+
+ .small-offset-9 {
+ margin-left: 75% !important; }
+
+ .small-offset-10 {
+ margin-left: 83.33333% !important; }
+
+ .small-offset-11 {
+ margin-left: 91.66667% !important; }
+
+ .small-reset-order {
+ margin-left: 0;
+ margin-right: 0;
+ left: auto;
+ right: auto;
+ float: left; }
+
+ .column.small-centered,
+ .columns.small-centered {
+ margin-left: auto;
+ margin-right: auto;
+ float: none; }
+
+ .column.small-uncentered,
+ .columns.small-uncentered {
+ margin-left: 0;
+ margin-right: 0;
+ float: left; }
+
+ .column.small-centered:last-child,
+ .columns.small-centered:last-child {
+ float: none; }
+
+ .column.small-uncentered:last-child,
+ .columns.small-uncentered:last-child {
+ float: left; }
+
+ .column.small-uncentered.opposite,
+ .columns.small-uncentered.opposite {
+ float: right; } }
+@media only screen and (min-width: 40.063em) {
+ .medium-push-0 {
+ position: relative;
+ left: 0%;
+ right: auto; }
+
+ .medium-pull-0 {
+ position: relative;
+ right: 0%;
+ left: auto; }
+
+ .medium-push-1 {
+ position: relative;
+ left: 8.33333%;
+ right: auto; }
+
+ .medium-pull-1 {
+ position: relative;
+ right: 8.33333%;
+ left: auto; }
+
+ .medium-push-2 {
+ position: relative;
+ left: 16.66667%;
+ right: auto; }
+
+ .medium-pull-2 {
+ position: relative;
+ right: 16.66667%;
+ left: auto; }
+
+ .medium-push-3 {
+ position: relative;
+ left: 25%;
+ right: auto; }
+
+ .medium-pull-3 {
+ position: relative;
+ right: 25%;
+ left: auto; }
+
+ .medium-push-4 {
+ position: relative;
+ left: 33.33333%;
+ right: auto; }
+
+ .medium-pull-4 {
+ position: relative;
+ right: 33.33333%;
+ left: auto; }
+
+ .medium-push-5 {
+ position: relative;
+ left: 41.66667%;
+ right: auto; }
+
+ .medium-pull-5 {
+ position: relative;
+ right: 41.66667%;
+ left: auto; }
+
+ .medium-push-6 {
+ position: relative;
+ left: 50%;
+ right: auto; }
+
+ .medium-pull-6 {
+ position: relative;
+ right: 50%;
+ left: auto; }
+
+ .medium-push-7 {
+ position: relative;
+ left: 58.33333%;
+ right: auto; }
+
+ .medium-pull-7 {
+ position: relative;
+ right: 58.33333%;
+ left: auto; }
+
+ .medium-push-8 {
+ position: relative;
+ left: 66.66667%;
+ right: auto; }
+
+ .medium-pull-8 {
+ position: relative;
+ right: 66.66667%;
+ left: auto; }
+
+ .medium-push-9 {
+ position: relative;
+ left: 75%;
+ right: auto; }
+
+ .medium-pull-9 {
+ position: relative;
+ right: 75%;
+ left: auto; }
+
+ .medium-push-10 {
+ position: relative;
+ left: 83.33333%;
+ right: auto; }
+
+ .medium-pull-10 {
+ position: relative;
+ right: 83.33333%;
+ left: auto; }
+
+ .medium-push-11 {
+ position: relative;
+ left: 91.66667%;
+ right: auto; }
+
+ .medium-pull-11 {
+ position: relative;
+ right: 91.66667%;
+ left: auto; }
+
+ .column,
+ .columns {
+ position: relative;
+ padding-left: 0.9375em;
+ padding-right: 0.9375em;
+ float: left; }
+
+ .medium-1 {
+ width: 8.33333%; }
+
+ .medium-2 {
+ width: 16.66667%; }
+
+ .medium-3 {
+ width: 25%; }
+
+ .medium-4 {
+ width: 33.33333%; }
+
+ .medium-5 {
+ width: 41.66667%; }
+
+ .medium-6 {
+ width: 50%; }
+
+ .medium-7 {
+ width: 58.33333%; }
+
+ .medium-8 {
+ width: 66.66667%; }
+
+ .medium-9 {
+ width: 75%; }
+
+ .medium-10 {
+ width: 83.33333%; }
+
+ .medium-11 {
+ width: 91.66667%; }
+
+ .medium-12 {
+ width: 100%; }
+
+ .medium-offset-0 {
+ margin-left: 0% !important; }
+
+ .medium-offset-1 {
+ margin-left: 8.33333% !important; }
+
+ .medium-offset-2 {
+ margin-left: 16.66667% !important; }
+
+ .medium-offset-3 {
+ margin-left: 25% !important; }
+
+ .medium-offset-4 {
+ margin-left: 33.33333% !important; }
+
+ .medium-offset-5 {
+ margin-left: 41.66667% !important; }
+
+ .medium-offset-6 {
+ margin-left: 50% !important; }
+
+ .medium-offset-7 {
+ margin-left: 58.33333% !important; }
+
+ .medium-offset-8 {
+ margin-left: 66.66667% !important; }
+
+ .medium-offset-9 {
+ margin-left: 75% !important; }
+
+ .medium-offset-10 {
+ margin-left: 83.33333% !important; }
+
+ .medium-offset-11 {
+ margin-left: 91.66667% !important; }
+
+ .medium-reset-order {
+ margin-left: 0;
+ margin-right: 0;
+ left: auto;
+ right: auto;
+ float: left; }
+
+ .column.medium-centered,
+ .columns.medium-centered {
+ margin-left: auto;
+ margin-right: auto;
+ float: none; }
+
+ .column.medium-uncentered,
+ .columns.medium-uncentered {
+ margin-left: 0;
+ margin-right: 0;
+ float: left; }
+
+ .column.medium-centered:last-child,
+ .columns.medium-centered:last-child {
+ float: none; }
+
+ .column.medium-uncentered:last-child,
+ .columns.medium-uncentered:last-child {
+ float: left; }
+
+ .column.medium-uncentered.opposite,
+ .columns.medium-uncentered.opposite {
+ float: right; }
+
+ .push-0 {
+ position: relative;
+ left: 0%;
+ right: auto; }
+
+ .pull-0 {
+ position: relative;
+ right: 0%;
+ left: auto; }
+
+ .push-1 {
+ position: relative;
+ left: 8.33333%;
+ right: auto; }
+
+ .pull-1 {
+ position: relative;
+ right: 8.33333%;
+ left: auto; }
+
+ .push-2 {
+ position: relative;
+ left: 16.66667%;
+ right: auto; }
+
+ .pull-2 {
+ position: relative;
+ right: 16.66667%;
+ left: auto; }
+
+ .push-3 {
+ position: relative;
+ left: 25%;
+ right: auto; }
+
+ .pull-3 {
+ position: relative;
+ right: 25%;
+ left: auto; }
+
+ .push-4 {
+ position: relative;
+ left: 33.33333%;
+ right: auto; }
+
+ .pull-4 {
+ position: relative;
+ right: 33.33333%;
+ left: auto; }
+
+ .push-5 {
+ position: relative;
+ left: 41.66667%;
+ right: auto; }
+
+ .pull-5 {
+ position: relative;
+ right: 41.66667%;
+ left: auto; }
+
+ .push-6 {
+ position: relative;
+ left: 50%;
+ right: auto; }
+
+ .pull-6 {
+ position: relative;
+ right: 50%;
+ left: auto; }
+
+ .push-7 {
+ position: relative;
+ left: 58.33333%;
+ right: auto; }
+
+ .pull-7 {
+ position: relative;
+ right: 58.33333%;
+ left: auto; }
+
+ .push-8 {
+ position: relative;
+ left: 66.66667%;
+ right: auto; }
+
+ .pull-8 {
+ position: relative;
+ right: 66.66667%;
+ left: auto; }
+
+ .push-9 {
+ position: relative;
+ left: 75%;
+ right: auto; }
+
+ .pull-9 {
+ position: relative;
+ right: 75%;
+ left: auto; }
+
+ .push-10 {
+ position: relative;
+ left: 83.33333%;
+ right: auto; }
+
+ .pull-10 {
+ position: relative;
+ right: 83.33333%;
+ left: auto; }
+
+ .push-11 {
+ position: relative;
+ left: 91.66667%;
+ right: auto; }
+
+ .pull-11 {
+ position: relative;
+ right: 91.66667%;
+ left: auto; } }
+@media only screen and (min-width: 64.063em) {
+ .large-push-0 {
+ position: relative;
+ left: 0%;
+ right: auto; }
+
+ .large-pull-0 {
+ position: relative;
+ right: 0%;
+ left: auto; }
+
+ .large-push-1 {
+ position: relative;
+ left: 8.33333%;
+ right: auto; }
+
+ .large-pull-1 {
+ position: relative;
+ right: 8.33333%;
+ left: auto; }
+
+ .large-push-2 {
+ position: relative;
+ left: 16.66667%;
+ right: auto; }
+
+ .large-pull-2 {
+ position: relative;
+ right: 16.66667%;
+ left: auto; }
+
+ .large-push-3 {
+ position: relative;
+ left: 25%;
+ right: auto; }
+
+ .large-pull-3 {
+ position: relative;
+ right: 25%;
+ left: auto; }
+
+ .large-push-4 {
+ position: relative;
+ left: 33.33333%;
+ right: auto; }
+
+ .large-pull-4 {
+ position: relative;
+ right: 33.33333%;
+ left: auto; }
+
+ .large-push-5 {
+ position: relative;
+ left: 41.66667%;
+ right: auto; }
+
+ .large-pull-5 {
+ position: relative;
+ right: 41.66667%;
+ left: auto; }
+
+ .large-push-6 {
+ position: relative;
+ left: 50%;
+ right: auto; }
+
+ .large-pull-6 {
+ position: relative;
+ right: 50%;
+ left: auto; }
+
+ .large-push-7 {
+ position: relative;
+ left: 58.33333%;
+ right: auto; }
+
+ .large-pull-7 {
+ position: relative;
+ right: 58.33333%;
+ left: auto; }
+
+ .large-push-8 {
+ position: relative;
+ left: 66.66667%;
+ right: auto; }
+
+ .large-pull-8 {
+ position: relative;
+ right: 66.66667%;
+ left: auto; }
+
+ .large-push-9 {
+ position: relative;
+ left: 75%;
+ right: auto; }
+
+ .large-pull-9 {
+ position: relative;
+ right: 75%;
+ left: auto; }
+
+ .large-push-10 {
+ position: relative;
+ left: 83.33333%;
+ right: auto; }
+
+ .large-pull-10 {
+ position: relative;
+ right: 83.33333%;
+ left: auto; }
+
+ .large-push-11 {
+ position: relative;
+ left: 91.66667%;
+ right: auto; }
+
+ .large-pull-11 {
+ position: relative;
+ right: 91.66667%;
+ left: auto; }
+
+ .column,
+ .columns {
+ position: relative;
+ padding-left: 0.9375em;
+ padding-right: 0.9375em;
+ float: left; }
+
+ .large-1 {
+ width: 8.33333%; }
+
+ .large-2 {
+ width: 16.66667%; }
+
+ .large-3 {
+ width: 25%; }
+
+ .large-4 {
+ width: 33.33333%; }
+
+ .large-5 {
+ width: 41.66667%; }
+
+ .large-6 {
+ width: 50%; }
+
+ .large-7 {
+ width: 58.33333%; }
+
+ .large-8 {
+ width: 66.66667%; }
+
+ .large-9 {
+ width: 75%; }
+
+ .large-10 {
+ width: 83.33333%; }
+
+ .large-11 {
+ width: 91.66667%; }
+
+ .large-12 {
+ width: 100%; }
+
+ .large-offset-0 {
+ margin-left: 0% !important; }
+
+ .large-offset-1 {
+ margin-left: 8.33333% !important; }
+
+ .large-offset-2 {
+ margin-left: 16.66667% !important; }
+
+ .large-offset-3 {
+ margin-left: 25% !important; }
+
+ .large-offset-4 {
+ margin-left: 33.33333% !important; }
+
+ .large-offset-5 {
+ margin-left: 41.66667% !important; }
+
+ .large-offset-6 {
+ margin-left: 50% !important; }
+
+ .large-offset-7 {
+ margin-left: 58.33333% !important; }
+
+ .large-offset-8 {
+ margin-left: 66.66667% !important; }
+
+ .large-offset-9 {
+ margin-left: 75% !important; }
+
+ .large-offset-10 {
+ margin-left: 83.33333% !important; }
+
+ .large-offset-11 {
+ margin-left: 91.66667% !important; }
+
+ .large-reset-order {
+ margin-left: 0;
+ margin-right: 0;
+ left: auto;
+ right: auto;
+ float: left; }
+
+ .column.large-centered,
+ .columns.large-centered {
+ margin-left: auto;
+ margin-right: auto;
+ float: none; }
+
+ .column.large-uncentered,
+ .columns.large-uncentered {
+ margin-left: 0;
+ margin-right: 0;
+ float: left; }
+
+ .column.large-centered:last-child,
+ .columns.large-centered:last-child {
+ float: none; }
+
+ .column.large-uncentered:last-child,
+ .columns.large-uncentered:last-child {
+ float: left; }
+
+ .column.large-uncentered.opposite,
+ .columns.large-uncentered.opposite {
+ float: right; }
+
+ .push-0 {
+ position: relative;
+ left: 0%;
+ right: auto; }
+
+ .pull-0 {
+ position: relative;
+ right: 0%;
+ left: auto; }
+
+ .push-1 {
+ position: relative;
+ left: 8.33333%;
+ right: auto; }
+
+ .pull-1 {
+ position: relative;
+ right: 8.33333%;
+ left: auto; }
+
+ .push-2 {
+ position: relative;
+ left: 16.66667%;
+ right: auto; }
+
+ .pull-2 {
+ position: relative;
+ right: 16.66667%;
+ left: auto; }
+
+ .push-3 {
+ position: relative;
+ left: 25%;
+ right: auto; }
+
+ .pull-3 {
+ position: relative;
+ right: 25%;
+ left: auto; }
+
+ .push-4 {
+ position: relative;
+ left: 33.33333%;
+ right: auto; }
+
+ .pull-4 {
+ position: relative;
+ right: 33.33333%;
+ left: auto; }
+
+ .push-5 {
+ position: relative;
+ left: 41.66667%;
+ right: auto; }
+
+ .pull-5 {
+ position: relative;
+ right: 41.66667%;
+ left: auto; }
+
+ .push-6 {
+ position: relative;
+ left: 50%;
+ right: auto; }
+
+ .pull-6 {
+ position: relative;
+ right: 50%;
+ left: auto; }
+
+ .push-7 {
+ position: relative;
+ left: 58.33333%;
+ right: auto; }
+
+ .pull-7 {
+ position: relative;
+ right: 58.33333%;
+ left: auto; }
+
+ .push-8 {
+ position: relative;
+ left: 66.66667%;
+ right: auto; }
+
+ .pull-8 {
+ position: relative;
+ right: 66.66667%;
+ left: auto; }
+
+ .push-9 {
+ position: relative;
+ left: 75%;
+ right: auto; }
+
+ .pull-9 {
+ position: relative;
+ right: 75%;
+ left: auto; }
+
+ .push-10 {
+ position: relative;
+ left: 83.33333%;
+ right: auto; }
+
+ .pull-10 {
+ position: relative;
+ right: 83.33333%;
+ left: auto; }
+
+ .push-11 {
+ position: relative;
+ left: 91.66667%;
+ right: auto; }
+
+ .pull-11 {
+ position: relative;
+ right: 91.66667%;
+ left: auto; } }
+button, .button {
+ border-style: solid;
+ border-width: 0px;
+ cursor: pointer;
+ font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
+ font-weight: normal;
+ line-height: normal;
+ margin: 0 0 1.25rem;
+ position: relative;
+ text-decoration: none;
+ text-align: center;
+ -webkit-appearance: none;
+ -webkit-border-radius: 0;
+ display: inline-block;
+ padding-top: 1rem;
+ padding-right: 2rem;
+ padding-bottom: 1.0625rem;
+ padding-left: 2rem;
+ font-size: 1rem;
+ background-color: #2ba6cb;
+ border-color: #2285a2;
+ color: white;
+ transition: background-color 300ms ease-out; }
+ button:hover, button:focus, .button:hover, .button:focus {
+ background-color: #2285a2; }
+ button:hover, button:focus, .button:hover, .button:focus {
+ color: white; }
+ button.secondary, .button.secondary {
+ background-color: #e9e9e9;
+ border-color: #bababa;
+ color: #333333; }
+ button.secondary:hover, button.secondary:focus, .button.secondary:hover, .button.secondary:focus {
+ background-color: #bababa; }
+ button.secondary:hover, button.secondary:focus, .button.secondary:hover, .button.secondary:focus {
+ color: #333333; }
+ button.success, .button.success {
+ background-color: #5da423;
+ border-color: #4a831c;
+ color: white; }
+ button.success:hover, button.success:focus, .button.success:hover, .button.success:focus {
+ background-color: #4a831c; }
+ button.success:hover, button.success:focus, .button.success:hover, .button.success:focus {
+ color: white; }
+ button.alert, .button.alert {
+ background-color: #c60f13;
+ border-color: #9e0c0f;
+ color: white; }
+ button.alert:hover, button.alert:focus, .button.alert:hover, .button.alert:focus {
+ background-color: #9e0c0f; }
+ button.alert:hover, button.alert:focus, .button.alert:hover, .button.alert:focus {
+ color: white; }
+ button.warning, .button.warning {
+ background-color: #f08a24;
+ border-color: #cf6e0e;
+ color: white; }
+ button.warning:hover, button.warning:focus, .button.warning:hover, .button.warning:focus {
+ background-color: #cf6e0e; }
+ button.warning:hover, button.warning:focus, .button.warning:hover, .button.warning:focus {
+ color: white; }
+ button.info, .button.info {
+ background-color: #a0d3e8;
+ border-color: #61b6d9;
+ color: #333333; }
+ button.info:hover, button.info:focus, .button.info:hover, .button.info:focus {
+ background-color: #61b6d9; }
+ button.info:hover, button.info:focus, .button.info:hover, .button.info:focus {
+ color: white; }
+ button.large, .button.large {
+ padding-top: 1.125rem;
+ padding-right: 2.25rem;
+ padding-bottom: 1.1875rem;
+ padding-left: 2.25rem;
+ font-size: 1.25rem; }
+ button.small, .button.small {
+ padding-top: 0.875rem;
+ padding-right: 1.75rem;
+ padding-bottom: 0.9375rem;
+ padding-left: 1.75rem;
+ font-size: 0.8125rem; }
+ button.tiny, .button.tiny {
+ padding-top: 0.625rem;
+ padding-right: 1.25rem;
+ padding-bottom: 0.6875rem;
+ padding-left: 1.25rem;
+ font-size: 0.6875rem; }
+ button.expand, .button.expand {
+ padding-right: 0;
+ padding-left: 0;
+ width: 100%; }
+ button.left-align, .button.left-align {
+ text-align: left;
+ text-indent: 0.75rem; }
+ button.right-align, .button.right-align {
+ text-align: right;
+ padding-right: 0.75rem; }
+ button.radius, .button.radius {
+ border-radius: 3px; }
+ button.round, .button.round {
+ border-radius: 1000px; }
+ button.disabled, button[disabled], .button.disabled, .button[disabled] {
+ background-color: #2ba6cb;
+ border-color: #2285a2;
+ color: white;
+ cursor: default;
+ opacity: 0.7;
+ box-shadow: none; }
+ button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
+ background-color: #2285a2; }
+ button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
+ color: white; }
+ button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
+ background-color: #2ba6cb; }
+ button.disabled.secondary, button[disabled].secondary, .button.disabled.secondary, .button[disabled].secondary {
+ background-color: #e9e9e9;
+ border-color: #bababa;
+ color: #333333;
+ cursor: default;
+ opacity: 0.7;
+ box-shadow: none; }
+ button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
+ background-color: #bababa; }
+ button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
+ color: #333333; }
+ button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
+ background-color: #e9e9e9; }
+ button.disabled.success, button[disabled].success, .button.disabled.success, .button[disabled].success {
+ background-color: #5da423;
+ border-color: #4a831c;
+ color: white;
+ cursor: default;
+ opacity: 0.7;
+ box-shadow: none; }
+ button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
+ background-color: #4a831c; }
+ button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
+ color: white; }
+ button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
+ background-color: #5da423; }
+ button.disabled.alert, button[disabled].alert, .button.disabled.alert, .button[disabled].alert {
+ background-color: #c60f13;
+ border-color: #9e0c0f;
+ color: white;
+ cursor: default;
+ opacity: 0.7;
+ box-shadow: none; }
+ button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
+ background-color: #9e0c0f; }
+ button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
+ color: white; }
+ button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
+ background-color: #c60f13; }
+ button.disabled.warning, button[disabled].warning, .button.disabled.warning, .button[disabled].warning {
+ background-color: #f08a24;
+ border-color: #cf6e0e;
+ color: white;
+ cursor: default;
+ opacity: 0.7;
+ box-shadow: none; }
+ button.disabled.warning:hover, button.disabled.warning:focus, button[disabled].warning:hover, button[disabled].warning:focus, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus {
+ background-color: #cf6e0e; }
+ button.disabled.warning:hover, button.disabled.warning:focus, button[disabled].warning:hover, button[disabled].warning:focus, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus {
+ color: white; }
+ button.disabled.warning:hover, button.disabled.warning:focus, button[disabled].warning:hover, button[disabled].warning:focus, .button.disabled.warning:hover, .button.disabled.warning:focus, .button[disabled].warning:hover, .button[disabled].warning:focus {
+ background-color: #f08a24; }
+ button.disabled.info, button[disabled].info, .button.disabled.info, .button[disabled].info {
+ background-color: #a0d3e8;
+ border-color: #61b6d9;
+ color: #333333;
+ cursor: default;
+ opacity: 0.7;
+ box-shadow: none; }
+ button.disabled.info:hover, button.disabled.info:focus, button[disabled].info:hover, button[disabled].info:focus, .button.disabled.info:hover, .button.disabled.info:focus, .button[disabled].info:hover, .button[disabled].info:focus {
+ background-color: #61b6d9; }
+ button.disabled.info:hover, button.disabled.info:focus, button[disabled].info:hover, button[disabled].info:focus, .button.disabled.info:hover, .button.disabled.info:focus, .button[disabled].info:hover, .button[disabled].info:focus {
+ color: white; }
+ button.disabled.info:hover, button.disabled.info:focus, button[disabled].info:hover, button[disabled].info:focus, .button.disabled.info:hover, .button.disabled.info:focus, .button[disabled].info:hover, .button[disabled].info:focus {
+ background-color: #a0d3e8; }
+
+button::-moz-focus-inner {
+ border: 0;
+ padding: 0; }
+
+@media only screen and (min-width: 40.063em) {
+ button, .button {
+ display: inline-block; } }
+/* Standard Forms */
+form {
+ margin: 0 0 1rem; }
+
+/* Using forms within rows, we need to set some defaults */
+form .row .row {
+ margin: 0 -0.5rem; }
+ form .row .row .column,
+ form .row .row .columns {
+ padding: 0 0.5rem; }
+ form .row .row.collapse {
+ margin: 0; }
+ form .row .row.collapse .column,
+ form .row .row.collapse .columns {
+ padding: 0; }
+ form .row .row.collapse input {
+ -webkit-border-bottom-right-radius: 0;
+ -webkit-border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0; }
+form .row input.column,
+form .row input.columns,
+form .row textarea.column,
+form .row textarea.columns {
+ padding-left: 0.5rem; }
+
+/* Label Styles */
+label {
+ font-size: 0.875rem;
+ color: #4d4d4d;
+ cursor: pointer;
+ display: block;
+ font-weight: normal;
+ line-height: 1.5;
+ margin-bottom: 0;
+ /* Styles for required inputs */ }
+ label.right {
+ float: none !important;
+ text-align: right; }
+ label.inline {
+ margin: 0 0 1rem 0;
+ padding: 0.5625rem 0; }
+ label small {
+ text-transform: capitalize;
+ color: #676767; }
+
+/* Attach elements to the beginning or end of an input */
+.prefix,
+.postfix {
+ display: block;
+ position: relative;
+ z-index: 2;
+ text-align: center;
+ width: 100%;
+ padding-top: 0;
+ padding-bottom: 0;
+ border-style: solid;
+ border-width: 1px;
+ overflow: hidden;
+ font-size: 0.875rem;
+ height: 2.3125rem;
+ line-height: 2.3125rem; }
+
+/* Adjust padding, alignment and radius if pre/post element is a button */
+.postfix.button {
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ text-align: center;
+ line-height: 2.125rem;
+ border: none; }
+
+.prefix.button {
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ text-align: center;
+ line-height: 2.125rem;
+ border: none; }
+
+.prefix.button.radius {
+ border-radius: 0;
+ -webkit-border-bottom-left-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+ border-top-left-radius: 3px; }
+
+.postfix.button.radius {
+ border-radius: 0;
+ -webkit-border-bottom-right-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+ border-top-right-radius: 3px; }
+
+.prefix.button.round {
+ border-radius: 0;
+ -webkit-border-bottom-left-radius: 1000px;
+ -webkit-border-top-left-radius: 1000px;
+ border-bottom-left-radius: 1000px;
+ border-top-left-radius: 1000px; }
+
+.postfix.button.round {
+ border-radius: 0;
+ -webkit-border-bottom-right-radius: 1000px;
+ -webkit-border-top-right-radius: 1000px;
+ border-bottom-right-radius: 1000px;
+ border-top-right-radius: 1000px; }
+
+/* Separate prefix and postfix styles when on span or label so buttons keep their own */
+span.prefix, label.prefix {
+ background: #f2f2f2;
+ border-right: none;
+ color: #333333;
+ border-color: #cccccc; }
+
+span.postfix, label.postfix {
+ background: #f2f2f2;
+ border-left: none;
+ color: #333333;
+ border-color: #cccccc; }
+
+/* We use this to get basic styling on all basic form elements */
+input[type="text"],
+input[type="password"],
+input[type="date"],
+input[type="datetime"],
+input[type="datetime-local"],
+input[type="month"],
+input[type="week"],
+input[type="email"],
+input[type="number"],
+input[type="search"],
+input[type="tel"],
+input[type="time"],
+input[type="url"],
+input[type="color"],
+textarea {
+ -webkit-appearance: none;
+ -webkit-border-radius: 0px;
+ background-color: white;
+ font-family: inherit;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #cccccc;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ color: rgba(0, 0, 0, 0.75);
+ display: block;
+ font-size: 0.875rem;
+ margin: 0 0 1rem 0;
+ padding: 0.5rem;
+ height: 2.3125rem;
+ width: 100%;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ transition: box-shadow 0.45s, border-color 0.45s ease-in-out; }
+ input[type="text"]:focus,
+ input[type="password"]:focus,
+ input[type="date"]:focus,
+ input[type="datetime"]:focus,
+ input[type="datetime-local"]:focus,
+ input[type="month"]:focus,
+ input[type="week"]:focus,
+ input[type="email"]:focus,
+ input[type="number"]:focus,
+ input[type="search"]:focus,
+ input[type="tel"]:focus,
+ input[type="time"]:focus,
+ input[type="url"]:focus,
+ input[type="color"]:focus,
+ textarea:focus {
+ box-shadow: 0 0 5px #999999;
+ border-color: #999999; }
+ input[type="text"]:focus,
+ input[type="password"]:focus,
+ input[type="date"]:focus,
+ input[type="datetime"]:focus,
+ input[type="datetime-local"]:focus,
+ input[type="month"]:focus,
+ input[type="week"]:focus,
+ input[type="email"]:focus,
+ input[type="number"]:focus,
+ input[type="search"]:focus,
+ input[type="tel"]:focus,
+ input[type="time"]:focus,
+ input[type="url"]:focus,
+ input[type="color"]:focus,
+ textarea:focus {
+ background: #fafafa;
+ border-color: #999999;
+ outline: none; }
+ input[type="text"]:disabled,
+ input[type="password"]:disabled,
+ input[type="date"]:disabled,
+ input[type="datetime"]:disabled,
+ input[type="datetime-local"]:disabled,
+ input[type="month"]:disabled,
+ input[type="week"]:disabled,
+ input[type="email"]:disabled,
+ input[type="number"]:disabled,
+ input[type="search"]:disabled,
+ input[type="tel"]:disabled,
+ input[type="time"]:disabled,
+ input[type="url"]:disabled,
+ input[type="color"]:disabled,
+ textarea:disabled {
+ background-color: #dddddd;
+ cursor: default; }
+ input[type="text"][disabled], input[type="text"][readonly], fieldset[disabled] input[type="text"],
+ input[type="password"][disabled],
+ input[type="password"][readonly], fieldset[disabled]
+ input[type="password"],
+ input[type="date"][disabled],
+ input[type="date"][readonly], fieldset[disabled]
+ input[type="date"],
+ input[type="datetime"][disabled],
+ input[type="datetime"][readonly], fieldset[disabled]
+ input[type="datetime"],
+ input[type="datetime-local"][disabled],
+ input[type="datetime-local"][readonly], fieldset[disabled]
+ input[type="datetime-local"],
+ input[type="month"][disabled],
+ input[type="month"][readonly], fieldset[disabled]
+ input[type="month"],
+ input[type="week"][disabled],
+ input[type="week"][readonly], fieldset[disabled]
+ input[type="week"],
+ input[type="email"][disabled],
+ input[type="email"][readonly], fieldset[disabled]
+ input[type="email"],
+ input[type="number"][disabled],
+ input[type="number"][readonly], fieldset[disabled]
+ input[type="number"],
+ input[type="search"][disabled],
+ input[type="search"][readonly], fieldset[disabled]
+ input[type="search"],
+ input[type="tel"][disabled],
+ input[type="tel"][readonly], fieldset[disabled]
+ input[type="tel"],
+ input[type="time"][disabled],
+ input[type="time"][readonly], fieldset[disabled]
+ input[type="time"],
+ input[type="url"][disabled],
+ input[type="url"][readonly], fieldset[disabled]
+ input[type="url"],
+ input[type="color"][disabled],
+ input[type="color"][readonly], fieldset[disabled]
+ input[type="color"],
+ textarea[disabled],
+ textarea[readonly], fieldset[disabled]
+ textarea {
+ background-color: #dddddd;
+ cursor: default; }
+ input[type="text"].radius,
+ input[type="password"].radius,
+ input[type="date"].radius,
+ input[type="datetime"].radius,
+ input[type="datetime-local"].radius,
+ input[type="month"].radius,
+ input[type="week"].radius,
+ input[type="email"].radius,
+ input[type="number"].radius,
+ input[type="search"].radius,
+ input[type="tel"].radius,
+ input[type="time"].radius,
+ input[type="url"].radius,
+ input[type="color"].radius,
+ textarea.radius {
+ border-radius: 3px; }
+
+form .row .prefix-radius.row.collapse input,
+form .row .prefix-radius.row.collapse textarea,
+form .row .prefix-radius.row.collapse select {
+ border-radius: 0;
+ -webkit-border-bottom-right-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+ border-top-right-radius: 3px; }
+form .row .prefix-radius.row.collapse .prefix {
+ border-radius: 0;
+ -webkit-border-bottom-left-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+ border-top-left-radius: 3px; }
+form .row .postfix-radius.row.collapse input,
+form .row .postfix-radius.row.collapse textarea,
+form .row .postfix-radius.row.collapse select {
+ border-radius: 0;
+ -webkit-border-bottom-left-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+ border-top-left-radius: 3px; }
+form .row .postfix-radius.row.collapse .postfix {
+ border-radius: 0;
+ -webkit-border-bottom-right-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+ border-top-right-radius: 3px; }
+form .row .prefix-round.row.collapse input,
+form .row .prefix-round.row.collapse textarea,
+form .row .prefix-round.row.collapse select {
+ border-radius: 0;
+ -webkit-border-bottom-right-radius: 1000px;
+ -webkit-border-top-right-radius: 1000px;
+ border-bottom-right-radius: 1000px;
+ border-top-right-radius: 1000px; }
+form .row .prefix-round.row.collapse .prefix {
+ border-radius: 0;
+ -webkit-border-bottom-left-radius: 1000px;
+ -webkit-border-top-left-radius: 1000px;
+ border-bottom-left-radius: 1000px;
+ border-top-left-radius: 1000px; }
+form .row .postfix-round.row.collapse input,
+form .row .postfix-round.row.collapse textarea,
+form .row .postfix-round.row.collapse select {
+ border-radius: 0;
+ -webkit-border-bottom-left-radius: 1000px;
+ -webkit-border-top-left-radius: 1000px;
+ border-bottom-left-radius: 1000px;
+ border-top-left-radius: 1000px; }
+form .row .postfix-round.row.collapse .postfix {
+ border-radius: 0;
+ -webkit-border-bottom-right-radius: 1000px;
+ -webkit-border-top-right-radius: 1000px;
+ border-bottom-right-radius: 1000px;
+ border-top-right-radius: 1000px; }
+
+input[type="submit"] {
+ -webkit-appearance: none;
+ -webkit-border-radius: 0px; }
+
+/* Respect enforced amount of rows for textarea */
+textarea[rows] {
+ height: auto; }
+
+/* Not allow resize out of parent */
+textarea {
+ max-width: 100%; }
+
+/* Add height value for select elements to match text input height */
+select {
+ -webkit-appearance: none !important;
+ -webkit-border-radius: 0px;
+ background-color: #fafafa;
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+);
+ background-position: 100% center;
+ background-repeat: no-repeat;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #cccccc;
+ padding: 0.5rem;
+ font-size: 0.875rem;
+ font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
+ color: rgba(0, 0, 0, 0.75);
+ line-height: normal;
+ border-radius: 0;
+ height: 2.3125rem; }
+ select::-ms-expand {
+ display: none; }
+ select.radius {
+ border-radius: 3px; }
+ select:hover {
+ background-color: #f3f3f3;
+ border-color: #999999; }
+ select:disabled {
+ background-color: #dddddd;
+ cursor: default; }
+
+/* Adjust margin for form elements below */
+input[type="file"],
+input[type="checkbox"],
+input[type="radio"],
+select {
+ margin: 0 0 1rem 0; }
+
+input[type="checkbox"] + label,
+input[type="radio"] + label {
+ display: inline-block;
+ margin-left: 0.5rem;
+ margin-right: 1rem;
+ margin-bottom: 0;
+ vertical-align: baseline; }
+
+/* Normalize file input width */
+input[type="file"] {
+ width: 100%; }
+
+/* HTML5 Number spinners settings */
+/* We add basic fieldset styling */
+fieldset {
+ border: 1px solid #dddddd;
+ padding: 1.25rem;
+ margin: 1.125rem 0; }
+ fieldset legend {
+ font-weight: bold;
+ background: white;
+ padding: 0 0.1875rem;
+ margin: 0;
+ margin-left: -0.1875rem; }
+
+/* Error Handling */
+[data-abide] .error small.error, [data-abide] .error span.error, [data-abide] span.error, [data-abide] small.error {
+ display: block;
+ padding: 0.375rem 0.5625rem 0.5625rem;
+ margin-top: -1px;
+ margin-bottom: 1rem;
+ font-size: 0.75rem;
+ font-weight: normal;
+ font-style: italic;
+ background: #c60f13;
+ color: white; }
+[data-abide] span.error, [data-abide] small.error {
+ display: none; }
+
+span.error, small.error {
+ display: block;
+ padding: 0.375rem 0.5625rem 0.5625rem;
+ margin-top: -1px;
+ margin-bottom: 1rem;
+ font-size: 0.75rem;
+ font-weight: normal;
+ font-style: italic;
+ background: #c60f13;
+ color: white; }
+
+.error input,
+.error textarea,
+.error select {
+ margin-bottom: 0; }
+.error input[type="checkbox"],
+.error input[type="radio"] {
+ margin-bottom: 1rem; }
+.error label,
+.error label.error {
+ color: #c60f13; }
+.error small.error {
+ display: block;
+ padding: 0.375rem 0.5625rem 0.5625rem;
+ margin-top: -1px;
+ margin-bottom: 1rem;
+ font-size: 0.75rem;
+ font-weight: normal;
+ font-style: italic;
+ background: #c60f13;
+ color: white; }
+.error > label > small {
+ color: #676767;
+ background: transparent;
+ padding: 0;
+ text-transform: capitalize;
+ font-style: normal;
+ font-size: 60%;
+ margin: 0;
+ display: inline; }
+.error span.error-message {
+ display: block; }
+
+input.error,
+textarea.error,
+select.error {
+ margin-bottom: 0; }
+
+label.error {
+ color: #c60f13; }
* Author URI: http://www.gaslightmedia.com
* License: All right reserved
*/
-namespace Glm\Employment;
-use Glm\Employment as Emp;
defined('ABSPATH') or die();
+define('GLM_EMP_PLUGIN_PATH_FILE', __FILE__);
+define('GLM_EMP_VERSION', '1.0');
+define('GLM_EMP_VRS_OPTION_NAME', 'glm_jobs_db_version');
+define('GLM_EMP_POST_TYPE', 'glm_jobs');
+define('GLM_EMP_APPLICATION_TABLE', 'glm_jobs_application');
+define('GLM_EMP_FORM_TABLE', 'glm_jobs_app_form');
+
require_once 'controllers/admin.php';
require_once 'controllers/front.php';
require_once 'models/job.php';
-use Glm\Employment\Controller as Controller;
-use Glm\Employment\Model as Model;
+require_once 'models/database.php';
+$glm_member_db = new glm_employment_models_database($GLOBALS['wpdb']);
/**
* Setup class to call in the Controllers
*/
-class Setup
+class glm_employment_setup
{
public function __construct()
{
if (is_admin()) {
- $adminController = new Controller\AdminController(
- plugin_dir_path(__FILE__)
+ $adminController = new glm_employment_admin(
+ plugin_dir_path(__FILE__),
+ $GLOBALS['wpdb']
);
} else {
- $frontController = new Controller\FrontController(
- plugin_dir_path(__FILE__)
+ $frontController = new glm_employment_front(
+ plugin_dir_path(__FILE__),
+ $GLOBALS['wpdb']
);
}
}
}
-$employmentApp = new Emp\Setup();
\ No newline at end of file
+$employmentApp = new glm_employment_setup();
+
+function glm_load_style()
+{
+ wp_enqueue_style('foundation',
+ plugin_dir_url(__FILE__) . 'css/foundation.css');
+}
+if ($_REQUEST['action'] == 'view') {
+ add_action('admin_enqueue_scripts', 'glm_load_style');
+}
--- /dev/null
+<?php
+
+/**
+ * database.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_database
+ *
+ * Description of database
+ *
+ * @category Toolkit
+ * @package Package
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @copyright 2013 Gaslight Media
+ * @license Gaslight Media
+ * @release Release: (0.1)
+ * @link <>
+ */
+class glm_employment_models_database
+{
+ public $wpdb;
+ public $applicationTable;
+ public $appFormTable;
+
+ public function __construct($wpdb)
+ {
+ $this->wpdb = $wpdb;
+ register_activation_hook(
+ GLM_EMP_PLUGIN_PATH_FILE,
+ array($this, 'install')
+ );
+ add_action('plugins_loaded', array($this, 'glm_emp_update_db_check'));
+
+ $this->applicationTable = $this->wpdb->prefix . GLM_EMP_APPLICATION_TABLE;
+ $this->appFormTable = $this->wpdb->prefix . GLM_EMP_FORM_TABLE;
+ }
+
+ public function install()
+ {
+ $charset_collate = $this->wpdb->get_charset_collate();
+
+ $sql = "CREATE TABLE {$this->applicationTable} (
+ id BIGINT(20) NOT NULL AUTO_INCREMENT,
+ create_time DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
+ fname TEXT NOT NULL,
+ lname TEXT NOT NULL,
+ mname TEXT DEFAULT '' NOT NULL,
+ resume TEXT DEFAULT '' NOT NULL,
+ archived BOOLEAN DEFAULT false NOT NULL,
+ UNIQUE KEY id (id)
+ ) {$charset_collate}";
+ include ABSPATH . 'wp-admin/includes/upgrade.php';
+ dbDelta($sql);
+
+ $sql = "CREATE TABLE {$this->appFormTable} (
+ id BIGINT(20) NOT NULL AUTO_INCREMENT,
+ create_time DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
+ application BIGINT(20) NOT NULL,
+ form_data TEXT DEFAULT '' NOT NULL,
+ form_part INTEGER DEFAULT 0 NOT NULL,
+ UNIQUE KEY id (id)
+ ) {$charset_collate}";
+ dbDelta($sql);
+
+ update_option(GLM_EMP_VRS_OPTION_NAME, GLM_EMP_VERSION);
+ }
+
+ public function glm_emp_update_db_check()
+ {
+ if (GLM_EMP_VERSION != get_option(GLM_EMP_VRS_OPTION_NAME)) {
+ $this->install();
+ }
+ }
+
+}
--- /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
+$fname = [
+ 'type' => 'text',
+ 'name' => 'fname',
+ 'label' => 'First Name',
+ 'large' => 5,
+ 'req' => true
+];
+$lname = [
+ 'type' => 'text',
+ 'name' => 'lname',
+ 'label' => 'Last Name',
+ 'large' => 5
+];
+$mname = [
+ 'type' => 'text',
+ 'name' => 'mname',
+ 'label' => 'Middle Name',
+ 'large' => 2
+];
+$street = [
+ 'type' => 'text',
+ 'name' => 'street',
+ 'label' => 'Street',
+ 'large' => 3
+];
+$city = [
+ 'type' => 'text',
+ 'name' => 'city',
+ 'label' => 'City',
+ 'large' => 3
+];
+$state = [
+ 'type' => 'text',
+ 'name' => 'state',
+ 'label' => 'State',
+ 'large' => 3
+];
+$zip = [
+ 'type' => 'text',
+ 'name' => 'zip',
+ 'label' => 'ZIP',
+ 'large' => 3
+];
+
+$phone = [
+ 'type' => 'tel',
+ 'name' => 'phone',
+ 'label' => 'Phone',
+ 'large' => 4
+];
+$altPhone = [
+ 'type' => 'tel',
+ 'name' => 'alt_phone',
+ 'label' => 'Alternate Phone',
+ 'large' => 4
+];
+$email = [
+ 'type' => 'email',
+ 'name' => 'email',
+ 'label' => 'Email',
+ 'large' => 4,
+ 'req' => true
+];
+$over_18 = [
+ 'type' => 'radio',
+ 'name' => 'over_18',
+ 'label' => 'Are you 18 years or older?',
+ 'large' => 4,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'over_18_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'over_18_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$us_citizen = [
+ 'type' => 'radio',
+ 'name' => 'us_citizen',
+ 'label' => 'Are you an U.S. citizen?',
+ 'large' => 4,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'us_citizen_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'us_citizen_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$us_auth = [
+ 'type' => 'radio',
+ 'name' => 'us_auth',
+ 'label' => 'Are you authorized to work in the United States?',
+ 'large' => 4,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'us_auth_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'us_auth_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$employed_before = [
+ 'type' => 'radio',
+ 'name' => 'employed_before',
+ 'label' => 'Have you been previously employed here?',
+ 'large' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'employed_before_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'employed_before_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$employed_before_dates = [
+ 'type' => 'text',
+ 'name' => 'employed_before_dates',
+ 'label' => 'If yes, date(s)',
+ 'large' => 6
+];
+$supervisor = [
+ 'type' => 'text',
+ 'name' => 'supervisor',
+ 'label' => 'Supervisor Name(s)',
+ 'large' => 12
+];
+$applied_before = [
+ 'type' => 'radio',
+ 'name' => 'applied_before',
+ 'label' => 'Have you ever applied to this Company before?',
+ 'large' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'applied_before_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'applied_before_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$applied_before_dates = [
+ 'type' => 'text',
+ 'name' => 'applied_before_dates',
+ 'label' => 'Where?',
+ 'large' => 6
+];
+$applied_before_under_what_name = [
+ 'type' => 'text',
+ 'name' => 'applied_before_under_what_name',
+ 'label' => 'Under what name?',
+ 'large' => 6
+];
+$applied_before_when = [
+ 'type' => 'text',
+ 'name' => 'applied_before_when',
+ 'label' => 'When?',
+ 'large' => 6
+];
+$list_any_friends = [
+ 'type' => 'text',
+ 'name' => 'list_any_friends',
+ 'label' => 'List any friends or relatives working here',
+ 'large' => 12
+];
+$have_drivers_license = [
+ 'type' => 'radio',
+ 'name' => 'have_drivers_license',
+ 'label' => 'DO YOU HAVE A DRIVER\'S LICENSE?',
+ 'large' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'have_drivers_license_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'have_drivers_license_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$means_of_travel = [
+ 'type' => 'text',
+ 'name' => 'means_of_travel',
+ 'label' => 'What is your means of transportation to work?',
+ 'large' => 6
+];
+$drivers_license = [
+ 'type' => 'text',
+ 'name' => 'drivers_license',
+ 'label' => 'Driver\'/s License Number',
+ 'large' => 6
+];
+$license_state = [
+ 'type' => 'text',
+ 'name' => 'license_state',
+ 'label' => 'State of issue',
+ 'large' => 6
+];
+$license_type = [
+ 'type' => 'radio',
+ 'name' => 'license_type',
+ 'label' => 'Drivers License',
+ 'large' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'license_type_operator',
+ 'label' => 'Operator',
+ 'value' => 'Operator'
+ ],[
+ 'name' => 'license_type_commercial',
+ 'label' => 'Commercial',
+ 'value' => 'Commercial'
+ ],[
+ 'name' => 'license_type_chauffeur',
+ 'label' => 'Chauffeur',
+ 'value' => 'Chauffeur']]
+];
+$license_exp_date = [
+ 'type' => 'text',
+ 'name' => 'license_exp_date',
+ 'label' => 'Expiration date',
+ 'large' => 6
+];
+$had_accident_in_past_three_years = [
+ 'type' => 'radio',
+ 'name' => 'had_accident_in_past_three_years',
+ 'label' => 'Have you had any accidents during the past three years?',
+ 'large' => 8,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'had_accident_in_past_three_years_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'had_accident_in_past_three_years_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$had_accident_in_past_three_years_how_many = [
+ 'type' => 'text',
+ 'name' => 'had_accident_in_past_three_years_how_many',
+ 'label' => 'How Many',
+ 'large' => 4
+];
+$had_violations_in_past_three_years = [
+ 'type' => 'radio',
+ 'name' => 'had_violations_in_past_three_years',
+ 'label' => 'Have you had any moving violations during the past three years?',
+ 'large' => 8,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'had_violations_in_past_three_years_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'had_violations_in_past_three_years_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$had_violations_in_past_three_years_how_many = [
+ 'type' => 'text',
+ 'name' => 'had_violations_in_past_three_years_how_many',
+ 'label' => 'How Many',
+ 'large' => 4
+];
+$position_applied_for = [
+ 'type' => 'text',
+ 'name' => 'position_applied_for',
+ 'label' => 'Position Applied For',
+ 'large' => 6
+];
+$date_available_for_work = [
+ 'type' => 'text',
+ 'name' => 'date_available_for_work',
+ 'label' => 'Date Available to Work',
+ 'large' => 6
+];
+$type_of_employment = [
+ 'type' => 'checkbox',
+ 'name' => 'type_of_employment',
+ 'label' => 'Type of Employment',
+ 'large' => 6,
+ 'req' => false,
+ 'opts' => [[
+ 'name' => 'type_of_employment_fulltime',
+ 'label' => 'Full Time',
+ 'value' => 'Full Time'
+ ],[
+ 'name' => 'type_of_employment_parttime',
+ 'label' => 'Part Time',
+ 'value' => 'Part Time'
+ ]]
+];
+$salary_desired = [
+ 'type' => 'text',
+ 'name' => 'salary_desired',
+ 'label' => 'Salary Desired',
+ 'large' => 6
+];
+$location_preference = [
+ 'type' => 'checkbox',
+ 'name' => 'location_preference',
+ 'label' => 'Location Preference',
+ 'large' => 6,
+ 'req' => false,
+ 'opts' => [[
+ 'name' => 'location_preference_petoskey',
+ 'label' => 'Petoskey',
+ 'value' => 'Petoskey'
+ ],[
+ 'name' => 'location_preference_harborsprings',
+ 'label' => 'Harbor Springs',
+ 'value' => 'Harbor Springs'
+ ],[
+ 'name' => 'location_preference_gaylord',
+ 'label' => 'Gaylord',
+ 'value' => 'Gaylord'
+ ]]
+];
+$do_you_have_building_exp = [
+ 'type' => 'radio',
+ 'name' => 'do_you_have_building_exp',
+ 'label' => 'Do you have experience in the building industry?',
+ 'large' => 6,
+ 'req' => true,
+ 'opts' => [[
+ 'name' => 'do_you_have_building_exp_yes',
+ 'label' => 'Yes',
+ 'value' => 1
+ ],[
+ 'name' => 'do_you_have_building_exp_no',
+ 'label' => 'No',
+ 'value' => 0]]
+];
+$special_training = [
+ 'type' => 'textarea',
+ 'name' => 'special_training',
+ 'label' => 'Do you have any special training, skills, certifications, qualifications,'
+ . ' or other experiences that relate to the position(s) applied for?',
+ 'large' => 12
+];
+$form1 = [
+ ['type' => 'header', 'label' => 'Personal Information'],
+ [$fname, $lname, $mname],
+ [$street, $city, $state, $zip],
+ [$phone, $altPhone, $email],
+ [$over_18, $us_citizen, $us_auth],
+ [$employed_before, $employed_before_dates],
+ [$supervisor],
+ [$applied_before, $applied_before_dates],
+ [$applied_before_under_what_name, $applied_before_when],
+ [$list_any_friends],
+ [$have_drivers_license, $means_of_travel],
+ [$drivers_license, $license_state],
+ [$license_type, $license_exp_date],
+ [$had_accident_in_past_three_years, $had_accident_in_past_three_years_how_many],
+ [$had_violations_in_past_three_years, $had_violations_in_past_three_years_how_many],
+ ['type' => 'header', 'label' => 'Employment Desired'],
+ [$position_applied_for, $date_available_for_work],
+ [$type_of_employment, $salary_desired],
+ [$location_preference, $do_you_have_building_exp],
+ [$special_training]
+];
--- /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()
+ {
+
+ }
+
+}
<?php
-namespace Glm\Employment\Model;
-
-class Job
+class glm_employment_job
{
public $pluginDirName;
public function __construct($path)
{
$this->pluginDirName = $path;
- \add_action('init', array($this, 'addPostTypes'));
- \add_action('init', array($this, 'createJobTaxonomy'));
+ add_action('init', array($this, 'addPostTypes'));
+ add_action('init', array($this, 'createJobTaxonomy'));
+ add_filter('post_updated_messages', array($this, 'jobsUpdatedMessages'));
- \add_filter('manage_edit-glm_jobs_columns',
+ add_filter('manage_edit-glm_jobs_columns',
array($this, 'jobs_edit_columns'));
- \add_action('manage_posts_custom_column',
+
+ add_action('manage_posts_custom_column',
array($this, 'jobs_custom_columns'));
- \add_action('admin_init', array($this, 'meta_dates'));
- \add_action('save_post', array($this, 'save_emp_meta'));
+ add_action('admin_init', array($this, 'meta_dates'));
+ add_action('save_post', array($this, 'save_emp_meta'));
+ add_filter('manage_edit-glm_jobs_sortable_columns', array($this, 'sortByDates'));
+ add_filter('restrict_manage_posts', array($this, 'jobFilterList'));
+ add_filter('parse_query', array($this, 'jobFilter'));
+ }
+
+ public function sortByDates($columns)
+ {
+ $columns['glmjobs_col_date'] = 'glmjobs_col_date';
+ $columns['glmjobs_col_cat'] = 'glmjobs_col_cat';
+ $columns['glmjobs_col_dep'] = 'glmjobs_col_dep';
+ return $columns;
+ }
+
+ public function jobFilter($query)
+ {
+ $qv = &$query->query_vars;
+ if ( ( isset($qv['glm_jobscategory']) && $qv['glm_jobscategory'] ) && is_numeric( $qv['glm_jobscategory'] ) ) {
+ $term = get_term_by( 'id', $qv['glm_jobscategory'], 'glm_jobscategory' );
+ $qv['glm_jobscategory'] = $term->slug;
+ }
+ if ( ( isset($qv['glm_jobsdepartment']) && $qv['glm_jobsdepartment'] ) && is_numeric( $qv['glm_jobsdepartment'] ) ) {
+ $term = get_term_by( 'id', $qv['glm_jobsdepartment'], 'glm_jobsdepartment' );
+ $qv['glm_jobsdepartment'] = $term->slug;
+ }
+ }
+
+ public function jobFilterList()
+ {
+ global $wp_query;
+ $screen = get_current_screen();
+ if ($screen->post_type == GLM_EMP_POST_TYPE) {
+ wp_dropdown_categories(array(
+ 'show_option_all' => 'Show all Categories',
+ 'taxonomy' => 'glm_jobscategory',
+ 'name' => 'glm_jobscategory',
+ 'orderby' => 'name',
+ 'selected' => (isset($wp_query->query['glm_jobscategory'])? $wp_query->query['glm_jobscategory']: ''),
+ 'hierarchical' => true,
+ 'depth' => 3,
+ 'show_count' => true,
+ 'hide_empty' => true
+ ));
+ wp_dropdown_categories(array(
+ 'show_option_all' => 'Show all Departments',
+ 'taxonomy' => 'glm_jobsdepartment',
+ 'name' => 'glm_jobsdepartment',
+ 'orderby' => 'name',
+ 'selected' => (isset($wp_query->query['glm_jobsdepartment'])? $wp_query->query['glm_jobsdepartment']: ''),
+ 'hierarchical' => true,
+ 'depth' => 3,
+ 'show_count' => true,
+ 'hide_empty' => true
+ ));
+ }
}
public function meta_dates()
{
add_meta_box('glm_employment_meta', 'Position Information',
- array($this, 'edit_job_meta'), 'glm_jobs');
+ array($this, 'edit_job_meta'), GLM_EMP_POST_TYPE);
}
public function edit_job_meta()
{
global $post;
$custom = get_post_custom($post->ID);
- //echo '<pre>'.print_r($custom, true).'</pre>';exit;
extract($custom);
+
$meta_sd = (isset($custom['glm_jobs_startdate']))
? $custom['glm_jobs_startdate'][0]
: time();
$clean_sd = date('D, M d, Y', $meta_sd);
$clean_ed = date('D, M d, Y', $meta_ed);
- include $this->pluginDirName . 'views/job_meta.php';
+ $glm_jobs_status = (isset($glm_jobs_status[0]))
+ ? $glm_jobs_status[0]
+ : '';
+ $glm_jobs_pay_grade = (isset($glm_jobs_pay_grade[0]))
+ ? $glm_jobs_pay_grade[0]
+ : '';
+ $glm_jobs_shift = (isset($glm_jobs_shift[0]))
+ ? $glm_jobs_shift[0]
+ : '';
+ $glm_jobs_contact = (isset($glm_jobs_contact[0]))
+ ? $glm_jobs_contact[0]
+ : '';
+ $glm_jobs_email = (isset($glm_jobs_email[0]))
+ ? $glm_jobs_email[0]
+ : '';
+ $glm_jobs_comments = (isset($glm_jobs_comments[0]))
+ ? $glm_jobs_comments[0]
+ : '';
+ $glm_jobs_code = (isset($glm_jobs_code[0]))
+ ? $glm_jobs_code[0]
+ : '';
+
+ include $this->pluginDirName . 'views/admin/job_meta.php';
}
public function save_emp_meta()
{
global $post;
+ if (!isset($_POST['glm-jobs-nonce'])) {
+ return;
+ }
// - still require nonce
if (!wp_verify_nonce($_POST['glm-jobs-nonce'], 'glm-jobs-nonce')) {
return $post->ID;
*/
public function addPostTypes()
{
+ if (isset($_REQUEST['post_type']) && $_REQUEST['post_type'] == GLM_EMP_POST_TYPE) {
+ add_filter('months_dropdown_results', '__return_empty_array');
+ }
$labels = array(
'name' => _x('Jobs', 'job general name'),
'singular_name' => _x('Job', 'job type singular name'),
'supports' => array('title', 'editor', 'thumbnail'),
'has_archive' => false,
'menu_icon' => 'dashicons-businessman',
- 'capability_type' => 'post',
+ 'capability_type' => 'page',
'hierarchical' => false,
// 'rewrite' => array('slug' => 'jobs')
);
- \register_post_type('glm_jobs', $args);
+ register_post_type(GLM_EMP_POST_TYPE, $args);
+ }
+
+ public function jobsUpdatedMessages($messages)
+ {
+ global $post, $post_ID;
+
+ $messages['post'] = array(
+ 0 => '', // Unused. Messages start at index 1.
+ 1 => sprintf( __('Job updated. <a href="%s">View item</a>'), esc_url( get_permalink($post_ID) ) ),
+ 2 => __('Custom field updated.'),
+ 3 => __('Custom field deleted.'),
+ 4 => __('Job updated.'),
+ /* translators: %s: date and time of the revision */
+ 5 => isset($_GET['revision']) ? sprintf( __('Job restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
+ 6 => sprintf( __('Job published. <a href="%s">View event</a>'), esc_url( get_permalink($post_ID) ) ),
+ 7 => __('Job saved.'),
+ 8 => sprintf( __('Job submitted. <a target="_blank" href="%s">Preview event</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
+ 9 => sprintf( __('Job scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview job</a>'),
+ // translators: Publish box date format, see http://php.net/date
+ date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
+ 10 => sprintf( __('Job draft updated. <a target="_blank" href="%s">Preview event</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
+ );
+ return $messages;
}
public function createJobTaxonomy()
'choose_from_most_used' => __('Choose from the most used categories'),
);
- \register_taxonomy('glm_jobscategory', 'glm_jobs',
- array(
- 'label' => __('Job Category'),
- 'labels' => $labels,
- 'hierarchical' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => array('slug' => 'job-category'),
+ register_taxonomy(
+ 'glm_jobscategory',
+ GLM_EMP_POST_TYPE,
+ array(
+ 'label' => __('Job Category'),
+ 'labels' => $labels,
+ 'hierarchical' => true,
+ 'show_ui' => true,
+ 'query_var' => true,
+ 'rewrite' => array('slug' => 'job-category'),
+ ));
+
+ $labels = array(
+ 'name' => _x('Departments',
+ 'taxonomy general name'),
+ 'singular_name' => _x('Department',
+ 'taxonomy singular name'),
+ 'search_items' => __('Search Departments'),
+ 'popular_items' => __('Popular Departments'),
+ 'all_items' => __('All Departments'),
+ 'parent_item' => null,
+ 'parent_item_colon' => null,
+ 'edit_item' => __('Edit Department'),
+ 'update_item' => __('Update Department'),
+ 'add_new_item' => __('Add New Department'),
+ 'new_item_name' => __('New Department Name'),
+ 'separate_items_with_commas' => __('Separate departments with commas'),
+ 'add_or_remove_items' => __('Add or remove departments'),
+ 'choose_from_most_used' => __('Choose from the most used departments'),
+ );
+
+ register_taxonomy(
+ 'glm_jobsdepartment',
+ GLM_EMP_POST_TYPE,
+ array(
+ 'label' => __('Job Department'),
+ 'labels' => $labels,
+ 'hierarchical' => true,
+ 'show_ui' => true,
+ 'query_var' => true,
+ 'rewrite' => array('slug' => 'job-department'),
));
}
{
$columns = array(
"cb" => "<input type=\"checkbox\" />",
+ "title" => "Job Title",
"glmjobs_col_cat" => "Category",
+ "glmjobs_col_dep" => "Department",
"glmjobs_col_date" => "Dates",
- "title" => "Job",
- "glmjobs_col_desc" => "Description",
);
return $columns;
}
function jobs_custom_columns($column)
{
global $post;
- $custom = \get_post_custom();
+ $custom = get_post_custom();
switch ($column) {
case "glmjobs_col_cat":
// - show taxonomy terms -
- $eventcats = \get_the_terms($post->ID, "glm_jobscategory");
+ $eventcats = get_the_terms($post->ID, "glm_jobscategory");
+ $eventcats_html = array();
+ if ($eventcats) {
+ foreach ($eventcats as $eventcat) {
+ array_push($eventcats_html, $eventcat->name);
+ }
+ echo implode($eventcats_html, ", ");
+ } else {
+ _e('None', 'themeforce');
+ ;
+ }
+ break;
+ case "glmjobs_col_dep":
+ // - show taxonomy terms -
+ $eventcats = get_the_terms($post->ID, "glm_jobsdepartment");
$eventcats_html = array();
if ($eventcats) {
foreach ($eventcats as $eventcat) {
$enddate = date("F j, Y", $endd);
echo $startdate . '<br /><em>' . $enddate . '</em>';
break;
- case "glmjobs_col_desc";
- \the_excerpt();
- break;
}
}
--- /dev/null
+<?php
+require_once 'class-glm-list-table.php';
+
+class List_Applications extends GLM_List_Table
+{
+ public $wpdb;
+ /** ************************************************************************
+ * REQUIRED. Set up a constructor that references the parent constructor. We
+ * use the parent reference to set some default configs.
+ ***************************************************************************/
+ function __construct($wpdb){
+ global $status, $page;
+ $this->wpdb = $wpdb;
+
+ //Set parent defaults
+ parent::__construct( array(
+ 'singular' => 'application', //singular name of the listed records
+ 'plural' => 'applications', //plural name of the listed records
+ 'ajax' => false //does this table support ajax?
+ ) );
+ }
+ public function get_data()
+ {
+ $sql = "
+ SELECT id as ID,fname, lname,create_time
+ FROM " . $this->wpdb->prefix . GLM_EMP_APPLICATION_TABLE . "
+ WHERE archived <> true
+ ";
+ return $this->wpdb->get_results(
+ $sql,
+ ARRAY_A
+ );
+ }
+ /** ************************************************************************
+ * Recommended. This method is called when the parent class can't find a method
+ * specifically build for a given column. Generally, it's recommended to include
+ * one method for each column you want to render, keeping your package class
+ * neat and organized. For example, if the class needs to process a column
+ * named 'title', it would first see if a method named $this->column_title()
+ * exists - if it does, that method will be used. If it doesn't, this one will
+ * be used. Generally, you should try to use custom column methods as much as
+ * possible.
+ *
+ * Since we have defined a column_title() method later on, this method doesn't
+ * need to concern itself with any column with a name of 'title'. Instead, it
+ * needs to handle everything else.
+ *
+ * For more detailed insight into how columns are handled, take a look at
+ * WP_List_Table::single_row_columns()
+ *
+ * @param array $item A singular item (one full row's worth of data)
+ * @param array $column_name The name/slug of the column to be processed
+ * @return string Text or HTML to be placed inside the column <td>
+ **************************************************************************/
+ function column_default($item, $column_name){
+ switch($column_name){
+ case 'fname':
+ case 'lname':
+ case 'position':
+ case 'create_time':
+ return $item[$column_name];
+ default:
+ return print_r($item,true); //Show the whole array for troubleshooting purposes
+ }
+ }
+
+
+ /** ************************************************************************
+ * Recommended. This is a custom column method and is responsible for what
+ * is rendered in any column with a name/slug of 'title'. Every time the class
+ * needs to render a column, it first looks for a method named
+ * column_{$column_title} - if it exists, that method is run. If it doesn't
+ * exist, column_default() is called instead.
+ *
+ * This example also illustrates how to implement rollover actions. Actions
+ * should be an associative array formatted as 'slug'=>'link html' - and you
+ * will need to generate the URLs yourself. You could even ensure the links
+ *
+ *
+ * @see WP_List_Table::::single_row_columns()
+ * @param array $item A singular item (one full row's worth of data)
+ * @return string Text to be placed inside the column <td> (movie title only)
+ **************************************************************************/
+ function column_fname($item){
+
+ //Build row actions
+ $actions = array(
+ 'view' => sprintf(
+ '<a href="?post_type=%s&page=%s&action=%s&application=%s">View</a>',
+ GLM_EMP_POST_TYPE,
+ $_REQUEST['page'],
+ 'view',
+ $item['ID']
+ ),
+ 'archive' => sprintf(
+ '<a href="?post_type=%s&page=%s&action=%s&application=%s">Archive</a>',
+ GLM_EMP_POST_TYPE,
+ $_REQUEST['page'],
+ 'archive',
+ $item['ID']
+ ),
+ );
+
+ //Return the title contents
+ return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
+ /*$1%s*/ $item['fname'],
+ /*$2%s*/ $item['ID'],
+ /*$3%s*/ $this->row_actions($actions)
+ );
+ }
+
+
+ /** ************************************************************************
+ * REQUIRED if displaying checkboxes or using bulk actions! The 'cb' column
+ * is given special treatment when columns are processed. It ALWAYS needs to
+ * have it's own method.
+ *
+ * @see WP_List_Table::::single_row_columns()
+ * @param array $item A singular item (one full row's worth of data)
+ * @return string Text to be placed inside the column <td> (movie title only)
+ **************************************************************************/
+ function column_cb($item){
+ return sprintf(
+ '<input type="checkbox" name="%1$s[]" value="%2$s" />',
+ /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("movie")
+ /*$2%s*/ $item['ID'] //The value of the checkbox should be the record's id
+ );
+ }
+
+
+ /** ************************************************************************
+ * REQUIRED! This method dictates the table's columns and titles. This should
+ * return an array where the key is the column slug (and class) and the value
+ * is the column's title text. If you need a checkbox for bulk actions, refer
+ * to the $columns array below.
+ *
+ * The 'cb' column is treated differently than the rest. If including a checkbox
+ * column in your table you must create a column_cb() method. If you don't need
+ * bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
+ *
+ * @see WP_List_Table::::single_row_columns()
+ * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
+ **************************************************************************/
+ function get_columns(){
+ $columns = array(
+ 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
+ 'fname' => 'First Name',
+ 'lname' => 'Last Name',
+ 'position' => 'Position',
+ 'create_time' => 'Created'
+ );
+ return $columns;
+ }
+
+
+ /** ************************************************************************
+ * Optional. If you want one or more columns to be sortable (ASC/DESC toggle),
+ * you will need to register it here. This should return an array where the
+ * key is the column that needs to be sortable, and the value is db column to
+ * sort by. Often, the key and value will be the same, but this is not always
+ * the case (as the value is a column name from the database, not the list table).
+ *
+ * This method merely defines which columns should be sortable and makes them
+ * clickable - it does not handle the actual sorting. You still need to detect
+ * the ORDERBY and ORDER querystring variables within prepare_items() and sort
+ * your data accordingly (usually by modifying your query).
+ *
+ * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool)
+ **************************************************************************/
+ function get_sortable_columns() {
+ $sortable_columns = array(
+ 'fname' => array('fname', false), //true means it's already sorted
+ 'lname' => array('lname', false),
+ 'position' => array('position', false),
+ 'create_time' => array('create_time', false)
+ );
+ return $sortable_columns;
+ }
+
+
+ /** ************************************************************************
+ * Optional. If you need to include bulk actions in your list table, this is
+ * the place to define them. Bulk actions are an associative array in the format
+ * 'slug'=>'Visible Title'
+ *
+ * If this method returns an empty value, no bulk action will be rendered. If
+ * you specify any bulk actions, the bulk actions box will be rendered with
+ * the table automatically on display().
+ *
+ * Also note that list tables are not automatically wrapped in <form> elements,
+ * so you will need to create those manually in order for bulk actions to function.
+ *
+ * @return array An associative array containing all the bulk actions: 'slugs'=>'Visible Titles'
+ **************************************************************************/
+ function get_bulk_actions() {
+ $actions = array(
+ 'archive' => 'Archive'
+ );
+ return $actions;
+ }
+
+
+ /** ************************************************************************
+ * Optional. You can handle your bulk actions anywhere or anyhow you prefer.
+ * For this example package, we will handle it in the class to keep things
+ * clean and organized.
+ *
+ * @see $this->prepare_items()
+ **************************************************************************/
+ function process_bulk_action() {
+
+ //Detect when a bulk action is being triggered...
+ if( 'delete'===$this->current_action() ) {
+ wp_die('Items deleted (or they would be if we had items to delete)!');
+ }
+ if( 'archive'===$this->current_action() ) {
+ $applications = filter_var(
+ $_REQUEST['application'],
+ FILTER_VALIDATE_INT,
+ array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_FORCE_ARRAY)
+ );
+ $appId = filter_var($_REQUEST['application'], FILTER_VALIDATE_INT);
+ if (!$applications && $appId) {
+ $applications[0] = $appId;
+ }
+ foreach ($applications as $app) {
+ $sql = "
+ UPDATE " . $this->wpdb->prefix . GLM_EMP_APPLICATION_TABLE ."
+ SET archived = true
+ WHERE id = {$app}";
+ $this->wpdb->query($sql);
+ }
+// wp_die('Items archived (or they would be if we had items to archive)!');
+ }
+
+ }
+
+
+ /** ************************************************************************
+ * REQUIRED! This is where you prepare your data for display. This method will
+ * usually be used to query the database, sort and filter the data, and generally
+ * get it ready to be displayed. At a minimum, we should set $this->items and
+ * $this->set_pagination_args(), although the following properties and methods
+ * are frequently interacted with here...
+ *
+ * @global WPDB $wpdb
+ * @uses $this->_column_headers
+ * @uses $this->items
+ * @uses $this->get_columns()
+ * @uses $this->get_sortable_columns()
+ * @uses $this->get_pagenum()
+ * @uses $this->set_pagination_args()
+ **************************************************************************/
+ function prepare_items() {
+ global $wpdb; //This is used only if making any database queries
+
+ /**
+ * First, lets decide how many records per page to show
+ */
+ $per_page = 5;
+
+
+ /**
+ * REQUIRED. Now we need to define our column headers. This includes a complete
+ * array of columns to be displayed (slugs & titles), a list of columns
+ * to keep hidden, and a list of columns that are sortable. Each of these
+ * can be defined in another method (as we've done here) before being
+ * used to build the value for our _column_headers property.
+ */
+ $columns = $this->get_columns();
+ $hidden = array();
+ $sortable = $this->get_sortable_columns();
+
+
+ /**
+ * REQUIRED. Finally, we build an array to be used by the class for column
+ * headers. The $this->_column_headers property takes an array which contains
+ * 3 other arrays. One for all columns, one for hidden columns, and one
+ * for sortable columns.
+ */
+ $this->_column_headers = array($columns, $hidden, $sortable);
+
+
+ /**
+ * Optional. You can handle your bulk actions however you see fit. In this
+ * case, we'll handle them within our package just to keep things clean.
+ */
+ $this->process_bulk_action();
+
+
+ /**
+ * Instead of querying a database, we're going to fetch the example data
+ * property we created for use in this plugin. This makes this example
+ * package slightly different than one you might build on your own. In
+ * this example, we'll be using array manipulation to sort and paginate
+ * our data. In a real-world implementation, you will probably want to
+ * use sort and pagination data to build a custom query instead, as you'll
+ * be able to use your precisely-queried data immediately.
+ */
+ $data = $this->get_data();
+
+
+ /**
+ * This checks for sorting input and sorts the data in our array accordingly.
+ *
+ * In a real-world situation involving a database, you would probably want
+ * to handle sorting by passing the 'orderby' and 'order' values directly
+ * to a custom query. The returned data will be pre-sorted, and this array
+ * sorting technique would be unnecessary.
+ */
+ function usort_reorder($a,$b){
+ $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'create_time'; //If no sort, default to created
+ $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'desc'; //If no order, default to desc
+ $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order
+ return ($order==='asc') ? $result : -$result; //Send final sort direction to usort
+ }
+ usort($data, 'usort_reorder');
+
+
+ /***********************************************************************
+ * ---------------------------------------------------------------------
+ * vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+ *
+ * In a real-world situation, this is where you would place your query.
+ *
+ * For information on making queries in WordPress, see this Codex entry:
+ * http://codex.wordpress.org/Class_Reference/wpdb
+ *
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * ---------------------------------------------------------------------
+ **********************************************************************/
+
+
+ /**
+ * REQUIRED for pagination. Let's figure out what page the user is currently
+ * looking at. We'll need this later, so you should always include it in
+ * your own package classes.
+ */
+ $current_page = $this->get_pagenum();
+
+ /**
+ * REQUIRED for pagination. Let's check how many items are in our data array.
+ * In real-world use, this would be the total number of items in your database,
+ * without filtering. We'll need this later, so you should always include it
+ * in your own package classes.
+ */
+ $total_items = count($data);
+
+
+ /**
+ * The WP_List_Table class does not handle pagination for us, so we need
+ * to ensure that the data is trimmed to only the current page. We can use
+ * array_slice() to
+ */
+ $data = array_slice($data,(($current_page-1)*$per_page),$per_page);
+
+
+
+ /**
+ * REQUIRED. Now we can add our *sorted* data to the items property, where
+ * it can be used by the rest of the class.
+ */
+ $this->items = $data;
+
+
+ /**
+ * REQUIRED. We also have to register our pagination options & calculations.
+ */
+ $this->set_pagination_args( array(
+ 'total_items' => $total_items, //WE have to calculate the total number of items
+ 'per_page' => $per_page, //WE have to determine how many items to show on a page
+ 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages
+ ) );
+ }
+
+
+}
+
+++ /dev/null
-<?php
-require_once 'class-glm-list-table.php';
-
-class listJobs extends GLM_List_Table
-{
- /** ************************************************************************
- * Normally we would be querying data from a database and manipulating that
- * for use in your list table. For this example, we're going to simplify it
- * slightly and create a pre-built array. Think of this as the data that might
- * be returned by $wpdb->query().
- *
- * @var array
- **************************************************************************/
- var $example_data = array(
- array(
- 'ID' => 1,
- 'title' => 'RN - OR Circular Nurse',
- 'category' => 'Nursing',
- 'department' => 'Nursing'
- ),
- array(
- 'ID' => 2,
- 'title' => 'Dermatologist',
- 'category' => 'Physicians',
- 'department' => 'Dermatology'
- ),
- array(
- 'ID' => 3,
- 'title' => 'ER Physician',
- 'category' => 'Physicians',
- 'department' => 'Family Practice'
- ),
- array(
- 'ID' => 4,
- 'title' => 'Respiratory Therapist',
- 'category' => 'Allied Health/Certified/Licensed',
- 'department' => 'Nursing'
- ),
- array(
- 'ID' => 5,
- 'title' => 'Family Practice',
- 'category' => 'Physicians',
- 'department' => 'Neurology'
- ),
- array(
- 'ID' => 6,
- 'title' => 'Cerified Surgical Technician',
- 'category' => 'Allied Health/Certified/Licensed',
- 'department' => 'Cardiopulmonary'
- ),
- array(
- 'ID' => 7,
- 'title' => 'Dietary Aide',
- 'category' => 'Support Services',
- 'department' => 'Food & Nutrition Services'
- )
- );
- /** ************************************************************************
- * REQUIRED. Set up a constructor that references the parent constructor. We
- * use the parent reference to set some default configs.
- ***************************************************************************/
- function __construct(){
- global $status, $page;
-
- //Set parent defaults
- parent::__construct( array(
- 'singular' => 'movie', //singular name of the listed records
- 'plural' => 'movies', //plural name of the listed records
- 'ajax' => false //does this table support ajax?
- ) );
-
- }
- /** ************************************************************************
- * Recommended. This method is called when the parent class can't find a method
- * specifically build for a given column. Generally, it's recommended to include
- * one method for each column you want to render, keeping your package class
- * neat and organized. For example, if the class needs to process a column
- * named 'title', it would first see if a method named $this->column_title()
- * exists - if it does, that method will be used. If it doesn't, this one will
- * be used. Generally, you should try to use custom column methods as much as
- * possible.
- *
- * Since we have defined a column_title() method later on, this method doesn't
- * need to concern itself with any column with a name of 'title'. Instead, it
- * needs to handle everything else.
- *
- * For more detailed insight into how columns are handled, take a look at
- * WP_List_Table::single_row_columns()
- *
- * @param array $item A singular item (one full row's worth of data)
- * @param array $column_name The name/slug of the column to be processed
- * @return string Text or HTML to be placed inside the column <td>
- **************************************************************************/
- function column_default($item, $column_name){
- switch($column_name){
- case 'category':
- case 'department':
- return $item[$column_name];
- default:
- return print_r($item,true); //Show the whole array for troubleshooting purposes
- }
- }
-
-
- /** ************************************************************************
- * Recommended. This is a custom column method and is responsible for what
- * is rendered in any column with a name/slug of 'title'. Every time the class
- * needs to render a column, it first looks for a method named
- * column_{$column_title} - if it exists, that method is run. If it doesn't
- * exist, column_default() is called instead.
- *
- * This example also illustrates how to implement rollover actions. Actions
- * should be an associative array formatted as 'slug'=>'link html' - and you
- * will need to generate the URLs yourself. You could even ensure the links
- *
- *
- * @see WP_List_Table::::single_row_columns()
- * @param array $item A singular item (one full row's worth of data)
- * @return string Text to be placed inside the column <td> (movie title only)
- **************************************************************************/
- function column_title($item){
-
- //Build row actions
- $actions = array(
- 'edit' => sprintf('<a href="?page=%s&action=%s&movie=%s">Edit</a>',$_REQUEST['page'],'edit',$item['ID']),
- 'delete' => sprintf('<a href="?page=%s&action=%s&movie=%s">Delete</a>',$_REQUEST['page'],'delete',$item['ID']),
- );
-
- //Return the title contents
- return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
- /*$1%s*/ $item['title'],
- /*$2%s*/ $item['ID'],
- /*$3%s*/ $this->row_actions($actions)
- );
- }
-
-
- /** ************************************************************************
- * REQUIRED if displaying checkboxes or using bulk actions! The 'cb' column
- * is given special treatment when columns are processed. It ALWAYS needs to
- * have it's own method.
- *
- * @see WP_List_Table::::single_row_columns()
- * @param array $item A singular item (one full row's worth of data)
- * @return string Text to be placed inside the column <td> (movie title only)
- **************************************************************************/
- function column_cb($item){
- return sprintf(
- '<input type="checkbox" name="%1$s[]" value="%2$s" />',
- /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("movie")
- /*$2%s*/ $item['ID'] //The value of the checkbox should be the record's id
- );
- }
-
-
- /** ************************************************************************
- * REQUIRED! This method dictates the table's columns and titles. This should
- * return an array where the key is the column slug (and class) and the value
- * is the column's title text. If you need a checkbox for bulk actions, refer
- * to the $columns array below.
- *
- * The 'cb' column is treated differently than the rest. If including a checkbox
- * column in your table you must create a column_cb() method. If you don't need
- * bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
- *
- * @see WP_List_Table::::single_row_columns()
- * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
- **************************************************************************/
- function get_columns(){
- $columns = array(
- 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
- 'title' => 'Job Title',
- 'category' => 'Category',
- 'department' => 'Department'
- );
- return $columns;
- }
-
-
- /** ************************************************************************
- * Optional. If you want one or more columns to be sortable (ASC/DESC toggle),
- * you will need to register it here. This should return an array where the
- * key is the column that needs to be sortable, and the value is db column to
- * sort by. Often, the key and value will be the same, but this is not always
- * the case (as the value is a column name from the database, not the list table).
- *
- * This method merely defines which columns should be sortable and makes them
- * clickable - it does not handle the actual sorting. You still need to detect
- * the ORDERBY and ORDER querystring variables within prepare_items() and sort
- * your data accordingly (usually by modifying your query).
- *
- * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool)
- **************************************************************************/
- function get_sortable_columns() {
- $sortable_columns = array(
- 'title' => array('title',false), //true means it's already sorted
- 'category' => array('category',false),
- 'department' => array('department',false)
- );
- return $sortable_columns;
- }
-
-
- /** ************************************************************************
- * Optional. If you need to include bulk actions in your list table, this is
- * the place to define them. Bulk actions are an associative array in the format
- * 'slug'=>'Visible Title'
- *
- * If this method returns an empty value, no bulk action will be rendered. If
- * you specify any bulk actions, the bulk actions box will be rendered with
- * the table automatically on display().
- *
- * Also note that list tables are not automatically wrapped in <form> elements,
- * so you will need to create those manually in order for bulk actions to function.
- *
- * @return array An associative array containing all the bulk actions: 'slugs'=>'Visible Titles'
- **************************************************************************/
- function get_bulk_actions() {
- $actions = array(
- 'delete' => 'Delete'
- );
- return $actions;
- }
-
-
- /** ************************************************************************
- * Optional. You can handle your bulk actions anywhere or anyhow you prefer.
- * For this example package, we will handle it in the class to keep things
- * clean and organized.
- *
- * @see $this->prepare_items()
- **************************************************************************/
- function process_bulk_action() {
-
- //Detect when a bulk action is being triggered...
- if( 'delete'===$this->current_action() ) {
- wp_die('Items deleted (or they would be if we had items to delete)!');
- }
-
- }
-
-
- /** ************************************************************************
- * REQUIRED! This is where you prepare your data for display. This method will
- * usually be used to query the database, sort and filter the data, and generally
- * get it ready to be displayed. At a minimum, we should set $this->items and
- * $this->set_pagination_args(), although the following properties and methods
- * are frequently interacted with here...
- *
- * @global WPDB $wpdb
- * @uses $this->_column_headers
- * @uses $this->items
- * @uses $this->get_columns()
- * @uses $this->get_sortable_columns()
- * @uses $this->get_pagenum()
- * @uses $this->set_pagination_args()
- **************************************************************************/
- function prepare_items() {
- global $wpdb; //This is used only if making any database queries
-
- /**
- * First, lets decide how many records per page to show
- */
- $per_page = 5;
-
-
- /**
- * REQUIRED. Now we need to define our column headers. This includes a complete
- * array of columns to be displayed (slugs & titles), a list of columns
- * to keep hidden, and a list of columns that are sortable. Each of these
- * can be defined in another method (as we've done here) before being
- * used to build the value for our _column_headers property.
- */
- $columns = $this->get_columns();
- $hidden = array();
- $sortable = $this->get_sortable_columns();
-
-
- /**
- * REQUIRED. Finally, we build an array to be used by the class for column
- * headers. The $this->_column_headers property takes an array which contains
- * 3 other arrays. One for all columns, one for hidden columns, and one
- * for sortable columns.
- */
- $this->_column_headers = array($columns, $hidden, $sortable);
-
-
- /**
- * Optional. You can handle your bulk actions however you see fit. In this
- * case, we'll handle them within our package just to keep things clean.
- */
- $this->process_bulk_action();
-
-
- /**
- * Instead of querying a database, we're going to fetch the example data
- * property we created for use in this plugin. This makes this example
- * package slightly different than one you might build on your own. In
- * this example, we'll be using array manipulation to sort and paginate
- * our data. In a real-world implementation, you will probably want to
- * use sort and pagination data to build a custom query instead, as you'll
- * be able to use your precisely-queried data immediately.
- */
- $data = $this->example_data;
-
-
- /**
- * This checks for sorting input and sorts the data in our array accordingly.
- *
- * In a real-world situation involving a database, you would probably want
- * to handle sorting by passing the 'orderby' and 'order' values directly
- * to a custom query. The returned data will be pre-sorted, and this array
- * sorting technique would be unnecessary.
- */
- function usort_reorder($a,$b){
- $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'title'; //If no sort, default to title
- $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc
- $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order
- return ($order==='asc') ? $result : -$result; //Send final sort direction to usort
- }
- usort($data, 'usort_reorder');
-
-
- /***********************************************************************
- * ---------------------------------------------------------------------
- * vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
- *
- * In a real-world situation, this is where you would place your query.
- *
- * For information on making queries in WordPress, see this Codex entry:
- * http://codex.wordpress.org/Class_Reference/wpdb
- *
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- * ---------------------------------------------------------------------
- **********************************************************************/
-
-
- /**
- * REQUIRED for pagination. Let's figure out what page the user is currently
- * looking at. We'll need this later, so you should always include it in
- * your own package classes.
- */
- $current_page = $this->get_pagenum();
-
- /**
- * REQUIRED for pagination. Let's check how many items are in our data array.
- * In real-world use, this would be the total number of items in your database,
- * without filtering. We'll need this later, so you should always include it
- * in your own package classes.
- */
- $total_items = count($data);
-
-
- /**
- * The WP_List_Table class does not handle pagination for us, so we need
- * to ensure that the data is trimmed to only the current page. We can use
- * array_slice() to
- */
- $data = array_slice($data,(($current_page-1)*$per_page),$per_page);
-
-
-
- /**
- * REQUIRED. Now we can add our *sorted* data to the items property, where
- * it can be used by the rest of the class.
- */
- $this->items = $data;
-
-
- /**
- * REQUIRED. We also have to register our pagination options & calculations.
- */
- $this->set_pagination_args( array(
- 'total_items' => $total_items, //WE have to calculate the total number of items
- 'per_page' => $per_page, //WE have to determine how many items to show on a page
- 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages
- ) );
- }
-
-
-}
-
--- /dev/null
+<form method="post">
+ <div class="wrap">
+ <?php $applicationList->prepare_items();?>
+ <?php $applicationList->display();?>
+ </div>
+</form>
\ No newline at end of file
--- /dev/null
+<div class="row">
+ <div class="small-12 columns">
+ <h1><?php echo $formTitle;?></h1>
+ <?php foreach($form1 as $row):?>
+ <?php if ($row['type'] == 'header') :?>
+ <h3><?php echo $row['label'];?></h3>
+ <?php else:?>
+ <div class="row">
+ <?php foreach($row as $field) :?>
+ <div class="small-12 large-<?php echo $field['large'];?> columns">
+ <label<?php if ($field['req']):?> class="error"<?php endif;?>>
+ <?php echo $field['label'];?>
+ </label>
+ <?php switch($field['type']) :
+ case 'text':?>
+ <?php case 'tel':?>
+ <?php case 'email':?>
+ <?php case 'textarea':?>
+ <span><?php echo $field['value'];?></span>
+ <?php break;?>
+ <?php case 'radio':?>
+ <?php foreach($field['opts'] as $option) :?>
+ <span>( <?php if ($field['value'] == $option['value']) {
+ echo 'x';
+ }?> )
+ <?php echo $option['label'];?></span>
+ <?php endforeach;?>
+ <?php break;?>
+ <?php case 'checkbox':?>
+ <?php foreach($field['opts'] as $option) :?>
+ <span>( <?php if ($option['checked']) {
+ echo 'x';
+ }?> )
+ <?php echo $option['label'];?></span>
+ <?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>
+</div>
--- /dev/null
+<style>
+ .tf-meta { }
+ .tf-meta ul li { height: 20px; clear:both; margin: 0 0 15px 0;}
+ .tf-meta ul li label { width: 160px; display:block; float:left; padding-top:4px; text-align: right;padding-right: 20px;}
+ .tf-meta ul li input { width:200px; display:block; float:left; }
+ .tf-meta ul li em { width: 200px; display:block; float:left; color:gray; margin-left:10px; padding-top: 4px}
+</style>
+<input type="hidden"
+ name="glm-jobs-nonce"
+ id="tf-events-nonce"
+ value="<?php echo wp_create_nonce( 'glm-jobs-nonce' );?>" />
+<div class="tf-meta">
+ <ul>
+ <li>
+ <label>Start Date</label>
+ <input name="glm_jobs_startdate" class="tfdate"
+ value="<?php echo $clean_sd; ?>" />
+ </li>
+ <li>
+ <label>End Date</label>
+ <input name="glm_jobs_enddate" class="tfdate"
+ value="<?php echo $clean_ed; ?>" />
+ </li>
+ <li>
+ <label>Status</label>
+ <input name="glm_jobs_status"
+ value="<?php echo $glm_jobs_status; ?>" />
+ </li>
+ <li>
+ <label>Pay Grade</label>
+ <input name="glm_jobs_pay_grade"
+ value="<?php echo $glm_jobs_pay_grade; ?>" />
+ </li>
+ <li>
+ <label>Primary Shift</label>
+ <input name="glm_jobs_shift"
+ value="<?php echo $glm_jobs_shift; ?>" />
+ </li>
+ <li>
+ <label>HR Contact Name</label>
+ <input name="glm_jobs_contact"
+ value="<?php echo $glm_jobs_contact; ?>" />
+ </li>
+ <li>
+ <label>HR Email</label>
+ <input name="glm_jobs_email"
+ value="<?php echo $glm_jobs_email; ?>" />
+ </li>
+ <li>
+ <label>Comments</label>
+ <input name="glm_jobs_comments"
+ value="<?php echo $glm_jobs_comments; ?>" />
+ </li>
+ <li>
+ <label>Job Code</label>
+ <input name="glm_jobs_code"
+ value="<?php echo $glm_jobs_code; ?>" />
+ </li>
+ </ul>
+</div>
+<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
+<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
+<script>
+ jQuery(document).ready(function (){
+ jQuery(".tfdate").datepicker({
+ dateFormat: 'D, M d, yy',
+ showOn: 'button',
+ buttonImage: 'http://app.gaslightmedia.com/assets/icons/calendar.png',
+ buttonImageOnly: true,
+ numberOfMonths: 1
+
+ });
+ });
+</script>
--- /dev/null
+<style>
+ #appForm {
+ width: 600px;
+ background-color: #fff;
+ }
+ #appForm span {
+ font-size: 13px;
+ background-color: lightgrey;
+ padding: 5px;
+ }
+</style>
+
+<div id="appForm">
+ <?php include $viewPath . 'form_1.php';?>
+</div>
\ No newline at end of file
--- /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
+<div class="row">
+ <div class="small-12 columns">
+ <h1><?php echo $formTitle;?></h1>
+ <form method="post" action="<?php echo $formAction;?>">
+ <input type="hidden" name="applyOnline" value="2" />
+ <?php foreach($form1 as $row):?>
+ <?php if ($row['type'] == 'header') :?>
+ <h3><?php echo $row['label'];?></h3>
+ <?php else:?>
+ <div class="row">
+ <?php foreach($row as $field) :?>
+ <div class="small-12 large-<?php echo $field['large'];?> 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['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 '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
+<a href="#">Back To Search</a>
+<div class="small-12 columns">
+ <h2><a href="<?php echo $job->href; ?>"><?php echo $job->post_title; ?></a></h2>
+ <div><strong>Status: </strong><?php echo $job->glm_jobs_status; ?></div>
+ <div><strong>Pay Grade: </strong><?php echo $job->glm_jobs_pay_grade; ?></div>
+ <div><strong>Shift: </strong><?php echo $job->glm_jobs_shift; ?></div>
+ <div><strong>Contact: </strong>
+ <?php if ($job->glm_jobs_email):?>
+ <a href="<?php echo $job->glm_jobs_email;?>">
+ <?php endif;?>
+ <?php echo $job->glm_jobs_contact; ?>
+ <?php if ($job->glm_jobs_email):?>
+ </a>
+ <?php endif;?>
+ </div>
+
+ <div><?php echo apply_filters('the_content', $job->post_content);?></div>
+ <a href="<?php echo $applyOnlineHref;?>">Apply Online</a>
+</div>
\ No newline at end of file
--- /dev/null
+<div>
+ <h1>List Jobs</h1>
+ <div class="row">
+ <?php if ($jobs): foreach($jobs as $job) :?>
+ <div class="small-12 medium-6 columns">
+ <h2><a href="<?php echo $job->href;?>"><?php echo $job->post_title;?></a></h2>
+ <div><strong>Status: </strong><?php echo $job->glm_jobs_status;?></div>
+ <div><a href="<?php echo $job->href;?>">Full Job Description</a></div>
+ </div>
+ <?php endforeach; endif;?>
+ </div>
+</div>
--- /dev/null
+<style>
+ #job_search {width: 100%;padding: 2%;}
+ #cat_id_wrapper {width: 45%;float:left;}
+ #status_wrapper {width: 45%;float:right;}
+ #submit_wrapper, input[type="submit"] {width: 100%;text-align: center;}
+</style>
+
+<h2>Employment Search</h2>
+<form name="job_search" id="job_search" action="<?php echo $form_url;?>" method="post">
+ <div id="cat_id_wrapper">
+ <div id="cat_id_label">Search by Category</div>
+ <div id="cat_wrap">
+ <?php wp_dropdown_categories( $cat_args );?>
+ </div>
+ </div>
+ <div id="status_wrapper">
+ <div id="status_label">Search by Department</div>
+ <div id="dept_wrap">
+ <?php wp_dropdown_categories( $dep_args );?>
+ </div>
+ </div>
+ <div id="submit_wrapper"><input type="submit" value="Search"></div>
+</form>
\ No newline at end of file
+++ /dev/null
-<div>
- <h3>List Jobs</h3>
- <div class="row">
- <?php if ($jobs): foreach($jobs as $job) :?>
- <div class="small-12 medium-6 columns" style="width:700px;float:left;background-color: #b4e0c2;padding: 15px;margin: 20px 0;">
- <h2 style="width:45%;float:left;"><a href="<?php echo get_post_permalink($job->ID);?>"><?php echo $job->post_title;?></a></h2>
- <div style="width:25%;float:left;"><strong>Status: </strong><?php echo $job->glm_jobs_status;?></div>
- <div style="width:30%;float:left;"><a href="<?php echo get_post_permalink($job->ID);?>">Full Job Description</a></div>
- </div>
- <?php endforeach; endif;?>
- </div>
-</div>
+++ /dev/null
-<style>
- .tf-meta { }
- .tf-meta ul li { height: 20px; clear:both; margin: 0 0 15px 0;}
- .tf-meta ul li label { width: 160px; display:block; float:left; padding-top:4px; text-align: right;padding-right: 20px;}
- .tf-meta ul li input { width:200px; display:block; float:left; }
- .tf-meta ul li em { width: 200px; display:block; float:left; color:gray; margin-left:10px; padding-top: 4px}
-</style>
-<input type="hidden"
- name="glm-jobs-nonce"
- id="tf-events-nonce"
- value="<?php echo wp_create_nonce( 'glm-jobs-nonce' );?>" />
-<div class="tf-meta">
- <ul>
- <li>
- <label>Start Date</label>
- <input name="glm_jobs_startdate" class="tfdate"
- value="<?php echo $clean_sd; ?>" />
- </li>
- <li>
- <label>End Date</label>
- <input name="glm_jobs_enddate" class="tfdate"
- value="<?php echo $clean_ed; ?>" />
- </li>
- <li>
- <label>Status</label>
- <input name="glm_jobs_status"
- value="<?php echo $glm_jobs_status[0]; ?>" />
- </li>
- <li>
- <label>Pay Grade</label>
- <input name="glm_jobs_pay_grade"
- value="<?php echo $glm_jobs_pay_grade[0]; ?>" />
- </li>
- <li>
- <label>Primary Shift</label>
- <input name="glm_jobs_shift"
- value="<?php echo $glm_jobs_shift[0]; ?>" />
- </li>
- <li>
- <label>HR Contact Name</label>
- <input name="glm_jobs_contact"
- value="<?php echo $glm_jobs_contact[0]; ?>" />
- </li>
- <li>
- <label>HR Email</label>
- <input name="glm_jobs_email"
- value="<?php echo $glm_jobs_email[0]; ?>" />
- </li>
- <li>
- <label>Comments</label>
- <input name="glm_jobs_comments"
- value="<?php echo $glm_jobs_comments[0]; ?>" />
- </li>
- <li>
- <label>Job Code</label>
- <input name="glm_jobs_code"
- value="<?php echo $glm_jobs_code[0]; ?>" />
- </li>
- </ul>
-</div>
-<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
-<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
-<script>
- jQuery(document).ready(function (){
- jQuery(".tfdate").datepicker({
- dateFormat: 'D, M d, yy',
- showOn: 'button',
- buttonImage: 'http://app.gaslightmedia.com/assets/icons/calendar.png',
- buttonImageOnly: true,
- numberOfMonths: 1
-
- });
- });
-</script>