Пример #1
0
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $objDb = new SC_Helper_DB_Ex();
     $objPurchase = new SC_Helper_Purchase_Ex();
     if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $order_id = $_GET['order_id'];
     //受注データの取得
     $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id'));
     if (empty($this->tpl_arrOrderData)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY);
     $this->isMultiple = count($this->arrShipping) > 1;
     // 支払い方法の取得
     $this->arrPayment = $objDb->sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method');
     // 受注商品明細の取得
     $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id);
     $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail);
     $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail);
     // モバイルダウンロード対応処理
     $this->lfSetAU($this->tpl_arrOrderDetail);
     // 受注メール送信履歴の取得
     $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id);
 }
Пример #2
0
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     if (!SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id'));
     if (empty($arrMailView)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->tpl_subject = $arrMailView[0]['subject'];
     $this->tpl_body = $arrMailView[0]['mail_body'];
     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) {
         $this->setTemplate('mypage/mail_view.tpl');
     } else {
         $this->tpl_title = 'メール履歴詳細';
         $this->tpl_mainpage = 'mypage/mail_view.tpl';
     }
     switch ($this->getMode()) {
         case 'getDetail':
             echo SC_Utils_Ex::jsonEncode($arrMailView);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // チェック後のデータを格納
     $arrClean = array();
     // $_GET['move'] が想定値かどうかチェック
     switch ($_GET['move']) {
         case 'up':
         case 'down':
             $arrClean['move'] = $_GET['move'];
             break;
         default:
             $arrClean['move'] = "";
             break;
     }
     // 正当な数値であればOK
     if (SC_Utils_Ex::sfIsInt($_GET['id'])) {
         $arrClean['id'] = $_GET['id'];
         switch ($arrClean['move']) {
             case 'up':
                 $this->lfRunkUp($arrClean['id']);
                 break;
             case 'down':
                 $this->lfRunkDown($arrClean['id']);
                 break;
             default:
                 break;
         }
     } else {
         GC_Utils_Ex::gfPrintLog("error id=" . $_GET['id']);
     }
     // ページの表示
     SC_Response_Ex::sendRedirect(ADMIN_SYSTEM_URLPATH);
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $send_id = $_GET['send_id'];
     if (SC_Utils_Ex::sfIsInt($send_id)) {
         $mailHistory = $this->getMailHistory($send_id);
         $this->tpl_subject = $mailHistory[0]['subject'];
         $this->tpl_body = $mailHistory[0]['mail_body'];
     }
     $this->setTemplate($this->tpl_mainpage);
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objFormParam = new SC_FormParam();
     // パラメーター情報初期化
     $this->lfInitParam($objFormParam);
     // POST値をセット
     $objFormParam->setParam($_POST);
     if (SC_Utils_Ex::sfIsInt($tmp = $objFormParam->getValue('line'))) {
         $this->line_max = $tmp;
     }
     $this->tpl_ec_log = $this->getEccubeLog();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objMailHelper = new SC_Helper_Mail_Ex();
     switch ($this->getMode()) {
         case 'delete':
             if (SC_Utils_Ex::sfIsInt($_GET['id']) === true) {
                 $this->lfDeleteMailTemplate($_GET['id']);
                 $this->objDisplay->reload(null, true);
             }
             break;
         default:
             break;
     }
     $this->arrTemplates = $objMailHelper->sfGetMailmagaTemplate();
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
         $objQuery = new SC_Query();
         $col = "subject, mail_body";
         $where = "send_id = ?";
         $arrRet = $objQuery->select($col, "dtb_mail_history", $where, array($_GET['send_id']));
         $this->tpl_subject = $arrRet[0]['subject'];
         $this->tpl_body = $arrRet[0]['mail_body'];
     }
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
Пример #8
0
 public function isLoginSuccess($dont_check_email_mobile = false)
 {
     // ログイン時のメールアドレスとDBのメールアドレスが一致している場合
     if (isset($_SESSION['customer']['customer_id']) && SC_Utils_Ex::sfIsInt($_SESSION['customer']['customer_id'])) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $email = $objQuery->get('email', 'dtb_customer', 'customer_id = ?', array($_SESSION['customer']['customer_id']));
         if ($email == $_SESSION['customer']['email']) {
             // モバイルサイトの場合は携帯のメールアドレスが登録されていることもチェックする。
             // ただし $dont_check_email_mobile が true の場合はチェックしない。
             if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && !$dont_check_email_mobile) {
                 $email_mobile = $objQuery->get('email_mobile', 'dtb_customer', 'customer_id = ?', array($_SESSION['customer']['customer_id']));
                 return isset($email_mobile);
             }
             return true;
         }
     }
     return false;
 }
 /**
  * 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);
 }
Пример #10
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     $objCustomer = new SC_Customer_Ex();
     $objProduct = new SC_Product();
     if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $order_id = $_GET['order_id'];
     $this->is_price_change = false;
     //受注データの取得
     $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id'));
     if (empty($this->tpl_arrOrderData)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY);
     $this->isMultiple = count($this->arrShipping) > 1;
     // 支払い方法の取得
     $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList();
     // 受注商品明細の取得
     $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id);
     foreach ($this->tpl_arrOrderDetail as $product_index => $arrOrderProductDetail) {
         //必要なのは商品の販売金額のみなので、遅い場合は、別途SQL作成した方が良い
         $arrTempProductDetail = $objProduct->getProductsClass($arrOrderProductDetail['product_class_id']);
         // 税計算
         $this->tpl_arrOrderDetail[$product_index]['price_inctax'] = $this->tpl_arrOrderDetail[$product_index]['price'] + SC_Helper_TaxRule_Ex::calcTax($this->tpl_arrOrderDetail[$product_index]['price'], $this->tpl_arrOrderDetail[$product_index]['tax_rate'], $this->tpl_arrOrderDetail[$product_index]['tax_rule']);
         $arrTempProductDetail['price02_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrTempProductDetail['price02'], $arrTempProductDetail['product_id'], $arrTempProductDetail['product_class_id']);
         if ($this->tpl_arrOrderDetail[$product_index]['price_inctax'] != $arrTempProductDetail['price02_inctax']) {
             $this->is_price_change = true;
         }
         $this->tpl_arrOrderDetail[$product_index]['product_price_inctax'] = $arrTempProductDetail['price02_inctax'] ? $arrTempProductDetail['price02_inctax'] : 0;
     }
     $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail);
     $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail);
     // モバイルダウンロード対応処理
     $this->lfSetAU($this->tpl_arrOrderDetail);
     // 受注メール送信履歴の取得
     $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id);
 }
Пример #11
0
 /**
  * バッチ処理を実行する.
  *
  * @param mixed $argv コマンドライン引数
  * @return void
  */
 function execute($argv = "")
 {
     $term = 0;
     $start = 1;
     // 集計期間は、$start~$termの間となる。通常前日分から。
     $command = false;
     // 集計対象期間の取得(指定日分さかのぼる)
     if (SC_Utils_Ex::sfIsInt($argv[1]) && $argv[1] <= 365) {
         $term = $argv[1];
         $command = true;
     }
     // 集計開始日
     if (SC_Utils_Ex::sfIsInt($argv[2]) && $argv[2] <= 365) {
         $start = $argv[2];
         $command = true;
     }
     if ($term > 0) {
         // 集計の開始
         $this->lfStartDailyTotal($term, $start, $command);
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objMailHelper = new SC_Helper_Mail_Ex();
     switch ($this->getMode()) {
         case 'template':
             if (SC_Utils_Ex::sfIsInt($_GET['template_id'])) {
                 $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'history':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 $arrMail = $objMailHelper->sfGetSendHistory($_GET['send_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'presend':
             $this->mail['body'] = $_POST['body'];
         default:
     }
     $this->setTemplate($this->tpl_mainpage);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCartSess = new SC_CartSession("", false);
     $objDb = new SC_Helper_DB_Ex();
     // 管理ページからの確認の場合は、非公開の商品も表示する。
     if (isset($_GET['admim']) && $_GET['admin'] == 'on') {
         $where = "del_flg = 0";
     } else {
         $where = "del_flg = 0 AND status = 1";
     }
     // 値の正当性チェック
     if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) {
         SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
     }
     $image_key = $_GET['image'];
     $objQuery = new SC_Query();
     // カラムが存在していなければエラー画面を表示
     if (!$objDb->sfColumnExists("dtb_products", $image_key)) {
         SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
     }
     $col = "name, {$image_key}";
     $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id']));
     $image_path = IMAGE_SAVE_DIR . $arrRet[0][$image_key];
     if (file_exists($image_path)) {
         list($width, $height) = getimagesize($image_path);
     } else {
         $width = 0;
         $height = 0;
     }
     $this->tpl_width = $width;
     $this->tpl_height = $height;
     $this->tpl_table_width = $this->tpl_width + 20;
     $this->tpl_table_height = $this->tpl_height + 20;
     $this->tpl_image = $arrRet[0][$image_key];
     $this->tpl_name = $arrRet[0]['name'];
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 /**
  * 入力エラーチェック.
  *
  * @param  array $arrForm メーカー情報
  * @return array $objErr->arrErr エラー内容
  */
 function lfErrorCheck(&$arrForm)
 {
     $objErr = new SC_CheckError_Ex($arrForm);
     $objErr->doFunc(array("メーカー名", 'name', SMTEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
     // maker_id の正当性チェック
     if (!empty($arrForm['maker_id'])) {
         $objDb = new SC_Helper_DB_Ex();
         if (!SC_Utils_Ex::sfIsInt($arrForm['maker_id']) || SC_Utils_Ex::sfIsZeroFilling($arrForm['maker_id']) || !$objDb->sfIsRecord('dtb_maker', 'maker_id', array($arrForm['maker_id']))) {
             // maker_idが指定されていて、且つその値が不正と思われる場合はエラー
             $objErr->arrErr['maker_id'] = "※ メーカーIDが不正です<br />";
         }
     }
     if (!isset($objErr->arrErr['name'])) {
         $objQuery =& SC_Query_Ex::getSingletonInstance();
         $arrMaker = array();
         $arrMaker = $objQuery->select("maker_id, name", "dtb_maker", "del_flg = 0 AND name = ?", array($arrForm['name']));
         // 編集中のレコード以外に同じ名称が存在する場合
         if ($arrMaker[0]['maker_id'] != $arrForm['maker_id'] && $arrMaker[0]['name'] == $arrForm['name']) {
             $objErr->arrErr['name'] = "※ 既に同じ内容の登録が存在します。<br />";
         }
     }
     return $objErr->arrErr;
 }
 /**
  * 受注ID を取得する.
  *
  * 以下の順序で受注IDを取得する.
  *
  * 1. $_SESSION['order_id']
  * 2. $_POST['order_id']
  * 3. $_GET['order_id']
  *
  * 受注IDが取得できない場合は false を返す.
  *
  * @access private
  * @return integer|boolean 受注IDの取得に成功した場合は受注IDを返す;
  *                         失敗した場合は, false を返す.
  */
 function getOrderId()
 {
     if (isset($_SESSION['order_id']) && !SC_Utils_Ex::isBlank($_SESSION['order_id']) && SC_Utils_Ex::sfIsInt($_SESSION['order_id'])) {
         return $_SESSION['order_id'];
     }
     if (isset($_POST['order_id']) && !SC_Utils_Ex::isBlank($_POST['order_id']) && SC_Utils_Ex::sfIsInt($_POST['order_id'])) {
         return $_POST['order_id'];
     }
     if (isset($_GET['order_id']) && !SC_Utils_Ex::isBlank($_GET['order_id']) && SC_Utils_Ex::sfIsInt($_GET['order_id'])) {
         return $_GET['order_id'];
     }
     return false;
 }
 /**
  * 実行履歴の取得
  *
  * @param integer $search_pageno 表示したいページ番号
  * @return array( integer 全体件数, mixed メール配信データ一覧配列, mixed SC_PageNaviオブジェクト)
  */
 function lfDoSearch($search_pageno = 1)
 {
     // 引数の初期化
     if (SC_Utils_Ex::sfIsInt($search_pageno) === false) {
         $search_pageno = 1;
     }
     //
     $objSelect =& SC_Query_Ex::getSingletonInstance();
     // 一覧データ取得用
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     // 件数取得用
     // 該当全体件数の取得
     $linemax = $objQuery->count('dtb_send_history', 'del_flg = 0');
     // 一覧データの取得
     $objSelect->setOrder('start_date DESC, send_id DESC');
     $col = '*';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id) AS count_all';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 1) AS count_sent';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 2) AS count_error';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag IS NULL) AS count_unsent';
     // ページ送りの取得
     $offset = SEARCH_PMAX * ($search_pageno - 1);
     $objSelect->setLimitOffset(SEARCH_PMAX, $offset);
     $arrResult = $objSelect->select($col, 'dtb_send_history', ' del_flg = 0');
     $objNavi = new SC_PageNavi_Ex($search_pageno, $linemax, SEARCH_PMAX);
     return array($linemax, $arrResult, $objNavi->arrPagenavi);
 }
 function lfGetOrderData($order_id)
 {
     //注文番号が数字であれば
     if (SC_Utils_Ex::sfIsInt($order_id)) {
         // DBから受注情報を読み込む
         $objQuery = new SC_Query();
         $col = "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, ";
         $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, ";
         $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date ";
         $from = "dtb_order";
         $where = "order_id = ?";
         $arrRet = $objQuery->select($col, $from, $where, array($order_id));
         $arrOrder = $arrRet[0];
         // 受注詳細データの取得
         $arrRet = $this->lfGetOrderDetail($order_id);
         $arrOrderDetail = SC_Utils_Ex::sfSwapArray($arrRet);
         $arrData = array_merge($arrOrder, $arrOrderDetail);
     }
     return $arrData;
 }
Пример #18
0
 function lfGetProductsClass($product_id)
 {
     $arrRet = array();
     if (SC_Utils_Ex::sfIsInt($product_id)) {
         // 商品規格取得
         $objQuery = new SC_Query();
         $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited";
         $table = "vw_product_class AS prdcls";
         $where = "product_id = ?";
         $objQuery->setorder("rank1 DESC, rank2 DESC");
         $arrRet = $objQuery->select($col, $table, $where, array($product_id));
     }
     return $arrRet;
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParamSearchCustomer($objFormParam);
     $objFormParam->setParam($_POST);
     // パラメーター読み込み
     $this->arrHidden = $objFormParam->getSearchArray();
     // 入力パラメーターチェック
     $this->arrErr = SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam);
     $this->arrForm = $objFormParam->getFormParamList();
     if (!SC_Utils_Ex::isBlank($this->arrErr)) {
         return;
     }
     // モードによる処理切り替え
     switch ($this->getMode()) {
         // 配信先検索
         case 'search':
         case 'back':
             list($this->tpl_linemax, $this->arrResults, $this->objNavi) = SC_Helper_Customer_Ex::sfGetSearchData($objFormParam->getHashArray());
             $this->arrPagenavi = $this->objNavi->arrPagenavi;
             break;
             // input:検索結果画面「配信内容を設定する」押下後
         // input:検索結果画面「配信内容を設定する」押下後
         case 'input':
             $this->tpl_mainpage = 'mail/input.tpl';
             break;
             // template:テンプレート選択時
         // template:テンプレート選択時
         case 'template':
         case 'regist_back':
             $this->tpl_mainpage = 'mail/input.tpl';
             if (SC_Utils_Ex::sfIsInt($_POST['template_id']) === true) {
                 $this->lfAddParamSelectTemplate($objFormParam);
                 $this->lfGetTemplateData($objFormParam, $_POST['template_id']);
                 // regist_back時、subject,bodyにはテンプレートを読み込むのではなく、入力内容で上書き
                 if ($this->getMode() == 'regist_back') {
                     $objFormParam->setParam($_POST);
                 }
             }
             break;
         case 'regist_confirm':
             $this->tpl_mainpage = 'mail/input.tpl';
             $this->lfAddParamSelectTemplate($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/input_confirm.tpl';
             }
             break;
         case 'regist_complete':
             $this->tpl_mainpage = 'mail/input.tpl';
             $this->lfAddParamSelectTemplate($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/index.tpl';
                 SC_Helper_Mail_Ex::sfSendMailmagazine($this->lfRegisterData($objFormParam));
                 // DB登録・送信
                 SC_Response_Ex::sendRedirect('./history.php');
             }
             break;
             // query:配信履歴から「確認」
         // query:配信履歴から「確認」
         case 'query':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 $this->arrSearchData = $this->lfGetMailQuery();
             }
             $this->setTemplate('mail/query.tpl');
             break;
             // query:配信履歴から「再送信」
         // query:配信履歴から「再送信」
         case 'retry':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 SC_Helper_Mail_Ex::sfSendMailmagazine($_GET['send_id']);
                 // DB登録・送信
                 SC_Response_Ex::sendRedirect('./history.php');
             } else {
                 $this->tpl_onload = "window.alert('メール送信IDが正しくありません');";
             }
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * ページ番号が信頼しうる値かチェックする.
  *
  * @access private
  * @param  integer $pageno ページの番号
  * @return integer $clean_pageno チェック後のページの番号
  */
 function lfCheckPageNo($pageno)
 {
     $clean_pageno = '';
     // $pagenoが0以上の整数かチェック
     if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) {
         $clean_pageno = $pageno;
     } else {
         $clean_pageno = 1;
     }
     return $clean_pageno;
 }
Пример #21
0
 /**
  * 保存されているメルマガ送信履歴の取得
  * @param integer 特定の送信履歴を取り出したい時はsend_idを指定。未指定時は全件取得
  * @return array 送信履歴情報を格納した配列
  */
 function sfGetSendHistory($send_id = null)
 {
     // 初期化
     $where = '';
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     // 条件文
     $where = 'del_flg = ?';
     $arrValues[] = 0;
     //send_id指定時
     if (SC_Utils_Ex::sfIsInt($send_id) === true) {
         $where .= ' AND send_id = ?';
         $arrValues[] = $send_id;
     }
     // 表示順
     $objQuery->setOrder("create_date DESC");
     $arrResults = $objQuery->select('*', 'dtb_send_history', $where, $arrValues);
     return $arrResults;
 }
Пример #22
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objNews = new SC_Helper_News_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     $news_id = $objFormParam->getValue('news_id');
     //---- 新規登録/編集登録
     switch ($this->getMode()) {
         case 'edit':
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (!SC_Utils_Ex::isBlank($this->arrErr['news_id'])) {
                 trigger_error('', E_USER_ERROR);
                 return;
             }
             if (count($this->arrErr) <= 0) {
                 // POST値の引き継ぎ
                 $arrParam = $objFormParam->getHashArray();
                 // 登録実行
                 $res_news_id = $this->doRegist($news_id, $arrParam, $objNews);
                 if ($res_news_id !== FALSE) {
                     // 完了メッセージ
                     $news_id = $res_news_id;
                     $this->tpl_onload = "alert('登録が完了しました。');";
                 }
             }
             // POSTデータを引き継ぐ
             $this->tpl_news_id = $news_id;
             break;
         case 'pre_edit':
             $news = $objNews->getNews($news_id);
             list($news['year'], $news['month'], $news['day']) = $this->splitNewsDate($news['cast_news_date']);
             $objFormParam->setParam($news);
             // POSTデータを引き継ぐ
             $this->tpl_news_id = $news_id;
             break;
         case 'delete':
             //---- データ削除
             $objNews->deleteNews($news_id);
             //自分にリダイレクト(再読込による誤動作防止)
             SC_Response_Ex::reload();
             break;
             //---- 表示順位移動
         //---- 表示順位移動
         case 'up':
             $objNews->rankUp($news_id);
             // リロード
             SC_Response_Ex::reload();
             break;
         case 'down':
             $objNews->rankDown($news_id);
             // リロード
             SC_Response_Ex::reload();
             break;
         case 'moveRankSet':
             //---- 指定表示順位移動
             $input_pos = $this->getPostRank($news_id);
             if (SC_Utils_Ex::sfIsInt($input_pos)) {
                 $objNews->moveRank($news_id, $input_pos);
             }
             SC_Response_Ex::reload();
             break;
         default:
             break;
     }
     $this->arrNews = $objNews->getList();
     $this->line_max = count($this->arrNews);
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objDb = new SC_Helper_DB_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     $news_id = $objFormParam->getValue('news_id');
     //---- 新規登録/編集登録
     switch ($this->getMode()) {
         case 'regist':
             $arrPost = $objFormParam->getHashArray();
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 // ニュースIDの値がPOSTされて来た場合は既存データの編集とみなし、
                 // 更新メソッドを呼び出す。
                 // ニュースIDが存在しない場合は新規登録を行う。
                 $arrPost['link_method'] = $this->checkLinkMethod($arrPost['link_method']);
                 $arrPost['news_date'] = $this->getRegistDate($arrPost);
                 $member_id = $_SESSION['member_id'];
                 if (strlen($news_id) > 0 && is_numeric($news_id)) {
                     $this->lfNewsUpdate($arrPost, $member_id);
                 } else {
                     $this->lfNewsInsert($arrPost, $member_id);
                 }
                 $news_id = '';
                 $this->tpl_onload = "window.alert('編集が完了しました');";
             } else {
                 $this->arrForm = $arrPost;
             }
             break;
         case 'search':
             if (is_numeric($news_id)) {
                 list($this->arrForm) = $this->getNews($news_id);
                 list($this->arrForm['year'], $this->arrForm['month'], $this->arrForm['day']) = $this->splitNewsDate($this->arrForm['cast_news_date']);
                 $this->edit_mode = 'on';
             }
             break;
         case 'delete':
             //---- データ削除
             if (is_numeric($news_id)) {
                 $pre_rank = $this->getRankByNewsId($news_id);
                 $this->computeRankForDelete($news_id, $pre_rank);
                 SC_Response_Ex::reload();
                 //自分にリダイレクト(再読込による誤動作防止)
             }
             break;
         case 'move':
             //---- 表示順位移動
             if (strlen($news_id) > 0 && is_numeric($news_id) == true) {
                 $term = $objFormParam->getValue('term');
                 if ($term == 'up') {
                     $objDb->sfRankUp('dtb_news', 'news_id', $news_id);
                 } else {
                     if ($term == 'down') {
                         $objDb->sfRankDown('dtb_news', 'news_id', $news_id);
                     }
                 }
                 $this->objDisplay->reload();
             }
             break;
         case 'moveRankSet':
             //---- 指定表示順位移動
             $input_pos = $this->getPostRank($news_id);
             if (SC_Utils_Ex::sfIsInt($input_pos)) {
                 $objDb->sfMoveRank('dtb_news', 'news_id', $news_id, $input_pos);
                 $this->objDisplay->reload();
             }
             break;
         default:
             break;
     }
     $this->arrNews = $this->getNews();
     $this->tpl_news_id = $news_id;
     $this->line_max = count($this->arrNews);
     $this->max_rank = $this->getRankMax();
 }
