Beispiel #1
0
 static function updateProfileInformation($data)
 {
     global $_js_helper;
     $success = 0;
     if (!$_js_helper->is_logged()) {
         return false;
     }
     $args = wp_parse_args($data, array());
     if ($args['edit_task'] && $args['edit_task'] == 'change_password') {
         $current_user = JS_Helper::get_current_js_user();
         if (!wp_check_password($args['old_pass'], $current_user->user_pass, $current_user->ID)) {
             return -2;
         }
     }
     $meta_data = $args['meta'];
     unset($args['meta']);
     if (!is_wp_error(wp_update_user($args))) {
         $success++;
     }
     if ($meta_data) {
         foreach ($meta_data as $meta_key => $meta_value) {
             $success += update_user_meta($args['ID'], $meta_key, $meta_value) ? 1 : 0;
         }
     }
     return strval($success);
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 private function get_path_file($slug_file)
 {
     if (strpos($slug_file, '.') && !strpos($slug_file, '.php')) {
         $slug_file = str_replace('.', DIRECTORY_SEPARATOR, $slug_file) . '.php';
     }
     if (strpos($slug_file, JS_Helper::getSetting('plugin_path'))) {
         return $slug_file;
     }
     return JS_Helper::getSetting('plugin_path') . 'templates' . DIRECTORY_SEPARATOR . $slug_file;
 }
 function creatView($view, $config = array())
 {
     $view_class = 'JS_View_' . ucfirst($view);
     $path = JS_Helper::getSetting('plugin_path') . 'view' . DIRECTORY_SEPARATOR . $view . '.php';
     if (file_exists($path)) {
         require_once $path;
         return new $view_class($config);
     } else {
         return null;
     }
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 function getData($filter = null)
 {
     $args = array('post_type' => 'jobssnap', 'post_status' => 'publish', 'posts_per_page' => $this->limited, 'orderby' => $this->orderby, 'order' => $this->order, 'paged' => $this->paged);
     $current_user = JS_Helper::get_current_js_user();
     switch ($filter) {
         case 'saved':
             $args['post__in'] = $current_user->saved_jobs ? $current_user->saved_jobs : array(-1);
             break;
         case 'opened':
         case 'opening':
         case 'open':
             $args['meta_key'] = 'snap_job_status';
             $args['meta_value'] = 'opened';
             break;
         case 'snapped':
             $snapped_jobs = $this->get_snapped_jobs(get_current_user_id(), false, array('fields' => 'job_id'));
             if (!$snapped_jobs) {
                 $snapped_jobs = array(-1);
             }
             $args['post__in'] = $snapped_jobs;
             break;
         default:
             if ($this->user) {
                 $args['author'] = $this->user->ID;
             }
             if (is_array($filter)) {
                 $args = wp_parse_args($filter, $args);
             }
             break;
     }
     $data = new WP_Query($args);
     foreach ($data->posts as $key => $item) {
         $this->prepareItem($item);
     }
     $this->total_count = $data->post_count;
     return $this->items;
 }
Beispiel #7
0
            <div class="item-info-name">
                <h4>
                    <span><?php 
echo esc_html($item->name);
?>
</span>
                    <span class="specialisations"><?php 
echo implode(', ', $item->specialisations);
?>
</span>
                </h4>

                <div class="item-reviews">
                    <ul class="stars-rate">
                        <?php 
JS_Helper::render_rating_html($item->rating);
?>
                    </ul>
                    <span><?php 
printf('%d Review%s', $item->reviews_count, $item->reviews_count > 1 ? 's' : '');
?>
</span>
                </div>
            </div>
            <!-- /.item-info-name -->
        </div>
        <!-- /.item-info-date -->
        <div class="item-information">
            <h5>Location</h5>

            <p><?php 
Beispiel #8
0
 function listAPI()
 {
     $methods = get_class_methods($this);
     ob_start();
     include JS_Helper::getSetting('plugin_path') . 'api/list.php';
     $page_content = ob_get_contents();
     ob_end_clean();
     echo $page_content;
 }
Beispiel #9
0
 function __construct()
 {
     $this->user = JS_Helper::get_current_js_user();
 }
<?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;
        }
Beispiel #11
0
<?php

global $_js_helper;
$current_user = JS_Helper::get_current_js_user();
?>

<div id="main-content" class="site-content reviews-page">

    <div class="container">
        <!-- banner search -->
        <div class="banner-search banner"
             style="background-image: url(<?php 
echo get_template_directory_uri();
?>
/images/header-bg-2.jpg);">
            <div class="user-info">
                <div class="user-avatar">
                    <a href="<?php 
echo $_js_helper->get_profile_user_url($this->user->ID);
?>
">
                        <?php 
echo $this->user->avatar;
?>
                    </a>
                </div>
                <div class="user-information">
                    <h2><?php 
echo $this->user->name;
?>
</h2>
Beispiel #12
0
 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);
 }
Beispiel #13
0
 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);
 }
