Пример #1
0
 /**
  * Идентификаторы предложений из раздела "Сделаю"
  * 
  * @return array ($id => $position)
  */
 public function GetFreelancerOffersIdsPosition()
 {
     $filter = offers_filter::GetFilter($_SESSION["uid"]);
     $fSql = "";
     if ($filter) {
         $fSql = offers_filter::createSqlFilter($filter, "AND");
     }
     global $DB;
     $limit = 10 * freelancer_offers::FRL_COUNT_PAGES;
     $ids = $DB->cache(1800)->rows("SELECT \n                                fo.id \n                            FROM freelance_offers fo\n                            WHERE 1 = 1 {$fSql}\n                            ORDER BY fo.id DESC LIMIT {$limit};\n                            ");
     $mirror = array();
     foreach ($ids as $k => $i) {
         $mirror[$i["id"]] = $k;
     }
     return $mirror;
 }
Пример #2
0
     $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 = '&amp;';
         $has_hidd = false;
         break;
     default:
         $frm_action = '/projects/';
         $frm_action2 = '/';
         $prmd = '?';
 }