Пример #1
0
function JB_delete_post($post_id)
{
    $old_data = JB_load_post_data($post_id);
    JB_delete_post_files($post_id);
    $sql = "DELETE FROM `posts_table` where `post_id`='" . jb_escape_sql($post_id) . "'";
    JB_mysql_query($sql) or die(mysql_error());
    $sql = "DELETE FROM `applications` where `post_id`='" . jb_escape_sql($post_id) . "'";
    JB_mysql_query($sql) or die(mysql_error());
    $sql = "DELETE FROM `saved_jobs` where `post_id`='" . jb_escape_sql($post_id) . "'";
    JB_mysql_query($sql) or die(mysql_error());
    JB_update_post_category_count($old_data);
    // category counters
    JBPLUG_do_callback('delete_post', $post_id);
}
Пример #2
0
                // is it owned by the person who logged in?
                $i++;
                JB_expire_post($post_id);
                JB_update_post_category_count($post_data);
            }
        }
        JB_finalize_post_updates();
        $label['employer_manager_expired_posts'] = str_replace('%COUNT%', $i, $label['employer_manager_expired_posts']);
        $JBMarkup->ok_msg($label["employer_manager_expired_posts"]);
    } else {
        $JBMarkup->error_msg($label["employer_manager_not_selected_exp"]);
    }
}
if (isset($_REQUEST['undo_expire'])) {
    $post_id = (int) $_REQUEST['post_id'];
    $post_data = JB_load_post_data($post_id);
    if ($post_data['user_id'] == $_SESSION['JB_ID']) {
        // is it owned by the person who logged in?
        $sql = "UPDATE posts_table SET expired='N' where post_id='" . jb_escape_sql($post_id) . "' ";
        JB_mysql_query($sql) or $DB_ERROR = mysql_error();
        JB_update_post_category_count($post_data);
    }
    JB_finalize_post_updates();
    $JBMarkup->ok_msg($label['post_unexpire_ok']);
}
jbplug_do_callback('post_manager_action', $A = false);
JB_render_box_top(95, $label['employer_manager_head']);
// set fees flag
if (JB_POSTING_FEE_ENABLED == 'YES' || JB_PREMIUM_POSTING_FEE_ENABLED == 'YES') {
    $_FEES_ENABLED = "YES";
}
Пример #3
0
 function &load($record_id, $user_id = '')
 {
     switch ($this->form_id) {
         case 1:
             // include/posts.inc.php
             $this->set_values(JB_load_post_data($record_id));
             break;
         case 2:
             // include/resumes.inc.php
             $this->set_values(JB_load_resume_data($record_id));
             break;
         case 3:
             // include/profiles.inc.php
             $this->set_values(JB_load_profile_data($record_id, $user_id));
             break;
         case 4:
             // include/employers.inc.php
             $this->set_values(JB_load_employer_data($record_id));
             break;
         case 5:
             // include/candidates.inc.php
             $this->set_values(JB_load_candidate_data($record_id));
             break;
         default:
             $values = null;
             JBPLUG_do_callback('load_values', $values, $this->form_id, $record_id);
             if (is_array($values)) {
                 $this->set_values($values);
             }
             break;
     }
     // now that the fields are initialized and loaded, we can append
     // extra tags to the <head> and <body> sections as needed
     // Tgas will be appended only if JBMarkup is not null
     $this->append_extra_markup();
     return $this->get_values();
 }