Beispiel #1
0
function JB_get_day_and_week($date_time)
{
    global $label;
    $trimmed_date = JB_trim_date(JB_get_local_time($date_time));
    $t = strtotime($date_time) + 3600 * JB_GMT_DIF;
    $t_now = strtotime(gmdate('Y-M-d') . ' 23:59:59') + 3600 * JB_GMT_DIF;
    $diff = $t_now - $t;
    if ($diff < 0) {
        // cannot be negative
        $diff = 0;
    }
    $weeks = floor($diff / 604800);
    if ($weeks > 4) {
        static $more_than_4;
        if ($more_than_4) {
            return null;
            // only repeat once
        }
        $more_than_4 = $label['post_list_dow_' . $d];
        return $more_than_4;
    }
    if ($weeks == 3) {
        $d = gmdate("w", $t);
        $day = $label['post_list_dow_' . $d];
        return $label['post_list_3_weeks'] . " " . $day;
    }
    if ($weeks == 2) {
        $d = gmdate("w", $t);
        $day = $label['post_list_dow_' . $d];
        return $label['post_list_2_weeks'] . " " . $day;
    }
    if ($weeks == 1) {
        $d = gmdate("w", $t);
        $day = $label['post_list_dow_' . $d];
        return $label['post_list_1_week'] . " " . $day;
    }
    if ($weeks == 0) {
        $td2 = JB_trim_date(JB_get_local_time(gmdate('r')));
        // is it today?
        if ($trimmed_date == $td2) {
            return $label['post_list_today'];
        }
        $d = gmdate("w", $t);
        $day = $label['post_list_dow_' . $d] . " ";
        return $day;
    }
}
Beispiel #2
0
 function list_job(&$post)
 {
     static $previous_day;
     $this->current_post = $post;
     $LM =& JB_get_PostListMarkupObject();
     // load the ListMarkup Class
     $count++;
     $POST_MODE = 'normal';
     $class_name = $LM->get_item_class_name($POST_MODE);
     $class_postfix = $LM->get_item_class_postfix($POST_MODE);
     $DATE = $this->current_post['date'];
     # display day of week
     if (JB_POSTS_SHOW_DAYS_ELAPSED == "YES") {
         //echo $prams['post_date'];
         $day_and_week = JB_get_day_and_week(JB_trim_date($DATE));
         if (JB_trim_date($DATE) !== JB_trim_date($previous_day)) {
             // new day?
             if ($day_and_week != '') {
                 $LM->list_day_of_week($day_and_week, $class_postfix);
             }
         }
         $previous_day = $DATE;
     }
     ########################################
     # Open the list data items
     $LM->list_item_open($POST_MODE, $class_name);
     ########################################################################
     JB_echo_job_list_data($admin);
     // display the data cells
     ########################################################################
     # Close list data items
     $LM->list_item_close();
 }
Beispiel #3
0
    function data_cell($field_id)
    {
        switch ($field_id) {
            case 'employer_id':
                $emp_name = JB_get_employer_company_name($this->get_data_value('employer_id'));
                ?>
				<a href="search.php?show_emp=<?php 
                echo $this->get_data_value('employer_id');
                ?>
"><?php 
                echo $this->escape($emp_name);
                ?>
</a>
				<?php 
                break;
            case 'request_date':
                echo JB_trim_date(JB_get_local_time($this->get_data_value('request_date')));
                break;
        }
    }