init(); } elseif (!empty($_GET['_back'])) { // 別画面から戻ったとき $search_past = $query->load($_GET); $query->load($_REQUEST); unset($_GET['_back']); unset($_GET['_action']); unset($_GET['_update']); } $is_ajax = $_GET['is_ajax']; unset($_GET['is_ajax']); $query->save($_GET); $params = array(); $records = array(); $sql = <<= ? OR end_date is null) SQL; $params[] = PUBLISH_ENTRY_KOUKAI; $params[] = date('Y-m-d'); $params[] = date('Y-m-d'); if(strlen($_GET['model']) > 0) { $model = mb_convert_kana($_GET['model'], 'a'); $sql .= ' AND (model LIKE ? OR title LIKE ?) '; $params[] = '%'.str_replace('ー', '-', $model).'%'; $params[] = '%'.$model.'%'; } //$sql .= " order by CHAR_LENGTH(sort_model) ASC, sort_model ASC "; $sql .= " order by sort_model ASC "; $page_limit = 20; $pager = new VISH_SQL_Pager( $page_limit, $Context->Connection, $sql, $params, $Context->Config['pager/option/content'] ); $records = $pager->data(); // Ajaxリクエストの場合は、パーツHTMLを返す if($is_ajax) { ob_start(); $page_template = 'ajax.html.php'; include_with_param( $page_template, array( 'records' => $records, 'pager' => $pager, ) ); $html = ob_get_clean(); echo $html; exit; } $page_template = 'index.html.php'; include_with_param( $page_template, array( 'records' => $records, 'pager' => $pager, ) );