当前位置: 首页>>代码示例>>PHP>>正文


PHP search::searchResume方法代码示例

本文整理汇总了PHP中search::searchResume方法的典型用法代码示例。如果您正苦于以下问题:PHP search::searchResume方法的具体用法?PHP search::searchResume怎么用?PHP search::searchResume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在search的用法示例。


在下文中一共展示了search::searchResume方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 */
$arrFields = array('id_section' => false, 'id_profession' => false, 'id_region' => false, 'id_city' => false, 'chart_work' => false, 'expire_work' => false, 'education' => false, 'age_from' => false, 'age_post' => false, 'pay_from' => false, 'pay_post' => false, 'currency' => false, 'gender' => false, 'user_type' => false, 'period' => false, 'records' => false);
// поиск
if (isset($_GET['id_section'])) {
    // проверяем наличие всех необходимых полей в поисковом запросе
    foreach ($arrFields as $key => $value) {
        !isset($_GET[$key]) ? $arrErrors = ERROR_SEARCH_NONE_REQUIRED_FIELDS : null;
    }
    if (!$arrErrors) {
        // создаем объект
        $search = new search('resume');
        $arrFields = array('id_section' => validate::checkNaturalNumber($_GET['id_section']), 'id_profession' => validate::checkNaturalNumber($_GET['id_profession']), 'id_region' => validate::checkNaturalNumber($_GET['id_region']), 'id_city' => validate::checkNaturalNumber($_GET['id_city']), 'chart_work' => in_array($search->decodeSearchString($_GET['chart_work']), $arrAddDict['ChartWork']['values']) ? $search->decodeSearchString($_GET['chart_work']) : false, 'expire_work' => in_array($search->decodeSearchString($_GET['expire_work']), $arrAddDict['ExpireWorkSearch']['values']) ? $search->decodeSearchString($_GET['expire_work']) : false, 'education' => in_array($search->decodeSearchString($_GET['education']), $arrAddDict['Education']['values']) ? $search->decodeSearchString($_GET['education']) : false, 'age_from' => validate::checkNaturalNumber($_GET['age_from']), 'age_post' => validate::checkNaturalNumber($_GET['age_post']), 'pay_from' => validate::checkNaturalNumber($_GET['pay_from']), 'pay_post' => validate::checkNaturalNumber($_GET['pay_post']), 'currency' => in_array($_GET['currency'], $arrSysDict['Currency']['values']) ? $_GET['currency'] : false, 'gender' => array_key_exists($_GET['gender'], $arrSysDict['Gender']['values']) ? $_GET['gender'] : false, 'user_type' => $_GET['user_type'], 'period' => array_key_exists($_GET['period'], $arrSysDict['SearchPeriod']['values']) ? $_GET['period'] : 0, 'records' => in_array($_GET['records'], $arrSysDict['AnnounceRecords']['values']) ? $_GET['records'] : 5);
        // смещение, всегда 0 (затем берется из $_GET)
        $offset = isset($_GET['offset']) ? (int) abs($_GET['offset']) : 0;
        // производим поиск
        $arrData = $search->searchResume($arrFields + array('offset' => $offset));
        if ($arrData['result']) {
            // формируем ссылку
            $path = 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=search.resume&id_section=' . $arrFields['id_section'] . '&id_profession=' . $arrFields['id_profession'] . '&id_region=' . $arrFields['id_region'] . '&id_city=' . $arrFields['id_city'] . '&chart_work=' . $arrFields['chart_work'] . '&expire_work=' . $arrFields['expire_work'] . '&education=' . $arrFields['education'] . '&age_from=' . $arrFields['age_from'] . '&age_post=' . $arrFields['age_post'] . '&pay_from=' . $arrFields['pay_from'] . '&pay_post=' . $arrFields['pay_post'] . '&currency=' . $arrFields['currency'] . '&gender=' . $arrFields['gender'] . '&user_type=' . $arrFields['user_type'] . '&period=' . $arrFields['period'] . '&records=' . $arrFields['records'] . '&';
            // формируем странциы
            $strPages = strings::generatePage($arrData['records'], $offset, $arrFields['records'], $path, true);
            // передаем в шаблон необходимые данные
            $smarty->assign('link', CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=resume&action=view&id=');
            $smarty->assignByRef('return_data', $arrData['result']);
            $smarty->assignByRef('string_page', $strPages);
        } else {
            $arrErrors[] = MESSAGE_NOT_FOUND_RECORDS;
        }
    }
}
// имя страницы
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:search.resume.php


注:本文中的search::searchResume方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。