本文整理汇总了PHP中SC_Query::update方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::update方法的具体用法?PHP SC_Query::update怎么用?PHP SC_Query::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Query
的用法示例。
在下文中一共展示了SC_Query::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
function install(array $arrPlugin, SC_Plugin_Installer $installer)
{
$plugin_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$upload_plugin_dir = PLUGIN_UPLOAD_REALDIR . $arrPlugin["plugin_code"] . DIRECTORY_SEPARATOR;
$backup_plugin_dir = PLUGIN_UPLOAD_REALDIR . $arrPlugin["plugin_code"] . "_" . date("Ymd") . DIRECTORY_SEPARATOR;
if (!is_dir($backup_plugin_dir)) {
SC_Utils_Ex::sfCopyDir($upload_plugin_dir, $backup_plugin_dir);
}
SC_Helper_FileManager_Ex::deleteFile($upload_plugin_dir, false);
SC_Utils_Ex::sfCopyDir($plugin_dir . "/", $upload_plugin_dir);
SC_Utils_Ex::sfCopyDir($plugin_dir . "/copy/Smarty/templates/admin/", TEMPLATE_ADMIN_REALDIR);
SC_Utils_Ex::sfCopyDir($plugin_dir . "/copy/modules/", DATA_REALDIR . "module/");
// logo コピー
$installer->copyDirectory("copy/plugin_dir/", "");
$table = "dtb_products";
$fields = array('auto_display_status' => $this->intColumn('自動公開'), 'auto_display_start_date' => $this->timestampColumn('公開開始日'), 'auto_display_end_date' => $this->timestampColumn('公開終了日'));
$type = "timestamp";
$definition = compact("type");
foreach ($fields as $name => $define) {
$this->objDb->sfColumnExists($table, $name, $define["type"], "", true);
$this->fieldComment($installer, $table, $name, $define["comment"]);
switch ($define["type"]) {
case "timestamp":
break;
default:
continue;
}
$change = array();
$change[$name] = compact('definition');
$this->objManager->alterTable($table, compact("change"), false);
}
$this->objQuery->update("dtb_products", array(), "auto_display_start_date IS NULL", array(), array("auto_display_start_date" => "create_date"));
$masterfields = array("id" => $this->intColumn("ID"), "name" => $this->textColumn("NAME"), "rank" => $this->intColumn("RANK"));
$table = "atd_mtb_auto_display_status";
if ($this->objDb->sfColumnExists($table, "id") == false) {
$this->objManager->createTable($table, $masterfields);
}
foreach ($masterfields as $name => $define) {
$this->objDb->sfColumnExists($table, $name, $define["type"], "", true);
$this->fieldComment($installer, $table, $name, $define["comment"]);
}
$this->masterdata->deleteMasterData($table);
$this->masterdata->clearCache($table);
$this->masterdata->registMasterData($table, array(), explode(",", "常時公開,時限公開"));
// $this->insertMasterData ( "PRODUCTS_RESULT_ROWSPAN", 1, '管理画面/商品管理一覧 行結合数' );
// $this->insertMasterData ( "PRODUCTS_RESULT_COLUMN", 5, '管理画面/商品管理一覧 列位置' );
// $this->insertMasterData ( "PRODUCTS_SEARCH_AUTO_DISPLAY", 1, '検索画面表示設定(1: ON/ 0:OFF)' );
// $this->insertMasterData ( "PRODUCTS_DETAIL_AUTO_DISPLAY", 1, '検索画面表示設定(1: ON/ 0:OFF)' );
}
示例2: changeStatus
/**
* 公開状態変更
*
* @param unknown $device_id
*/
static function changeStatus($device_id, SC_Query $objQuery)
{
$objQuery->update("cp_dtb_device", array("update_date" => "CURRENT_TIMESTAMP"), "device_id=? AND del_flg=0", (array) $device_id, array("status" => "CASE WHEN status = 1 THEN 2 ELSE 1 END"));
}
示例3: 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;
}
示例4: lfUpdateData
function lfUpdateData()
{
// 入力データを渡す。
$sqlval = $this->objFormParam->getHashArray();
$sqlval['update_date'] = 'Now()';
$objQuery = new SC_Query();
// UPDATEの実行
$ret = $objQuery->update("dtb_baseinfo", $sqlval);
}
示例5: 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 == "") {
//.........这里部分代码省略.........
示例6: lfGetPayLimit
break;
//ミニストップ、デイリーヤマザキ、ヤマザキデイリーストア
//ミニストップ、デイリーヤマザキ、ヤマザキデイリーストア
case '5':
$arrRet['cv_type'] = '5';
//コンビニの種類
$arrRet['cv_payment_url'] = $arrResult[RES_HARAIKOMI_URL];
//払込票URL(PC)
break;
}
//支払期限
$arrRet['cv_payment_limit'] = lfGetPayLimit();
//コンビニ決済情報を格納
$sqlval['conveni_data'] = serialize($arrRet);
$objQuery = new SC_Query();
$objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ? ", array($uniqid));
// 正常に登録されたことを記録しておく
$objSiteSess->setRegistFlag();
//購入完了ページへ
header("Location: " . URL_SHOP_COMPLETE);
//失敗
} else {
$objPage->arrErr = 'エラーが発生しました。';
}
# ログ出力(ここまで)
$logger->logprint('DEBUG', '<<< 支払結果画面処理終了. >>>');
}
break;
//戻る
//戻る
case 'return':
示例7: lfUpdateCat
function lfUpdateCat($category_id)
{
$objQuery = new SC_Query();
// 入力データを渡す。
$sqlval = $this->objFormParam->getHashArray();
$sqlval['update_date'] = "Now()";
$where = "category_id = ?";
$objQuery->update("dtb_category", $sqlval, $where, array($category_id));
}
示例8: lfCopyDeliv
function lfCopyDeliv($uniqid, $arrData)
{
$objQuery = new SC_Query();
// 別のお届け先を指定していない場合、配送先に登録住所をコピーする。
if ($arrData["deliv_check"] != "1") {
$sqlval['deliv_name01'] = $arrData['order_name01'];
$sqlval['deliv_name02'] = $arrData['order_name02'];
$sqlval['deliv_kana01'] = $arrData['order_kana01'];
$sqlval['deliv_kana02'] = $arrData['order_kana02'];
$sqlval['deliv_pref'] = $arrData['order_pref'];
$sqlval['deliv_zip01'] = $arrData['order_zip01'];
$sqlval['deliv_zip02'] = $arrData['order_zip02'];
$sqlval['deliv_addr01'] = $arrData['order_addr01'];
$sqlval['deliv_addr02'] = $arrData['order_addr02'];
$sqlval['deliv_tel01'] = $arrData['order_tel01'];
$sqlval['deliv_tel02'] = $arrData['order_tel02'];
$sqlval['deliv_tel03'] = $arrData['order_tel03'];
$where = "order_temp_id = ?";
$objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
}
}
示例9: 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;
}
示例10: sfEditCustomerData
/**
* 会員編集登録処理を行う.
*
* @param array $array パラメータの配列
* @param array $arrRegistColumn 登録するカラムの配列
* @return void
*/
function sfEditCustomerData($array, $arrRegistColumn)
{
$objQuery = new SC_Query();
foreach ($arrRegistColumn as $data) {
if ($data["column"] != "password") {
if ($array[$data['column']] != "") {
$arrRegist[$data["column"]] = $array[$data["column"]];
} else {
$arrRegist[$data['column']] = NULL;
}
}
}
if (strlen($array["year"]) > 0 && strlen($array["month"]) > 0 && strlen($array["day"]) > 0) {
$arrRegist["birth"] = $array["year"] . "/" . $array["month"] . "/" . $array["day"] . " 00:00:00";
} else {
$arrRegist["birth"] = NULL;
}
//-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない)
if ($array["password"] != DEFAULT_PASSWORD) {
$arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC);
}
$arrRegist["update_date"] = "NOW()";
//-- 編集登録実行
$objQuery->begin();
$objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id']));
$objQuery->commit();
}
示例11: process
/**
* Page のプロセス.
*
* @return void
*/
function process()
{
$objQuery = new SC_Query();
$objView = new SC_AdminView();
$objSess = new SC_Session();
// 認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
$arrActive = array("0" => "稼働", "1" => "非稼働");
$arrQuestion = array("0" => "使用しない", "1" => "テキストエリア", "2" => "テキストボックス", "3" => "チェックボックス", "4" => "ラジオボタン");
$result = $objQuery->select('*, cast(create_date as date) as disp_date', 'dtb_question', 'del_flg = 0 ORDER BY question_id');
$this->list_data = $result;
if (!isset($_GET['mode'])) {
$_GET['mode'] = "";
}
// アンケートを作成ボタン押下時
if ($_GET['mode'] == 'regist') {
for ($i = 0; $i < count($_POST["question"]); $i++) {
$_POST['question'][$i]['name'] = mb_convert_kana(trim($_POST['question'][$i]['name']), "K");
for ($j = 0; $j < count($_POST['question'][$i]['option']); $j++) {
$_POST['question'][$i]['option'][$j] = mb_convert_kana(trim($_POST['question'][$i]['option'][$j]));
}
}
$error = $this->lfErrCheck();
if (!$error) {
// 新規登録
if (!is_numeric($_POST['question_id'])) {
//登録
$value = serialize($_POST);
if (DB_TYPE == "pgsql") {
$question_id = $objQuery->nextval('dtb_question', 'question_id');
}
$sql_val = array('question' => $value, 'question_name' => $_POST['title'], 'question_id' => $question_id, 'create_date' => 'now()');
$objQuery->insert('dtb_question', $sql_val);
$this->MESSAGE = "登録が完了しました";
if (DB_TYPE == "mysql") {
$question_id = $objQuery->nextval('dtb_question', 'question_id');
}
$this->QUESTION_ID = $question_id;
$this->reload(null, true);
// 編集
} else {
//編集
$value = serialize($_POST);
$sql_val = array('question' => $value, 'question_name' => $_POST['title']);
$objQuery->update('dtb_question', $sql_val, 'question_id = ?', array($_POST['question_id']));
$this->MESSAGE = "編集が完了しました";
$this->QUESTION_ID = $_POST['question_id'];
$this->reload(null, true);
}
} else {
//エラー表示
$this->ERROR = $error;
$this->QUESTION_ID = $_REQUEST['question_id'];
$this->ERROR_COLOR = $this->lfGetErrColor($error, ERR_COLOR);
}
// 削除ボタン押下時
} elseif ($_GET['mode'] == 'delete' && SC_Utils_Ex::sfCheckNumLength($_GET['question_id'])) {
$sqlval = array('del_flg' => 1);
$objQuery->update('dtb_question', $sqlval, 'question_id = ?', array($_GET['question_id']));
$this->reload(null, true);
// CSVダウンロードボタン押下時
} elseif ($_GET['mode'] == 'csv' && SC_Utils_Ex::sfCheckNumLength($_GET['question_id'])) {
require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
$objCSV = new SC_Helper_CSV_Ex();
$head = SC_Utils_Ex::sfGetCSVList($this->arrCVSTITLE);
$sql = <<<__EOS__
SELECT
dtb_question_result.result_id
,dtb_question_result.question_id
,dtb_question_result.create_date
,dtb_question.question_name
,dtb_question_result.name01
,dtb_question_result.name02
,dtb_question_result.kana01
,dtb_question_result.kana02
,dtb_question_result.zip01
,dtb_question_result.zip02
,dtb_question_result.pref
,dtb_question_result.addr01
,dtb_question_result.addr02
,dtb_question_result.tel01
,dtb_question_result.tel02
,dtb_question_result.tel03
,dtb_question_result.mail01
,dtb_question_result.question01
,dtb_question_result.question02
,dtb_question_result.question03
,dtb_question_result.question04
,dtb_question_result.question05
,dtb_question_result.question06
FROM dtb_question_result
LEFT JOIN dtb_question
ON dtb_question_result.question_id = dtb_question.question_id
WHERE 0=0
AND dtb_question_result.del_flg = 0
//.........这里部分代码省略.........
示例12: updateMemberData
/**
* 管理者データをUpdateする.
*
* @param array 管理者データの連想配列
* @return void
*/
function updateMemberData($member_id, $arrMemberData)
{
$objQuery = new SC_Query();
// Updateする値を作成する.
$sqlVal = array();
$sqlVal['name'] = $arrMemberData['name'];
$sqlVal['department'] = $arrMemberData['department'];
$sqlVal['login_id'] = $arrMemberData['login_id'];
$sqlVal['authority'] = $arrMemberData['authority'];
$sqlVal['update_date'] = 'NOW()';
if ($arrMemberData['password'] != DUMMY_PASS) {
$sqlVal['password'] = sha1($arrMemberData['password'] . ":" . AUTH_MAGIC);
}
$where = "member_id = ?";
// UPDATEの実行
$objQuery->update("dtb_member", $sqlVal, $where, array($member_id));
}
示例13: mobileProcess
/**
* Page のプロセス(モバイル).
*
* @return void
*/
function mobileProcess()
{
// 買い物を続ける場合
if (!isset($_REQUEST['continue'])) {
$_REQUEST['continue'] = "";
}
if ($_REQUEST['continue']) {
$this->sendRedirect($this->getLocation(MOBILE_URL_SITE_TOP), true);
exit;
}
$objView = new SC_MobileView(false);
$objCartSess = new SC_CartSession("", false);
$objSiteSess = new SC_SiteSession();
$objSiteInfo = $objView->objSiteInfo;
$objCustomer = new SC_Customer();
$objDb = new SC_Helper_DB_Ex();
// 基本情報の取得
$arrInfo = $objSiteInfo->data;
// 商品購入中にカート内容が変更された。
if ($objCartSess->getCancelPurchase()) {
$this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。";
}
if (!isset($_POST['mode'])) {
$_POST['mode'] = "";
}
switch ($_POST['mode']) {
case 'confirm':
// カート内情報の取得
$arrRet = $objCartSess->getCartList();
$max = count($arrRet);
$cnt = 0;
for ($i = 0; $i < $max; $i++) {
// 商品規格情報の取得
$arrData = $objDb->sfGetProductsClass($arrRet[$i]['id']);
// DBに存在する商品
if ($arrData != "") {
$cnt++;
}
}
// カート商品が1件以上存在する場合
if ($cnt > 0) {
// 正常に登録されたことを記録しておく
$objSiteSess->setRegistFlag();
$pre_uniqid = $objSiteSess->getUniqId();
// 注文一時IDの発行
$objSiteSess->setUniqId();
$uniqid = $objSiteSess->getUniqId();
// エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ
if ($pre_uniqid != "") {
$sqlval['order_temp_id'] = $uniqid;
$where = "order_temp_id = ?";
$objQuery = new SC_Query();
$objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid));
}
// カートを購入モードに設定
$objCartSess->saveCurrentCart($uniqid);
// 購入ページへ
$this->sendRedirect(MOBILE_URL_SHOP_TOP, true);
exit;
}
break;
default:
break;
}
if (!isset($_GET['mode'])) {
$_GET['mode'] = "";
}
/*
* FIXME sendRedirect() を使った方が良いが無限ループしてしまう...
*/
switch ($_GET['mode']) {
case 'up':
$objCartSess->upQuantity($_GET['cart_no']);
SC_Utils_Ex::sfReload(session_name() . "=" . session_id());
break;
case 'down':
$objCartSess->downQuantity($_GET['cart_no']);
SC_Utils_Ex::sfReload(session_name() . "=" . session_id());
break;
case 'delete':
$objCartSess->delProduct($_GET['cart_no']);
SC_Utils_Ex::sfReload(session_name() . "=" . session_id());
break;
}
// カート集計処理
if (empty($arrData)) {
$arrData = array();
}
$objDb->sfTotalCart($this, $objCartSess, $arrInfo);
$this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo, $objCustomer);
$this->arrInfo = $arrInfo;
// ログイン判定
if ($objCustomer->isLoginSuccess(true)) {
$this->tpl_login = true;
$this->tpl_user_point = $objCustomer->getValue('point');
//.........这里部分代码省略.........
示例14: lfUninstallModule
function lfUninstallModule()
{
global $objPage;
$objQuery = new SC_Query();
$arrRet = $objQuery->select("module_id, extern_php, other_files, install_sql, uninstall_sql, latest_version", "dtb_module", "module_id = ?", array($_POST['module_id']));
$flg_ok = true;
// 処理の成功判定
if (count($arrRet) > 0) {
// モジュールを削除する
$objQuery->query("UPDATE dtb_payment SET del_flg = 1 WHERE module_id = ?", array($arrRet[0]['module_id']));
$arrFiles = array();
if ($arrRet[0]['other_files'] != "") {
$arrFiles = split("\\|", $arrRet[0]['other_files']);
}
$arrFiles[] = $arrRet[0]['extern_php'];
foreach ($arrFiles as $val) {
$path = MODULE_PATH . $val;
// ファイルを削除する
if (file_exists($path) && unlink($path)) {
$objPage->update_mess .= ">> " . $path . ":削除成功<br>";
} else {
$objPage->update_mess .= ">> " . $path . ":削除失敗<br>";
}
}
// 必要なSQL文の実行
if ($arrRet[0]['uninstall_sql'] != "") {
// SQL文実行、パラーメータなし、エラー無視
$ret = $objQuery->query($arrRet[0]['uninstall_sql'], "", true);
if (DB::isError($ret)) {
// エラー文を取得する
ereg("\\[(.*)\\]", $ret->userinfo, $arrKey);
$objPage->update_mess .= ">> テーブル構成の変更に失敗しました。<br>";
$objPage->update_mess .= $arrKey[0] . "<br>";
$flg_ok = false;
} else {
$objPage->update_mess .= ">> テーブル構成の変更を行いました。<br>";
}
}
} else {
sfErrorHeader(">> 対象の機能は、配布を終了しております。");
}
if ($flg_ok) {
// バージョン情報を削除する。
$sqlval['now_version'] = "";
$sqlval['update_date'] = "now()";
$objQuery->update("dtb_module", $sqlval, "module_id = ?", array($arrRet[0]['module_id']));
}
}
示例15: lfRegistProductClass
/**
* 商品規格登録を行う.
*
* @param SC_Query $objQuery SC_Queryインスタンス
* @param array $arrList 商品規格情報配列
* @param integer $product_id 商品ID
* @param integer $product_class_id 商品規格ID
* @return void
*/
function lfRegistProductClass($objQuery, $arrList, $product_id, $product_class_id)
{
$sqlval['product_code'] = $arrList["product_code"];
$sqlval['stock'] = $arrList["stock"];
if ($sqlval['stock'] == "") {
$sqlval['stock_unlimited'] = '1';
} else {
$sqlval['stock_unlimited'] = '0';
}
$sqlval['price01'] = $arrList['price01'];
$sqlval['price02'] = $arrList['price02'];
$sqlval['creator_id'] = $_SESSION['member_id'];
// TODO $sqlval['member_id'] は何処から出てくる?
if ($sqlval['member_id'] == "") {
$sqlval['creator_id'] = '0';
}
if ($product_class_id == "") {
// 新規登録
$where = "product_id = ?";
// 念のために既存の規格を削除
$objQuery->delete("dtb_products_class", $where, array($product_id));
$sqlval['product_id'] = $product_id;
$sqlval['classcategory_id1'] = '0';
$sqlval['classcategory_id2'] = '0';
$sqlval['create_date'] = "now()";
$objQuery->insert("dtb_products_class", $sqlval);
} else {
// 既存編集
$where = "product_id = ? AND product_class_id = ?";
$objQuery->update("dtb_products_class", $sqlval, $where, array($product_id, $product_class_id));
}
}