当前位置: 首页>>代码示例>>PHP>>正文


PHP SC_Query::nextval方法代码示例

本文整理汇总了PHP中SC_Query::nextval方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::nextval方法的具体用法?PHP SC_Query::nextval怎么用?PHP SC_Query::nextval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SC_Query的用法示例。


在下文中一共展示了SC_Query::nextval方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lfRegistProduct

 function lfRegistProduct($arrList)
 {
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     $objQuery->begin();
     // 配列の添字を定義
     $checkArray = array("name", "status", "product_flag", "main_list_comment", "main_comment", "point_rate", "deliv_fee", "comment1", "comment2", "comment3", "comment4", "comment5", "comment6", "main_list_comment", "sale_limit", "sale_unlimited", "deliv_date_id", "note");
     $arrList = SC_Utils_Ex::arrayDefineIndexes($arrList, $checkArray);
     // INSERTする値を作成する。
     $sqlval['name'] = $arrList['name'];
     $sqlval['status'] = $arrList['status'];
     $sqlval['product_flag'] = $arrList['product_flag'];
     $sqlval['main_list_comment'] = $arrList['main_list_comment'];
     $sqlval['main_comment'] = $arrList['main_comment'];
     $sqlval['point_rate'] = $arrList['point_rate'];
     $sqlval['deliv_fee'] = $arrList['deliv_fee'];
     $sqlval['comment1'] = $arrList['comment1'];
     $sqlval['comment2'] = $arrList['comment2'];
     $sqlval['comment3'] = $arrList['comment3'];
     $sqlval['comment4'] = $arrList['comment4'];
     $sqlval['comment5'] = $arrList['comment5'];
     $sqlval['comment6'] = $arrList['comment6'];
     $sqlval['main_list_comment'] = $arrList['main_list_comment'];
     $sqlval['sale_limit'] = $arrList['sale_limit'];
     $sqlval['sale_unlimited'] = $arrList['sale_unlimited'];
     $sqlval['deliv_date_id'] = $arrList['deliv_date_id'];
     $sqlval['note'] = $arrList['note'];
     $sqlval['update_date'] = "Now()";
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $arrRet = $this->objUpFile->getDBFileList();
     $sqlval = array_merge($sqlval, $arrRet);
     $arrList['category_id'] = unserialize($arrList['category_id']);
     for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
         $sqlval['sub_title' . $cnt] = $arrList['sub_title' . $cnt];
         $sqlval['sub_comment' . $cnt] = $arrList['sub_comment' . $cnt];
     }
     if ($arrList['product_id'] == "") {
         // product_id 取得(PostgreSQLの場合)
         if (DB_TYPE == 'pgsql') {
             $product_id = $objQuery->nextval("dtb_products", "product_id");
             $sqlval['product_id'] = $product_id;
         }
         // INSERTの実行
         $sqlval['create_date'] = "Now()";
         $objQuery->insert("dtb_products", $sqlval);
         // product_id 取得(MySQLの場合)
         if (DB_TYPE == 'mysql') {
             $product_id = $objQuery->nextval("dtb_products", "product_id");
         }
         // カテゴリを更新
         $objDb->updateProductCategories($arrList['category_id'], $product_id);
         // コピー商品の場合には規格もコピーする
         if ($_POST["copy_product_id"] != "" and SC_Utils_Ex::sfIsInt($_POST["copy_product_id"])) {
             if ($this->tpl_nonclass) {
                 //規格なしの場合、コピーは価格等の入力が発生しているため、その内容で追加登録を行う
                 $arrList['product_id'] = $product_id;
                 $this->lfCopyProductClass($arrList, $objQuery);
             } else {
                 //規格がある場合のコピーは複製元の内容で追加登録を行う
                 // dtb_products_class のカラムを取得
                 $dbFactory = SC_DB_DBFactory_Ex::getInstance();
                 $arrColList = $dbFactory->sfGetColumnList("dtb_products_class", $objQuery);
                 $arrColList_tmp = array_flip($arrColList);
                 // コピーしない列
                 unset($arrColList[$arrColList_tmp["product_class_id"]]);
                 //規格ID
                 unset($arrColList[$arrColList_tmp["product_id"]]);
                 //商品ID
                 unset($arrColList[$arrColList_tmp["create_date"]]);
                 $col = SC_Utils_Ex::sfGetCommaList($arrColList);
                 $objQuery->query("INSERT INTO dtb_products_class (product_id, create_date, " . $col . ") SELECT ?, now(), " . $col . " FROM dtb_products_class WHERE product_id = ? ORDER BY product_class_id", array($product_id, $_POST["copy_product_id"]));
             }
         }
     } else {
         $product_id = $arrList['product_id'];
         // 削除要求のあった既存ファイルの削除
         $arrRet = $this->lfGetProduct($arrList['product_id']);
         $this->objUpFile->deleteDBFile($arrRet);
         // UPDATEの実行
         $where = "product_id = ?";
         $objQuery->update("dtb_products", $sqlval, $where, array($product_id));
         // カテゴリを更新
         $objDb->updateProductCategories($arrList['category_id'], $product_id);
     }
     //商品登録の時は規格を生成する。複製の場合は規格も複製されるのでこの処理は不要。
     if ($_POST["copy_product_id"] == "") {
         // 規格登録
         SC_Utils_Ex::sfInsertProductClass($objQuery, $arrList, $product_id, $arrList['product_class_id']);
     }
     // おすすめ商品登録
     $this->lfInsertRecommendProducts($objQuery, $arrList, $product_id);
     $objQuery->commit();
     return $product_id;
 }
