path('/modules/system/include/functions.php'); $def_city = system_CleanVars($_REQUEST, 'city', '', 'string'); $def_cate_sn = system_CleanVars($_REQUEST, 'cate_sn', '', 'int'); $def_county = system_CleanVars($_REQUEST, 'county', '', 'string'); $def_keyword = system_CleanVars($_REQUEST, 'keyword', '', 'string'); $and_name=$and_cate_sn=$and_city=""; if(!empty($def_keyword)){ $and_name="and (`name` like '%{$def_keyword}%' or `city` like '%{$def_keyword}%' or `county` like '%{$def_keyword}%' or `addr` like '%{$def_keyword}%')"; }else{ $and_cate_sn = empty($def_cate_sn) ? "" : "and `cate_sn` = '{$def_cate_sn}'"; $and_county = empty($def_county) ? "" : "and `county` = '{$def_county}'"; $and_city = empty($def_city) ? "" : "and `city` = '{$def_city}'"; } //取得分類資料 $phone_book_cate_arr = get_phone_book_cate_arr(); $myts = MyTextSanitizer::getInstance(); $sql = "select * from `" . $xoopsDB->prefix("phone_book") . "` where 1 $and_cate_sn $and_county $and_city $and_name"; $result = $xoopsDB->query($sql) or web_error($sql); $html="