Пример #24
0
 /**
  *
  * PDF作成フォームのデフォルト値の生成
  */
 function createFromValues($order_id, $pdf_order_id)
 {
     // ここが$arrFormの初登場ということを明示するため宣言する。
     $arrForm = array();
     // タイトルをセット
     $arrForm['title'] = "お買上げ明細書(納品書)";
     // 今日の日付をセット
     $arrForm['year'] = date('Y');
     $arrForm['month'] = date('m');
     $arrForm['day'] = date('d');
     // メッセージ
     $arrForm['msg1'] = 'このたびはお買上げいただきありがとうございます。';
     $arrForm['msg2'] = '下記の内容にて納品させていただきます。';
     $arrForm['msg3'] = 'ご確認くださいますよう、お願いいたします。';
     // 注文番号があったら、セットする
     if (SC_Utils_Ex::sfIsInt($order_id)) {
         $arrForm['order_id'][0] = $order_id;
     } elseif (is_array($pdf_order_id)) {
         sort($pdf_order_id);
         foreach ($pdf_order_id as $key => $val) {
             $arrForm['order_id'][] = $val;
         }
     }
     return $arrForm;
 }
Пример #25
0
 /**
  * 検索結果の1ページあたりの最大表示件数を取得する
  *
  * フォームの入力値から最大表示件数を取得する
  * 取得できなかった場合は, 定数 SEARCH_PMAX の値を返す
  *
  * @param string $search_page_max 表示件数の選択値
  * @return integer 1ページあたりの最大表示件数
  */
 function sfGetSearchPageMax($search_page_max)
 {
     if (SC_Utils_Ex::sfIsInt($search_page_max) && $search_page_max > 0) {
         $page_max = intval($search_page_max);
     } else {
         $page_max = SEARCH_PMAX;
     }
     return $page_max;
 }
