/** * Возвращает общее количество предложений * * @param unknown_type $filter * @return unknown */ public function getCountFreelancerOffers($filter = false) { global $DB; $fSql = ""; if ($filter) { $fSql = offers_filter::createSqlFilter($filter, "AND"); } $is_block = $is_admin = ""; if (!hasPermissions('projects')) { $is_block = "AND fo.is_blocked = 'f' AND fo.is_closed = 'f' "; $inner_block = "INNER JOIN freelancer f ON f.uid = fo.user_id AND f.is_banned = B'0'"; } return $DB->cache(300)->val("SELECT COUNT(fo.id) as all_cnt FROM freelance_offers as fo {$inner_block} WHERE 1=1 {$is_block} {$fSql};"); }
} if ($_POST['pf_category'] && !$_POST['pf_subcategory']) { $f_category[0][$_POST['pf_category']] = 0; } if ($_POST['pf_subcategory']) { $f_category[1][$_POST['pf_subcategory']] = 1; } $f_only_my_offs = $_POST['pf_only_my_offs'] ? true : false; $offers_filter->Save(get_uid(), $f_category, $f_only_my_offs); break; case "delete_offers_filter": $offers_filter = new offers_filter(); $offers_filter->DeleteFilter(get_uid()); break; case "activate_offers_filter": $offers_filter = new offers_filter(); $offers_filter->ActivateFilter(get_uid()); break; case "delete_offers": if (!hasPermissions('projects')) { break; } $fid = intval($_GET['fid']); $frl_offers->Delete($fid); $page_uri = $_GET['page'] > 1 ? "&page=" . $_GET['page'] : ""; header("Location: /projects/?kind=8{$page_uri}"); break; case "unblock_offers": if (!hasPermissions('projects')) { break; }
// проекты $prj = new new_projects(); $prj_content = $prj->SearchDB($kind, $page, $filter || is_emp() || hasPermissions('projects') ? 0 : 1, $filter, false, true); //echo $prj_content;die; $prj_pos = strpos($prj_content, '<!--data_found-->'); } else { $filter_page = $kind * 10; $filter_params = array('kind' => isset($_GET['kind']) ? intval($_GET['kind']) : intval($_POST['kind'])); // Развернутость / свернутость фильтра. if (isset($_COOKIE['new_pf' . $filter_page])) { $filter_show = $_COOKIE['new_pf' . $filter_page]; } else { $filter_show = 0; setcookie("new_pf" . $filter_page, $filter_show, time() + 60 * 60 * 24 * 30, "/"); } $offers_filter = new offers_filter(); $filter = $offers_filter->GetFilter($uid); $filter_apply = $filter['active'] == "t"; $filter_only_my_offs = $filter['only_my_offs'] == "t"; } switch ($filter_page) { case 1: $frm_action = '/proj/?p=list'; $frm_action2 = '/proj/?p=list'; $prmd = '&'; $has_hidd = false; break; default: $frm_action = '/projects/'; $frm_action2 = '/'; $prmd = '?';