本文整理汇总了PHP中SC_Helper_DB_Ex::sfDeleteRankRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Helper_DB_Ex::sfDeleteRankRecord方法的具体用法?PHP SC_Helper_DB_Ex::sfDeleteRankRecord怎么用?PHP SC_Helper_DB_Ex::sfDeleteRankRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Helper_DB_Ex
的用法示例。
在下文中一共展示了SC_Helper_DB_Ex::sfDeleteRankRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
/**
* Page のアクション.
*
* @return void
*/
function action()
{
$objDb = new SC_Helper_DB_Ex();
$mode = $this->getMode();
if (!empty($_POST)) {
$objFormParam = new SC_FormParam_Ex();
$objFormParam->setParam($_POST);
$this->arrErr = $this->lfCheckError($mode, $objFormParam);
if (!empty($this->arrErr['deliv_id'])) {
SC_Utils_Ex::sfDispException();
return;
}
}
switch ($mode) {
case 'delete':
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord("dtb_deliv", "deliv_id", $_POST['deliv_id']);
$this->objDisplay->reload();
// PRG pattern
break;
case 'up':
$objDb->sfRankUp("dtb_deliv", "deliv_id", $_POST['deliv_id']);
$this->objDisplay->reload();
// PRG pattern
break;
case 'down':
$objDb->sfRankDown("dtb_deliv", "deliv_id", $_POST['deliv_id']);
$this->objDisplay->reload();
// PRG pattern
break;
default:
break;
}
$this->arrDelivList = $this->lfGetDelivList();
}
示例2: 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'] = "";
}
switch ($_POST['mode']) {
case 'delete':
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord("dtb_payment", "payment_id", $_POST['payment_id']);
// 再表示
$this->reload();
break;
case 'up':
$objDb->sfRankUp("dtb_payment", "payment_id", $_POST['payment_id']);
// 再表示
$this->reload();
break;
case 'down':
$objDb->sfRankDown("dtb_payment", "payment_id", $_POST['payment_id']);
// 再表示
$this->reload();
break;
}
$this->arrDelivList = $objDb->sfGetIDValueList("dtb_deliv", "deliv_id", "service_name");
$this->arrPaymentListFree = $this->lfGetPaymentList(2);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例3: action
function action()
{
$objDb = new SC_Helper_DB_Ex();
$objFormParam = new SC_FormParam_Ex();
$this->lfInitParam($objFormParam);
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$this->tpl_questionnaire_id = $objFormParam->getValue('questionnaire_id');
$mode = $this->getMode();
switch ($mode) {
case 'csv':
if (is_numeric($this->tpl_questionnaire_id)) {
$this->lfDoCSV($this->tpl_questionnaire_id);
}
break;
case 'delete':
if (is_numeric($this->tpl_questionnaire_id)) {
$objDb->sfDeleteRankRecord('dtb_questionnaire', 'questionnaire_id', $this->tpl_questionnaire_id);
$this->objDisplay->reload();
}
break;
case 'pre_edit':
if (is_numeric($this->tpl_questionnaire_id)) {
$arrContents = reset($this->lfGetContents($this->tpl_questionnaire_id));
$arrContents['question'] = unserialize($arrContents['question']);
$objFormParam->setParam($arrContents);
}
break;
//---- 新規登録/編集登録
//---- 新規登録/編集登録
case 'confirm':
$this->arrErr = $this->lfCheckError($objFormParam);
if (SC_Utils_Ex::isBlank($this->arrErr)) {
// IDの値がPOSTされて来た場合は既存データの編集とみなす
$member_id = $_SESSION['member_id'];
$this->lfRegistData($objFormParam, $member_id, $this->tpl_questionnaire_id);
$this->tpl_onload = "window.alert('登録が完了しました');";
}
break;
default:
break;
}
$this->arrForm = $objFormParam->getFormParamList();
$this->arrContents = $this->lfGetContents();
}
示例4: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objQuery = new SC_Query();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
switch ($_POST['mode']) {
case 'delete':
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord("dtb_deliv", "deliv_id", $_POST['deliv_id']);
// 再表示
SC_Utils_Ex::sfReload();
break;
case 'up':
$objDb->sfRankUp("dtb_deliv", "deliv_id", $_POST['deliv_id']);
// 再表示
SC_Utils_Ex::sfReload();
break;
case 'down':
$objDb->sfRankDown("dtb_deliv", "deliv_id", $_POST['deliv_id']);
// 再表示
SC_Utils_Ex::sfReload();
break;
default:
break;
}
// 配送業者一覧の取得
$col = "deliv_id, name, service_name";
$where = "del_flg = 0";
$table = "dtb_deliv";
$objQuery->setorder("rank DESC");
$this->arrDelivList = $objQuery->select($col, $table, $where);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例5: action
/**
* Page のアクション.
*
* @return void
*/
function action()
{
$objDb = new SC_Helper_DB_Ex();
$mode = $this->getMode();
if (!empty($_POST)) {
$objFormParam = new SC_FormParam_Ex();
$objFormParam->addParam('配送業者ID', 'payment_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$arrErr = $objFormParam->checkError();
if (!empty($this->arrErr['payment_id'])) {
trigger_error('', E_USER_ERROR);
return;
}
$post = $objFormParam->getHashArray();
}
switch ($this->getMode()) {
case 'delete':
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord('dtb_payment', 'payment_id', $post['payment_id']);
// 再表示
$this->objDisplay->reload();
break;
case 'up':
$objDb->sfRankUp('dtb_payment', 'payment_id', $post['payment_id']);
// 再表示
$this->objDisplay->reload();
break;
case 'down':
$objDb->sfRankDown('dtb_payment', 'payment_id', $post['payment_id']);
// 再表示
$this->objDisplay->reload();
break;
}
$this->arrDelivList = $objDb->sfGetIDValueList('dtb_deliv', 'deliv_id', 'service_name');
$this->arrPaymentListFree = $this->lfGetPaymentList();
}
示例6: 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);
}
示例7: 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->objFormParam = new SC_FormParam();
// パラメータ情報の初期化
$this->lfInitParam();
// POST値の取得
$this->objFormParam->setParam($_POST);
// 通常時は親カテゴリを0に設定する。
$this->arrForm['parent_category_id'] = isset($_POST['parent_category_id']) ? $_POST['parent_category_id'] : "";
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
switch ($_POST['mode']) {
case 'edit':
$this->objFormParam->convParam();
$arrRet = $this->objFormParam->getHashArray();
$this->arrErr = $this->lfCheckError($arrRet);
if (count($this->arrErr) == 0) {
if ($_POST['category_id'] == "") {
$objQuery = new SC_Query();
$count = $objQuery->count("dtb_category");
if ($count < CATEGORY_MAX) {
$this->lfInsertCat($_POST['parent_category_id']);
} else {
print "カテゴリの登録最大数を超えました。";
}
} else {
$this->lfUpdateCat($_POST['category_id']);
}
} else {
$this->arrForm = array_merge($this->arrForm, $this->objFormParam->getHashArray());
$this->arrForm['category_id'] = $_POST['category_id'];
}
break;
case 'pre_edit':
// 編集項目のカテゴリ名をDBより取得する。
$oquery = new SC_Query();
$where = "category_id = ?";
$cat_name = $oquery->get("dtb_category", "category_name", $where, array($_POST['category_id']));
$description = $oquery->get("dtb_category", "description", $where, array($_POST['category_id']));
// 入力項目にカテゴリ名を入力する。
$this->arrForm['category_name'] = $cat_name;
$this->arrForm['description'] = $description;
// POSTデータを引き継ぐ
$this->arrForm['category_id'] = $_POST['category_id'];
break;
case 'delete':
$objQuery = new SC_Query();
// 子カテゴリのチェック
$where = "parent_category_id = ? AND del_flg = 0";
$count = $objQuery->count("dtb_category", $where, array($_POST['category_id']));
if ($count != 0) {
$this->arrErr['category_name'] = "※ 子カテゴリが存在するため削除できません。<br>";
}
// 登録商品のチェック
$table = "dtb_product_categories AS T1 LEFT JOIN dtb_products AS T2 ON T1.product_id = T2.product_id";
$where = "T1.category_id = ? AND T2.del_flg = 0";
$count = $objQuery->count($table, $where, array($_POST['category_id']));
if ($count != 0) {
$this->arrErr['category_name'] = "※ カテゴリ内に商品が存在するため削除できません。<br>";
}
if (!isset($this->arrErr['category_name'])) {
// ランク付きレコードの削除(※処理負荷を考慮してレコードごと削除する。)
$objDb->sfDeleteRankRecord("dtb_category", "category_id", $_POST['category_id'], "", true);
}
break;
case 'up':
$objQuery = new SC_Query();
$objQuery->begin();
$up_id = $this->lfGetUpRankID($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
if ($up_id != "") {
// 上のグループのrankから減算する数
$my_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
// 自分のグループのrankに加算する数
$up_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $up_id);
if ($my_count > 0 && $up_count > 0) {
// 自分のグループに加算
$this->lfUpRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id'], $up_count);
// 上のグループから減算
$this->lfDownRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $up_id, $my_count);
}
}
$objQuery->commit();
break;
case 'down':
$objQuery = new SC_Query();
$objQuery->begin();
$down_id = $this->lfGetDownRankID($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
//.........这里部分代码省略.........
示例8: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objSess = new SC_Session();
$objQuery = new SC_Query();
$objDb = new SC_Helper_DB_Ex();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
// 要求判定
switch ($_POST['mode']) {
// 編集処理
case 'edit':
// POST値の引き継ぎ
$this->arrForm = $_POST;
// 入力文字の変換
$this->arrForm = $this->lfConvertParam($this->arrForm);
// エラーチェック
$this->arrErr = $this->lfErrorCheck();
if (count($this->arrErr) <= 0) {
if ($_POST['class_id'] == "") {
$this->lfInsertClass($this->arrForm);
// 新規作成
} else {
$this->lfUpdateClass($this->arrForm);
// 既存編集
}
// 再表示
$this->reload();
} else {
// POSTデータを引き継ぐ
$this->tpl_class_id = $_POST['class_id'];
}
break;
// 削除
// 削除
case 'delete':
$objDb->sfDeleteRankRecord("dtb_class", "class_id", $_POST['class_id'], "", true);
$objQuery = new SC_Query();
$objQuery->delete("dtb_classcategory", "class_id = ?", $_POST['class_id']);
// 再表示
$this->reload();
break;
// 編集前処理
// 編集前処理
case 'pre_edit':
// 編集項目をDBより取得する。
$where = "class_id = ?";
$class_name = $objQuery->get("dtb_class", "name", $where, array($_POST['class_id']));
// 入力項目にカテゴリ名を入力する。
$this->arrForm['name'] = $class_name;
// POSTデータを引き継ぐ
$this->tpl_class_id = $_POST['class_id'];
break;
case 'down':
$objDb->sfRankDown("dtb_class", "class_id", $_POST['class_id']);
// 再表示
$this->reload();
break;
case 'up':
$objDb->sfRankUp("dtb_class", "class_id", $_POST['class_id']);
// 再表示
$this->reload();
break;
default:
break;
}
// 規格の読込
$where = "del_flg <> 1";
$objQuery->setorder("rank DESC");
$this->arrClass = $objQuery->select("name, class_id", "dtb_class", $where);
$this->arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount();
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
示例9: 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 . ")";
//.........这里部分代码省略.........
示例10: deleteNews
/**
* ニュースの削除.
*
* @param integer $news_id ニュースID
* @return void
*/
public function deleteNews($news_id)
{
$objDb = new SC_Helper_DB_Ex();
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord('dtb_news', 'news_id', $news_id);
}
示例11: computeRankForDelete
/**
* 削除する新着情報以降のrankを1つ繰り上げる。
* @param Integer $news_id
* @param Integer $rank
*/
function computeRankForDelete($news_id, $rank)
{
SC_Helper_DB_Ex::sfDeleteRankRecord('dtb_news', 'news_id', $news_id);
}
示例12: deleteKiyaku
/**
* 会員規約の削除.
*
* @param integer $kiyaku_id 会員規約ID
* @return void
*/
public function deleteKiyaku($kiyaku_id)
{
$objDb = new SC_Helper_DB_Ex();
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord('dtb_kiyaku', 'kiyaku_id', $kiyaku_id);
}
示例13: delete
/**
* カテゴリーの削除
*
* @param int $category_id カテゴリーID
* @return void
*/
public function delete($category_id)
{
$objDb = new SC_Helper_DB_Ex();
// ランク付きレコードの削除(※処理負荷を考慮してレコードごと削除する。)
$objDb->sfDeleteRankRecord('dtb_category', 'category_id', $category_id, '', true);
}
示例14: delete
/**
* 休日の削除.
*
* @param integer $holiday_id 休日ID
* @return void
*/
public function delete($holiday_id)
{
$objDb = new SC_Helper_DB_Ex();
// ランク付きレコードの削除
$objDb->sfDeleteRankRecord('dtb_holiday', 'holiday_id', $holiday_id, '', true);
}
示例15: lfDelete
/**
* メーカー情報削除.
*
* @param integer $maker_id メーカーID
* @return void
*/
function lfDelete($maker_id)
{
$objDb = new SC_Helper_DB_Ex();
$objDb->sfDeleteRankRecord('dtb_maker', 'maker_id', $maker_id, '', true);
}