Example #1
0
function JB_display_post_list(&$posts, $lm)
{
    global $JobListAttributes;
    global $list_mode;
    $list_mode = $lm;
    global $post_count;
    global $post_id;
    global $label;
    global $column_list;
    // - this is initialized in lists.inc.php using the JB_echo_list_head_data() function
    global $column_info;
    // - same as above
    $PLM =& JB_get_PostListMarkupObject();
    // load the ListMarkup Class
    $PLM->set_list_mode($lm);
    if (func_num_args() > 2) {
        // what kind of posts to show
        $show = func_get_arg(2);
        $_REQUEST['show'] = $show;
    }
    $PLM->set_show($show);
    $JobListAttributes = new JobListAttributes($list_mode, $show);
    $JobListAttributes->set_list_mode($lm);
    if ($list_mode == 'ADMIN') {
        $admin = true;
    }
    if ($list_mode == "BY_CATEGORY_ADMIN") {
        $list_mode = "ADMIN";
    }
    if ($list_mode == 'ADMIN' || $list_mode == 'SAVED' || $list_mode == 'EMPLOYER') {
        $PLM->open_form($JobListAttributes);
    }
    if ($list_mode == 'PREMIUM') {
        if (JB_PREMIUM_POSTS_LIMIT == 'YES') {
            $pp_page = JB_PREMIUM_POSTS_PER_PAGE;
        } else {
            $pp_page = 200;
        }
    } elseif ($list_mode == 'EMPLOYER') {
        if (defined('JB_MANAGER_POSTS_PER_PAGE')) {
            $pp_page = JB_MANAGER_POSTS_PER_PAGE;
        } else {
            $pp_page = 20;
        }
    } else {
        $pp_page = JB_POSTS_PER_PAGE;
    }
    if ($list_mode != 'PREMIUM') {
        JB_nav_pages($result, $q_string, $pp_page);
    }
    $css_id = $PLM->get_list_css_id();
    $PLM->list_start($css_id);
    ################
    # Generate output for the head <tr> row of the table
    # Dynamic columns are generated by Jb_echo_list_head_data() in lists.inc.php and
    # placed in the $head_data variable
    # The $head_data is cached, otherwise if conditions are used
    # to generate the output for the <td> parts
    $COLSPAN = '';
    // How many columns? (the hits column does not count here...)
    ob_start();
    // buffer the output, so that we can calculate the colspan.
    $COLSPAN = JB_echo_list_head_data(1, $admin);
    $list_head_data = ob_get_contents();
    ob_end_clean();
    JBPLUG_do_callback('job_list_set_colspan', $COLSPAN);
    // set the colspan value
    $PLM->set_colspan($COLSPAN);
    if ($list_mode == 'SAVED') {
        $PLM->saved_list_controls();
    } elseif ($list_mode == 'ADMIN') {
        $PLM->admin_list_controls();
    } elseif ($list_mode == 'EMPLOYER') {
        $PLM->employer_list_controls();
    }
    JBPLUG_do_callback('job_list_controls', $PLM);
    // plugins can render any undefined list controls
    #######################################
    # Open the list heading section
    $PLM->list_head_open();
    if ($list_mode == 'ADMIN') {
        $PLM->list_head_admin_action();
        JBPLUG_do_callback('job_list_head_admin_action', $A = false);
        // plugin for addition action column
    } elseif ($list_mode == 'EMPLOYER') {
        $PLM->list_head_employer_action();
    } elseif ($list_mode == 'SAVED') {
        $PLM->list_head_saved_action();
    }
    JBPLUG_do_callback('joblist_list_head_action', $PLM);
    ########################################################################
    echo $list_head_data;
    // output the header columns that were buffered before.
    ########################################################################
    if ($list_mode == 'EMPLOYER') {
        // Here we make sure that the 'views' and 'applications' columns
        // appear in manager.php, regardless how the list is configured.
        $PLM->list_head_employer_extras();
        JBPLUG_do_callback('job_list_head_employer_extra_col', $A = false);
        // plugin for the additional columns seen by the employer's Application manager
    }
    if ($list_mode == 'PREMIUM' && JB_SHOW_PREMIUM_HITS == 'YES') {
        $PLM->list_head_premium_extras();
    }
    ######################################
    # Close the list heading section
    $PLM->list_head_close();
    $i = 0;
    $current_day = JB_get_local_time(gmdate("r"));
    // local time form GMT
    # Output the data rows
    JBPLUG_do_callback('job_list_pre_fill', $i, $list_mode);
    //A plugin can list its own records before, and adjust the $i
    // init a week ago from first post
    while (($row = mysql_fetch_array($posts, MYSQL_ASSOC)) && $i < $pp_page) {
        $PLM->set_values($row);
        JBPLUG_do_callback('job_list_set_data', $row, $i, $list_mode);
        // A plugin can modify the prams
        $i++;
        $post_id = $row['post_id'];
        $POST_MODE = $row['post_mode'];
        $class_name = $PLM->get_item_class_name($POST_MODE);
        $class_postfix = $PLM->get_item_class_postfix($POST_MODE);
        //$DATE_TIME = JB_get_local_time($row['post_date']." GMT");
        # display day of week
        if ($list_mode == 'ALL' && JB_POSTS_SHOW_DAYS_ELAPSED == "YES" || $list_mode == 'PREMIUM' && JB_P_POSTS_SHOW_DAYS_ELAPSED == "YES") {
            $DATE_TIME = JB_get_local_time($row['post_date'] . " GMT");
            # display day of week
            if ($list_mode == 'ALL' && JB_POSTS_SHOW_DAYS_ELAPSED == "YES" || $list_mode == 'PREMIUM' && JB_P_POSTS_SHOW_DAYS_ELAPSED == "YES") {
                $day_and_week = JB_get_day_and_week($row['post_date']);
                if ($day_and_week !== $prev_day_and_week) {
                    // new day?
                    if ($day_and_week != '') {
                        $PLM->list_day_of_week($day_and_week, $class_postfix);
                    }
                }
                $prev_day_and_week = $day_and_week;
            }
        }
        ########################################
        # Open the list data items
        $PLM->list_item_open($POST_MODE, $class_name);
        # Action cells
        # Here the action buttons are displayed, eg. 'Delete', 'Approve', checkboxes to select, etc
        if ($list_mode == 'ADMIN') {
            $PLM->list_data_admin_action($class_postfix, $row['post_mode']);
            JBPLUG_do_callback('job_list_data_admin_action', $A = false);
            // plugin for the additional controls for the Admin
        } elseif ($list_mode == 'SAVED') {
            $PLM->list_data_saved_action();
        } elseif ($list_mode == 'EMPLOYER') {
            // EMPLOYER MODE ONLY!
            $PLM->list_data_employer_action($class_postfix, $row['post_mode']);
            JBPLUG_do_callback('job_list_data_employer_buttons', $A = false);
            // plugin for the additional controls for the Admin
        }
        JBPLUG_do_callback('joblist_list_data_user_action', $A = false);
        ########################################################################
        JB_echo_job_list_data($admin);
        // display the data cells
        ########################################################################
        if ($list_mode == 'EMPLOYER') {
            // displayed on manager.php
            $app_count = $row['applications'];
            // change the app_count in to a link
            if ($app_count > 0) {
                $app_count = $PLM->get_emp_app_link('app.php?post_id=' . $row['post_id'], $app_count);
            }
            $PLM->list_data_employer_extras($app_count);
            JBPLUG_do_callback('job_list_data_employer_extra_col', $A = false);
            // plugin for the additional fields seen by the employer's Application manager
        }
        if ($list_mode == 'PREMIUM' && JB_SHOW_PREMIUM_HITS == 'YES') {
            $PLM->list_data_premium_extras();
        }
        $PLM->list_item_close();
    }
    ############ end while()
    JBPLUG_do_callback('job_list_back_fill', $i, $list_mode);
    // A plugin can list its own records after
    $PLM->list_end();
    if ($list_mode == 'ADMIN' || $list_mode == 'SAVED' || $list_mode == 'EMPLOYER') {
        $PLM->close_form();
    }
    if ($list_mode == 'PREMIUM') {
        if (JB_PREMIUM_POSTS_LIMIT == 'YES') {
            JB_nav_pages($result, $q_string, $pp_page);
        }
    } else {
        JB_nav_pages($result, $q_string, $pp_page);
    }
}
Example #2
0
 if (sizeof($resume_row) > 0) {
     $anon_q = 'a=' . $is_anon;
     $key = substr(md5($is_anon . $resume_row['resume_id'] . $user_row['Password'] . $user_row['ID']), 0, 10);
     $key_q = $anon_q . '&resume_id=' . $resume_row['resume_id'] . '&id=' . $user_row['ID'] . '&key=' . $key;
     $resume_db_link = JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . "search.php?" . $key_q;
 } else {
     $resume_db_link = $label["app_resume_notpres"];
 }
 //$app_name = $PForm->get_value('app_name');
 //$app_email = $PForm->get_value('app_email');
 $e_row = mysql_fetch_array($e_result, MYSQL_ASSOC);
 $text_message = $e_row['EmailText'];
 $text_message = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $text_message);
 $text_message = str_replace("%SITE_NAME%", JB_SITE_NAME, $text_message);
 $text_message = str_replace("%BASE_HTTP_PATH%", JB_BASE_HTTP_PATH, $text_message);
 $JobListAttributes = new JobListAttributes();
 $JobListAttributes->clear();
 $text_message = str_replace("%POST_URL%", JB_job_post_url($post_id, $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php'), $text_message);
 $text_message = str_replace("%POSTED_BY%", $POSTED_BY, $text_message);
 $text_message = str_replace("%EMPLOYER_EMAIL%", $EMAIL, $text_message);
 $text_message = str_replace("%JOB_TITLE%", $TITLE, $text_message);
 $text_message = str_replace("%APP_NAME%", $app_name, $text_message);
 $text_message = str_replace("%APP_EMAIL%", $app_email, $text_message);
 $text_message = str_replace("%POST_ID%", $post_id, $text_message);
 $text_message = str_replace("%APP_SUBJECT%", $app_subject, $text_message);
 $text_message = str_replace("%APP_LETTER%", $app_letter, $text_message);
 $text_message = str_replace("%APP_ATTACHMENT1%", $_FILES['att1']['name'], $text_message);
 $text_message = str_replace("%APP_ATTACHMENT2%", $_FILES['att2']['name'], $text_message);
 $text_message = str_replace("%APP_ATTACHMENT3%", $_FILES['att3']['name'], $text_message);
 $CandidateEmailMessage = $text_message;
 $text_message = str_replace("%RESUME_DB_LINK%", $resume_db_link, $text_message);
Example #3
0
function JB_template_email_job()
{
    global $label, $error, $post_id, $your_email, $your_name, $to_email, $message, $to_email, $JBMarkup;
    JBPLUG_do_callback('email_job_before', $A = false);
    require_once dirname(__FILE__) . "/posts.inc.php";
    $JobListAttributes = new JobListAttributes();
    $JobListAttributes->clear();
    if (file_exists(JB_THEME_PATH . 'email-job-form.php')) {
        require JB_THEME_PATH . 'email-job-form.php';
    } else {
        require JB_DEFAULT_THEME_PATH . 'email-job-form.php';
    }
    JBPLUG_do_callback('email_job_after', $A = false);
}
Example #4
0
# You can obtain one at http://mozilla.org/MPL/2.0/.
###########################################################################
if (defined('JB_RSS_FEED_PATH')) {
    // config.php was already included
    // - this file is included by another file
    define('JB_OMIT_SESSION_START', true);
    define('NO_HOUSE_KEEPING', true);
    $out_to_browser = false;
    // send outpt to rss.xml
} else {
    require dirname(__FILE__) . "/config.php";
    $out_to_browser = true;
    // send output to browser
}
require_once dirname(__FILE__) . "/include/posts.inc.php";
$JobListAttributes = new JobListAttributes();
$JobListAttributes->clear();
$out_to_file = true;
$cat = '';
########################################################
# Special function to convert HTML string to UTF-8
function JB_rss_xmlentities($string, $quote_style = ENT_COMPAT)
{
    // convert all entities to UTF-8 encoded string
    // this is to preserve characters of other languages
    // encoded using htmlentities
    require_once dirname(__FILE__) . "/include/xml_feed_functions.php";
    $string = JBXM_html_entity_decode($string);
    // xmlentities
    $trans = array("<" => '&lt;', "&" => '&amp;', ">" => '&gt;', '"' => '&quot;', '\'' => '&apos;');
    $string = strtr($string, $trans);