Пример #1
0
 echo $label["emp_app_title"];
 $ALM->list_head_cell_close();
 $ALM->list_head_cell_open();
 echo $label["emp_app_name"];
 $ALM->list_head_cell_close();
 $ALM->list_head_cell_open();
 echo $label["emp_app_email"];
 $ALM->list_head_cell_close();
 $ALM->list_head_close();
 while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
     $ALM->set_values($row);
     $i++;
     $ALM->list_item_open('standard');
     $ALM->list_data_employer_action();
     $ALM->list_cell_open();
     echo JB_get_formatted_date(JB_get_local_time($row['app_date']));
     $ALM->list_cell_close();
     $ALM->list_cell_open();
     echo $ALM->get_open_link('apps.php?post_id=' . $row['post_id'], $extra_attr);
     echo JB_escape_html($row['data1']);
     echo $ALM->get_close_link();
     $ALM->list_cell_close();
     $ALM->list_cell_open();
     $sql2 = "SELECT * FROM users where ID='" . jb_escape_sql($row['user_id']) . "'";
     $result2 = JB_mysql_query($sql2) or die(mysql_error());
     $candidate_row = mysql_fetch_array($result2);
     $sql3 = "SELECT * FROM resumes_table where user_id='" . jb_escape_sql($row['user_id']) . "'";
     $result3 = JB_mysql_query($sql3) or die(mysql_error());
     $resume_row = mysql_fetch_array($result3);
     $sql4 = "SELECT * FROM posts_table where post_id='" . jb_escape_sql($row['post_id']) . "'";
     $result4 = JB_mysql_query($sql4) or die(mysql_error());