Beispiel #14
0
 function handle_jobsshopper_requests()
 {
     global $wp, $_js_helper;
     if (is_admin()) {
         return;
     }
     if (!empty($_GET['payment_tmpl'])) {
         $wp->query_vars['payment_tmpl'] = $_GET['payment_tmpl'];
     }
     if (!empty($wp->query_vars['payment_tmpl'])) {
         include JS_Helper::getSetting('plugin_path') . 'paypal' . DIRECTORY_SEPARATOR . $wp->query_vars['payment_tmpl'] . '.php';
         exit;
     }
     $queries = explode('/', $wp->request);
     if ($_js_helper->get_current_area() != $queries[0] && ('jobsboss' == $queries[0] || 'jobsshopper' == $queries[0]) && !in_array('login', $queries) && !in_array('register', $queries)) {
         wp_redirect($_js_helper->jobsshops_login_url($queries[0]));
         exit;
     }
     if ($queries[0] == 'search') {
         $wp->query_vars['snap_option'] = $_js_helper->get_current_area();
     }
     if (!empty($_GET['snap_option'])) {
         $wp->query_vars['snap_option'] = $_GET['snap_option'];
         if (!$_js_helper->is_logged()) {
             wp_redirect(site_url());
             exit;
         }
     }
     if (!empty($_GET['snap_view'])) {
         $wp->query_vars['snap_view'] = $_GET['snap_view'];
     }
     if (!empty($_GET['snap_user'])) {
         $wp->query_vars['snap_user'] = $_GET['snap_user'];
     }
     if (!empty($_GET['id'])) {
         $wp->query_vars['id'] = $_GET['id'];
     }
     if (!empty($_GET['snap_task'])) {
         $wp->query_vars['snap_task'] = $_REQUEST['snap_task'];
     }
     if ($wp->query_vars['snap_option'] == 'profile') {
         $template_view = $wp->query_vars['snap_option'];
         if ($wp->query_vars['snap_view']) {
             $template_view .= '.' . $wp->query_vars['snap_view'];
         }
     } else {
         if ($wp->query_vars['snap_option'] == 'jobs') {
             $template_view = $wp->query_vars['snap_option'] . '.' . $wp->query_vars['snap_view'];
             if ($_js_helper->get_current_area() == 'jobsboss') {
                 $wp->query_vars['snap_user'] = get_current_user_id();
             }
         } else {
             if ($wp->query_vars['snap_option'] == 'reviews') {
                 $template_view = $wp->query_vars['snap_option'];
             } else {
                 switch ($wp->query_vars['snap_view']) {
                     case 'login':
                         $template_view = 'login';
                         break;
                     case 'register':
                         $template_view = 'register.' . $wp->query_vars['snap_option'];
                         break;
                     case 'inbox':
                     case 'jobschat':
                         $template_view = 'inbox';
                         break;
                     case 'post-timesnaps':
                         if (!$wp->query_vars['snap_task']) {
                             $wp->query_vars['snap_task'] = 'form';
                         }
                         $template_view = 'timesnaps.calendar';
                         break;
                     case 'create-timesnaps':
                         if (!$wp->query_vars['snap_task']) {
                             $wp->query_vars['snap_task'] = 'add';
                         }
                         $template_view = 'timesnaps.form';
                         break;
                     case 'edit-timesnaps':
                         $wp->query_vars['snap_task'] = 'edit';
                         $template_view = 'timesnaps.form';
                         break;
                     case 'my-timesnaps':
                         $template_view = 'timesnaps.viewcalendar';
                         if (!$wp->query_vars['snap_task']) {
                             $wp->query_vars['snap_task'] = 'calendar';
                         } else {
                             if ($wp->query_vars['snap_task'] == 'list') {
                                 $template_view = 'timesnaps.viewlisting';
                             } else {
                                 if ($wp->query_vars['snap_task'] == 'calendar') {
                                     $template_view = 'timesnaps.viewcalendar';
                                 }
                             }
                         }
                         break;
                     case 'timesnaps':
                         $wp->query_vars['id'] = $wp->query_vars['snap_task'];
                         $wp->query_vars['snap_task'] = 'item';
                         $template_view = 'timesnaps.item';
                         break;
                     case 'edit-jobssnaps':
                         if (!$wp->query_vars['snap_task']) {
                             $wp->query_vars['snap_task'] = 'edit';
                         }
                         $template_view = 'jobs.form';
                         break;
                     case 'post-jobssnaps':
                         if (!$wp->query_vars['snap_task']) {
                             $wp->query_vars['snap_task'] = 'add';
                         }
                         $template_view = 'jobs.form';
                         break;
                     case 'my-jobssnaps':
                         if (!$wp->query_vars['snap_task']) {
                             $wp->query_vars['snap_user'] = get_current_user_id();
                         }
                         $view = $_REQUEST['view'] ? $_REQUEST['view'] : 'calendar';
                         if ($view == 'list') {
                             $view = 'index';
                         }
                         $template_view = 'jobs.' . $view;
                         break;
                     case 'saved':
                         $template_view = $wp->query_vars['snap_option'] . '.saved';
                         break;
                     case 'applications':
                         $template_view = $wp->query_vars['snap_option'] . '.applications';
                         break;
                     case 'history':
                         $template_view = $wp->query_vars['snap_option'] . '.history';
                         break;
                     case 'search':
                         $template_view = 'search';
                         break;
                     case 'saved-jobsshoppers':
                         $template_view = 'jobsshopper.saved';
                         break;
                     case 'listing-jobsshoppers':
                         $template_view = 'jobsshopper';
                         break;
                 }
             }
         }
     }
     if (isset($template_view) && $template_view) {
         $this->helper->loadView($template_view);
         exit;
     } else {
         if (!is_null($wp->query_vars['snap_option'])) {
             include get_template_directory() . '/404.php';
             exit;
         }
     }
 }
