本文整理汇总了PHP中SC_Query::setlimitoffset方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::setlimitoffset方法的具体用法?PHP SC_Query::setlimitoffset怎么用?PHP SC_Query::setlimitoffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Query
的用法示例。
在下文中一共展示了SC_Query::setlimitoffset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if ($_POST['mode'] == "search") {
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の強制変換
$this->lfConvertParam();
$where = "del_flg = 0 AND status = 1";
/* 入力エラーなし */
foreach ($this->arrForm as $key => $val) {
if ($val == "") {
continue;
}
switch ($key) {
case 'search_name':
$where .= " AND name ILIKE ?";
$arrval[] = "%{$val}%";
break;
case 'search_category_id':
list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($val);
if ($tmp_where != "") {
$where .= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")";
$arrval = array_merge((array) $arrval, (array) $tmp_arrval);
}
break;
case 'search_product_code':
$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ? GROUP BY product_id)";
$arrval[] = "{$val}%";
break;
default:
break;
}
}
$order = "update_date DESC, product_id DESC";
// 読み込む列とテーブルの指定
$col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
$from = "vw_products_nonclass AS noncls ";
$objQuery = new SC_Query();
// 行数の取得
if (empty($arrval)) {
$arrval = array();
}
$linemax = $objQuery->count("dtb_products", $where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの処理
if (isset($_POST['search_page_max']) && is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
}
// カテゴリ取得
$this->arrCatList = $objDb->sfGetCategoryList();
//---- ページ表示
$objView->assignobj($this);
$objView->display($this->tpl_mainpage);
}
示例2: mobileProcess
/**
* Page のプロセス(モバイル).
*
* @return void
*/
function mobileProcess()
{
$objView = new SC_MobileView();
$objCustomer = new SC_Customer();
$offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
$next = $offset;
// レイアウトデザインを取得
$objLayout = new SC_Helper_PageLayout_Ex();
$objLayout->sfGetPageLayout($this, false, DEF_LAYOUT);
// 規約内容の取得
$objQuery = new SC_Query();
$count = $objQuery->count("dtb_kiyaku", "del_flg <> 1");
$objQuery->setorder("rank DESC");
$objQuery->setlimitoffset(1, $offset);
$arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1");
if ($count > $offset + 1) {
$next++;
} else {
$next = -1;
}
$max = count($arrRet);
$this->tpl_kiyaku_text = "";
for ($i = 0; $i < $max; $i++) {
$this->tpl_kiyaku_text .= $arrRet[$i]['kiyaku_title'] . "\n\n";
$this->tpl_kiyaku_text .= $arrRet[$i]['kiyaku_text'] . "\n\n";
}
$objView->assign("offset", $next);
$objView->assignobj($this);
$objView->display(SITE_FRAME);
}
示例3: process
//.........这里部分代码省略.........
$arrval[] = $date;
break;
case 'search_ebirthyear':
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_ebirthyear'], $_POST['search_ebirthmonth'], $_POST['search_ebirthday'], true);
$where .= " AND order_birth <= ?";
$arrval[] = $date;
break;
case 'search_order_status':
$where .= " AND status = ?";
$arrval[] = $val;
break;
default:
if (!isset($arrval)) {
$arrval = array();
}
break;
}
}
$order = "update_date DESC";
switch ($_POST['mode']) {
case 'csv':
require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
$objCSV = new SC_Helper_CSV_Ex();
// オプションの指定
$option = "ORDER BY {$order}";
// CSV出力タイトル行の作成
$arrCsvOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(3, " WHERE csv_id = 3 AND status = 1"));
if (count($arrCsvOutput) <= 0) {
break;
}
$arrCsvOutputCols = $arrCsvOutput['col'];
$arrCsvOutputTitle = $arrCsvOutput['disp_name'];
$head = SC_Utils_Ex::sfGetCSVList($arrCsvOutputTitle);
$data = $objCSV->lfGetCSV("dtb_order", $where, $option, $arrval, $arrCsvOutputCols);
// CSVを送信する。
SC_Utils_Ex::sfCSVDownload($head . $data);
exit;
break;
case 'pdf':
$objFpdf = new SC_Fpdf(1, '納品書');
$objFpdf->setData($arrRet);
$objFpdf->createPdf();
break;
case 'delete_all':
// 検索結果をすべて削除
$sqlval['del_flg'] = 1;
$objQuery = new SC_Query();
$objQuery->update("dtb_order", $sqlval, $where, $arrval);
break;
default:
// 読み込む列とテーブルの指定
$col = "*";
$from = "dtb_order";
$objQuery = new SC_Query();
// 行数の取得
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの処理
if (is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($this->arrHidden['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->arrPagenavi = $objNavi->arrPagenavi;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrResults = $objQuery->select($col, $from, $where, $arrval);
}
}
break;
default:
break;
}
$objDate = new SC_Date();
// 登録・更新日検索用
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE("Y"));
$this->arrRegistYear = $objDate->getYear();
// 生年月日検索用
$objDate->setStartYear(BIRTH_YEAR);
$objDate->setEndYear(DATE("Y"));
$this->arrBirthYear = $objDate->getYear();
// 月日の設定
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
// 入力値の取得
$this->arrForm = $this->objFormParam->getFormParamList();
// 支払い方法の取得
$arrRet = $objDb->sfGetPayment();
$this->arrPayment = SC_Utils_Ex::sfArrKeyValue($arrRet, 'payment_id', 'payment_method');
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例4: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
//---- ページ初期設定
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objDate = new SC_Date();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_GET['send_id'])) {
$_GET['send_id'] = "";
}
if (!isset($_GET['mode'])) {
$_GET['mode'] = "";
}
if (!isset($_POST['search_pageno'])) {
$_POST['search_pageno'] = "";
}
// 削除時
if (SC_Utils_Ex::sfCheckNumLength($_GET['send_id']) && $_GET['mode'] == 'delete') {
$sql = "UPDATE dtb_send_history SET del_flg = 1 WHERE send_id = ?";
$conn->query($sql, array($_GET['send_id']));
$_SERVER['QUERY_STRING'] = "";
$this->reload();
}
$col = "*";
$from = "dtb_send_history";
$where = " del_flg = ?";
$arrval[] = "0";
$objQuery = new SC_Query();
// 行数の取得
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの取得
$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, SEARCH_PMAX, "fnNaviSearchPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset(SEARCH_PMAX, $startno);
// 表示順序
$order = "start_date DESC, send_id DESC";
$objQuery->setorder($order);
// 検索結果の取得
$this->arrDataList = $objQuery->select($col, $from, $where, $arrval);
//---- ページ表示
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例5: process
//.........这里部分代码省略.........
$arrval[] = "%{$val}%";
break;
case 'search_reviewer_url':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND reviewer_url ILIKE ? ";
$arrval[] = "%{$val}%";
break;
case 'search_name':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND name ILIKE ? ";
$arrval[] = "%{$val}%";
break;
case 'search_product_code':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND A.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? )";
$arrval[] = "%{$val}%";
break;
case 'search_sex':
$tmp_where = "";
//$val=配列の中身,$element=各キーの値(1,2)
if (is_array($val)) {
foreach ($val as $element) {
if ($element != "") {
if ($tmp_where == "") {
$tmp_where .= " AND (sex = ?";
} else {
$tmp_where .= " OR sex = ?";
}
$arrval[] = $element;
}
}
if ($tmp_where != "") {
$tmp_where .= ")";
$where .= " {$tmp_where} ";
}
}
break;
case 'search_recommend_level':
$where .= " AND recommend_level = ? ";
$arrval[] = $val;
break;
case 'search_startyear':
if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) {
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']);
$where .= " AND A.create_date >= ? ";
$arrval[] = $date;
}
break;
case 'search_endyear':
if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) {
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']);
$end_date = date("Y/m/d", strtotime("1 day", strtotime($date)));
$where .= " AND A.create_date <= cast('{$end_date}' as date) ";
}
break;
}
}
}
$order = "A.create_date DESC";
// ページ送りの処理
if (is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
if (!isset($arrval)) {
$arrval = array();
}
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
$this->tpl_pageno = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
// ページ送りの取得
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
$this->arrPagenavi = $objNavi->arrPagenavi;
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
//検索結果の取得
$this->arrReview = $objQuery->select($select, $from, $where, $arrval);
//CSVダウンロード
if ($_POST['mode'] == 'csv') {
$objCSV = new SC_Helper_CSV_Ex();
// オプションの指定
$option = "ORDER BY review_id";
// CSV出力タイトル行の作成
$head = SC_Utils_Ex::sfGetCSVList($objCSV->arrREVIEW_CVSTITLE);
$data = $objCSV->lfGetReviewCSV($where, '', $arrval);
// CSVを送信する。
SC_Utils_Ex::sfCSVDownload($head . $data);
exit;
}
}
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例6: mobileProcess
/**
* Page のプロセス(モバイル).
*
* @return void
*/
function mobileProcess()
{
define("HISTORY_NUM", 5);
$objView = new SC_MobileView();
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
$pageNo = isset($_GET['pageno']) ? (int) $_GET['pageno'] : 0;
// TODO
// ログインチェック
if (!isset($_SESSION['customer'])) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
}
$col = "order_id, create_date, payment_id, payment_total";
$from = "dtb_order";
$where = "del_flg = 0 AND customer_id=?";
$arrval = array($objCustomer->getvalue('customer_id'));
$order = "order_id DESC";
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset(HISTORY_NUM, $pageNo);
// 表示順序
$objQuery->setorder($order);
//購入履歴の取得
$this->arrOrder = $objQuery->select($col, $from, $where, $arrval);
// next
if ($pageNo + HISTORY_NUM < $linemax) {
$next = "<a href='history.php?pageno=" . ($pageNo + HISTORY_NUM) . "'>次へ→</a>";
} else {
$next = "";
}
// previous
if ($pageNo - HISTORY_NUM > 0) {
$previous = "<a href='history.php?pageno=" . ($pageNo - HISTORY_NUM) . "'>←前へ</a>";
} elseif ($pageNo == 0) {
$previous = "";
} else {
$previous = "<a href='history.php?pageno=0'>←前へ</a>";
}
// bar
if ($next != '' && $previous != '') {
$bar = " | ";
} else {
$bar = "";
}
$this->tpl_strnavi = $previous . $bar . $next;
$objView->assignobj($this);
//$objpage内の全てのテンプレート変数をsmartyに格納
$objView->display(SITE_FRAME);
//パスとテンプレート変数の呼び出し、実行
}
示例7: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_AdminView();
// POSTのモードがsearchなら顧客検索開始
if ($_POST['mode'] == 'search') {
$this->objFormParam = new SC_FormParam();
// 値の初期化
$this->lfInitParam();
// POST値の取得
$this->objFormParam->setParam($_POST);
// 入力値の変換
$this->objFormParam->convParam();
// 入力された値を取得する
$arrForm = $this->objFormParam->getHashArray();
// エラーチェック
$this->arrErr = $this->lfCheckError();
if (is_array($this->arrErr) === true && 0 < count($this->arrErr)) {
$is_select = false;
} else {
$where = "del_flg = 0";
// 検索
foreach ($arrForm as $tmp_key => $val) {
if (is_array($val) === false && 0 < strlen($val)) {
$key = strtr($tmp_key, array('search_' => ''));
switch ($key) {
case 'customer_id':
$where .= " AND customer_id = ? ";
$sqlval[$key] = $val;
break;
case 'name01':
$where .= " AND name01 ILIKE ? ";
$sqlval[$key] = '%' . $val . '%';
break;
case 'name02':
$where .= " AND name02 ILIKE ? ";
$sqlval[$key] = '%' . $val . '%';
break;
case 'kana01':
$where .= " AND kana01 ILIKE ? ";
$sqlval[$key] = '%' . $val . '%';
break;
case 'kana02':
$where .= " AND kana02 ILIKE ? ";
$sqlval[$key] = '%' . $val . '%';
break;
default:
break;
}
}
}
$is_select = true;
}
if ($is_select === true) {
$objQuery = new SC_Query();
// 既に購入した事がある顧客を取得
$col = '*';
$from = 'dtb_customer';
$order = 'customer_id';
$arrCustomer = $objQuery->select($col, $from, $where, $sqlval);
// 顧客情報を取得できたら、テンプレートに
if (is_array($arrCustomer) === true && count($arrCustomer) > 0) {
$customer_count = count($arrCustomer);
if ($customer_count != 0) {
$this->tpl_linemax = $customer_count;
}
} else {
$this->tpl_linemax = null;
}
// ページ送りの処理
if (isset($_POST['search_page_max']) && is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($_POST['search_pageno'], $customer_count, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrCustomer = $objQuery->select($col, $from, $where, $sqlval);
}
}
// 画面の表示
$this->arrForm = $arrForm;
$objView->assignobj($this);
$objView->display($this->tpl_mainpage);
}
示例8: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_SiteView();
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
// レイアウトデザインを取得
$objLayout = new SC_Helper_PageLayout_Ex();
$objLayout->sfGetPageLayout($this, false, "mypage/index.php");
// ログインチェック
if (!$objCustomer->isLoginSuccess()) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
} else {
//マイページトップ顧客情報表示用
$this->CustomerName1 = $objCustomer->getvalue('name01');
$this->CustomerName2 = $objCustomer->getvalue('name02');
$this->CustomerPoint = $objCustomer->getvalue('point');
}
//ページ送り用
if (isset($_POST['pageno'])) {
$this->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE);
}
$col = "order_id, create_date, payment_id, payment_total";
$from = "dtb_order";
$where = "del_flg = 0 AND customer_id=?";
$arrval = array($objCustomer->getvalue('customer_id'));
$order = "order_id DESC";
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// ページ送りの取得
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset(SEARCH_PMAX, $startno);
// 表示順序
$objQuery->setorder($order);
//購入履歴の取得
$this->arrOrder = $objQuery->select($col, $from, $where, $arrval);
// 支払い方法の取得
$objDb = new SC_Helper_DB_Ex();
$this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
$objView->assignobj($this);
//$objpage内の全てのテンプレート変数をsmartyに格納
$objView->display(SITE_FRAME);
//パスとテンプレート変数の呼び出し、実行
}
示例9: process
//.........这里部分代码省略.........
}
$arrval[] = $element;
}
}
if ($tmp_where != "") {
$tmp_where .= ")";
$where .= " {$tmp_where}";
$view_where .= " {$tmp_where}";
}
break;
default:
break;
}
}
$order = "update_date DESC, product_id DESC";
$objQuery = new SC_Query();
switch ($_POST['mode']) {
case 'csv':
require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
$objCSV = new SC_Helper_CSV_Ex();
// オプションの指定
$option = "ORDER BY {$order}";
// CSV出力タイトル行の作成
$arrOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1"));
if (count($arrOutput) <= 0) {
break;
}
$arrOutputCols = $arrOutput['col'];
$arrOutputTitle = $arrOutput['disp_name'];
$head = SC_Utils_Ex::sfGetCSVList($arrOutputTitle);
$data = $objCSV->lfGetProductsCSV($where, $option, $arrval, $arrOutputCols);
// CSVを送信する。
SC_Utils_Ex::sfCSVDownload($head . $data);
exit;
break;
case 'delete_all':
// 検索結果の取得
$col = "product_id";
$from = "vw_products_nonclass AS noncls ";
$arrProducts = $objQuery->select($col, $from, $where, $arrval);
// 検索結果をすべて削除
$sqlval['del_flg'] = 1;
$where = "product_id = ?";
if (count($arrProducts) > 0) {
foreach ($arrProducts as $key => $val) {
$objQuery->update("dtb_products", $sqlval, $where, array($arrProducts[$key]["product_id"]));
}
}
break;
default:
// 読み込む列とテーブルの指定
$col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited";
$from = "vw_products_nonclass AS noncls ";
// 行数の取得
$linemax = $objQuery->count("dtb_products", $view_where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの処理
if (is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($this->arrHidden['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->arrPagenavi = $objNavi->arrPagenavi;
//キャンペーン商品検索時は、全結果の商品IDを変数に格納する
if (isset($_POST['search_mode']) && $_POST['search_mode'] == 'campaign') {
$arrRet = $objQuery->select($col, $from, $where, $arrval);
if (count($arrRet) > 0) {
$arrRet = sfSwapArray($arrRet);
$pid = implode("-", $arrRet['product_id']);
$this->arrHidden['campaign_product_id'] = $pid;
}
}
// 取得範囲の指定(開始行番号、行数のセット)
// if(DB_TYPE != "mysql") $objQuery->setlimitoffset($page_max, $startno);
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
// 各商品ごとのカテゴリIDを取得
if (count($this->arrProducts) > 0) {
foreach ($this->arrProducts as $key => $val) {
$this->arrProducts[$key]["categories"] = $objDb->sfGetCategoryId($val["product_id"]);
$objDb->g_category_on = false;
}
}
}
}
}
// カテゴリの読込
list($this->arrCatKey, $this->arrCatVal) = $objDb->sfGetLevelCatList(false);
$this->arrCatList = $this->lfGetIDName($this->arrCatKey, $this->arrCatVal);
// 画面の表示
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例10: lfGetProduct
function lfGetProduct($category_id)
{
$objQuery = new SC_Query();
$col = "T2.product_id, name, main_list_image, T2.rank, product_code";
$table = "vw_products_nonclass AS noncls " . " LEFT JOIN dtb_product_categories AS T2 USING (product_id)";
$where = "del_flg = 0 AND T2.category_id = ?";
// 行数の取得
$linemax = $objQuery->count($table, $where, array($category_id));
// 該当件数表示用
$this->tpl_linemax = $linemax;
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->tpl_start_row = $objNavi->start_row;
$this->tpl_strnavi = $objNavi->strnavi;
// Navi表示文字列
$this->tpl_pagemax = $objNavi->max_page;
// ページ最大数(「上へ下へ」表示判定用)
$this->tpl_disppage = $objNavi->now_page;
// 表示ページ番号(「上へ下へ」表示判定用)
// 取得範囲の指定(開始行番号、行数のセット)
if (DB_TYPE != "mysql") {
$objQuery->setlimitoffset(SEARCH_PMAX, $startno);
}
$objQuery->setorder("rank DESC");
$arrRet = $objQuery->select($col, $table, $where, array($category_id));
return $arrRet;
}
示例11: lfStatusDisp
function lfStatusDisp($status, $pageno)
{
$objQuery = new SC_Query();
$select = "*";
$from = "dtb_order";
$where = "del_flg = 0 AND status = ?";
$arrval[] = $status;
$order = "order_id DESC";
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// ページ送りの処理
$page_max = ORDER_STATUS_MAX;
// ページ送りの取得
$objNavi = new SC_PageNavi($pageno, $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
$this->tpl_pageno = $pageno;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
//表示順序
$objQuery->setorder($order);
//検索結果の取得
$this->arrStatus = $objQuery->select($select, $from, $where, $arrval);
}
示例12: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_SiteView();
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
// レイアウトデザインを取得
$objLayout = new SC_Helper_PageLayout_Ex();
$objLayout->sfGetPageLayout($this, false, "mypage/index.php");
// ログインチェック
if (!$objCustomer->isLoginSuccess()) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
} else {
//マイページトップ顧客情報表示用
$this->CustomerName1 = $objCustomer->getvalue('name01');
$this->CustomerName2 = $objCustomer->getvalue('name02');
$this->CustomerPoint = $objCustomer->getvalue('point');
}
// お気に入り削除
if ($_POST['mode'] == 'delete_favorite') {
$customer_id = $objCustomer->getValue('customer_id');
$this->lfDeleteFavoriteProduct($customer_id, $_POST['product_id']);
}
//ページ送り用
if (isset($_POST['pageno'])) {
$this->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE);
}
$col = "*";
$from = " (SELECT\r\n T2.product_id AS product_id_main,\r\n T2.del_flg ,\r\n T2.status ,\r\n T2.name ,\r\n T2.main_list_image ,\r\n T1.create_date ,\r\n T1.customer_id\r\n FROM\r\n (SELECT\r\n product_id AS product_id_c ,\r\n create_date ,\r\n customer_id\r\n FROM\r\n dtb_customer_favorite_products\r\n ) AS T1 INNER JOIN dtb_products AS T2 ON T1.product_id_c = T2.product_id\r\n ) AS T3 INNER JOIN\r\n (SELECT\r\n product_id ,\r\n MIN(price02) AS price02_min ,\r\n MAX(price02) AS price02_max ,\r\n MAX(stock) AS stock_max ,\r\n MAX(stock_unlimited) AS stock_unlimited_max\r\n FROM\r\n dtb_products_class\r\n GROUP BY\r\n product_id\r\n ) AS T4 ON T3.product_id_main = T4.product_id";
$where = "customer_id = ? AND del_flg = 0 AND status = 1";
// 在庫無し商品の非表示
if (NOSTOCK_HIDDEN === true) {
$where .= " AND (stock_max >= 1 OR stock_unlimited_max = 1)";
}
$order = "create_date DESC";
$arrval = array($objCustomer->getvalue('customer_id'));
//お気に入りの数を取得
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
// ページ送りの取得
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset(SEARCH_PMAX, $startno);
// 表示順序
$objQuery->setorder($order);
//お気に入りの取得
$this->arrFavorite = $objQuery->select($col, $from, $where, $arrval);
// パラメータ管理クラス
$this->objFormParam = new SC_FormParam();
// POST値の取得
$this->objFormParam->setParam($_POST);
// 入力情報を渡す
$this->arrForm = $this->objFormParam->getFormParamList();
$objView->assignobj($this);
//$objpage内の全てのテンプレート変数をsmartyに格納
$objView->display(SITE_FRAME);
//パスとテンプレート変数の呼び出し、実行
}
示例13: lfDispProductsList
function lfDispProductsList($category_id, $name, $disp_num, $orderby)
{
$objQuery = new SC_Query();
$objDb = new SC_Helper_DB_Ex();
$this->tpl_pageno = defined("MOBILE_SITE") ? @$_GET['pageno'] : @$_POST['pageno'];
//表示順序
switch ($orderby) {
//価格順
case 'price':
$col = "DISTINCT price02_min, product_id, product_code_min, product_code_max," . " name, comment1, comment2, comment3," . " main_list_comment, main_image, main_list_image," . " price01_min, price01_max, price02_max," . " stock_min, stock_max, stock_unlimited_min, stock_unlimited_max," . " point_rate, sale_limit, sale_unlimited, deliv_date_id, deliv_fee," . " status, product_flag, create_date, del_flg";
$from = "vw_products_allclass AS T1";
$order = "price02_min, product_id";
break;
//新着順
//新着順
case 'date':
$col = "DISTINCT create_date, product_id, product_code_min, product_code_max," . " name, comment1, comment2, comment3," . " main_list_comment, main_image, main_list_image," . " price01_min, price01_max, price02_min, price02_max," . " stock_min, stock_max, stock_unlimited_min, stock_unlimited_max," . " point_rate, sale_limit, sale_unlimited, deliv_date_id, deliv_fee," . " status, product_flag, del_flg";
$from = "vw_products_allclass AS T1";
$order = "create_date DESC, product_id";
break;
default:
$col = "DISTINCT T1.product_id, product_code_min, product_code_max," . " price01_min, price01_max, price02_min, price02_max," . " stock_min, stock_max, stock_unlimited_min," . " stock_unlimited_max, del_flg, status, name, comment1," . " comment2, comment3, main_list_comment, main_image," . " main_list_image, product_flag, deliv_date_id, sale_limit," . " point_rate, sale_unlimited, create_date, deliv_fee, " . " T4.product_rank, T4.category_rank";
$from = "vw_products_allclass AS T1" . " JOIN (" . " SELECT max(T3.rank) AS category_rank," . " max(T2.rank) AS product_rank," . " T2.product_id" . " FROM dtb_product_categories T2" . " JOIN dtb_category T3 USING (category_id)" . " GROUP BY product_id) AS T4 USING (product_id)";
$order = "T4.category_rank DESC, T4.product_rank DESC";
break;
}
// 商品検索条件の作成(未削除、表示)
$where = "del_flg = 0 AND status = 1 ";
// カテゴリからのWHERE文字列取得
if ($category_id) {
list($tmp_where, $arrval) = $objDb->sfGetCatWhere($category_id);
if ($tmp_where != "") {
$where .= " AND {$tmp_where}";
}
}
// 商品名をwhere文に
$name = ereg_replace(",", "", $name);
// XXX
// 全角スペースを半角スペースに変換
$name = str_replace(' ', ' ', $name);
// スペースでキーワードを分割
$names = preg_split("/ +/", $name);
// 分割したキーワードを一つずつwhere文に追加
foreach ($names as $val) {
if (strlen($val) > 0) {
$where .= " AND ( name ILIKE ? OR comment3 ILIKE ?) ";
$ret = SC_Utils_Ex::sfManualEscape($val);
$arrval[] = "%{$ret}%";
$arrval[] = "%{$ret}%";
}
}
if (empty($arrval)) {
$arrval = array();
}
// 行数の取得
$linemax = count($objQuery->getAll("SELECT DISTINCT product_id " . "FROM vw_products_allclass AS allcls " . (!empty($where) ? " WHERE " . $where : ""), $arrval));
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの取得
$this->objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, $disp_num, "fnNaviPage", NAVI_PMAX);
$strnavi = $this->objNavi->strnavi;
$strnavi = str_replace('onclick="fnNaviPage', 'onclick="form1.mode.value=\'' . '\'; fnNaviPage', $strnavi);
// 表示文字列
$this->tpl_strnavi = empty($strnavi) ? " " : $strnavi;
$startno = $this->objNavi->start_row;
// 開始行
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($disp_num, $startno);
// 表示順序
$objQuery->setorder($order);
// 検索結果の取得
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
// 規格名一覧
$arrClassName = $objDb->sfGetIDValueList("dtb_class", "class_id", "name");
// 規格分類名一覧
$arrClassCatName = $objDb->sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
// 規格セレクトボックス設定
if ($disp_num == 15) {
for ($i = 0; $i < count($this->arrProducts); $i++) {
$this->lfMakeSelect($this->arrProducts[$i]['product_id'], $arrClassName, $arrClassCatName);
// 購入制限数を取得
$this->lfGetSaleLimit($this->arrProducts[$i]);
}
}
}
示例14: process
//.........这里部分代码省略.........
$this->arrErr = $this->lfCheckError();
if (!$this->arrErr) {
foreach ($_POST as $key => $val) {
$val = SC_Utils_Ex::sfManualEscape($val);
if ($val == "") {
continue;
}
switch ($key) {
case 'search_blog_name':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND A.blog_name ILIKE ? ";
$arrval[] = "%{$val}%";
break;
case 'search_blog_title':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND A.title ILIKE ? ";
$arrval[] = "%{$val}%";
break;
case 'search_blog_url':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND A.url ILIKE ? ";
$arrval[] = "%{$val}%";
break;
case 'search_status':
if (isset($_POST['search_status'])) {
$where .= " AND A.status = ? ";
$arrval[] = $val;
}
break;
case 'search_name':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND B.name ILIKE ? ";
$arrval[] = "%{$val}%";
break;
case 'search_product_code':
$val = ereg_replace(" ", "%", $val);
$val = ereg_replace(" ", "%", $val);
$where .= " AND B.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? )";
$arrval[] = "%{$val}%";
break;
case 'search_startyear':
if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) {
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']);
$where .= " AND A.create_date >= ? ";
$arrval[] = $date;
}
break;
case 'search_endyear':
if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) {
$date = SC_Utils_Ex::sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']);
$end_date = date("Y/m/d", strtotime("1 day", strtotime($date)));
$where .= " AND A.create_date <= cast('{$end_date}' as date) ";
}
break;
}
}
}
$order = "A.create_date DESC";
// ページ送りの処理
if (is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
if (!isset($arrval)) {
$arrval = array();
}
$linemax = $objQuery->count($from, $where, $arrval);
$this->tpl_linemax = $linemax;
$this->tpl_pageno = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
// ページ送りの取得
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
$this->arrPagenavi = $objNavi->arrPagenavi;
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
// 表示順序
$objQuery->setorder($order);
//検索結果の取得
$this->arrTrackback = $objQuery->select($select, $from, $where, $arrval);
//CSVダウンロード
if ($_POST['mode'] == 'csv') {
$objCSV = new SC_Helper_CSV_Ex();
// オプションの指定
$option = "ORDER BY A.trackback_id";
// CSV出力タイトル行の作成
$head = SC_Utils_Ex::sfGetCSVList($objCSV->arrTRACKBACK_CVSTITLE);
$data = $objCSV->lfGetTrackbackCSV($where, '', $arrval);
// CSVを送信する。
SC_Utils_Ex::sfCSVDownload($head . $data);
exit;
}
}
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例15: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objDb = new SC_Helper_DB_Ex();
$objQuery = new SC_Query();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if ($_GET['no'] != '') {
$this->tpl_no = strval($_GET['no']);
} elseif ($_POST['no'] != '') {
$this->tpl_no = strval($_POST['no']);
}
if ($_POST['mode'] == "search") {
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の強制変換
$this->lfConvertParam();
$where = "del_flg = 0";
/* 入力エラーなし */
foreach ($this->arrForm as $key => $val) {
if ($val == "") {
continue;
}
switch ($key) {
case 'search_name':
$where .= " AND name ILIKE ?";
$arrval[] = "%{$val}%";
break;
case 'search_category_id':
list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($val);
if ($tmp_where != "") {
$where .= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")";
$arrval = array_merge((array) $arrval, (array) $tmp_arrval);
}
break;
case 'search_product_code':
$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ? GROUP BY product_id)";
$arrval[] = "{$val}%";
break;
default:
break;
}
}
/*
$order = "update_date DESC, product_id DESC ";
// 読み込む列とテーブルの指定
$col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
$from = "vw_products_nonclass AS noncls ";
*/
$col = "DISTINCT T1.product_id, product_code_min, product_code_max," . " price01_min, price01_max, price02_min, price02_max," . " stock_min, stock_max, stock_unlimited_min," . " stock_unlimited_max, del_flg, status, name, comment1," . " comment2, comment3, main_list_comment, main_image," . " main_list_image, product_flag, deliv_date_id, sale_limit," . " point_rate, sale_unlimited, create_date, deliv_fee, " . " T4.product_rank, T4.category_rank";
$from = "vw_products_allclass AS T1" . " JOIN (" . " SELECT max(T3.rank) AS category_rank," . " max(T2.rank) AS product_rank," . " T2.product_id" . " FROM dtb_product_categories T2" . " JOIN dtb_category T3 USING (category_id)" . " GROUP BY product_id) AS T4 USING (product_id)";
$order = "T4.category_rank DESC, T4.product_rank DESC";
$objQuery = new SC_Query();
// 行数の取得
if (empty($arrval)) {
$arrval = array();
}
$linemax = $objQuery->count("dtb_products", $where, $arrval);
$this->tpl_linemax = $linemax;
// 何件が該当しました。表示用
// ページ送りの処理
if (isset($_POST['search_page_max']) && is_numeric($_POST['search_page_max'])) {
$page_max = $_POST['search_page_max'];
} else {
$page_max = SEARCH_PMAX;
}
// ページ送りの取得
$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi;
// 表示文字列
$startno = $objNavi->start_row;
// 取得範囲の指定(開始行番号、行数のセット)
if (DB_TYPE != "mysql") {
$objQuery->setlimitoffset($page_max, $startno);
}
// 表示順序
$objQuery->setorder($order);
// viewも絞込みをかける(mysql用)
//sfViewWhere("&&noncls_where&&", $where, $arrval, $objQuery->order . " " . $objQuery->setlimitoffset($page_max, $startno, true));
// 検索結果の取得
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
// 規格名一覧
$arrClassName = $objDb->sfGetIDValueList("dtb_class", "class_id", "name");
// 規格分類名一覧
$arrClassCatName = $objDb->sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
// 規格セレクトボックス設定
for ($i = 0; $i < count($this->arrProducts); $i++) {
$this->lfMakeSelect($this->arrProducts[$i]['product_id'], $arrClassName, $arrClassCatName);
// 購入制限数を取得
//.........这里部分代码省略.........