function lists() { global $viewhelper, $pos; using("industry", "area"); $area = new Areas(); $industry = new Industries(); $conditions[] = "Job.status=1"; $viewhelper->setTitle(L("hr_information", "tpl")); $viewhelper->setPosition(L("hr_information", "tpl"), "index.php?do=job&action=" . __FUNCTION__); if (!empty($_GET['q'])) { $title = trim($_GET['q']); $conditions[] = "Job.name like '%" . $title . "%'"; } if (!empty($_GET['data']['salary_id'])) { $conditions[] = "Job.salary_id=" . intval($_GET['data']['salary_id']); } if (!empty($_GET['data']['area_id'])) { $conditions[] = "Job.area_id=" . intval($_GET['data']['area_id']); } if (isset($_GET['industryid'])) { $industry_id = intval($_GET['industryid']); $tmp_info = $industry->setInfo($industry_id); if (!empty($tmp_info)) { $conditions[] = "Job.industry_id=" . $tmp_info['id']; $viewhelper->setTitle($tmp_info['name']); $viewhelper->setPosition($tmp_info['name'], "index.php?do=job&action=" . __FUNCTION__ . "&industryid=" . $tmp_info['id']); } } if (isset($_GET['areaid'])) { $area_id = intval($_GET['areaid']); $tmp_info = $area->setInfo($area_id); if (!empty($tmp_info)) { $conditions[] = "Job.area_id=" . $tmp_info['id']; $viewhelper->setTitle($tmp_info['name']); $viewhelper->setPosition($tmp_info['name'], "index.php?do=job&action=" . __FUNCTION__ . "&areaid=" . $tmp_info['id']); } } $amount = $this->job->findCount(null, $conditions, "Job.id"); $result = $this->job->findAll("Job.*,Job.cache_spacename AS userid,Job.created AS pubdate,(select Company.name from " . $this->job->table_prefix . "companies Company where Company.id=Job.id) AS companyname", null, $conditions, "Job.id DESC", $pos, $this->displaypg); $viewhelper->setTitle(L("search", "tpl")); $viewhelper->setPosition(L("search", "tpl")); setvar("items", $result); setvar("paging", array('total' => $amount)); render("job/list", 1); }
function lists() { global $pos; require CACHE_COMMON_PATH . "cache_type.php"; $_PB_CACHE['area'] = cache_read("area"); $_PB_CACHE['industry'] = cache_read("industry"); using("area"); $area = new Areas(); $conditions = array(); $this->view_helper->setTitle(L("fair", "tpl")); $this->view_helper->setPosition(L("fair", "tpl"), "index.php?do=fair"); if (!empty($_GET['q'])) { $conditions[] = "name like '%" . $_GET['q'] . "%'"; } if (!empty($_GET['type'])) { if ($_GET['type'] == "commend") { $conditions[] = "if_commend=1"; } } if (!empty($_GET['typeid'])) { $type_id = intval($_GET['typeid']); $conditions[] = "expotype_id=" . $type_id; $type_name = $_PB_CACHE['expotype'][$type_id]; $this->view_helper->setTitle($type_name); $this->view_helper->setPosition($type_name, "index.php?do=fair&action=lists&typeid=" . $type_id); } if (isset($_GET['areaid'])) { $area_id = intval($_GET['areaid']); $tmp_info = $area->setInfo($area_id); if (!empty($tmp_info)) { $conditions[] = "area_id" . $tmp_info['level'] . "=" . $tmp_info['id']; $this->view_helper->setTitle($tmp_info['name']); $this->view_helper->setPosition($tmp_info['name'], "index.php?do=fair&action=lists&areaid=" . $tmp_info['id']); } } $amount = $this->expo->findCount(null, $conditions); $result = $this->expo->findAll("*", null, $conditions, "id desc", $pos, $this->displaypg); if (!empty($result)) { for ($i = 0; $i < count($result); $i++) { if ($result[$i]['begin_time']) { $result[$i]['begin_date'] = df($result[$i]['begin_time']); } if ($result[$i]['end_time']) { $result[$i]['end_date'] = df($result[$i]['end_time']); } $result[$i]['description'] = mb_substr(strip_tags(trim(pb_lang_split($result[$i]['description']))), 0, 100); $result[$i]['typename'] = $_PB_CACHE['expotype'][$result[$i]['expotype_id']]; $result[$i]['title'] = pb_lang_split($result[$i]['name']); if (isset($result[$i]['picture'])) { $result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '', 'small'); } if (!empty($result[$i]['area_id'])) { $result[$i]['area'] = "(" . $_PB_CACHE['area'][1][$result[$i]['area_id']] . ")"; } } setvar("items", $result); } setvar("Areas", $_PB_CACHE['area']); setvar("Type", $_PB_CACHE['expotype']); $this->view_helper->setTitle(L("search", "tpl")); $this->view_helper->setPosition(L("search", "tpl")); setvar("paging", array('total' => $amount)); render("fair/list"); }
} if (!empty($_GET['type'])) { if ($_GET['type'] == "commend") { $conditions[] = "if_commend=1"; } } if (!empty($_GET['typeid'])) { $type_id = intval($_GET['typeid']); $conditions[] = "expotype_id=" . $type_id; $type_name = $_PB_CACHE['expotype'][$type_id]; $viewhelper->setTitle($type_name); $viewhelper->setPosition($type_name, "fair/list.php?typeid=" . $type_id); } if (isset($_GET['areaid'])) { $area_id = intval($_GET['areaid']); $tmp_info = $area->setInfo($area_id); if (!empty($tmp_info)) { $conditions[] = "area_id" . $tmp_info['level'] . "=" . $tmp_info['id']; $viewhelper->setTitle($tmp_info['name']); $viewhelper->setPosition($tmp_info['name'], "fair/list.php?areaid=" . $tmp_info['id']); } } $amount = $expo->findCount(null, $conditions); $result = $expo->findAll("*", null, $conditions, "id desc", $pos, $limit); if (!empty($result)) { for ($i = 0; $i < count($result); $i++) { if ($result[$i]['begin_time']) { $result[$i]['begin_date'] = df($result[$i]['begin_time']); } if ($result[$i]['end_time']) { $result[$i]['end_date'] = df($result[$i]['end_time']);
/** * search * @list */ function lists() { global $G, $viewhelper, $pos; uses("trade", "industry", "area", "tradefield", "form", "tag"); $trusttypes = cache_read("trusttype"); $countries = cache_read("country"); $membergroups = cache_read("membergroup"); $area = new Areas(); $offer = new Tradefields(); $trade = new Trades(); $form = new Forms(); $industry = new Industries(); $tag = new Tags(); $conditions = array(); $industry_id = $area_id = 0; $conditions[] = "t.status=1"; !empty($_GET) && ($_GET = clear_html($_GET)); if (isset($_GET['navid'])) { setvar("nav_id", intval($_GET['navid'])); } $viewhelper->setTitle(L('offer', 'tpl')); $viewhelper->setPosition(L('offer', 'tpl'), "index.php?do=offer"); $trade_types = cache_read("type", "offertype"); if (isset($_GET['typeid'])) { $type_id = intval($_GET['typeid']); $conditions[] = "t.type_id='" . $type_id . "'"; setvar("typeid", $type_id); $type_name = $trade_types[$type_id]; $viewhelper->setTitle($type_name); $viewhelper->setPosition($type_name, "index.php?do=offer&action=lists&typeid=" . $type_id); } if (isset($_GET['industryid'])) { $industry_id = intval($_GET['industryid']); $tmp_info = $industry->setInfo($industry_id); if (!empty($tmp_info)) { $sub_ids = $industry->getSubDatas($tmp_info['id']); $sub_ids = array_keys($sub_ids); $conditions[] = "t.industry_id IN (" . implode(",", $sub_ids) . ")"; $viewhelper->setTitle($tmp_info['name']); $viewhelper->setPosition($tmp_info['name'], "index.php?do=offer&action=lists&industryid=" . $tmp_info['id']); } } if (isset($_GET['areaid'])) { $area_id = intval($_GET['areaid']); $tmp_info = $area->setInfo($area_id); if (!empty($tmp_info)) { $sub_ids = $area->getSubDatas($tmp_info['id']); $sub_ids = array_keys($sub_ids); $conditions[] = "t.area_id IN (" . implode(",", $sub_ids) . ")"; $viewhelper->setTitle($tmp_info['name']); $viewhelper->setPosition($tmp_info['name'], "index.php?do=offer&action=lists&areaid=" . $tmp_info['id']); } } if (isset($_GET['type'])) { if ($_GET['type'] == "urgent") { $conditions[] = "t.if_urgent='1'"; } } if (!empty($_GET['price_start']) || !empty($_GET['price_end'])) { $conditions[] = "t.price BETWEEN " . intval($_GET['price_start']) . " AND " . intval($_GET['price_end']); } if (!empty($_GET['picture'])) { $conditions[] = "t.picture!=''"; } if (!empty($_GET['urgent'])) { $conditions[] = "t.if_urgent=1"; } if (!empty($_GET['commend'])) { $conditions[] = "t.if_commend=1"; } if (!empty($_GET['country'])) { $conditions[] = "t.country_id='" . intval($_GET['country']) . "'"; } if (!empty($_GET['sure'])) { $conditions[] = "m.trusttype_ids='" . intval($_GET['sure']) . "'"; } if (!empty($_GET['date'])) { $d = intval($_GET['date']); if ($d <= 7948800) { $conditions[] = "t.submit_time<='" . intval($_GET['date']) . "'"; } } if (isset($_GET['q'])) { $searchkeywords = $_GET['q']; $viewhelper->setTitle(L("search_in_keyword", "tpl", $searchkeywords)); $viewhelper->setPosition(L("search_in_keyword", "tpl", $searchkeywords)); $conditions[] = "t.title like '%" . $searchkeywords . "%'"; setvar("highlight_str", $searchkeywords); } if (isset($_GET['pubdate'])) { switch ($_GET['pubdate']) { case "l3": $conditions[] = "t.submit_time>" . ($offer->timestamp - 3 * 86400); break; case "l10": $conditions[] = "t.submit_time>" . ($offer->timestamp - 10 * 86400); break; case "l30": $conditions[] = "t.submit_time>" . ($offer->timestamp - 30 * 86400); break; default: break; } } if ($G['setting']['offer_expire_method'] == 2 || $G['setting']['offer_expire_method'] == 3) { $conditions[] = "t.expire_time>" . $offer->timestamp; } $amount = $trade->findCount(null, $conditions, null, "t"); $result = $trade->getRenderDatas($conditions, $G['setting']['offer_filter']); $important_result = $trade->getStickyDatas(); setvar("StickyItems", $important_result); setvar('items', $result); setvar('trusttype', $trusttypes); setvar('countries', $countries); setvar("paging", array('total' => $amount)); render("offer/list"); }