From 7ba14d9e31a5d4791aac6ce9c497a2cb58ad45f2 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 8 Dec 2014 13:42:32 -0500 Subject: [PATCH] Setting up views Setting up Admin and Front views. Form1 view page in admin --- controllers/admin.php | 104 +- controllers/front.php | 322 ++- css/foundation.css | 1739 +++++++++++++++++ glm-employment.php | 36 +- models/database.php | 86 + models/forms/builder.php | 45 + models/forms/elementAbstract.php | 50 + models/forms/elementInterface.php | 17 + models/forms/form1.ini | 3 + models/forms/form1.php | 38 + models/forms/settings.php | 373 ++++ models/forms/text.php | 42 + models/forms/textarea.php | 42 + models/job.php | 207 +- .../{listJobs.php => list-applications.php} | 146 +- views/admin/applicationList.php | 6 + views/admin/form_1.php | 47 + views/{ => admin}/job_meta.php | 14 +- views/admin/view-application.php | 15 + views/front/form.php | 107 + views/front/form_1.php | 110 ++ views/front/jobDetail.php | 19 + views/front/jobList.php | 12 + views/front/jobSearch.php | 23 + views/jobList.php | 12 - 25 files changed, 3442 insertions(+), 173 deletions(-) create mode 100644 css/foundation.css create mode 100644 models/database.php create mode 100644 models/forms/builder.php create mode 100644 models/forms/elementAbstract.php create mode 100644 models/forms/elementInterface.php create mode 100644 models/forms/form1.ini create mode 100644 models/forms/form1.php create mode 100644 models/forms/settings.php create mode 100644 models/forms/text.php create mode 100644 models/forms/textarea.php rename models/{listJobs.php => list-applications.php} (80%) create mode 100644 views/admin/applicationList.php create mode 100644 views/admin/form_1.php rename views/{ => admin}/job_meta.php (83%) create mode 100644 views/admin/view-application.php create mode 100644 views/front/form.php create mode 100644 views/front/form_1.php create mode 100644 views/front/jobDetail.php create mode 100644 views/front/jobList.php create mode 100644 views/front/jobSearch.php delete mode 100644 views/jobList.php diff --git a/controllers/admin.php b/controllers/admin.php index a824dda..e1e8267 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -1,8 +1,5 @@ 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 '

Job Settings