Пример #26
0
 /**
  * 商品規格を設定しているか
  *
  * @param  integer $product_id 商品ID
  * @return bool    商品規格が存在する場合:true, それ以外:false
  */
 public function sfHasProductClass($product_id)
 {
     if (!SC_Utils_Ex::sfIsInt($product_id)) {
         return false;
     }
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     $where = 'product_id = ? AND del_flg = 0 AND (classcategory_id1 != 0 OR classcategory_id2 != 0)';
     $exists = $objQuery->exists('dtb_products_class', $where, array($product_id));
     return $exists;
 }
 /**
  * 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->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
     // ファイル情報の初期化
     $this->objUpFile = $this->lfInitFile();
     // Hiddenからのデータを引き継ぐ
     $this->objUpFile->setHiddenFileList($_POST);
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // POST値の取得
     $this->objFormParam->setParam($_POST);
     switch ($_POST['mode']) {
         case 'edit':
             // 入力値の変換
             $this->objFormParam->convParam();
             // エラーチェック
             $this->arrErr = $this->lfCheckError();
             $this->charge_flg = $_POST["charge_flg"];
             if (count($this->arrErr) == 0) {
                 $this->lfRegistData($_POST['payment_id']);
                 // 一時ファイルを本番ディレクトリに移動する
                 $this->objUpFile->moveTempFile();
                 // 親ウィンドウを更新するようにセットする。
                 $this->tpl_onload = "fnUpdateParent('" . URL_PAYMENT_TOP . "'); window.close();";
             }
             break;
             // 画像のアップロード
         // 画像のアップロード
         case 'upload_image':
             // ファイル存在チェック
             $this->arrErr = $this->objUpFile->checkEXISTS($_POST['image_key']);
             // 画像保存処理
             $this->arrErr[$_POST['image_key']] = $this->objUpFile->makeTempFile($_POST['image_key']);
             break;
             // 画像の削除
         // 画像の削除
         case 'delete_image':
             $this->objUpFile->deleteFile($_POST['image_key']);
             break;
         default:
             break;
     }
     if ($_POST['mode'] == "") {
         switch ($_GET['mode']) {
             case 'pre_edit':
                 if (SC_Utils_Ex::sfIsInt($_GET['payment_id'])) {
                     $arrRet = $this->lfGetData($_GET['payment_id']);
                     $this->objFormParam->setParam($arrRet);
                     $this->charge_flg = $arrRet["charge_flg"];
                     // DBデータから画像ファイル名の読込
                     $this->objUpFile->setDBFileList($arrRet);
                     $this->tpl_payment_id = $_GET['payment_id'];
                 }
                 break;
             default:
                 break;
         }
     } else {
         $this->tpl_payment_id = $_POST['payment_id'];
     }
     $this->arrDelivList = $objDb->sfGetIDValueList("dtb_deliv", "deliv_id", "service_name");
     $this->arrForm = $this->objFormParam->getFormParamList();
     // FORM表示用配列を渡す。
     $this->arrFile = $this->objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL);
     // HIDDEN用に配列を渡す。
     $this->arrHidden = array_merge((array) $this->arrHidden, (array) $this->objUpFile->getHiddenFileList());
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 function lfCheckProductId($admin_mode, $product_id)
 {
     // 管理機能からの確認の場合は、非公開の商品も表示する。
     if (isset($admin_mode) && $admin_mode == 'on') {
         SC_Utils_Ex::sfIsSuccess(new SC_Session_Ex());
         $status = true;
         $where = 'del_flg = 0';
     } else {
         $status = false;
         $where = 'del_flg = 0 AND status = 1';
     }
     if (!SC_Utils_Ex::sfIsInt($product_id) || SC_Utils_Ex::sfIsZeroFilling($product_id) || !SC_Helper_DB_Ex::sfIsRecord('dtb_products', 'product_id', (array) $product_id, $where)) {
         SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
     }
     return $product_id;
 }
 /**
  * 会員検索パラメーター エラーチェック(管理画面用)
  *
  * @param SC_FormParam $objFormParam SC_FormParam インスタンス
  * @access public
  * @return array エラー配列
  */
 public function sfCheckErrorSearchParam(&$objFormParam)
 {
     // パラメーターの基本チェック
     $arrErr = $objFormParam->checkError();
     // エラーチェック対象のパラメータ取得
     $array = $objFormParam->getHashArray();
     // 拡張エラーチェック初期化
     $objErr = new SC_CheckError_Ex($array);
     // 拡張エラーチェック
     $objErr->doFunc(array('誕生日(開始日)', 'search_b_start_year', 'search_b_start_month', 'search_b_start_day'), array('CHECK_DATE'));
     $objErr->doFunc(array('誕生日(終了日)', 'search_b_end_year', 'search_b_end_month', 'search_b_end_day'), array('CHECK_DATE'));
     $objErr->doFunc(array('誕生日(開始日)', '誕生日(終了日)', 'search_b_start_year', 'search_b_start_month', 'search_b_start_day', 'search_b_end_year', 'search_b_end_month', 'search_b_end_day'), array('CHECK_SET_TERM'));
     $objErr->doFunc(array('登録・更新日(開始日)', 'search_start_year', 'search_start_month', 'search_start_day'), array('CHECK_DATE'));
     $objErr->doFunc(array('登録・更新日(終了日)', 'search_end_year', 'search_end_month', 'search_end_day'), array('CHECK_DATE'));
     $objErr->doFunc(array('登録・更新日(開始日)', '登録・更新日(終了日)', 'search_start_year', 'search_start_month', 'search_start_day', 'search_end_year', 'search_end_month', 'search_end_day'), array('CHECK_SET_TERM'));
     $objErr->doFunc(array('最終購入日(開始)', 'search_buy_start_year', 'search_buy_start_month', 'search_buy_start_day'), array('CHECK_DATE'));
     $objErr->doFunc(array('最終購入日(終了)', 'search_buy_end_year', 'search_buy_end_month', 'search_buy_end_day'), array('CHECK_DATE'));
     // 開始 > 終了 の場合はエラーとする
     $objErr->doFunc(array('最終購入日(開始)', '最終購入日(終了)', 'search_buy_start_year', 'search_buy_start_month', 'search_buy_start_day', 'search_buy_end_year', 'search_buy_end_month', 'search_buy_end_day'), array('CHECK_SET_TERM'));
     if (SC_Utils_Ex::sfIsInt($array['search_buy_total_from']) && SC_Utils_Ex::sfIsInt($array['search_buy_total_to']) && $array['search_buy_total_from'] > $array['search_buy_total_to']) {
         $objErr->arrErr['search_buy_total_from'] .= '※ 購入金額の指定範囲が不正です。';
     }
     if (SC_Utils_Ex::sfIsInt($array['search_buy_times_from']) && SC_Utils_Ex::sfIsInt($array['search_buy_times_to']) && $array['search_buy_times_from'] > $array['search_buy_times_to']) {
         $objErr->arrErr['search_buy_times_from'] .= '※ 購入回数の指定範囲が不正です。';
     }
     if (!SC_Utils_Ex::isBlank($objErr->arrErr)) {
         $arrErr = array_merge($arrErr, $objErr->arrErr);
     }
     return $arrErr;
 }
 /**
  * 検索条件のwhere文とかを取得
  *
  * @return array
  */
 public function lfGetSearchCondition(&$arrSearchData)
 {
     $searchCondition = parent::lfGetSearchCondition($arrSearchData);
     GC_Utils_Ex::gfPrintLog(print_r($this->arrForm, true), DEBUG_LOG_REALFILE);
     $objSql = new SC_SelectSql_Ex();
     $objSql->setWhere($searchCondition['where']);
     $character_id = $this->arrForm['character_id'];
     if (SC_Utils_Ex::sfIsInt($character_id)) {
         $this->arrSearchData["character_id"] = $character_id;
         $objSql->setWhere("product_id IN (\n                        SELECT product_id\n                        FROM cp_dtb_product_characters\n                        INNER JOIN cp_dtb_character USING(character_id)\n                        WHERE character_id = ?\n                        AND   cp_dtb_character.status  = 1\n                        AND   cp_dtb_character.del_flg = 0\n                    )");
         $searchCondition['arrval'][] = intval($character_id);
     }
     $searchCondition['where'] = $objSql->getWhere(false);
     $searchCondition['where_for_count'] = $objSql->getWhere(false);
     return $searchCondition;
 }