Пример #2
0
 $resume_alert_list_text = '';
 mysql_data_seek($result2, 0);
 $RForm =& JB_get_DynamicFormObject(2);
 $RForm->set_viewer($user_row['ID']);
 while ($resume_row = mysql_fetch_array($result2, MYSQL_ASSOC)) {
     $RForm->set_values($resume_row);
     //
     $temp_text = $resume_alert_line;
     // copy the template
     //$val = substr(md5 ($resume_row['resume_id'].$user_row['Password'].$user_row['ID']), 0,10);
     $resume_db_link = JB_BASE_HTTP_PATH . JB_EMPLOYER_FOLDER . "search.php?resume_id=" . $resume_row['resume_id'];
     //."&id=".$user_row['ID']."&key=$val";
     $temp_text = str_replace('%RESUME_DB_LINK%', $resume_db_link, $temp_text);
     // load in legacy values
     $DATE = $RForm->get_template_value('DATE');
     $FORMATTED_DATE = JB_get_formatted_date($DATE);
     $temp_text = str_replace("%FORMATTED_DATE%", $FORMATTED_DATE, $temp_text);
     $temp_text = str_replace("%DATE%", $FORMATTED_DATE, $temp_text);
     // substitute temporary template
     $RForm->reset_fields();
     $RForm->set_viewer($user_row['ID']);
     while ($field = $RForm->next_field()) {
         if ($field['field_type'] == 'BLANK' || $field['field_type'] == 'SEPERATOR') {
             continue;
         }
         if ($field['template_tag'] != '' && strlen($field['field_label']) > 0) {
             $temp_text = str_replace('%' . $field['template_tag'] . '%', $RForm->get_raw_template_value($field['template_tag']), $temp_text);
         }
     }
     // append to the list
     $resume_alert_list_text .= $temp_text . "\n";
Пример #3
0
 function job_list_data_val(&$val, $template_tag)
 {
     if (!$this->fill_in_progress) {
         return;
     }
     // is there a fill in progress?
     global $JobListAttributes;
     static $sup;
     if (!isset($sup)) {
         if ($JobListAttributes->query_string) {
             $JobListAttributes->query_string .= '&';
         }
         $JobListAttributes->query_string .= 'sup=1';
         $sup = 1;
     }
     $internal_temp = $JobListAttributes->internal_page;
     //$JobListAttributes->internal_page= true; // turn off mod-rewrite
     $LM =& JB_get_PostListMarkupObject();
     // load the ListMarkup Class
     if ($template_tag == 'DATE') {
         $val = JB_get_formatted_date($this->current_post['date']);
     } elseif ($template_tag == 'LOCATION') {
         $val = '';
         if ($this->current_post['city']) {
             $comma = ', ';
             $val .= $this->current_post['city'];
         }
         if ($this->current_post['state']) {
             if ($this->current_post['city'] != $this->current_post['state']) {
                 $val .= $comma;
                 $comma = ', ';
                 $val .= $this->current_post['state'];
             }
         }
         if ($this->current_post['country']) {
             $val .= $comma;
             $comma = ', ';
             $val .= $this->current_post['country'];
         }
     } elseif ($template_tag == 'TITLE') {
         $val = '<span class="job_list_title" ><a class="job_list_title" href="p.php?ref_id=' . $this->current_post['job_ref'] . '&amp;sup=1">' . $this->current_post['title'] . '</a></span>';
     } elseif ($template_tag == 'POST_SUMMARY') {
         $val = '<span class="job_list_title" ><a class="job_list_title" href="p.php?ref_id=' . $this->current_post['job_ref'] . '&amp;sup=1">' . $this->current_post['title'] . '</a></span><br>';
         if ($this->current_post['source']) {
             $val .= '<span class="job_list_small_print">source:</span> <span class="job_list_cat_name">' . $this->current_post['source'] . '</span><br>';
         }
         $val .= '<span class="job_list_small_print">' . $this->current_post['snippet'] . '</span>';
         "Post summary";
     } else {
         static $DynamicForm;
         if ($DynamicForm == null) {
             $DynamicForm =& JB_get_DynamicFormObject(1, 'global');
         }
         $field_id = $DynamicForm->tag_to_field_id[$template_tag]['field_id'];
         $val = $this->current_post[$this->config['map'][$field_id]];
     }
     $JobListAttributes->internal_page = $internal_temp;
 }
Пример #4
0
 function job_list_data_val(&$val, $template_tag)
 {
     if (!$this->fill_in_progress) {
         return;
     }
     // is there a fill in progress?
     $val = '';
     global $JobListAttributes;
     $LM =& $this->JB_get_markup_obj();
     // load the ListMarkup Class
     if ($template_tag == 'DATE') {
         $val = JB_get_formatted_date($this->current_post['date']);
     }
     if ($template_tag == 'LOCATION') {
         /*$state_comma = ($this->current_post['state']) ? ',':'';
         		$country_comma = ($this->current_post['state']) ? ',':'';
         		$val = $this->current_post['city'].$state_comma.' '.$this->current_post['state'].$country_comma.' '.$this->current_post['country'];
         		*/
         $val = $this->current_post['locations'];
     }
     if ($template_tag == 'TITLE') {
         $val = '<span class="job_list_title" ><a  href="' . jb_escape_html($this->current_post['url']) . '">' . $this->current_post['title'] . '</a></span>';
     }
     if ($template_tag == 'POST_SUMMARY') {
         $val = '<span class="job_list_title" ><A onclick="' . $this->current_post['onclick'] . '" href="' . jb_escape_html($this->current_post['url']) . '">' . $this->current_post['title'] . '</A></span><br>';
         $val .= '<span class="job_list_small_print">source:</span> <span class="job_list_cat_name">' . $this->current_post['source'] . '</span><br>';
         $val .= '<span class="job_list_small_print">' . $this->current_post['snippet'] . '</span>';
         "Post summary";
     }
 }
Пример #5
0
function JB_expire_post($post_id)
{
    $post_id = (int) $post_id;
    $sql = "UPDATE posts_table SET expired='Y' where post_id='" . jb_escape_sql($post_id) . "' ";
    JB_mysql_query($sql) or $DB_ERROR = mysql_error();
    JBPLUG_do_callback('expire_post', $post_id);
    // col val is post_id
    if (JB_EMAIL_POST_EXP_SWITCH == 'YES') {
        // Send Expiration email
        $Form = JB_get_DynamicFormObject(1);
        $Form->load($post_id);
        $TITLE = $Form->get_raw_template_value("TITLE");
        $DATE = JB_get_formatted_date($Form->get_template_value("DATE"));
        $POSTED_BY_ID = $Form->get_value('user_id');
        // get the employer
        $sql = "SELECT * FROM employers WHERE ID='" . jb_escape_sql($POSTED_BY_ID) . "' ";
        $emp_result = jb_mysql_query($sql);
        $emp_row = mysql_fetch_array($emp_result);
        // get the email template
        $template_result = JB_get_email_template(210, $emp_row['lang']);
        $t_row = mysql_fetch_array($template_result);
        $to_address = $emp_row['Email'];
        $to_name = JB_get_formatted_name($emp_row['FirstName'], $emp_row['LastName']);
        $subject = $t_row['EmailSubject'];
        $message = $t_row['EmailText'];
        $from_name = $t_row['EmailFromName'];
        $from_address = $t_row['EmailFromAddress'];
        $message = str_replace("%LNAME%", $emp_row['LastName'], $message);
        $message = str_replace("%FNAME%", $emp_row['FirstName'], $message);
        $message = str_replace("%SITE_NAME%", JB_SITE_NAME, $message);
        $message = str_replace("%SITE_URL%", JB_BASE_HTTP_PATH, $message);
        $message = str_replace("%SITE_CONTACT_EMAIL%", JB_SITE_CONTACT_EMAIL, $message);
        $message = str_replace("%POST_TITLE%", $TITLE, $message);
        $message = str_replace("%POST_DATE%", $DATE, $message);
        $message = str_replace("%VIEWS%", $Form->get_value('hits'), $message);
        $message = str_replace("%APPS%", $Form->get_value('applications'), $message);
        $message = strip_tags($message);
        // plugin can change the recipient
        JBPLUG_do_callback('expire_post_set_recipient_email', $to_address);
        JBPLUG_do_callback('expire_post_set_recipient_name', $to_name);
        // Place the email on the queue!
        JB_queue_mail($to_address, $to_name, $from_address, $from_name, $subject, $message, '', 210);
    }
}
Пример #6
0
function JB_get_list_template_value($field, $val, $admin, $form_id = 1)
{
    $LM =& JB_get_ListMarkupObject($form_id);
    $Form =& JB_get_DynamicFormObject($form_id);
    // it is assumed that this function is called in 'view' mode
    // the viewer id and type is unknown so null is passed
    if ($Form->process_field_restrictions($field, null, null, $admin)) {
        // Its a restricted field, eg anonymous, blocked or member's only
        return $Form->get_value($field['field_id']);
    }
    switch ($field['field_type']) {
        case 'TIME':
            // convert timestamp to local time zone
            // using the raw value stored in the record
            if ($val != '0000-00-00 00:00:00') {
                $val = JB_get_local_time($Form->get_value($field['field_id']) . ' GMT');
            }
            break;
        case 'EDITOR':
            $val = strip_tags($val);
            $val = jb_escape_html($val);
            if (!$admin) {
                $val = JB_email_at_replace($val);
            }
            break;
        case 'IMAGE':
            if (JB_image_thumb_file_exists($Form->get_value($field['field_id']))) {
                $val = $LM->get_img_html($Form->get_value($field['field_id']));
            }
            break;
        case "CURRENCY":
            if ($val > 0) {
                $val = JB_escape_html(JB_format_currency($Form->get_value($field['field_id']), JB_get_default_currency()));
            } else {
                $val = '';
            }
            break;
        case "CATEGORY":
            $val = jb_escape_html(JB_getCatName($Form->get_value($field['field_id'])));
            break;
        case "RADIO":
            $val = jb_escape_html(JB_getCodeDescription($field['field_id'], $Form->get_value($field['field_id'])));
            break;
        case "SELECT":
            $val = jb_escape_html(JB_getCodeDescription($field['field_id'], $Form->get_value($field['field_id'])));
            break;
        case "MSELECT":
        case "CHECK":
            $vals = explode(",", $Form->get_value($field['field_id']));
            $comma = '';
            $str = '';
            if (sizeof($vals) > 0) {
                foreach ($vals as $v) {
                    $str .= $comma . jb_escape_html(JB_getCodeDescription($field['field_id'], $v));
                    $comma = ", ";
                }
            }
            $val = $str;
            break;
        case "DATE":
        case "DATE_CAL":
            if ($val != '0000-00-00 00:00:00') {
                $val = JB_get_local_time($Form->get_value($field['field_id']) . " GMT");
                $val = JB_get_formatted_date($val);
            } else {
                $val = '';
            }
            break;
        case "SKILL_MATRIX":
            $sql = "SELECT name FROM skill_matrix_data where object_id='" . JB_escape_sql($Form->get_value('resume_id')) . "' ";
            $result = JB_mysql_query($sql) or die(mysql_error());
            $val = '';
            $comma = '';
            while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                $val .= $comma . $row['name'];
                $comma = ", ";
            }
            break;
        default:
            // plugins can alter the data in the cell to be
            // be presented on the list in a custom manner
            $args = array('val' => &$val, 'has_changed' => false, 'field' => &$field, 'form_id' => $form_id, 'data' => $Form->get_values());
            JBPLUG_do_callback('get_list_template_value', $args);
            // This hook was added in 3.6, allows plugins to modify the cell data based on $field, eg. $field['field_type'], the plugin should set 'has_changed' to true if the data in 'val' was changed.
            if ($args['has_changed']) {
                // has it changed?
                return $val;
            }
            // if not modified by plugin
            $val = jb_escape_html($val);
            if (!$admin) {
                $val = JB_email_at_replace($val);
            }
    }
    return $val;
}
Пример #7
0
function JB_get_formatted_time($date)
{
    return JB_get_formatted_date($date, true);
}
Пример #8
0
            } else {
                echo $row['months_duration'];
                ?>
 <?php 
                if ($row['months_duration'] > 1) {
                    echo $label['c_membership_months_plural'];
                } else {
                    echo $label['c_membership_months_singular'];
                }
            }
            $SLM->list_cell_close();
            $SLM->list_cell_open();
            if ($row['months_duration'] == '0') {
                echo $label['c_membership_membership_not_end'];
            } else {
                echo JB_get_formatted_date($row['member_end']);
            }
            $SLM->list_cell_close();
            $SLM->list_cell_open();
            if ($row['status'] == 'member_cancel') {
                echo $label['c_membership_cancelled'];
            } else {
                echo JB_get_invoice_status_label($row['status']);
            }
            $SLM->list_cell_close();
            $SLM->list_item_close();
            $SLM->list_item_open();
            $SLM->list_cell_open('colspan:4');
            if ($row['status'] == 'Completed' || $row['reason'] == 'jb_credit_advanced' && $row['status'] == 'Pending') {
                echo $label['c_membership_active'];
            }