'; + } + + 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 '
'; + $viewPath = $this->pluginDirName . 'views/admin/'; + $form1 = unserialize($formData[0]['form_data']); + include $viewPath . 'view-application.php'; + echo '
'; + } + + 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; } diff --git a/controllers/front.php b/controllers/front.php index 114f267..baa4f05 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -1,8 +1,5 @@ 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 '
'.print_r($this->appId, true).'
'; + echo '
'.print_r($this->formId, true).'
'; +// echo '
'.print_r($form1, true).'
'; +// echo '
'.print_r($_POST, true).'
'; +// 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]; @@ -53,13 +269,65 @@ class FrontController $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) diff --git a/css/foundation.css b/css/foundation.css new file mode 100644 index 0000000..b82f1e9 --- /dev/null +++ b/css/foundation.css @@ -0,0 +1,1739 @@ +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; } diff --git a/glm-employment.php b/glm-employment.php index 1c7300f..3c2aff4 100644 --- a/glm-employment.php +++ b/glm-employment.php @@ -7,36 +7,52 @@ * 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'); +} diff --git a/models/database.php b/models/database.php new file mode 100644 index 0000000..0b73952 --- /dev/null +++ b/models/database.php @@ -0,0 +1,86 @@ + + * @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 + * @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(); + } + } + +} diff --git a/models/forms/builder.php b/models/forms/builder.php new file mode 100644 index 0000000..1e54580 --- /dev/null +++ b/models/forms/builder.php @@ -0,0 +1,45 @@ + + * @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 + * @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; + } + } +} diff --git a/models/forms/elementAbstract.php b/models/forms/elementAbstract.php new file mode 100644 index 0000000..3cc0ecc --- /dev/null +++ b/models/forms/elementAbstract.php @@ -0,0 +1,50 @@ + + * @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 + * @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'); + } + + } + } +} diff --git a/models/forms/elementInterface.php b/models/forms/elementInterface.php new file mode 100644 index 0000000..a17c9f7 --- /dev/null +++ b/models/forms/elementInterface.php @@ -0,0 +1,17 @@ + + * @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 + * @copyright 2013 Gaslight Media + * @license Gaslight Media + * @release Release: (0.1) + * @link <> + */ +class form1 +{ + public $rows = array(); + + public function __construct() + { + + } +} diff --git a/models/forms/settings.php b/models/forms/settings.php new file mode 100644 index 0000000..abc8eae --- /dev/null +++ b/models/forms/settings.php @@ -0,0 +1,373 @@ + '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] +]; diff --git a/models/forms/text.php b/models/forms/text.php new file mode 100644 index 0000000..dd6f6e1 --- /dev/null +++ b/models/forms/text.php @@ -0,0 +1,42 @@ + + * @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 + * @copyright 2013 Gaslight Media + * @license Gaslight Media + * @release Release: (0.1) + * @link <> + */ +class text extends elementAbstract implements elementInterface +{ + + public function toArray() + { + + } + + public function toString() + { + + } +} diff --git a/models/forms/textarea.php b/models/forms/textarea.php new file mode 100644 index 0000000..a32e8cc --- /dev/null +++ b/models/forms/textarea.php @@ -0,0 +1,42 @@ + + * @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 + * @copyright 2013 Gaslight Media + * @license Gaslight Media + * @release Release: (0.1) + * @link <> + */ +class textarea implements elementInterface +{ + public function toArray() + { + + } + + public function toString() + { + + } + +} diff --git a/models/job.php b/models/job.php index a1bf9a1..ddaf14d 100644 --- a/models/job.php +++ b/models/job.php @@ -1,8 +1,6 @@ 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 '
'.print_r($custom, true).'
';exit; extract($custom); + $meta_sd = (isset($custom['glm_jobs_startdate'])) ? $custom['glm_jobs_startdate'][0] : time(); @@ -43,12 +97,37 @@ class Job $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; @@ -89,6 +168,9 @@ class Job */ 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'), @@ -113,11 +195,34 @@ class Job '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. View item'), 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. View event'), esc_url( get_permalink($post_ID) ) ), + 7 => __('Job saved.'), + 8 => sprintf( __('Job submitted. Preview event'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), + 9 => sprintf( __('Job scheduled for: %1$s. Preview job'), + // 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. Preview event'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), + ); + return $messages; } public function createJobTaxonomy() @@ -141,14 +246,47 @@ class Job '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'), )); } @@ -156,10 +294,10 @@ class Job { $columns = array( "cb" => "", + "title" => "Job Title", "glmjobs_col_cat" => "Category", + "glmjobs_col_dep" => "Department", "glmjobs_col_date" => "Dates", - "title" => "Job", - "glmjobs_col_desc" => "Description", ); return $columns; } @@ -167,12 +305,26 @@ class Job 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) { @@ -192,9 +344,6 @@ class Job $enddate = date("F j, Y", $endd); echo $startdate . '
' . $enddate . ''; break; - case "glmjobs_col_desc"; - \the_excerpt(); - break; } } diff --git a/models/listJobs.php b/models/list-applications.php similarity index 80% rename from models/listJobs.php rename to models/list-applications.php index 78daf39..8e136ab 100644 --- a/models/listJobs.php +++ b/models/list-applications.php @@ -1,74 +1,35 @@ 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' - ) - ); + public $wpdb; /** ************************************************************************ * REQUIRED. Set up a constructor that references the parent constructor. We * use the parent reference to set some default configs. ***************************************************************************/ - function __construct(){ + function __construct($wpdb){ global $status, $page; + $this->wpdb = $wpdb; //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? + '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 @@ -93,8 +54,10 @@ class listJobs extends GLM_List_Table **************************************************************************/ function column_default($item, $column_name){ switch($column_name){ - case 'category': - case 'department': + 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 @@ -118,17 +81,29 @@ class listJobs extends GLM_List_Table * @param array $item A singular item (one full row's worth of data) * @return string Text to be placed inside the column (movie title only) **************************************************************************/ - function column_title($item){ + function column_fname($item){ //Build row actions $actions = array( - 'edit' => sprintf('Edit',$_REQUEST['page'],'edit',$item['ID']), - 'delete' => sprintf('Delete',$_REQUEST['page'],'delete',$item['ID']), + 'view' => sprintf( + 'View', + GLM_EMP_POST_TYPE, + $_REQUEST['page'], + 'view', + $item['ID'] + ), + 'archive' => sprintf( + 'Archive', + GLM_EMP_POST_TYPE, + $_REQUEST['page'], + 'archive', + $item['ID'] + ), ); //Return the title contents return sprintf('%1$s (id:%2$s)%3$s', - /*$1%s*/ $item['title'], + /*$1%s*/ $item['fname'], /*$2%s*/ $item['ID'], /*$3%s*/ $this->row_actions($actions) ); @@ -168,10 +143,11 @@ class listJobs extends GLM_List_Table **************************************************************************/ function get_columns(){ $columns = array( - 'cb' => '', //Render a checkbox instead of text - 'title' => 'Job Title', - 'category' => 'Category', - 'department' => 'Department' + 'cb' => '', //Render a checkbox instead of text + 'fname' => 'First Name', + 'lname' => 'Last Name', + 'position' => 'Position', + 'create_time' => 'Created' ); return $columns; } @@ -193,9 +169,10 @@ class listJobs extends GLM_List_Table **************************************************************************/ 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) + '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; } @@ -217,7 +194,7 @@ class listJobs extends GLM_List_Table **************************************************************************/ function get_bulk_actions() { $actions = array( - 'delete' => 'Delete' + 'archive' => 'Archive' ); return $actions; } @@ -236,6 +213,25 @@ class listJobs extends GLM_List_Table 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)!'); + } } @@ -301,7 +297,7 @@ class listJobs extends GLM_List_Table * 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; + $data = $this->get_data(); /** @@ -313,8 +309,8 @@ class listJobs extends GLM_List_Table * 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 + $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 } diff --git a/views/admin/applicationList.php b/views/admin/applicationList.php new file mode 100644 index 0000000..a0d8ae4 --- /dev/null +++ b/views/admin/applicationList.php @@ -0,0 +1,6 @@ +
+
+ prepare_items();?> + display();?> +
+
\ No newline at end of file diff --git a/views/admin/form_1.php b/views/admin/form_1.php new file mode 100644 index 0000000..7742e1f --- /dev/null +++ b/views/admin/form_1.php @@ -0,0 +1,47 @@ +
+
+

+ + +

+ +
+ +
+ class="error"> + + + + + + + + + + + ( ) + + + + + + ( ) + + + + + + + +
+ +
+ + +
+
diff --git a/views/job_meta.php b/views/admin/job_meta.php similarity index 83% rename from views/job_meta.php rename to views/admin/job_meta.php index 6c0a57f..357a75a 100644 --- a/views/job_meta.php +++ b/views/admin/job_meta.php @@ -24,37 +24,37 @@
  • + value="" />
  • + value="" />
  • + value="" />
  • + value="" />
  • + value="" />
  • + value="" />
  • + value="" />
  • diff --git a/views/admin/view-application.php b/views/admin/view-application.php new file mode 100644 index 0000000..9fc47d1 --- /dev/null +++ b/views/admin/view-application.php @@ -0,0 +1,15 @@ + + +
    + +
    \ No newline at end of file diff --git a/views/front/form.php b/views/front/form.php new file mode 100644 index 0000000..3c28b8a --- /dev/null +++ b/views/front/form.php @@ -0,0 +1,107 @@ +
    +
    +

    Online Application Form

    +
    + +

    Name

    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +

    Current Address

    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +

    Telephone#

    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + + /> + + /> + +
    +
    + + /> + + /> + +
    +
    + +
    +
    + + /> + + /> + +
    +
    +
    +
    + + /> + + /> + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    diff --git a/views/front/form_1.php b/views/front/form_1.php new file mode 100644 index 0000000..d167bf6 --- /dev/null +++ b/views/front/form_1.php @@ -0,0 +1,110 @@ +
    +
    +

    +
    + + + +

    + +
    + +
    + class="error"> + + + + + + + pattern="" + + name="" + type="text" + value="" /> + + + + + + pattern="" + + name="" + type="tel" + value="" /> + + + + + + pattern="" + + name="" + type="email" + value="" /> + + + + + + + + + + pattern="" + + id="" + name="" + type="radio" + value="" + /> + + + + + + + + + pattern="" + + id="" + name="" + type="checkbox" + value="" + /> + + + + + + + +
    + +
    + + +
    +
    + +
    +
    +
    +
    + +
    diff --git a/views/front/jobDetail.php b/views/front/jobDetail.php new file mode 100644 index 0000000..8825147 --- /dev/null +++ b/views/front/jobDetail.php @@ -0,0 +1,19 @@ +Back To Search +
    +

    post_title; ?>

    +
    Status: glm_jobs_status; ?>
    +
    Pay Grade: glm_jobs_pay_grade; ?>
    +
    Shift: glm_jobs_shift; ?>
    +
    Contact: + glm_jobs_email):?> + + + glm_jobs_contact; ?> + glm_jobs_email):?> + + +
    + +
    post_content);?>
    + Apply Online +
    \ No newline at end of file diff --git a/views/front/jobList.php b/views/front/jobList.php new file mode 100644 index 0000000..71db430 --- /dev/null +++ b/views/front/jobList.php @@ -0,0 +1,12 @@ +
    +

    List Jobs

    +
    + +
    +

    post_title;?>

    +
    Status: glm_jobs_status;?>
    + +
    + +
    +
    diff --git a/views/front/jobSearch.php b/views/front/jobSearch.php new file mode 100644 index 0000000..85b9dfa --- /dev/null +++ b/views/front/jobSearch.php @@ -0,0 +1,23 @@ + + +

    Employment Search

    + \ No newline at end of file diff --git a/views/jobList.php b/views/jobList.php deleted file mode 100644 index d8349d3..0000000 --- a/views/jobList.php +++ /dev/null @@ -1,12 +0,0 @@ -
    -

    List Jobs

    -
    - -
    -

    post_title;?>

    -
    Status: glm_jobs_status;?>
    - -
    - -
    -
    -- 2.17.1