本文整理汇总了PHP中SC_Utils_Ex::sfQuoteSmart方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Utils_Ex::sfQuoteSmart方法的具体用法?PHP SC_Utils_Ex::sfQuoteSmart怎么用?PHP SC_Utils_Ex::sfQuoteSmart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Utils_Ex
的用法示例。
在下文中一共展示了SC_Utils_Ex::sfQuoteSmart方法的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);
$this->tpl_pageno = isset($_POST['pageno']) ? $_POST['pageno'] : "";
// 通常時は親カテゴリを0に設定する。
$this->arrForm['parent_category_id'] = isset($_POST['parent_category_id']) ? $_POST['parent_category_id'] : 0;
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
switch ($_POST['mode']) {
case 'up':
$where = "category_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['parent_category_id']);
$objDb->sfRankUp("dtb_product_categories", "product_id", $_POST['product_id'], $where);
break;
case 'down':
$where = "category_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['parent_category_id']);
$objDb->sfRankDown("dtb_product_categories", "product_id", $_POST['product_id'], $where);
break;
case 'move':
$key = "pos-" . $_POST['product_id'];
$input_pos = mb_convert_kana($_POST[$key], "n");
if (SC_Utils_Ex::sfIsInt($input_pos)) {
$where = "category_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['parent_category_id']);
$objDb->sfMoveRank("dtb_product_categories", "product_id", $_POST['product_id'], $input_pos, $where);
}
break;
case 'tree':
// カテゴリの切替は、ページ番号をクリアする。
$this->tpl_pageno = "";
break;
default:
break;
}
$this->arrTree = $objDb->sfGetCatTree($this->arrForm['parent_category_id']);
$this->arrProductsList = $this->lfGetProduct($this->arrForm['parent_category_id']);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例2: lfDownRank
/**
* 並び順を下げる
*
* @param integer $class_id 規格ID
* @param integer $classcategory_id 規格分類ID
* @return void
*/
function lfDownRank($class_id, $classcategory_id)
{
$objDb = new SC_Helper_DB_Ex();
$where = 'class_id = ' . SC_Utils_Ex::sfQuoteSmart($class_id);
$objDb->sfRankDown('dtb_classcategory', 'classcategory_id', $classcategory_id, $where);
}
开发者ID:nanasess,项目名称:eccube-WindowsAzureBlob-plugin,代码行数:13,代码来源:LC_Page_Admin_Products_ClassCategory.php
示例3: lfRegistData
function lfRegistData($array, $arrRegistColumn, &$objCustomer)
{
$objConn = new SC_DBConn();
foreach ($arrRegistColumn as $data) {
if (strlen($array[$data["column"]]) > 0) {
$arrRegist[$data["column"]] = $array[$data["column"]];
}
}
$arrRegist['customer_id'] = $objCustomer->getvalue('customer_id');
//-- 編集登録実行
$objConn->query("BEGIN");
if ($array['other_deliv_id'] != "") {
$objConn->autoExecute("dtb_other_deliv", $arrRegist, "other_deliv_id = " . SC_Utils_Ex::sfQuoteSmart($array["other_deliv_id"]));
} else {
$objConn->autoExecute("dtb_other_deliv", $arrRegist);
}
$objConn->query("COMMIT");
}
示例4: updateMasterData
/**
* マスターデータを更新する.
*
* 引数 $masterData の値でマスターデータを更新する.
* $masterData は key => value 形式の配列である必要がある.
*
* @param string $name マスターデータ名
* @param array $columns [0] => キー, [1] => 表示文字列, [2] => 表示順
* を表すカラム名を格納した配列
* @param array $masterData マスターデータ
* @param bool $autoCommit トランザクションを自動的に commit する場合 true
* @return integer マスターデータの更新数
*/
function updateMasterData($name, $columns, $masterData, $autoCommit = true)
{
$columns = $this->getDefaultColumnName($columns);
$this->objQuery =& SC_Query_Ex::getSingletonInstance();
if ($autoCommit) {
$this->objQuery->begin();
}
// 指定のデータを更新
$i = 0;
foreach ($masterData as $key => $val) {
$sqlVal = array($columns[1] => $val);
$this->objQuery->update($name, $sqlVal, $columns[0] . ' = ' . SC_Utils_Ex::sfQuoteSmart($key));
$i++;
}
if ($autoCommit) {
$this->objQuery->commit();
}
return $i;
}
示例5: lfGetSecretKey
function lfGetSecretKey($email, &$objConn)
{
$sql = "SELECT secret_key FROM dtb_customer_mail WHERE email = ?";
$uniqid = $objConn->getOne($sql, array($email));
if ($uniqid == '') {
$count = 1;
while ($count != 0) {
$uniqid = SC_Utils_Ex::sfGetUniqRandomId("t");
$count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer_mail WHERE secret_key = ?", array($uniqid));
}
$objQuery = new SC_Query();
$objQuery->update("dtb_customer_mail", array('secret_key' => $uniqid), "email = " . SC_Utils_Ex::sfQuoteSmart($email));
}
return $uniqid;
}
示例6: sfViewWhere
/**
* View の WHERE 句を置換する.
*
* @param string $target 置換対象の文字列
* @param string $where 置換する文字列
* @param array $arrval WHERE 句の要素の配列
* @param string $option SQL 文の追加文字列
* @return string 置換後の SQL 文
*/
function sfViewWhere($target, $where = "", $arrval = array(), $option = "")
{
$arrWhere = split("[?]", $where);
$where_tmp = " WHERE " . $arrWhere[0];
for ($i = 1; $i < count($arrWhere); $i++) {
$where_tmp .= SC_Utils_Ex::sfQuoteSmart($arrval[$i - 1]) . $arrWhere[$i];
}
$arrWhere = $this->getWhereConverter();
$arrWhere[$target] = $where_tmp . " " . $option;
return $arrWhere[$target];
}
示例7: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
//---- ページ初期設定
$objQuery = new SC_Query();
$objView = new SC_AdminView();
$objDate = new SC_Date(1901);
$objDb = new SC_Helper_DB_Ex();
$this->arrYear = $objDate->getYear();
// 日付プルダウン設定
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
$this->objDate = $objDate;
// 認証可否の判定
$objSess = new SC_Session();
SC_Utils_Ex::sfIsSuccess($objSess);
// POST値の引き継ぎ
$this->arrForm = $_POST;
// ページ送り用
$this->arrHidden['search_pageno'] = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
// 検索ワードの引き継ぎ
foreach ($_POST as $key => $val) {
switch ($key) {
case 'sex':
case 'status':
$this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
if (!is_array($val)) {
$this->arrForm[$key] = split("-", $val);
}
break;
default:
$this->arrHidden[$key] = $val;
break;
}
}
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
// 顧客削除
if ($_POST['mode'] == "delete") {
$sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0";
$result_customer = $objQuery->conn->getAll($sql, array($_POST["edit_customer_id"]));
if ($result_customer[0]["status"] == 2) {
//本会員削除
$arrDel = array("del_flg" => 1, "update_date" => "NOW()");
$objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["edit_customer_id"]));
} elseif ($result_customer[0]["status"] == 1) {
//仮会員削除
$sql = "DELETE FROM dtb_customer WHERE customer_id = ?";
$objQuery->conn->query($sql, array($_POST["edit_customer_id"]));
}
}
//if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all") {
// 登録メール再送
if ($_POST['mode'] == "resend_mail") {
$arrRet = $objQuery->select("name01, name02, secret_key, email", "dtb_customer", "customer_id = ? AND del_flg <> 1 AND status = 1", array($_POST["edit_customer_id"]));
if (is_array($arrRet) === true && count($arrRet) > 0) {
$CONF = $objDb->sf_getBasisData();
$this->CONF = $CONF;
$objMailText = new SC_SiteView();
$objMailText->assignobj($this);
$mailHelper = new SC_Helper_Mail_Ex();
$this->name01 = $arrRet[0]['name01'];
$this->name02 = $arrRet[0]['name02'];
$this->uniqid = $arrRet[0]['secret_key'];
$subject = $mailHelper->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご確認');
$toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
$objMail = new SC_SendMail();
$objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"]);
// 宛先の設定
$name = $this->name01 . $this->name02 . " 様";
$objMail->setTo($arrRet[0]["email"], $name);
$objMail->sendMail();
}
}
if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "resend_mail") {
// 入力文字の強制変換
$this->lfConvertParam();
// エラーチェック
$this->arrErr = $this->lfCheckError($this->arrForm);
$where = "del_flg = 0";
/* 入力エラーなし */
if (count($this->arrErr) == 0) {
//-- 検索データ取得
$objSelect = new SC_CustomerList($this->arrForm, "customer");
// 表示件数設定
$page_rows = $this->arrForm['page_rows'];
if (is_numeric($page_rows)) {
$page_max = $page_rows;
} else {
$page_max = SEARCH_PMAX;
}
if (!isset($this->arrForm['search_pageno'])) {
$this->arrForm['search_pageno'] = "";
}
if ($this->arrForm['search_pageno'] == 0) {
//.........这里部分代码省略.........
示例8: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objQuery = new SC_Query();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
$objSess = new SC_Session();
SC_Utils_Ex::sfIsSuccess($objSess);
$get_check = false;
// 規格IDのチェック
if (SC_Utils_Ex::sfIsInt($_GET['class_id'])) {
// 規格名の取得
$this->tpl_class_name = $objQuery->get("dtb_class", "name", "class_id = ?", array($_GET['class_id']));
if ($this->tpl_class_name != "") {
// 規格IDの引き継ぎ
$this->arrHidden['class_id'] = $_GET['class_id'];
$get_check = true;
}
}
if (!$get_check) {
// 規格登録ページに飛ばす。
$this->sendRedirect($this->getLocation(URL_CLASS_REGIST));
exit;
}
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
if (isset($_POST['class_id'])) {
if (!SC_Utils_Ex::sfIsInt($_POST['class_id'])) {
SC_Utils_Ex::sfDispError("");
}
}
// 新規作成 or 編集
switch ($_POST['mode']) {
// 登録ボタン押下
case 'edit':
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の変換
$_POST = $this->lfConvertParam($_POST);
// エラーチェック
$this->arrErr = $this->lfErrorCheck();
if (count($this->arrErr) <= 0) {
if ($_POST['classcategory_id'] == "") {
$this->lfInsertClass();
// DBへの書き込み
} else {
$this->lfUpdateClass();
// DBへの書き込み
}
// 再表示
$this->reload($_GET['class_id']);
//sfReload("class_id=" . $_GET['class_id']);
} else {
// POSTデータを引き継ぐ
$this->tpl_classcategory_id = $_POST['classcategory_id'];
}
break;
// 削除
// 削除
case 'delete':
// ランク付きレコードの削除
$where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
$objDb->sfDeleteRankRecord("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where, true);
break;
// 編集前処理
// 編集前処理
case 'pre_edit':
// 編集項目をDBより取得する。
$where = "classcategory_id = ?";
$name = $objQuery->get("dtb_classcategory", "name", $where, array($_POST['classcategory_id']));
// 入力項目にカテゴリ名を入力する。
$this->arrForm['name'] = $name;
// POSTデータを引き継ぐ
$this->tpl_classcategory_id = $_POST['classcategory_id'];
break;
case 'down':
$where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
$objDb->sfRankDown("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where);
break;
case 'up':
$where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
$objDb->sfRankUp("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where);
break;
default:
break;
}
// 規格分類の読込
$where = "del_flg <> 1 AND class_id = ?";
$objQuery->setorder("rank DESC");
$this->arrClassCat = $objQuery->select("name, classcategory_id", "dtb_classcategory", $where, array($_GET['class_id']));
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例9: setWhereByOR
public function setWhereByOR($arrWhere)
{
$count = count($arrWhere);
for ($i = 0; $i < $count; $i++) {
if (isset($arrWhere[$i]['value'])) {
$statement .= $arrWhere[$i]['column'] . ' = ' . SC_Utils_Ex::sfQuoteSmart($arrWhere[$i]['value']) . ' OR ';
}
}
$statement = '(' . rtrim($statement, ' OR ') . ')';
if ($this->where) {
$this->where .= ' AND ' . $statement;
} else {
$this->where = 'WHERE ' . $statement;
}
}
示例10: lfRankMove
function lfRankMove(&$objDb, $parent_category_id, $product_id)
{
$key = "pos-" . $product_id;
$input_pos = mb_convert_kana($_POST[$key], 'n');
if (SC_Utils_Ex::sfIsInt($input_pos)) {
$where = "category_id = " . SC_Utils_Ex::sfQuoteSmart($parent_category_id);
$objDb->sfMoveRank("dtb_product_categories", "product_id", $product_id, $input_pos, $where);
}
}
示例11: lfRankMove
public function lfRankMove(&$objDb, $parent_category_id, $product_id)
{
$key = 'pos-' . $product_id;
$input_pos = mb_convert_kana($_POST[$key], 'n');
if (SC_Utils_Ex::sfIsInt($input_pos)) {
$where = 'category_id = ' . SC_Utils_Ex::sfQuoteSmart($parent_category_id);
$objDb->sfMoveRank('dtb_product_categories', 'product_id', $product_id, $input_pos, $where);
}
}
开发者ID:ryoogata,项目名称:eccube-SQLAzureSupport-plugin,代码行数:9,代码来源:LC_Page_Admin_Products_ProductRank.php
示例12: lfChangeData
function lfChangeData($key, &$objQuery)
{
$arrUpdate['mail_flag'] = 3;
$arrUpdate['secret_key'] = NULL;
$result = $objQuery->update("dtb_customer_mail", $arrUpdate, "secret_key = " . SC_Utils_Ex::sfQuoteSmart($key));
}
示例13: setWhereByOR
function setWhereByOR($arrWhere)
{
$count = count($arrWhere);
for ($i = 0; $i < $count; $i++) {
if (isset($arrWhere[$i]["value"])) {
$statement .= $arrWhere[$i]["column"] . " = " . SC_Utils_Ex::sfQuoteSmart($arrWhere[$i]["value"]) . " OR ";
}
}
$statement = "( " . rtrim($statement, " OR ") . " )";
if ($this->where) {
$this->where .= " AND " . $statement;
} else {
$this->where = "WHERE " . $statement;
}
}
示例14: lfRegistData
function lfRegistData($array)
{
$objQuery = new SC_Query();
$this->arrInfo;
do {
$secret = SC_Utils_Ex::sfGetUniqRandomId("r");
} while (($result = $objQuery->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($secret))) != 0);
$sql = "SELECT email FROM dtb_customer WHERE secret_key = ? AND status = 1";
$email = $objQuery->getOne($sql, array($array["id"]));
$objQuery->begin();
$arrRegist["secret_key"] = $secret;
// 本登録ID発行
$arrRegist["status"] = 2;
$arrRegist["update_date"] = "NOW()";
$where = "secret_key = ? AND status = 1";
$arrRet = $objQuery->select("point", "dtb_customer", $where, array($array["id"]));
// 会員登録時の加算ポイント(購入時会員登録の場合は、ポイント加算)
$arrRegist['point'] = $arrRet[0]['point'] + $arrInfo['welcome_point'];
$objQuery->update("dtb_customer", $arrRegist, $where, array($array["id"]));
/* 購入時の自動会員登録は行わないためDEL
// 購入時登録の場合、その回の購入を会員購入とみなす。
// 会員情報の読み込み
$where1 = "secret_key = ? AND status = 2";
$customer = $objQuery->select("*", "dtb_customer", $where1, array($secret));
// 初回購入情報の読み込み
$order_temp_id = $objQuery->get("dtb_order_temp", "order_temp_id");
// 購入情報の更新
if ($order_temp_id != null) {
$arrCustomer['customer_id'] = $customer[0]['customer_id'];
$where3 = "order_temp_id = ?";
$objQuery->update("dtb_order_temp", $arrCustomer, $where3, array($order_temp_id));
$objQuery->update("dtb_order", $arrCustomer, $where3, array($order_temp_id));
}
*/
$sql = "SELECT mailmaga_flg FROM dtb_customer WHERE email = ?";
$result = $objQuery->getOne($sql, array($email));
switch ($result) {
// 仮HTML
case '4':
$arrRegistMail["mailmaga_flg"] = 1;
break;
// 仮TEXT
// 仮TEXT
case '5':
$arrRegistMail["mailmaga_flg"] = 2;
break;
// 仮なし
// 仮なし
case '6':
$arrRegistMail["mailmaga_flg"] = 3;
break;
default:
$arrRegistMail["mailmaga_flg"] = $result;
break;
}
$objQuery->update("dtb_customer", $arrRegistMail, "email = " . SC_Utils_Ex::sfQuoteSmart($email) . " AND del_flg = 0");
$objQuery->commit();
return $secret;
// 本登録IDを返す
}
示例15: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objView = new SC_AdminView();
$objDb = new SC_Helper_DB_Ex();
$objDate = new SC_Date();
// 登録・更新検索開始年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE("Y"));
$this->arrStartYear = $objDate->getYear();
$this->arrStartMonth = $objDate->getMonth();
$this->arrStartDay = $objDate->getDay();
// 登録・更新検索終了年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE("Y"));
$this->arrEndYear = $objDate->getYear();
$this->arrEndMonth = $objDate->getMonth();
$this->arrEndDay = $objDate->getDay();
// 認証可否の判定
$objSess = new SC_Session();
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
//キャンペーンの編集時
if (isset($_POST['campaign_id']) && SC_Utils_Ex::sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") {
$objQuery = new SC_Query();
$search_data = $objQuery->get("dtb_campaign", "search_condition", "campaign_id = ? ", array($_POST['campaign_id']));
$arrSearch = unserialize($search_data);
foreach ($arrSearch as $key => $val) {
$_POST[$key] = $val;
}
}
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 検索ワードの引き継ぎ
foreach ($_POST as $key => $val) {
if (ereg("^search_", $key) || ereg("^campaign_", $key)) {
switch ($key) {
case 'search_product_flag':
case 'search_status':
$this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
if (!is_array($val)) {
$this->arrForm[$key] = split("-", $val);
}
break;
default:
$this->arrHidden[$key] = $val;
break;
}
}
}
// ページ送り用
$this->arrHidden['search_pageno'] = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
// 商品削除
if ($_POST['mode'] == "delete") {
if ($_POST['category_id'] != "") {
// ランク付きレコードの削除
$where = "category_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['category_id']);
$objDb->sfDeleteRankRecord("dtb_products", "product_id", $_POST['product_id'], $where);
} else {
$objDb->sfDeleteRankRecord("dtb_products", "product_id", $_POST['product_id']);
}
// 子テーブル(商品規格)の削除
$objQuery = new SC_Query();
$objQuery->delete("dtb_products_class", "product_id = ?", array($_POST['product_id']));
// 件数カウントバッチ実行
$objDb->sfCategory_Count($objQuery);
}
if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") {
// 入力文字の強制変換
$this->lfConvertParam();
// エラーチェック
$this->arrErr = $this->lfCheckError();
$where = "del_flg = 0";
$view_where = "del_flg = 0";
// 入力エラーなし
if (count($this->arrErr) == 0) {
$arrval = array();
foreach ($this->arrForm as $key => $val) {
$val = SC_Utils_Ex::sfManualEscape($val);
if ($val == "") {
continue;
}
switch ($key) {
case 'search_product_id':
// 商品ID
$where .= " AND product_id = ?";
$view_where .= " AND product_id = ?";
$arrval[] = $val;
break;
case 'search_product_class_name':
//規格名称
$where_in = " (SELECT classcategory_id FROM dtb_classcategory WHERE class_id IN (SELECT class_id FROM dtb_class WHERE name LIKE ?)) ";
$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE classcategory_id1 IN " . $where_in;
$where .= " OR classcategory_id2 IN" . $where_in . ")";
//.........这里部分代码省略.........