Beispiel #15
0
            </h4>
            <div class="item-reviews">
                <div class="row">
                    <div class="col-xs-8">
                        <h5><?php 
echo $user->display_name;
?>
</h5>
                        <p class="specialist">
                            <?php 
echo implode(',', $user->specialisations);
?>
                        </p>
                        <ul class="stars-rate pull-left">
                            <?php 
JS_Helper::render_rating_html($user->rating);
?>
                        </ul>
                        <span class="review"><?php 
printf('%d Review%s', $user->reviews_count, $user->reviews_count > 1 ? 's' : '');
?>
</span>
                    </div>
                    <div class="pull-right">
                        <div class="item-logo">
                            <img src="<?php 
echo $user->avatar;
?>
" alt=""/>
                        </div>
                    </div>
Beispiel #16
0
 function render_rating_html($rating, $echo = true)
 {
     return JS_Helper::render_rating_html($rating, $echo);
 }
Beispiel #17
0
    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);
    }
Beispiel #18
0
<?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);
Beispiel #19
0
 function getData($filter = null)
 {
     $args = array('post_type' => 'jobssnap', 'post_status' => 'publish', 'posts_per_page' => $this->limited);
     $current_user = JS_Helper::get_current_js_user();
     switch ($filter) {
         case 'saved':
             $args['post__in'] = $current_user->saved_jobs ? $current_user->saved_jobs : array(-1);
             break;
         case 'opened':
         case 'opening':
         case 'open':
             $args['meta_key'] = 'snap_job_status';
             $args['meta_value'] = 'opened';
             break;
         case 'snapped':
             $jobs_model = SnapJobs::getModel('jobs');
             $snapped_jobs = $jobs_model->get_snapped_jobs(get_current_user_id(), false, array('fields' => 'job_id'));
             if (!$snapped_jobs) {
                 $snapped_jobs = array(-1);
             }
             $args['post__in'] = $snapped_jobs;
             break;
         default:
             if ($this->user) {
                 $args['author'] = $this->user->ID;
             }
             break;
     }
     $data = new WP_Query($args);
     $model = SnapJobs::getModel('jobs');
     $this->items = $model->prepareItems($data->posts);
     $this->total_count = $data->post_count;
 }
                        <a href="<?php 
echo site_url('search');
?>
">ADVANCED SEARCH <i class="icon icon-more"></i></a>
                    </div>
                </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">Latest Jobssnaps</h2>
                        <button class="btn btn-danger pull-right" onclick="document.location.href='<?php 
echo site_url('jobssnaps');
?>
'">View All Jobssnaps</button>
                    </div>
                    <?php 
$_js_helper->import_view('jobs');
$listing = new JS_View_Jobs();
$listing->display('jobs.list', true);
?>
                </div>
            </div>
        </div>
        <!-- /#main-content -->
<?php 
JS_Helper::get_footer(true);
Beispiel #21
0
    ?>
                            <div class="snap-hours col-md-6"
                                 style="background-image: url(<?php 
    echo get_template_directory_uri();
    ?>
/images/snap-hour-bg.jpg);">
                                <div class="row">
                                    <div class="available-snap-hours snap-hours-inner col-sm-6">
                                        <span>Available Snap Hours</span>

                                        <p class="hours-label"><?php 
    echo $this->user->available_hours;
    ?>
</p>
                                        <a href="<?php 
    echo JS_Helper::getJobslistUrl($this->user->ID);
    ?>
">View snap
                                            calendar</a>
                                    </div>
                                    <div class="completed-snap-hours snap-hours-inner col-sm-6">

                                        <span>Completed Snap Hours</span>

                                        <p class="hours-label"><?php 
    echo $this->user->completed_hours;
    ?>
</p>
                                        <a href="<?php 
    echo site_url('review/' . $this->user->user_login);
    ?>
Beispiel #22
0
 function creatView($view)
 {
     $views = explode('.', $view);
     if (count($views) > 1) {
         $view = $views[0];
     }
     $view_class = 'JS_View_' . ucfirst($view);
     $path = JS_Helper::getSetting('plugin_path') . 'view' . DIRECTORY_SEPARATOR . $view . '.php';
     if (file_exists($path)) {
         require_once $path;
         return new $view_class();
     } else {
         return null;
     }
 }
Beispiel #23
0
<?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);
}