开发者ID:RyotaKaji,项目名称:eccube-2.4.1,代码行数:94,代码来源:LC_Page_Admin_Products_Product.php

示例2: lfRegistData

 /**
  * 配送情報を登録する
  *
  * @return $deliv_id 
  */
 function lfRegistData()
 {
     $arrRet = $this->objFormParam->getHashArray();
     $objQuery = new SC_Query();
     $objQuery->begin();
     // 入力データを渡す。
     $sqlval['name'] = $arrRet['name'];
     $sqlval['service_name'] = $arrRet['service_name'];
     $sqlval['confirm_url'] = $arrRet['confirm_url'];
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $sqlval['update_date'] = 'Now()';
     // deliv_id が決まっていた場合
     if ($_POST['deliv_id'] != "") {
         $deliv_id = $_POST['deliv_id'];
         $where = "deliv_id = ?";
         $objQuery->update("dtb_deliv", $sqlval, $where, array($deliv_id));
         // 配送時間の登録
         $table = "dtb_delivtime";
         $where = "deliv_id = ? AND time_id = ?";
         for ($cnt = 1; $cnt <= DELIVTIME_MAX; $cnt++) {
             $sqlval = array();
             $keyname = "deliv_time" . $cnt;
             $arrval = array($deliv_id, $cnt * $deliv_id);
             // 既存データの有無を確認
             $curData = $objQuery->select("*", $table, $where, $arrval);
             if (strcmp($arrRet[$keyname], "") != 0) {
                 $sqlval['deliv_time'] = $arrRet[$keyname];
                 // 入力が空ではなく、DBに情報があれば更新
                 if (count($curData)) {
                     $objQuery->update($table, $sqlval, $where, $arrval);
                 } else {
                     $sqlval['deliv_id'] = $deliv_id;
                     $sqlval['time_id'] = $cnt * $deliv_id;
                     $objQuery->insert($table, $sqlval);
                 }
             } else {
                 if (count($curData)) {
                     $objQuery->delete($table, $where, $arrval);
                 }
             }
         }
         // 配送料の登録
         if (INPUT_DELIV_FEE) {
             for ($cnt = 1; $cnt <= DELIVFEE_MAX; $cnt++) {
                 $keyname = "fee" . $cnt;
                 if (strcmp($arrRet[$keyname], "") != 0) {
                     $sqlval = array('fee' => $arrRet[$keyname]);
                     $objQuery->update("dtb_delivfee", $sqlval, "deliv_id = ? AND pref = ?", array($deliv_id, $cnt));
                 }
             }
         }
     } else {
         // 登録する配送業者IDの取得
         if (DB_TYPE == "pgsql") {
             $deliv_id = $objQuery->nextval('dtb_deliv', 'deliv_id');
             $sqlval['deliv_id'] = $deliv_id;
         }
         $sqlval['rank'] = $objQuery->max("dtb_deliv", "rank") + 1;
         $sqlval['create_date'] = 'Now()';
         // INSERTの実行
         $objQuery->insert("dtb_deliv", $sqlval);
         if (DB_TYPE == "mysql") {
             $deliv_id = $objQuery->nextval('dtb_deliv', 'deliv_id');
         }
         $sqlval = array();
         // 配送時間の設定
         for ($cnt = 1; $cnt <= DELIVTIME_MAX; $cnt++) {
             $keyname = "deliv_time{$cnt}";
             if ($arrRet[$keyname] != "") {
                 $sqlval['deliv_id'] = $deliv_id;
                 $sqlval['time_id'] = $cnt * $deliv_id;
                 $sqlval['deliv_time'] = $arrRet[$keyname];
                 // INSERTの実行
                 $objQuery->insert("dtb_delivtime", $sqlval);
             }
         }
         if (INPUT_DELIV_FEE) {
             $sqlval = array();
             // 配送料金の設定
             for ($cnt = 1; $cnt <= DELIVFEE_MAX; $cnt++) {
                 $keyname = "fee{$cnt}";
                 if ($arrRet[$keyname] != "") {
                     $sqlval['deliv_id'] = $deliv_id;
                     $sqlval['fee'] = $arrRet[$keyname];
                     $sqlval['pref'] = $cnt;
                     // INSERTの実行
                     $objQuery->insert("dtb_delivfee", $sqlval);
                 }
             }
         }
     }
     $objQuery->commit();
     return $deliv_id;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:99,代码来源:LC_Page_Admin_Basis_Delivery_Input.php

示例3: lfRegistProduct

 /**
  * 商品登録を行う.
  *
  * @param SC_Query $objQuery SC_Queryインスタンス
  * @param string|integer $line 処理中の行数
  * @return void
  */
 function lfRegistProduct($objQuery, $line = "")
 {
     $objDb = new SC_Helper_DB_Ex();
     $arrRet = $this->objFormParam->getHashArray();
     // dtb_products以外に登録される値を除外する。
     foreach ($arrRet as $key => $val) {
         switch ($key) {
             case 'product_code':
             case 'price01':
             case 'price02':
             case 'stock':
             case 'product_class_id':
             case 'recommend_product_id1':
             case 'recommend_product_id2':
             case 'recommend_product_id3':
             case 'recommend_product_id4':
             case 'recommend_product_id5':
             case 'recommend_product_id6':
             case 'recommend_comment1':
             case 'recommend_comment2':
             case 'recommend_comment3':
             case 'recommend_comment4':
             case 'recommend_comment5':
             case 'recommend_comment6':
             case 'category_id':
                 break;
             default:
                 if (!ereg("^dummy", $key)) {
                     $sqlval[$key] = $val;
                 }
                 break;
         }
     }
     // 登録時間を生成(DBのnow()だとcommitした際、すべて同一の時間になってしまう)
     $time = date("Y-m-d H:i:s");
     // 秒以下を生成
     if ($line != "") {
         $microtime = sprintf("%06d", $line);
         $time .= ".{$microtime}";
     }
     $sqlval['update_date'] = $time;
     $sqlval['creator_id'] = $_SESSION['member_id'];
     if ($sqlval['sale_limit'] == "") {
         $sqlval['sale_unlimited'] = '1';
     } else {
         $sqlval['sale_unlimited'] = '0';
     }
     if ($sqlval['status'] == "") {
         $sqlval['status'] = 2;
     }
     if ($arrRet['product_id'] != "" && $arrRet['product_class_id'] != "") {
         // UPDATEの実行
         $where = "product_id = ?";
         $objQuery->update("dtb_products", $sqlval, $where, array($sqlval['product_id']));
     } else {
         // 新規登録
         // postgresqlとmysqlとで処理を分ける
         if (DB_TYPE == "pgsql") {
             $product_id = $objQuery->nextval("dtb_products", "product_id");
         } elseif (DB_TYPE == "mysql") {
             $product_id = $objQuery->get_auto_increment("dtb_products");
         }
         $sqlval['product_id'] = $product_id;
         $sqlval['create_date'] = $time;
         // INSERTの実行
         $objQuery->insert("dtb_products", $sqlval);
     }
     // カテゴリ登録
     $arrCategory_id = explode("|", $arrRet["category_id"]);
     $objDb->updateProductCategories($arrCategory_id, $sqlval['product_id']);
     // 規格登録
     $this->lfRegistProductClass($objQuery, $arrRet, $sqlval['product_id'], $arrRet['product_class_id']);
     // おすすめ商品登録
     $objQuery->delete("dtb_recommend_products", "product_id = ?", array($sqlval['product_id']));
     for ($i = 1; $i <= RECOMMEND_PRODUCT_MAX; $i++) {
         $keyname = "recommend_product_id" . $i;
         $comment_key = "recommend_comment" . $i;
         if ($arrRet[$keyname] != "") {
             $arrProduct = $objQuery->select("product_id", "dtb_products", "product_id = ?", array($arrRet[$keyname]));
             if ($arrProduct[0]['product_id'] != "") {
                 $arrval['product_id'] = $sqlval['product_id'];
                 $arrval['recommend_product_id'] = $arrProduct[0]['product_id'];
                 $arrval['comment'] = $arrRet[$comment_key];
                 $arrval['update_date'] = "Now()";
                 $arrval['create_date'] = "Now()";
                 $arrval['creator_id'] = $_SESSION['member_id'];
                 $arrval['rank'] = RECOMMEND_PRODUCT_MAX - $i + 1;
                 $objQuery->insert("dtb_recommend_products", $arrval);
             }
         }
     }
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:99,代码来源:LC_Page_Admin_Products_UploadCSV.php

示例4: 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
//.........这里部分代码省略.........
开发者ID:khrisna,项目名称:eccubedrm,代码行数:101,代码来源:LC_Page_Admin_Contents_Inquiry.php

示例5: lfRegistData

 function lfRegistData(&$conn, $arrData)
 {
     $objQuery = new SC_Query();
     $objSelect = new SC_CustomerList($this->lfConvertParam($arrData, $this->arrSearchColumn), "magazine");
     $search_data = $conn->getAll($objSelect->getListMailMagazine($this->lfGetIsMobile($_POST['mail_type'])), $objSelect->arrVal);
     $dataCnt = count($search_data);
     $dtb_send_history = array();
     if (DB_TYPE == 'pgsql') {
         $dtb_send_history["send_id"] = $objQuery->nextval('dtb_send_history', 'send_id');
     }
     $dtb_send_history["mail_method"] = $arrData['mail_method'];
     $dtb_send_history["subject"] = $arrData['subject'];
     $dtb_send_history["body"] = $arrData['body'];
     if (MELMAGA_BATCH_MODE) {
         $dtb_send_history["start_date"] = $arrData['send_year'] . "/" . $arrData['send_month'] . "/" . $arrData['send_day'] . " " . $arrData['send_hour'] . ":" . $arrData['send_minutes'];
     } else {
         $dtb_send_history["start_date"] = "now()";
     }
     $dtb_send_history["creator_id"] = $_SESSION['member_id'];
     $dtb_send_history["send_count"] = $dataCnt;
     $arrData['body'] = "";
     $dtb_send_history["search_data"] = serialize($arrData);
     $dtb_send_history["update_date"] = "now()";
     $dtb_send_history["create_date"] = "now()";
     $objQuery->insert("dtb_send_history", $dtb_send_history);
     if (DB_TYPE == "mysql") {
         $dtb_send_history["send_id"] = $objQuery->nextval('dtb_send_history', 'send_id');
     }
     if (is_array($search_data)) {
         foreach ($search_data as $line) {
             $dtb_send_customer = array();
             $dtb_send_customer["customer_id"] = $line["customer_id"];
             $dtb_send_customer["send_id"] = $dtb_send_history["send_id"];
             $dtb_send_customer["email"] = $line["email"];
             $dtb_send_customer["name"] = $line["name01"] . " " . $line["name02"];
             $conn->autoExecute("dtb_send_customer", $dtb_send_customer);
         }
     }
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:39,代码来源:LC_Page_Admin_Mail.php

示例6: lfGetAutoIncrementVal

 function lfGetAutoIncrementVal($table_name, $colname = "")
 {
     $objQuery = new SC_Query();
     $ret = "";
     if (DB_TYPE == "pgsql") {
         $ret = $objQuery->nextval($table_name, $colname) - 1;
     } else {
         if (DB_TYPE == "mysql") {
             $sql = "SHOW TABLE STATUS LIKE ?";
             $arrData = $objQuery->getAll($sql, array($table_name));
             $ret = $arrData[0]['Auto_increment'];
         }
     }
     return $ret;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:15,代码来源:LC_Page_Admin_System_Bkup.php

示例7: lfRegistNewData

 function lfRegistNewData()
 {
     $objQuery = new SC_Query();
     $objQuery->begin();
     // 入力データを渡す。
     $arrRet = $this->objFormParam->getHashArray();
     foreach ($arrRet as $key => $val) {
         // 配列は登録しない
         if (!is_array($val)) {
             $sqlval[$key] = $val;
         }
     }
     // postgresqlとmysqlとで処理を分ける
     if (DB_TYPE == "pgsql") {
         $order_id = $objQuery->nextval("dtb_order", "order_id");
     } elseif (DB_TYPE == "mysql") {
         $order_id = $objQuery->get_auto_increment("dtb_order");
     }
     $sqlval['order_id'] = $order_id;
     $sqlval['create_date'] = "Now()";
     // 注文ステータス:指定が無ければ新規受付に設定
     if ($sqlval["status"] == "") {
         $sqlval['status'] = '1';
     }
     // customer_id
     if ($sqlval["customer_id"] == "") {
         $sqlval['customer_id'] = '0';
     }
     unset($sqlval['total_point']);
     unset($sqlval['point']);
     $where = "order_id = ?";
     // 受注ステータスの判定
     if ($sqlval['status'] == ODERSTATUS_COMMIT) {
         // 受注テーブルの発送済み日を更新する
         $sqlval['commit_date'] = "Now()";
     }
     // 受注テーブルの登録
     $objQuery->insert("dtb_order", $sqlval);
     $sql = "";
     $sql .= " UPDATE";
     $sql .= "     dtb_order";
     $sql .= " SET";
     $sql .= "     payment_method = (SELECT payment_method FROM dtb_payment WHERE payment_id = ?)";
     $sql .= "     ,deliv_time = (SELECT deliv_time FROM dtb_delivtime WHERE time_id = ? AND deliv_id = (SELECT deliv_id FROM dtb_payment WHERE payment_id = ? ))";
     $sql .= " WHERE order_id = ?";
     if ($arrRet['deliv_time_id'] == "") {
         $deliv_time_id = 0;
     } else {
         $deliv_time_id = $arrRet['deliv_time_id'];
     }
     $arrUpdData = array($arrRet['payment_id'], $deliv_time_id, $arrRet['payment_id'], $order_id);
     $objQuery->query($sql, $arrUpdData);
     // 受注詳細データの更新
     $arrDetail = $this->objFormParam->getSwapArray(array("product_id", "product_code", "product_name", "price", "quantity", "point_rate", "classcategory_id1", "classcategory_id2", "classcategory_name1", "classcategory_name2"));
     $objQuery->delete("dtb_order_detail", $where, array($order_id));
     $max = count($arrDetail);
     for ($i = 0; $i < $max; $i++) {
         $sqlval = array();
         $sqlval['order_id'] = $order_id;
         $sqlval['product_id'] = $arrDetail[$i]['product_id'];
         $sqlval['product_code'] = $arrDetail[$i]['product_code'];
         $sqlval['product_name'] = $arrDetail[$i]['product_name'];
         $sqlval['price'] = $arrDetail[$i]['price'];
         $sqlval['quantity'] = $arrDetail[$i]['quantity'];
         $sqlval['point_rate'] = $arrDetail[$i]['point_rate'];
         $sqlval['classcategory_id1'] = $arrDetail[$i]['classcategory_id1'];
         $sqlval['classcategory_id2'] = $arrDetail[$i]['classcategory_id2'];
         $sqlval['classcategory_name1'] = $arrDetail[$i]['classcategory_name1'];
         $sqlval['classcategory_name2'] = $arrDetail[$i]['classcategory_name2'];
         $objQuery->insert("dtb_order_detail", $sqlval);
     }
     $objQuery->commit();
     return $order_id;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:74,代码来源:LC_Page_Admin_Order_Edit.php

示例8: mobileProcess

 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     $objView = new SC_MobileView();
     $objCartSess = new SC_CartSession();
     $objSiteInfo = $objView->objSiteInfo;
     $objSiteSess = new SC_SiteSession();
     $objCustomer = new SC_Customer();
     $arrInfo = $objSiteInfo->data;
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     // 前のページで正しく登録手続きが行われた記録があるか判定
     SC_Utils_Ex::sfIsPrePage($objSiteSess, true);
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
     $this->tpl_uniqid = $uniqid;
     // カート集計処理
     $objDb->sfTotalCart($this, $objCartSess, $arrInfo);
     // 一時受注テーブルの読込
     $arrData = $objDb->sfGetOrderTemp($uniqid);
     // カート集計を元に最終計算
     $arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo, $objCustomer);
     // カート内の商品の売り切れチェック
     $objCartSess->chkSoldOut($objCartSess->getCartList());
     // 会員ログインチェック
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = '1';
         $this->tpl_user_point = $objCustomer->getValue('point');
     }
     // 決済区分を取得する
     $payment_type = "";
     if ($objDb->sfColumnExists("dtb_payment", "memo01")) {
         // MEMO03に値が入っている場合には、モジュール追加されたものとみなす
         $sql = "SELECT memo03 FROM dtb_payment WHERE payment_id = ?";
         $arrPayment = $objQuery->getall($sql, array($arrData['payment_id']));
         $payment_type = $arrPayment[0]["memo03"];
     }
     $this->payment_type = $payment_type;
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         // 前のページに戻る
         case 'return':
             // 正常な推移であることを記録しておく
             $objSiteSess->setRegistFlag();
             $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
             exit;
             break;
         case 'confirm':
             // この時点で注文番号を確保しておく(クレジット、コンビニ決済で必要なため)
             // postgresqlとmysqlとで処理を分ける
             if (DB_TYPE == "pgsql") {
                 $order_id = $objQuery->nextval("dtb_order", "order_id");
             } elseif (DB_TYPE == "mysql") {
                 $order_id = $objQuery->get_auto_increment("dtb_order");
             }
             $arrData["order_id"] = $order_id;
             // セッション情報を保持
             $arrData['session'] = serialize($_SESSION);
             // 集計結果を受注一時テーブルに反映
             $objDb->sfRegistTempOrder($uniqid, $arrData);
             // 正常に登録されたことを記録しておく
             $objSiteSess->setRegistFlag();
             // 決済方法により画面切替
             if ($payment_type != "") {
                 $_SESSION["payment_id"] = $arrData['payment_id'];
                 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_MODULE), true);
             } else {
                 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_COMPLETE), true);
             }
             exit;
             break;
         default:
             break;
     }
     $this->arrData = $arrData;
     $this->arrInfo = $arrInfo;
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:85,代码来源:LC_Page_Shopping_Confirm.php


注:本文中的SC_Query::nextval方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。