function display($tmpl = null, $separator = false) { $task = JS_Helper::get_input('snap_task'); var_dump($task && $task == 'change-password'); if ($task && $task == 'change-password') { $tmpl = 'profile.' . $task; } parent::display($tmpl, $separator); }
function display($tmpl = null, $separator = false) { $user_name = JS_Helper::get_input('snap_user'); if ($user_name) { $model = SnapJobs::getModel('reviews'); $this->user = $model->load($user_name); $this->items = $model->getData(); $this->assignRef('total_count', $model->total_count); } parent::display($tmpl, $separator); }
function display($tmpl = null, $separator = false) { $controller = SnapJobs::getController('message'); $model = $controller->getModel(); switch ($this->snap_task) { case 'reply_message': $controller->execute($this->snap_task); break; case 'message': $tmpl = 'inbox.message'; $id = JS_Helper::get_input('id'); $this->assignRef('model', $model); $this->item = $model->viewMessage($id); break; default: case 'inbox': $this->items = $model->getData(); break; } parent::display($tmpl, $separator); }
<?php global $_js_helper, $snapjobs; $image_banner = get_field('banner_image', $this->page_id); if (!isset($_GET['uid'])) { wp_redirect($_js_helper->jobsshops_register_url(JS_Helper::get_input('snap_option'))); exit; } include JS_Helper::getSetting('plugin_path') . 'paypal/paypal_config.php'; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php wp_title(); ?> </title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <?php wp_head(); ?> <!--[if gte IE 9]> <style type="text/css"> .gradient { filter: none; }
<?php global $_js_helper; $search_area = JS_Helper::get_input('snap_search_area'); ?> <div id="main-content" class="site-content"> <!-- banner search form --> <div class="banner-search" style="background-image: url(<?php echo get_template_directory_uri(); ?> /images/header-bg-2.jpg);"> <div class="container"> <h2><?php printf('Results for: %s %s', JS_Helper::get_input('keyword'), JS_Helper::get_input('snap_date')); ?> </h2> </div> </div> <!-- /end banner search form --> <div class="clearfix"></div> <div class="container"> <div class="list-items thumbs-grid"> <div class="list-items-header"> <h2 class="pull-left"> <?php printf('Found %d item', $this->total_count);
<?php global $_js_helper; $item = $this->item; $view = JS_Helper::get_input('snap_view'); $jobid = $this->jobid; $is_saved = $_js_helper->get_current_area() != 'jobsboss' ? false : in_array($item->ID, JS_Helper::get_current_js_user()->saved_profiles); ?> <div class="col-md-3"> <div class="item" id="jobsshopper-<?php echo $item->ID; echo $jobid; ?> "> <div class="item-heading"> <div class="item-logo"> <img src="<?php echo $item->avatar; ?> " alt=""/> </div> <div class="item-info-name"> <h4> <span><?php echo esc_html($item->name); ?> </span> <span class="specialisations"><?php echo implode(', ', $item->specialisations); ?> </span>
function display($tmpl = null, $separator = false) { global $_js_helper; switch ($this->snap_task) { case 'save': $jobssnap_data = $_POST; $jobssnap_id = JS_Helper::get_input('id'); $author = $jobssnap_data['author']; $title = $jobssnap_data['title']; $snap_tag = $jobssnap_data['snap_tag']; $content = $jobssnap_data['description']; unset($jobssnap_data['author']); unset($jobssnap_data['title']); unset($jobssnap_data['snap_tag']); unset($jobssnap_data['description']); unset($jobssnap_data['terms']); $args = array('ID' => $jobssnap_id, 'post_title' => $title, 'post_content' => $content, 'author' => $author, 'tax_input' => array('snap_tag' => $snap_tag)); wp_update_post($args); foreach ($jobssnap_data as $meta_key => $meta_value) { if ($meta_key == 'date') { $meta_value = date('n/j/Y', strtotime($meta_value)); } update_post_meta($jobssnap_id, $meta_key, $meta_value); } $hours_diff = JS_Helper::calc_total_hours($jobssnap_data['time_from'], $jobssnap_data['time_to']); update_post_meta($jobssnap_id, 'total_hour', $hours_diff); wp_redirect($_js_helper->getHomeUrl('my-jobssnaps')); exit; break; case 'edit': $this->item = $this->prepareItem(get_post(JS_Helper::get_input('id'))); break; case 'add': $current_user = JS_User::getUser(get_current_user_id()); $current_slot = $current_user->slots; $jobssnap_data = $_POST; if (empty($jobssnap_data)) { break; } $author = $jobssnap_data['author']; $title = $jobssnap_data['title']; $snap_tag = $jobssnap_data['snap_tag']; $content = $jobssnap_data['description']; unset($jobssnap_data['author']); unset($jobssnap_data['title']); unset($jobssnap_data['snap_tag']); unset($jobssnap_data['description']); unset($jobssnap_data['terms']); $args = array('post_title' => $title, 'post_type' => 'jobssnap', 'post_content' => $content, 'author' => $author, 'tax_input' => array('snap_tag' => $snap_tag), 'post_status' => 'publish'); $jobssnap = wp_insert_post($args, true); if (!is_wp_error($jobssnap)) { foreach ($jobssnap_data as $meta_key => $meta_value) { if ($meta_key == 'date') { $meta_value = date('n/j/Y', strtotime($meta_value)); } update_post_meta($jobssnap, $meta_key, $meta_value); } update_post_meta($jobssnap, 'snap_job_status', 'opened'); $hours_diff = JS_Helper::calc_total_hours($jobssnap_data['time_from'], $jobssnap_data['time_to']); update_post_meta($jobssnap, 'total_hour', $hours_diff); $slot = intval($current_slot) - 1; update_user_meta($author, 'snap_package_post_jobs_slot', $slot); wp_redirect($_js_helper->getHomeUrl('my-jobssnaps')); exit; } break; } parent::display($tmpl, $separator); }
function body_classes($classes) { global $wp; $classes[] = JS_Helper::get_input('snap_option') . '-' . JS_Helper::get_input('snap_view') . '-page'; return $classes; }
function display($tmpl = null) { global $_js_helper; $headers = array('Content-Type: text/html; charset=UTF-8', "From: JOBSSHOP <*****@*****.**>"); if (JS_Helper::get_input('snap_task') == 'make-payment') { $tmpl = 'register.jobsboss-make-payment'; } if ('POST' == $_SERVER['REQUEST_METHOD']) { $redirect_to = site_url(); if (JS_Helper::get_input('snap_task') == 'make-payment') { $returnURL = RETURN_URL; $cancelURL = CANCEL_URL; $resArray = CallShortcutExpressCheckout($_POST, $returnURL, $cancelURL); $ack = strtoupper($resArray["ACK"]); if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") { RedirectToPayPal($resArray["TOKEN"]); } else { //Display a user friendly Error on the page using any of the following error information returned by PayPal $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); echo "SetExpressCheckout API call failed. "; echo "Detailed Error Message: " . $ErrorLongMsg; echo "Short Error Message: " . $ErrorShortMsg; echo "Error Code: " . $ErrorCode; echo "Error Severity Code: " . $ErrorSeverityCode; } } $userdata = $_POST['_snap_data']; $userdata['role'] = $this->user_role; $userdata['user_login'] = sanitize_title($userdata['user_login']); $errors = wp_insert_user($userdata); $this->message = ''; if (!is_wp_error($errors)) { $meta = $userdata['meta']; $meta_success = 0; foreach ($meta as $meta_key => $meta_value) { $meta_success += update_user_meta($errors, $meta_key, $meta_value) ? 1 : 0; } if ($meta_success > 0) { $user_email = $userdata['user_email']; $email_subject = "Account Details for {$userdata['first_name']} at Jobs Shop"; $site_url = site_url(); $email_content = <<<EOB Hello {$userdata['first_name']},<br /> <br /> Thank you for registering at Jobs Shop.<br /> <br /> You may now log in to {$site_url} using the following username and password:<br /> <br /> Username: {$userdata['user_login']}<br /> Password: {$userdata['user_pass']} EOB; $headers = array('Content-Type: text/html; charset=UTF-8', "From: JOBSSHOP <*****@*****.**>"); wp_mail($user_email, $email_subject, $email_content, $headers); $action = isset($_POST['action']); if ($action) { $redirect_to = site_url('jobsboss/register/make-payment'); $redirect_to = add_query_arg(array('uid' => $errors), $redirect_to); } wp_redirect($redirect_to); exit; } } else { $this->message = $errors->errors; } $this->userdata = $userdata; } $this->assignRef('user_role', $this->user_role); parent::display($tmpl, true); }
function display($tmpl = null, $separator = false) { global $wp, $_js_helper; $snap_task = JS_Helper::get_input('snap_task') ? JS_Helper::get_input('snap_task') : null; unset($_POST['snap_task']); if (JS_Helper::get_input('view') == 'list') { $tmpl = 'timesnaps.viewlisting'; $snap_task = 'list'; } switch ($snap_task) { case 'add': $timesnap_data = $_POST; if (empty($timesnap_data)) { $this->dates = $_REQUEST['dates']; break; } if (isset($timesnap_data['snap_category_new'])) { $timesnap_data['snap_category'] = $timesnap_data['snap_category_new']; } $author = $timesnap_data['author']; $snap_category = $timesnap_data['snap_category']; $snap_tag = $timesnap_data['snap_tag']; unset($timesnap_data['author']); unset($timesnap_data['snap_tag']); unset($timesnap_data['terms']); $args = array('post_type' => 'timesnap', 'author' => $author, 'tax_input' => array('snap_category' => array($snap_category), 'snap_tag' => $snap_tag), 'post_status' => 'publish'); $dates = explode(',', $timesnap_data['dates']); unset($timesnap_data['dates']); $success = 0; foreach ($dates as $date) { $selected_day = date_create_from_format('m/d/Y', $date); if (!$selected_day) { continue; } $post_title = date_format($selected_day, 'd . F . Y (l)'); $args['post_title'] = $post_title; $timesnap_data['date'] = $date; $timesnap = wp_insert_post($args, true); if (!is_wp_error($timesnap)) { foreach ($timesnap_data as $meta_key => $meta_value) { update_post_meta($timesnap, $meta_key, $meta_value); } $hours_diff = JS_Helper::calc_total_hours($timesnap_data['time_from'], $timesnap_data['time_to']); update_post_meta($timesnap, 'total_hour', $hours_diff); $success++; } } if ($success) { wp_redirect($_js_helper->getHomeUrl('my-timesnaps')); exit; } break; case 'item': case 'edit': $timesnap_id = $_GET['id'] ? $_GET['id'] : JS_Helper::get_input('id'); $this->item = $this->prepareItem(get_post($timesnap_id)); $this->dates = $this->item->date; $timesnap_data = $_POST; if (empty($timesnap_data)) { break; } if (isset($timesnap_data['snap_category_new'])) { $timesnap_data['snap_category'] = $timesnap_data['snap_category_new']; } $args = array('ID' => $timesnap_id, 'tax_input' => array('snap_category' => $timesnap_data['snap_category'], 'snap_tag' => $timesnap_data['snap_tag'])); $timesnap = wp_update_post($args, true); unset($timesnap_data['author']); unset($timesnap_data['snap_tag']); unset($timesnap_data['terms']); $dates = explode(',', $timesnap_data['dates']); $timesnap_data['date'] = $dates[0]; unset($timesnap_data['dates']); if (!is_wp_error($timesnap)) { foreach ($timesnap_data as $meta_key => $meta_value) { update_post_meta($timesnap, $meta_key, $meta_value); } $hours_diff = JS_Helper::calc_total_hours($timesnap_data['time_from'], $timesnap_data['time_to']); update_post_meta($timesnap, 'total_hour', $hours_diff); wp_redirect($_js_helper->getHomeUrl('my-timesnaps')); exit; } break; case 'list': $timesnaps = $this->getData(); $this->prepareItems($timesnaps); break; case 'calendar': $timesnaps = array(); for ($i = 1; $i <= date('t'); $i++) { $date = date('n/j/Y', mktime(0, 0, 0, date('n'), $i, date('Y'))); $timesnaps[$date] = $this->prepareItems($this->getDataByDate($date)); } $this->items = json_encode($timesnaps); break; case 'form': break; } parent::display($tmpl, $separator); }
function display($tmpl = null) { $this->results = array(); $this->authors = array(); $search_area = JS_Helper::get_input('snap_search_area'); if ($this->snap_task == 'search_jobs' && $search_area == 'jobsshopper') { $model = SnapJobs::getModel($search_area); $args_filter = array('s' => $_GET['keyword'], 'meta_query' => array()); if ($snap_education = JS_Helper::get_input('education')) { $args_filter['meta_query'][] = array('key' => 'education_qualifications', 'value' => $snap_education); } if ($snap_locate = JS_Helper::get_input('location')) { $args_filter['meta_query'][] = array('key' => 'location', 'value' => $snap_locate, 'compare' => 'LIKE'); } if ($snap_skills = JS_Helper::get_input('skills')) { $args_filter['meta_query'][] = array('key' => 'skills', 'value' => $snap_skills, 'compare' => 'LIKE'); } if ($snap_strengths = JS_Helper::get_input('strengths')) { $args_filter['meta_query'][] = array('key' => 'strengths', 'value' => $snap_strengths, 'compare' => 'LIKE'); } if ($snap_year_experience = JS_Helper::get_input('year_experience')) { $args_filter['meta_query'][] = array('key' => 'year_of_experiences_year', 'value' => $snap_year_experience, 'compare' => '<='); } $datas['date'] = JS_Helper::get_input('snap_date'); $datas['time_from'] = JS_Helper::get_input('time_from'); $datas['time_to'] = JS_Helper::get_input('time_to'); $datas['currency'] = JS_Helper::get_input('currency'); $datas['min_rate'] = JS_Helper::get_input('min_rate'); $datas['max_rate'] = JS_Helper::get_input('max_rate'); $this->authors = $this->getAuthorbyTime($datas); $args_filter['include'] = $this->authors; $this->results = $model->getData($args_filter); $this->total_count = $model->total_count; } elseif ($this->snap_task == 'search_jobs' && $search_area == 'jobs') { $model = SnapJobs::getModel($search_area); $args_filter = array('s' => $_GET['keyword'], 'post_type' => 'jobssnap', 'meta_query' => array(array('key' => 'snap_job_status', 'value' => 'closed', 'compare' => '!='))); if ($snap_education = JS_Helper::get_input('snap_date')) { $args_filter['meta_query'][] = array('key' => 'date', 'value' => date('n/j/Y', strtotime($datas['date'])), 'compare' => 'LIKE'); } if ($snap_education = JS_Helper::get_input('education')) { $args_filter['meta_query'][] = array('key' => 'education_qualifications', 'value' => $snap_education); } if ($snap_locate = JS_Helper::get_input('location')) { $args_filter['meta_query'][] = array('key' => 'location', 'value' => $snap_locate, 'compare' => 'LIKE'); } if ($snap_locate = JS_Helper::get_input('time_from')) { $args_filter['meta_query'][] = array('key' => 'time_from', 'value' => $snap_locate, 'compare' => '<='); } if ($snap_locate = JS_Helper::get_input('time_to')) { $args_filter['meta_query'][] = array('key' => 'time_to', 'value' => $snap_locate, 'compare' => '>='); } if ($snap_locate = JS_Helper::get_input('currency')) { $args_filter['meta_query'][] = array('key' => 'currency', 'value' => $snap_locate, 'compare' => 'LIKE'); } if ($snap_locate = JS_Helper::get_input('min_rate')) { $args_filter['meta_query'][] = array('key' => 'min_rate', 'value' => $snap_locate, 'compare' => '<='); } if (count($args_filter['meta_query']) > 1) { $args_filter['meta_query']['relation'] = 'AND'; } $this->results = $model->getDataSearch($args_filter); $this->total_count = $model->total_count; } parent::display($tmpl, false); }
<?php global $_js_helper; $current_area = $_js_helper->is_logged() ? $_js_helper->get_current_area() : JS_Helper::get_input('snap_option'); ?> <?php if ($this->snap_task == 'search_jobs') { $this->loadTemplate('results'); } else { $this->loadTemplate('form-' . $current_area); }