Пример #9
0
 function data_cell($field_id)
 {
     if ($field_id == 'invoice_date') {
         echo JB_get_formatted_date($this->get_data_value('invoice_date'));
     } elseif ($field_id == 'invoice_id') {
         if ($this->get_data_value('subscription_id')) {
             echo 'S';
         } elseif ($this->get_data_value('package_id')) {
             echo 'P';
         } elseif ($this->get_data_value('membership_id')) {
             echo 'M';
         }
         echo $this->get_data_value('invoice_id');
     } elseif ($field_id == 'amount') {
         echo JB_convert_to_default_currency_formatted($this->get_data_value('currency_code'), $this->get_data_value('amount'), true, $this->get_data_value('currency_rate'));
     } elseif ($field == 'status') {
         echo JB_get_invoice_status_label($this->get_data_value('status'));
     } else {
         echo $this->get_data_value($field_id);
     }
 }
Пример #10
0
</b></td><td><?php 
        echo JB_escape_html($email_letter);
        ?>
</td></tr>

		</table>

		<?php 
        $success = 1;
    }
}
if ($success != 1) {
    if ($email_subject == '') {
        $email_subject = $label['em_email_subject'];
        $DATE = JB_get_local_time(date('r'));
        $DATE = JB_get_formatted_date($DATE);
        $email_subject = str_replace("%DATE%", $DATE, $email_subject);
        $email_subject = str_replace("%TITLE%", $TITLE, $email_subject);
        $email_subject = str_replace("%SITE_NAME%", JB_SITE_NAME, $email_subject);
    }
    if ($_REQUEST['step'] != '') {
        // seed the form with pre-popluated data.
        $c_email = $CANDIDATE_EMAIL;
        //$user_row[Email];
        $c_name = $CANDIDATE_NAME;
        if ($c_name == '') {
            $c_name = jb_get_formatted_name($user_row['FirstName'], $user_row['LastName']);
        }
    }
    JB_template_employer_email_form($post_id, $c_name, $c_email, $email_subject, $email_letter);
}
Пример #11
0
 }
 if ($disapprove_post != '') {
     if ($reason == '') {
         echo "Please specify a reason<hr>";
     } else {
         $sql = "UPDATE `posts_table` SET `approved`='N', `reason`='" . jb_escape_sql($reason) . "' WHERE `post_id`='" . jb_escape_sql($post_id) . "'";
         JB_mysql_query($sql) or die(mysql_error() . $sql);
         $JBMarkup->ok_msg("Job Post #" . jb_escape_html($post_id) . " disapproved!");
         $PForm =& JB_get_DynamicFormObject(1);
         $PForm->load($post_id);
         JB_update_post_category_count($PForm->get_values());
         JB_finalize_post_updates();
         if (JB_EMAIL_POST_DISAPP_SWITCH == "YES") {
             // send out the disapproval notification to the employer
             $TITLE = $PForm->get_raw_template_value("TITLE");
             $DATE = JB_get_formatted_date($PForm->get_template_value("DATE"));
             $POSTED_BY_ID = $PForm->get_value('user_id');
             // get the employer
             $sql = "SELECT * FROM employers WHERE ID='" . jb_escape_sql($POSTED_BY_ID) . "' ";
             $emp_result = jb_mysql_query($sql);
             $emp_row = mysql_fetch_array($emp_result);
             // get the email template
             $template_result = JB_get_email_template(230, $emp_row['lang']);
             $t_row = mysql_fetch_array($template_result);
             $to_address = $emp_row['Email'];
             $to_name = jb_get_formatted_name($emp_row['FirstName'], $emp_row['LastName']);
             $subject = $t_row['EmailSubject'];
             $message = $t_row['EmailText'];
             $from_name = $t_row['EmailFromName'];
             $from_address = $t_row['EmailFromAddress'];
             /*substitute the vars
Пример #12
0
 function job_list_data_val(&$val, $template_tag)
 {
     if (!$this->fill_in_progress) {
         return;
     }
     // is there a fill in progress?
     $val = '';
     $LL =& $this->JB_get_markup_obj();
     // load the ListMarkup Class
     if ($template_tag == 'DATE') {
         $val = JB_get_formatted_date($this->current_post['date']);
     }
     if ($template_tag == 'LOCATION') {
         if ($this->current_post['city']) {
             $val .= $comma . $this->current_post['city'];
             $comma = ', ';
         }
         if ($this->current_post['state']) {
             $val .= $comma . $this->current_post['state'];
             $comma = ', ';
         }
         if ($this->current_post['country']) {
             $val .= $comma . $this->current_post['country'];
         }
     }
     if ($template_tag == 'TITLE') {
         $val = '<span class="job_list_title" ><A onmousedown="' . $this->current_post['onmousedown'] . '" href="' . jb_escape_html($this->current_post['url']) . '">' . $this->current_post['title'] . '</A></span>';
     }
     if ($template_tag == 'POST_SUMMARY') {
         $val = '<span class="job_list_title" ><A onmousedown="' . $this->current_post['onmousedown'] . '" href="' . jb_escape_html($this->current_post['url']) . '">' . $this->current_post['title'] . '</A></span><br>';
         $val .= '<span class="job_list_small_print">source:</span> <span class="job_list_cat_name">' . $this->current_post['source'] . '</span><br>';
         $val .= '<span class="job_list_small_print">' . $this->current_post['snippet'] . '</span>';
         "Post summary";
     }
 }
Пример #13
0
if (!defined('JB_POSTS_PER_RSS')) {
    define('JB_POSTS_PER_RSS', JB_POSTS_PER_PAGE);
}
$JB_POSTS_PER_RSS = JB_POSTS_PER_RSS;
if (!is_numeric($JB_POSTS_PER_RSS) || $JB_POSTS_PER_RSS == 0) {
    $JB_POSTS_PER_RSS = '15';
}
// removed from WHERE: DATE_SUB('".$now."',INTERVAL 30 DAY) <= `post_date` AND
$sql = "select *, `post_date` AS DAY,  DATE_FORMAT(`post_date`, '%a, %d %b %Y %H:%i:%s {$gmt_diff}') AS formatted_date from posts_table WHERE  `approved`='Y' AND expired='N' " . jb_escape_sql($extra_sql) . " ORDER BY `post_date` DESC LIMIT " . $JB_POSTS_PER_RSS;
$PostingForm =& JB_get_DynamicFormObject(1);
$result = JB_mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $PostingForm->set_values($row);
    $TITLE = $PostingForm->get_raw_template_value("TITLE");
    $DESCRIPTION = $PostingForm->get_raw_template_value("DESCRIPTION");
    $row['formatted_date'] = JB_get_formatted_date($row['post_date']);
    // force whitespace & strip tags.
    $DESCRIPTION = str_replace('<', ' <', $DESCRIPTION);
    $DESCRIPTION = str_replace('>', '> ', $DESCRIPTION);
    $DESCRIPTION = html_entity_decode(strip_tags($DESCRIPTION));
    $DESCRIPTION = preg_replace('/[\\n\\r\\t]/', ' ', $DESCRIPTION);
    $DESCRIPTION = str_replace('  ', ' ', $DESCRIPTION);
    $output .= "<item>\n" . "<title>" . JB_rss_xmlentities($TITLE) . "</title>\n" . "<link>" . JB_job_post_url($row['post_id'], $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php') . "</link>\n" . "<description>" . JB_rss_xmlentities(JB_truncate_html_str($DESCRIPTION, 255, $trunc_str_len)) . "...</description>\n" . "<pubDate>" . $row['formatted_date'] . "</pubDate>\n" . "<guid>" . JB_job_post_url($row['post_id'], $JobListAttributes, JB_BASE_HTTP_PATH . 'index.php') . "</guid>\n" . "</item>\n";
}
$output .= '</channel>';
$output .= '</rss>';
if ($out_to_file) {
    $file = fopen(trim(JB_RSS_FEED_PATH), "wb");
    fwrite($file, $output, strlen($output));
    fclose($file);
}
Пример #14
0
 function JBJobPage($post_id, $admin = false)
 {
     global $JBMarkup;
     $this->post_id = (int) $post_id;
     $this->page_name = "JOB_PAGE";
     require_once jb_basedirpath() . 'include/posts.inc.php';
     // Init data from the form
     $DynamicForm =& JB_get_DynamicFormObject(1);
     if (!$DynamicForm->load($this->post_id)) {
         $this->error_code = 404;
         //header('Status: 404 Not Found'); // fastcgi
         header("HTTP/1.0 404 Not Found");
     }
     // Online Applications enabled?
     $APP = false;
     if (JB_ONLINE_APP_ENABLED == 'YES') {
         $APP = true;
     }
     if ($APP) {
         $JBMarkup->enable_applications();
     }
     // vars used in the template to be extracted in to global scope for the templates
     $DATE = $DynamicForm->get_template_value('DATE', $admin);
     $this->vars = array('post_id' => $this->post_id, 'TITLE' => $DynamicForm->get_template_value('TITLE', $admin), 'POSTED_BY' => $DynamicForm->get_template_value('POSTED_BY', $admin), 'POSTED_BY_ID' => $DynamicForm->get_template_value('USER_ID', $admin), 'DATE' => $DynamicForm->get_template_value('DATE', $admin), 'FORMATTED_DATE' => JB_get_formatted_date($DATE), 'DESCRIPTION' => $DynamicForm->get_template_value('DESCRIPTION', $admin), 'LOCATION' => $DynamicForm->get_template_value('LOCATION', $admin), 'APP' => $APP, 'APPROVED' => $DynamicForm->get_value('approved'), 'DynamicForm' => &$DynamicForm, 'admin' => $admin);
     JBPLUG_do_callback('init_job_page_vars', $this, $post_id, $admin);
     // register the header_tags() method so that JBMarkup can call it back
     $JBMarkup->set_handler('header', $this, 'header_tags');
 }
Пример #15
0
 }
 $SLM->list_cell_close();
 $SLM->list_item_close();
 $SLM->list_item_open();
 $SLM->list_cell_open('colspan:4');
 if ($row['status'] == 'Completed' || $row['reason'] == 'jb_credit_advanced' && $row['status'] == 'Pending') {
     $SLM->subscription_status_open();
     if ($row['views_quota'] > 0 || $row['posts_quota'] > 0 || $row['p_posts_quota'] > 0) {
         $t = $row['quota_timestamp'];
         // calculate timestamp for 1 month in the future
         $t_next_month = mktime(date('H', $t), date('i', $t), date('s', $t), date('n', $t) + 1, date('j', $t), date('Y', $t));
         $label['subscription_quota'] = str_replace('%START_DATE%', date(JB_DATE_FORMAT, $t), $label['subscription_quota']);
         $label['subscription_quota'] = str_replace('%END_DATE%', date(JB_DATE_FORMAT, $t_next_month), $label['subscription_quota']);
         $SLM->subscription_status_line($label['subscription_quota']);
     } else {
         $label['subscription_quota_u'] = str_replace('%DATE%', JB_get_formatted_date($row['subscr_end']), $label['subscription_quota_u']);
         $SLM->subscription_status_line($label['subscription_quota_u']);
     }
     if ($row['views_quota'] > 0) {
         $label['subscription_views_quota'] = str_replace('%QUOTA%', $row['views_quota'], $label['subscription_views_quota']);
         $label['subscription_views_quota'] = str_replace('%TOTAL%', $row['views_quota_tally'], $label['subscription_views_quota']);
         $SLM->subscription_status_line($label['subscription_views_quota']);
     } elseif ($row['can_view_resumes'] == 'Y') {
         // unlimited (0)
         $SLM->subscription_status_line($label['subscription_views_quota_u']);
     }
     if ($row['posts_quota'] > 0 && JB_POSTING_FEE_ENABLED == 'YES') {
         $label['subscription_posts_quota'] = str_replace('%QUOTA%', $row['posts_quota'], $label['subscription_posts_quota']);
         $label['subscription_posts_quota'] = str_replace('%TOTAL%', $row['posts_quota_tally'], $label['subscription_posts_quota']);
         $SLM->subscription_status_line($label['subscription_posts_quota']);
     } elseif ($row['can_post'] == 'Y' && JB_POSTING_FEE_ENABLED == 'YES') {
Пример #16
0
 function get_template_value($tmpl, $admin = false, $raw = false)
 {
     $val = '';
     $field_id = $this->tag_to_field_id[$tmpl]['field_id'];
     if (!isset($this->data[$field_id])) {
         $this->data[$field_id] = '';
     }
     if ($raw) {
         // return without any post-processing
         return $this->data[$field_id];
     }
     /* Hook here for your plugin to bypass this function
      * Tip: Your plugin can use $this object like this: 
      * $obj = JB_get_DynamicFormObject($form_id)
      * $field_id = $this->tag_to_field_id[$tmpl]['field_id'];
      * ...
      */
     $val = false;
     JBPLUG_do_callback('get_template_value', $val, $this->form_id, $tmpl, $admin);
     if ($val !== false) {
         return $val;
     }
     if ($this->process_field_restrictions($tmpl, $this->viewer_id, $this->viewer_type, $admin)) {
         // Its a restricted field, eg anonymous, blocked or member's only
         return $this->data[$field_id];
     }
     // it is assumed that this function is called in 'view' mode
     /*if (JB_process_field_restrictions($this->data, $this->tag_to_field_id[$tmpl], 'view', $admin)) {
     			// Its a restricted field, eg anonymous, blocked or member's only
     			return $this->data[$field_id]; 
     		} */
     switch ($this->tag_to_field_id[$tmpl]['field_type']) {
         case "URL":
             $val = $this->data[$field_id];
             if (strlen($val) > 0) {
                 if (strpos($val, 'http://') === false && strpos($val, 'https://') === false) {
                     $val = 'http://' . $val;
                 }
                 $val = JB_escape_html($val);
                 // no html allowed in this field
             }
             break;
         case "IMAGE":
             if (!JB_image_thumb_file_exists($this->data[$field_id])) {
                 $val = $label['employer_resume_list_no_image'];
             } else {
                 $val = $this->data[$field_id];
             }
             break;
         case "NUMERIC":
         case "INTEGER":
             $val = jb_escape_html($this->data[$field_id]);
             // no html allowed in this field
             break;
         case "CURRENCY":
             if ($val > 0) {
                 $val = JB_escape_html(JB_format_currency($this->data[$field_id], JB_get_default_currency()));
             } else {
                 $val = '';
             }
             break;
         case "CATEGORY":
             $val = jb_escape_html(JB_getCatName($this->data[$field_id]));
             break;
         case "RADIO":
             $val = jb_escape_html(JB_getCodeDescription($field_id, $this->data[$field_id]));
             break;
         case "SELECT":
             $val = jb_escape_html(JB_getCodeDescription($field_id, $this->data[$field_id]));
             break;
         case "MSELECT":
         case "CHECK":
             $vals = explode(",", $this->data[$field_id]);
             $comma = '';
             $str = '';
             if (sizeof($vals) > 0) {
                 foreach ($vals as $v) {
                     $str .= $comma . jb_escape_html(JB_getCodeDescription($field_id, $v));
                     $comma = ", ";
                 }
             }
             $val = $str;
             break;
         case "TIME":
             if ($this->data[$field_id] != '0000-00-00 00:00:00') {
                 // convert the time to a local time zone
                 $val = JB_get_local_time($this->data[$field_id] . " GMT");
             }
             break;
         case "DATE":
         case "DATE_CAL":
             if ($this->data[$field_id] != '0000-00-00 00:00:00') {
                 $val = JB_get_local_time($this->data[$field_id] . " GMT");
                 $val = JB_get_formatted_date($val);
             } else {
                 $val = '';
             }
             break;
         case "SKILL_MATRIX":
             $sql = "SELECT name FROM skill_matrix_data where object_id='" . JB_escape_sql($this->data['resume_id']) . "' ";
             $result = JB_mysql_query($sql) or die(mysql_error());
             $val = '';
             $comma = '';
             while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                 $val .= $comma . $row['name'];
                 $comma = ", ";
             }
             break;
         case "TIME":
             // time is used for post_date, resume_date, signup_date, profile_date, etc..
             $val = JB_get_local_time($this->data[$field_id] . " GMT");
             // the time is always stored as GMT
             break;
         case 'TEXTAREA':
         case "TEXT":
             $val = JB_escape_html($this->data[$field_id]);
             // no html allowed in this field
             break;
         case "EDITOR":
             // HTML is allowed for this field
             //assuming that input was sanitized and only allowed HTML is included
             $val = $this->data[$field_id];
             break;
         case 'GMAP':
             $val = 'lat:' . $this->data[$field_id . '_lat'] . '/lng:' . $this->data[$field_id . '_lng'];
             break;
         default:
             $val = false;
             // A plugin can filter the $val value to be returned
             JBPLUG_do_callback('get_template_value_filter', $val, $this->tag_to_field_id[$tmpl]['field_type']);
             if ($val !== false) {
                 return $val;
             } else {
                 // $val is empty which means that it wasn't set by a plugin
                 // escape HTML just in case.
                 $val = JB_escape_html($this->data[$field_id]);
                 // no html allowed in this field
             }
             break;
     }
     if ($field_id == '') {
         //echo '<b>Configuration error: Failed to bind the "'.$tmpl.'" Template Tag. (not defined)</b> <br> ';
     }
     return $val;
 }