本文整理汇总了PHP中SC_Query::count方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::count方法的具体用法?PHP SC_Query::count怎么用?PHP SC_Query::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Query
的用法示例。
在下文中一共展示了SC_Query::count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sfSessWrite
/**
* セッションのデータをDBに書き込む.
*
* @param string $id セッションID
* @param string $sess_data セッションデータの値
* @return bool セッションの書き込みに成功した場合 true
*/
function sfSessWrite($id, $sess_data)
{
if (!$this->objDb->sfTabaleExists("dtb_session")) {
return false;
}
$objQuery = new SC_Query();
$count = $objQuery->count("dtb_session", "sess_id = ?", array($id));
$sqlval = array();
if ($count > 0) {
// レコード更新
$sqlval['sess_data'] = $sess_data;
$sqlval['update_date'] = 'Now()';
$objQuery->update("dtb_session", $sqlval, "sess_id = ?", array($id));
} else {
// セッションデータがある場合は、レコード作成
if (strlen($sess_data) > 0) {
$sqlval['sess_id'] = $id;
$sqlval['sess_data'] = $sess_data;
$sqlval['update_date'] = 'Now()';
$sqlval['create_date'] = 'Now()';
$objQuery->insert("dtb_session", $sqlval);
}
}
return true;
}
示例2: mobileProcess
/**
* Page のプロセス(モバイル).
*
* @return void
*/
function mobileProcess()
{
$objView = new SC_MobileView();
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
$objDb = new SC_Helper_DB_Ex();
//不正アクセス判定
$from = "dtb_order";
$where = "del_flg = 0 AND customer_id = ? AND order_id = ? ";
$arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']);
//DBに情報があるか判定
$cnt = $objQuery->count($from, $where, $arrval);
//ログインしていない、またはDBに情報が無い場合
if (!$objCustomer->isLoginSuccess(true) or $cnt == 0) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
} else {
//受注詳細データの取得
$this->arrDisp = $this->lfGetOrderData($_POST['order_id']);
// 支払い方法の取得
$this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
// 配送時間の取得
$arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']);
$this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
//マイページトップ顧客情報表示用
$this->CustomerName1 = $objCustomer->getvalue('name01');
$this->CustomerName2 = $objCustomer->getvalue('name02');
$this->CustomerPoint = $objCustomer->getvalue('point');
}
$objView->assignobj($this);
$objView->display(SITE_FRAME);
}
示例3: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objQuery = new SC_Query();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
$cnt = $objQuery->count("dtb_baseinfo");
if ($cnt > 0) {
$this->tpl_mode = "update";
} else {
$this->tpl_mode = "insert";
}
if (isset($_POST['mode']) && !empty($_POST["mode"])) {
// POSTデータの引き継ぎ
$this->arrForm = $_POST;
// 入力データの変換
$this->arrForm = $this->lfConvertParam($this->arrForm);
$this->arrForm['regular_holiday_ids'] = $_POST['regular_holiday_ids'];
// 定休日情報を付加
// 入力データのエラーチェック
$this->arrErr = $this->lfErrorCheck($this->arrForm);
if (count($this->arrErr) == 0) {
switch ($_POST['mode']) {
case 'update':
$this->lfUpdateData($this->arrForm);
// 既存編集
break;
case 'insert':
$this->lfInsertData($this->arrForm);
// 新規作成
break;
default:
break;
}
$this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "'); fnCheckLimit('max_download_cnt', 'download_cnt_unlimited', '" . DISABLED_RGB . "'); window.alert('SHOPマスタの登録が完了しました。');";
}
if (empty($this->arrForm['regular_holiday_ids'])) {
$this->arrSel = array();
} else {
$this->arrSel = $this->arrForm['regular_holiday_ids'];
}
} else {
$arrCol = $this->lfGetCol();
$col = SC_Utils_Ex::sfGetCommaList($arrCol);
$arrRet = $objQuery->select($col, "dtb_baseinfo");
$this->arrForm = $arrRet[0];
$regular_holiday_ids = explode('|', $this->arrForm['regular_holiday_ids']);
$this->arrForm['regular_holiday_ids'] = $regular_holiday_ids;
$this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "'); fnCheckLimit('max_download_cnt', 'download_cnt_unlimited', '" . DISABLED_RGB . "');";
}
$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();
$objQuery = new SC_Query();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
// パラメータ管理クラス
$this->objFormParam = new SC_FormParam();
// パラメータ情報の初期化
$this->lfInitParam();
// POST値の取得
$this->objFormParam->setParam($_POST);
$cnt = $objQuery->count("dtb_baseinfo");
if ($cnt > 0) {
$this->tpl_mode = "update";
} else {
$this->tpl_mode = "insert";
}
if (isset($_POST['mode']) && !empty($_POST['mode'])) {
// 入力値の変換
$this->objFormParam->convParam();
$this->arrErr = $this->lfCheckError();
if (count($this->arrErr) == 0) {
switch ($_POST['mode']) {
case 'update':
$this->lfUpdateData();
// 既存編集
break;
case 'insert':
$this->lfInsertData();
// 新規作成
break;
default:
break;
}
// 再表示
//sfReload();
$this->tpl_onload = "window.alert('特定商取引法の登録が完了しました。');";
}
} else {
$arrCol = $this->objFormParam->getKeyList();
// キー名一覧を取得
$col = SC_Utils_Ex::sfGetCommaList($arrCol);
$arrRet = $objQuery->select($col, "dtb_baseinfo");
// DB値の取得
$this->objFormParam->setParam($arrRet[0]);
}
$this->arrForm = $this->objFormParam->getFormParamList();
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例5: sfRegistTempOrder
/**
* 受注一時テーブルへの書き込み処理を行う.
*
* @param string $uniqid ユニークID
* @param array $sqlval SQLの値の配列
* @return void
*/
function sfRegistTempOrder($uniqid, $sqlval)
{
if ($uniqid != "") {
// 既存データのチェック
$objQuery = new SC_Query();
$where = "order_temp_id = ?";
$cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
// 既存データがない場合
if ($cnt == 0) {
// 初回書き込み時に会員の登録済み情報を取り込む
$sqlval = $this->sfGetCustomerSqlVal($uniqid, $sqlval);
$sqlval['create_date'] = "now()";
$objQuery->insert("dtb_order_temp", $sqlval);
} else {
$objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
}
}
}
示例6: findProductCount
/**
* SC_Queryインスタンスに設定された検索条件をもとに対象商品数を取得する.
*
* 検索条件は, SC_Query::setWhere() 関数で設定しておく必要があります.
*
* @param SC_Query $objQuery SC_Query インスタンス
* @param array $arrVal 検索パラメーターの配列
* @return array 対象商品ID数
*/
function findProductCount(&$objQuery, $arrVal = array())
{
$table = <<<__EOS__
dtb_products AS alldtl
__EOS__;
return $objQuery->count($table, '', $arrVal);
}
示例7: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_SiteView(false);
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
$ParentPage = MYPAGE_DELIVADDR_URL;
// GETでページを指定されている場合には指定ページに戻す
if (isset($_GET['page'])) {
$ParentPage = htmlspecialchars($_GET['page'], ENT_QUOTES);
} else {
if (isset($_POST['ParentPage'])) {
$ParentPage = htmlspecialchars($_POST['ParentPage'], ENT_QUOTES);
}
}
$this->ParentPage = $ParentPage;
//ログイン判定
if (!$objCustomer->isLoginSuccess()) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
}
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if (!isset($_GET['other_deliv_id'])) {
$_GET['other_deliv_id'] = "";
}
if ($_POST['mode'] == "") {
$_SESSION['other_deliv_id'] = $_GET['other_deliv_id'];
}
if ($_GET['other_deliv_id'] != "") {
//不正アクセス判定
$flag = $objQuery->count("dtb_other_deliv", "customer_id=? AND other_deliv_id=?", array($objCustomer->getValue("customer_id"), $_SESSION['other_deliv_id']));
if (!$objCustomer->isLoginSuccess() || $flag == 0) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
}
}
//別のお届け先DB登録用カラム配列
$arrRegistColumn = array(array("column" => "name01", "convert" => "aKV"), array("column" => "name02", "convert" => "aKV"), array("column" => "kana01", "convert" => "CKV"), array("column" => "kana02", "convert" => "CKV"), array("column" => "zip01", "convert" => "n"), array("column" => "zip02", "convert" => "n"), array("column" => "pref", "convert" => "n"), array("column" => "addr01", "convert" => "aKV"), array("column" => "addr02", "convert" => "aKV"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n"));
if ($_GET['other_deliv_id'] != "") {
//別のお届け先情報取得
$arrOtherDeliv = $objQuery->select("*", "dtb_other_deliv", "other_deliv_id=? ", array($_SESSION['other_deliv_id']));
$this->arrForm = $arrOtherDeliv[0];
}
switch ($_POST['mode']) {
case 'edit':
$_POST = $this->lfConvertParam($_POST, $arrRegistColumn);
$this->arrErr = $this->lfErrorCheck($_POST);
if ($this->arrErr) {
foreach ($_POST as $key => $val) {
if ($val != "") {
$this->arrForm[$key] = $val;
}
}
} else {
//別のお届け先登録数の取得
$deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=?", array($objCustomer->getValue('customer_id')));
if ($deliv_count < DELIV_ADDR_MAX or isset($_POST['other_deliv_id'])) {
if (strlen($_POST['other_deliv_id'] != 0)) {
$deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=? and other_deliv_id = ?", array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id']));
if ($deliv_count == 0) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
} else {
$this->lfRegistData($_POST, $arrRegistColumn, $objCustomer);
}
} else {
$this->lfRegistData($_POST, $arrRegistColumn, $objCustomer);
}
}
if ($_POST['ParentPage'] == MYPAGE_DELIVADDR_URL || $_POST['ParentPage'] == URL_DELIV_TOP) {
$this->tpl_onload = "fnUpdateParent('" . $this->getLocation($_POST['ParentPage']) . "'); window.close();";
} else {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
}
}
break;
}
$objView->assignobj($this);
$objView->display($this->tpl_mainpage);
}
示例8: findProductCount
/**
* SC_Queryインスタンスに設定された検索条件をもとに対象商品数を取得する.
*
* 検索条件は, SC_Query::setWhere() 関数で設定しておく必要があります.
*
* @param SC_Query $objQuery SC_Query インスタンス
* @param array $arrVal 検索パラメーターの配列
* @return array 対象商品ID数
*/
public function findProductCount(&$objQuery, $arrVal = array())
{
$table = 'dtb_products AS alldtl';
return $objQuery->count($table, '', $arrVal);
}
示例9: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objDb = new SC_Helper_DB_Ex();
$objSess = new SC_Session();
// パラメータ管理クラス
$this->objFormParam = new SC_FormParam();
// パラメータ情報の初期化
$this->lfInitParam();
$this->objFormParam->setParam($_POST);
$this->objFormParam->splitParamCheckBoxes('search_order_sex');
$this->objFormParam->splitParamCheckBoxes('search_payment_id');
// 検索ワードの引き継ぎ
foreach ($_POST as $key => $val) {
if (ereg("^search_", $key)) {
switch ($key) {
case 'search_order_sex':
case 'search_payment_id':
$this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
break;
default:
$this->arrHidden[$key] = $val;
break;
}
}
}
// ページ送り用
$this->arrHidden['search_pageno'] = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if (!isset($arrRet)) {
$arrRet = array();
}
if ($_POST['mode'] == 'delete') {
if (SC_Utils_Ex::sfIsInt($_POST['order_id'])) {
$objQuery = new SC_Query();
$where = "order_id = ?";
$sqlval['del_flg'] = '1';
$objQuery->update("dtb_order", $sqlval, $where, array($_POST['order_id']));
}
}
switch ($_POST['mode']) {
case 'delete':
case 'csv':
case 'pdf':
case 'delete_all':
case 'search':
// 入力値の変換
$this->objFormParam->convParam();
$this->arrErr = $this->lfCheckError($arrRet);
$arrRet = $this->objFormParam->getHashArray();
// 入力なし
if (count($this->arrErr) == 0) {
$where = "del_flg = 0";
foreach ($arrRet as $key => $val) {
if ($val == "") {
continue;
}
$val = SC_Utils_Ex::sfManualEscape($val);
switch ($key) {
case 'search_order_name':
if (DB_TYPE == "pgsql") {
$where .= " AND order_name01||order_name02 ILIKE ?";
} elseif (DB_TYPE == "mysql") {
$where .= " AND concat(order_name01,order_name02) ILIKE ?";
}
$nonsp_val = mb_ereg_replace("[ ]+", "", $val);
$arrval[] = "%{$nonsp_val}%";
break;
case 'search_order_kana':
if (DB_TYPE == "pgsql") {
$where .= " AND order_kana01||order_kana02 ILIKE ?";
} elseif (DB_TYPE == "mysql") {
$where .= " AND concat(order_kana01,order_kana02) ILIKE ?";
}
$nonsp_val = mb_ereg_replace("[ ]+", "", $val);
$arrval[] = "%{$nonsp_val}%";
break;
case 'search_order_id1':
$where .= " AND order_id >= ?";
$arrval[] = $val;
break;
case 'search_order_id2':
$where .= " AND order_id <= ?";
$arrval[] = $val;
break;
case 'search_order_sex':
$tmp_where = "";
foreach ($val as $element) {
if ($element != "") {
if ($tmp_where == "") {
//.........这里部分代码省略.........
示例10: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objQuery = new SC_Query();
$objSess = new SC_Session();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
$fp = fopen(ZIP_CSV_FILE_PATH, "r");
$img_path = USER_URL . "packages/" . TEMPLATE_NAME . "/img/";
// 一部のIEは256バイト以上受け取ってから表示を開始する。
for ($i = 0; $i < 256; $i++) {
print " ";
}
print "\n";
$this->myFlush();
if (!$fp) {
SC_Utils_Ex::sfErrorHeader(">> " . ZIP_CSV_FILE_PATH . "の取得に失敗しました。");
} else {
print "<img src='" . $img_path . "install/main_w.jpg'><br>";
$this->myFlush();
// CSVの件数を数える
$line = 0;
while (!feof($fp)) {
fgets($fp, ZIP_CSV_LINE_MAX);
$line++;
}
print "<img src='" . $img_path . "install/space_w.gif'>";
$this->myFlush();
// ファイルポインタを戻す
fseek($fp, 0);
// 画像を一個表示する件数を求める。
$disp_line = intval($line / IMAGE_MAX);
// 既に書き込まれたデータを数える
$end_cnt = $objQuery->count("mtb_zip");
$cnt = 1;
$img_cnt = 0;
while (!feof($fp)) {
$arrCSV = fgetcsv($fp, ZIP_CSV_LINE_MAX);
// すでに書き込まれたデータを飛ばす。
if ($cnt > $end_cnt) {
$sqlval['code'] = $arrCSV[0];
$sqlval['old_zipcode'] = $arrCSV[1];
$sqlval['zipcode'] = $arrCSV[2];
$sqlval['state_kana'] = $arrCSV[3];
$sqlval['city_kana'] = $arrCSV[4];
$sqlval['town_kana'] = $arrCSV[5];
$sqlval['state'] = $arrCSV[6];
$sqlval['city'] = $arrCSV[7];
$sqlval['town'] = $arrCSV[8];
$sqlval['flg1'] = $arrCSV[9];
$sqlval['flg2'] = $arrCSV[10];
$sqlval['flg3'] = $arrCSV[11];
$sqlval['flg4'] = $arrCSV[12];
$sqlval['flg5'] = $arrCSV[13];
$sqlval['flg6'] = $arrCSV[14];
$objQuery->insert("mtb_zip", $sqlval);
}
$cnt++;
// $disp_line件ごとに進捗表示する
if ($cnt % $disp_line == 0 && $img_cnt < IMAGE_MAX) {
print "<img src='" . $img_path . "install/graph_1_w.gif'>";
$this->myFlush();
$img_cnt++;
}
}
fclose($fp);
print "<img src='" . $img_path . "install/space_w.gif'><br>\n";
print "<table width='700' height='50' border='0' cellpadding='0' cellspacing='0' bgcolor='#494E5F'>\n";
print "<tr>\n";
print "<td align='center'><a href='javascript:window.close()'><img src='" . $img_path . "install/close.gif' alt='CLOSE' width='85' height='22' border='0' /></a></td>\n";
print "</tr>\n";
print "</table>\n";
}
}
示例11: 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);
}
示例12: registerOwnersStoreSettings
/**
* DBへ入力内容を登録する.
*
* @param array $arrSettingsData オーナーズストア設定の連想配列
* @return void
*/
function registerOwnersStoreSettings($arrSettingsData)
{
$table = 'dtb_ownersstore_settings';
$objQuery = new SC_Query();
$count = $objQuery->count($table);
if ($count) {
$objQuery->update($table, $arrSettingsData);
} else {
$objQuery->insert($table, $arrSettingsData);
}
}
示例13: mobileProcess
/**
* Page のプロセス(モバイル).
*
* @return void
*/
function mobileProcess()
{
$objView = new SC_MobileView();
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
// クッキー管理クラス
$objCookie = new SC_Cookie(COOKIE_EXPIRE);
// パラメータ管理クラス
$objFormParam = new SC_FormParam();
// パラメータ情報の初期化
$this->lfInitParam($objFormParam);
// POST値の取得
$objFormParam->setParam($_POST);
// 携帯端末IDが一致する会員が存在するかどうかをチェックする。
$this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId();
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
// ログイン処理
if ($_POST['mode'] == 'login') {
$objFormParam->toLower('login_email');
$arrErr = $objFormParam->checkError();
$arrForm = $objFormParam->getHashArray();
// クッキー保存判定
if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") {
$objCookie->setCookie('login_email', $_POST['login_email']);
} else {
$objCookie->setCookie('login_email', '');
}
if (count($arrErr) == 0) {
if ($objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) || $objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {
// ログインが成功した場合は携帯端末IDを保存する。
$objCustomer->updateMobilePhoneId();
/*
* email がモバイルドメインでは無く,
* 携帯メールアドレスが登録されていない場合
*/
$objMobile = new SC_Helper_Mobile_Ex();
if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
if (!$objCustomer->hasValue('email_mobile')) {
$this->sendRedirect($this->getLocation("../entry/email_mobile.php"), true);
exit;
}
}
} else {
$objQuery = new SC_Query();
$where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";
$ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));
if ($ret > 0) {
SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true);
} else {
SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true);
}
}
}
}
/*
* ログインチェック
* 携帯メールの登録を必須にする場合は isLoginSuccess(false) にする
*/
if (!$objCustomer->isLoginSuccess(true)) {
$this->tpl_mainpage = 'mypage/login.tpl';
$objView->assignArray($objFormParam->getHashArray());
if (empty($arrErr)) {
$arrErr = array();
}
$objView->assignArray(array("arrErr" => $arrErr));
} else {
//マイページトップ顧客情報表示用
$this->CustomerName1 = $objCustomer->getvalue('name01');
$this->CustomerName2 = $objCustomer->getvalue('name02');
}
$objView->assignobj($this);
//$objpage内の全てのテンプレート変数をsmartyに格納
$objView->display(SITE_FRAME);
//パスとテンプレート変数の呼び出し、実行
}
示例14: lfDispComplete
function lfDispComplete($objPage)
{
global $objWebParam;
global $objDBParam;
// hiddenに入力値を保持
$objPage->arrHidden = $objWebParam->getHashArray();
// hiddenに入力値を保持
$objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
$arrDsn = getArrayDsn($objDBParam);
$sqlval['id'] = 1;
$sqlval['shop_name'] = $objWebParam->getValue('shop_name');
$sqlval['email01'] = $objWebParam->getValue('admin_mail');
$sqlval['email02'] = $objWebParam->getValue('admin_mail');
$sqlval['email03'] = $objWebParam->getValue('admin_mail');
$sqlval['email04'] = $objWebParam->getValue('admin_mail');
$sqlval['email05'] = $objWebParam->getValue('admin_mail');
$sqlval['top_tpl'] = 'default1';
$sqlval['product_tpl'] = 'default1';
$sqlval['detail_tpl'] = 'default1';
$sqlval['mypage_tpl'] = 'default1';
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
$objQuery = new SC_Query($arrDsn);
$cnt = $objQuery->count('dtb_baseinfo');
if ($cnt > 0) {
$objQuery->update('dtb_baseinfo', $sqlval);
} else {
$objQuery->insert('dtb_baseinfo', $sqlval);
}
// 管理者登録
$login_id = $objWebParam->getValue('login_id');
$salt = SC_Utils_Ex::sfGetRandomString(10);
$login_pass = SC_Utils_Ex::sfGetHashString($objWebParam->getValue('login_pass'), $salt);
$arrVal = array('login_id' => $login_id, 'password' => $login_pass, 'salt' => $salt, 'work' => 1, 'del_flg' => 0, 'update_date' => 'CURRENT_TIMESTAMP');
$member_id = $objQuery->get('member_id', 'dtb_member', 'login_id = ? AND del_flg = 0', array($login_id));
if (strlen($member_id) == 0) {
$member_id = $objQuery->nextVal('dtb_member_member_id');
$arrVal['member_id'] = $member_id;
$arrVal['name'] = '管理者';
$arrVal['creator_id'] = 0;
$arrVal['authority'] = 0;
$arrVal['rank'] = 1;
$objQuery->insert('dtb_member', $arrVal);
} else {
$objQuery->update('dtb_member', $arrVal, 'member_id = ?', array($member_id));
}
$objPage->arrHidden['db_skip'] = $_POST['db_skip'];
$objPage->tpl_mainpage = 'complete.tpl';
$objPage->tpl_mode = 'complete';
$secure_url = $objWebParam->getValue('secure_url');
// 語尾に'/'をつける
$secure_url = rtrim($secure_url, '/') . '/';
$objPage->tpl_sslurl = $secure_url;
//EC-CUBEオフィシャルサイトからのお知らせURL
$objPage->install_info_url = INSTALL_INFO_URL;
return $objPage;
}
示例15: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_SiteView();
$objQuery = new SC_Query();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!$this->isValidToken()) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true);
}
}
//---- 登録用カラム配列
$arrRegistColumn = array(array("column" => "review_id", "convert" => "aKV"), array("column" => "product_id", "convert" => "aKV"), array("column" => "reviewer_name", "convert" => "aKV"), array("column" => "reviewer_url", "convert" => "a"), array("column" => "sex", "convert" => "n"), array("column" => "email", "convert" => "a"), array("column" => "recommend_level", "convert" => "n"), array("column" => "title", "convert" => "aKV"), array("column" => "comment", "convert" => "aKV"));
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
switch ($_POST['mode']) {
case 'confirm':
$arrForm = $this->lfConvertParam($_POST, $arrRegistColumn);
$this->arrErr = $this->lfErrorCheck($arrForm);
//重複メッセージの判定
$flag = $objQuery->count("dtb_review", "product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
if ($flag > 0) {
$this->arrErr['title'] .= "重複したタイトルは登録できません。";
}
//エラーチェック
if ($this->arrErr == "") {
//重複タイトルでない
if ($flag == 0) {
//商品名の取得
$arrForm['name'] = $objQuery->get("dtb_products", "name", "product_id = ? ", array($arrForm['product_id']));
$this->arrForm = $arrForm;
$this->tpl_mainpage = 'products/review_confirm.tpl';
}
} else {
//商品名の取得
$arrForm['name'] = $objQuery->get("dtb_products", "name", "product_id = ? ", array($arrForm['product_id']));
$this->arrForm = $arrForm;
}
break;
case 'return':
foreach ($_POST as $key => $val) {
$this->arrForm[$key] = $val;
}
//商品名の取得
$this->arrForm['name'] = $objQuery->get("dtb_products", "name", "product_id = ? ", array($this->arrForm['product_id']));
if (empty($this->arrForm['name'])) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
}
break;
case 'complete':
$arrForm = $this->lfConvertParam($_POST, $arrRegistColumn);
$arrErr = $this->lfErrorCheck($arrForm);
//重複メッセージの判定
$flag = $objQuery->count("dtb_review", "product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
//エラーチェック
if ($arrErr == "") {
//重複タイトルでない
if ($flag == 0) {
//登録実行
$this->lfRegistRecommendData($arrForm, $arrRegistColumn);
//レビュー書き込み完了ページへ
$this->sendRedirect($this->getLocation("./review_complete.php", array(), true));
exit;
}
} else {
if ($flag > 0) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
}
}
break;
default:
if (SC_Utils_Ex::sfIsInt($_GET['product_id'])) {
//商品情報の取得
$arrForm = $objQuery->select("product_id, name", "dtb_products", "del_flg = 0 AND status = 1 AND product_id=?", array($_GET['product_id']));
if (empty($arrForm)) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
}
$this->arrForm = $arrForm[0];
}
break;
}
$this->transactionid = $this->getToken();
$objView->assignobj($this);
$objView->display($this->tpl_mainpage);
}