Connection); $config_table =& new Production_Table_Configurations($Context->Connection); $config_entries = $config_table->getEntries(); $site_auth =& $Context->getAdminSiteAuth(); $params = array(); $current_date = date('Y-m-d'); $sql = <<= '{$current_date}' OR new_end_date is null)) THEN 1 ELSE 0 END AS is_new FROM products WHERE deleted is null SQL; if($_GET['preview'] === '1' && getIsAdmin($site_auth)) { // 管理画面からのプレビュー $sql .= ' AND id = ? '; $params[] = $_GET['id']; } else { $sql .= ' AND is_published = ? '; $sql .= " and (start_date <= ? OR start_date is null) "; $sql .= " and (end_date >= ? OR end_date is null) "; $params[] = PUBLISH_ENTRY_KOUKAI; $params[] = date('Y-m-d'); $params[] = date('Y-m-d'); } $sql .= " order by date desc, id desc"; $page_limit = $config_entries['product_limit']; $pager = new VISH_SQL_Pager( $page_limit, $Context->Connection, $sql, $params, $Context->Config['pager/option/content'] ); $records = $pager->data(); ob_start(); $page_template = 'index.html.php'; include_with_param( $page_template, array( 'records' => $records, 'pager' => $pager, ) );