コード例 #1
0
ファイル: Rank.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // チェック後のデータを格納
     $arrClean = array();
     // $_GET['move'] が想定値かどうかチェック
     switch ($_GET['move']) {
         case 'up':
         case 'down':
             $arrClean['move'] = $_GET['move'];
             break;
         default:
             $arrClean['move'] = '';
             break;
     }
     // 正当な数値であればOK
     if (Utils::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 {
         GcUtils::gfPrintLog('error id=' . $_GET['id']);
     }
     // ページの表示
     Application::alias('eccube.response')->sendRedirect(ADMIN_SYSTEM_URLPATH);
 }
コード例 #2
0
ファイル: MailView.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     if (!Utils::sfIsInt($_GET['send_id'])) {
         Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id'));
     if (empty($arrMailView)) {
         Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->tpl_subject = $arrMailView[0]['subject'];
     $this->tpl_body = $arrMailView[0]['mail_body'];
     if (Application::alias('eccube.display')->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 Utils::jsonEncode($arrMailView);
             Application::alias('eccube.response')->actionExit();
             break;
         default:
             break;
     }
 }
コード例 #3
0
ファイル: History.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 実行履歴の取得
  *
  * @param  integer $search_pageno 表示したいページ番号
  * @return array(  integer 全体件数, mixed メール配信データ一覧配列, mixed PageNaviオブジェクト)
  */
 public function lfDoSearch($search_pageno = 1)
 {
     // 引数の初期化
     if (Utils::sfIsInt($search_pageno) === false) {
         $search_pageno = 1;
     }
     //
     $objSelect = Application::alias('eccube.query');
     // 一覧データ取得用
     $objQuery = Application::alias('eccube.query');
     // 件数取得用
     // 該当全体件数の取得
     $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');
     /* @var $objNavi PageNavi */
     $objNavi = Application::alias('eccube.page_navi', $search_pageno, $linemax, SEARCH_PMAX);
     return array($linemax, $arrResult, $objNavi->arrPagenavi);
 }
コード例 #4
0
ファイル: MailView.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $send_id = $_GET['send_id'];
     if (Utils::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);
 }
コード例 #5
0
ファイル: Template.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objMailHelper MailHelper */
     $objMailHelper = Application::alias('eccube.helper.mail');
     switch ($this->getMode()) {
         case 'delete':
             if (Utils::sfIsInt($_GET['id']) === true) {
                 $this->lfDeleteMailTemplate($_GET['id']);
                 $this->objDisplay->reload(null, true);
             }
             break;
         default:
             break;
     }
     $this->arrTemplates = $objMailHelper->sfGetMailmagaTemplate();
 }
コード例 #6
0
ファイル: Delete.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objFormParam = Application::alias('eccube.form_param');
     // パラメーターの初期化
     $this->initParam($objFormParam, $_GET);
     // パラメーターの検証
     if ($objFormParam->checkError() || !Utils::sfIsInt($id = $objFormParam->getValue('id'))) {
         GcUtils::gfPrintLog("error id={$id}");
         Utils::sfDispError(INVALID_MOVE_ERRORR);
     }
     $id = $objFormParam->getValue('id');
     // レコードの削除
     $this->deleteMember($id);
     // リダイレクト
     $url = $this->getLocation(ADMIN_SYSTEM_URLPATH) . '?pageno=' . $objFormParam->getValue('pageno');
     Application::alias('eccube.response')->sendRedirect($url);
 }
コード例 #7
0
ファイル: History.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     /* @var $objPurchase PurchaseHelper */
     $objPurchase = Application::alias('eccube.helper.purchase');
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     /* @var $objProduct Product */
     $objProduct = Application::alias('eccube.product');
     if (!Utils::sfIsInt($_GET['order_id'])) {
         Utils::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)) {
         Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY);
     $this->isMultiple = count($this->arrShipping) > 1;
     // 支払い方法の取得
     $this->arrPayment = Application::alias('eccube.helper.payment')->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'] + TaxRuleHelper::calcTax($this->tpl_arrOrderDetail[$product_index]['price'], $this->tpl_arrOrderDetail[$product_index]['tax_rate'], $this->tpl_arrOrderDetail[$product_index]['tax_rule']);
         $arrTempProductDetail['price02_inctax'] = TaxRuleHelper::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);
 }
コード例 #8
0
ファイル: Preview.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objMailHelper MailHelper */
     $objMailHelper = Application::alias('eccube.helper.mail');
     switch ($this->getMode()) {
         case 'template':
             if (Utils::sfIsInt($_GET['template_id'])) {
                 $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'history':
             if (Utils::sfIsInt($_GET['send_id'])) {
                 $arrMail = $objMailHelper->sfGetSendHistory($_GET['send_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'presend':
             $this->mail['body'] = $_POST['body'];
         default:
             break;
     }
     $this->setTemplate($this->tpl_mainpage);
 }
コード例 #9
0
 /**
  * メルマガテンプレートデータの登録・更新を行う
  *
  * @param FormParam $objFormParam FormParam インスタンス
  * @param integer template_id 更新時は指定
  * @return void
  */
 public function lfRegistData(&$objFormParam, $template_id = null)
 {
     $objQuery = Application::alias('eccube.query');
     $sqlval = $objFormParam->getDbArray();
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
     if (Utils::sfIsInt($template_id)) {
         // 更新時
         $objQuery->update('dtb_mailmaga_template', $sqlval, 'template_id = ?', array($template_id));
     } else {
         // 新規登録時
         $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
         $sqlval['template_id'] = $objQuery->nextVal('dtb_mailmaga_template_template_id');
         $objQuery->insert('dtb_mailmaga_template', $sqlval);
     }
 }
コード例 #10
0
ファイル: MailHelper.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 保存されているメルマガ送信履歴の取得
  * @param integer 特定の送信履歴を取り出したい時はsend_idを指定。未指定時は全件取得
  * @return array 送信履歴情報を格納した配列
  */
 public function sfGetSendHistory($send_id = null)
 {
     // 初期化
     $where = '';
     $objQuery = Application::alias('eccube.query');
     // 条件文
     $where = 'del_flg = ?';
     $arrValues[] = 0;
     //send_id指定時
     if (Utils::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;
 }
コード例 #11
0
 public function __construct($array, $mode = '')
 {
     parent::__construct($array);
     /* @var $objDb DbHelper */
     $objDb = Application::alias('eccube.helper.db');
     /* @var $dbFactory DBFactory */
     $dbFactory = Application::alias('eccube.db.factory');
     if ($mode == '') {
         // 会員本登録会員で削除していない会員
         $this->setWhere('status = 2 AND del_flg = 0 ');
         // 登録日を示すカラム
         $regdate_col = 'dtb_customer.update_date';
     }
     if ($mode == 'customer') {
         $this->setWhere(' del_flg = 0 ');
         // 登録日を示すカラム
         $regdate_col = 'dtb_customer.update_date';
     }
     // 会員ID
     if (!isset($this->arrSql['search_customer_id'])) {
         $this->arrSql['search_customer_id'] = '';
     }
     if (strlen($this->arrSql['search_customer_id']) > 0) {
         $this->setWhere('customer_id =  ?');
         $this->arrVal[] = $this->arrSql['search_customer_id'];
     }
     // 名前
     if (!isset($this->arrSql['search_name'])) {
         $this->arrSql['search_name'] = '';
     }
     if (strlen($this->arrSql['search_name']) > 0) {
         $this->setWhere('(' . $dbFactory->concatColumn(array('name01', 'name02')) . ' LIKE ?)');
         $searchName = $this->addSearchStr($this->arrSql['search_name']);
         $this->arrVal[] = preg_replace('/[  ]+/u', '', $searchName);
     }
     // 名前(フリガナ)
     if (!isset($this->arrSql['search_kana'])) {
         $this->arrSql['search_kana'] = '';
     }
     if (strlen($this->arrSql['search_kana']) > 0) {
         $this->setWhere('(' . $dbFactory->concatColumn(array('kana01', 'kana02')) . ' LIKE ?)');
         $searchKana = $this->addSearchStr($this->arrSql['search_kana']);
         $this->arrVal[] = preg_replace('/[  ]+/u', '', $searchKana);
     }
     // 都道府県
     if (!isset($this->arrSql['search_pref'])) {
         $this->arrSql['search_pref'] = '';
     }
     if (strlen($this->arrSql['search_pref']) > 0) {
         $this->setWhere('pref = ?');
         $this->arrVal[] = $this->arrSql['search_pref'];
     }
     // 電話番号
     if (!isset($this->arrSql['search_tel'])) {
         $this->arrSql['search_tel'] = '';
     }
     if (is_numeric($this->arrSql['search_tel'])) {
         $this->setWhere('(' . $dbFactory->concatColumn(array('tel01', 'tel02', 'tel03')) . ' LIKE ?)');
         $searchTel = $this->addSearchStr($this->arrSql['search_tel']);
         $this->arrVal[] = str_replace('-', '', $searchTel);
     }
     // 性別
     if (!isset($this->arrSql['search_sex'])) {
         $this->arrSql['search_sex'] = '';
     }
     if (is_array($this->arrSql['search_sex'])) {
         $arrSexVal = $this->setItemTerm($this->arrSql['search_sex'], 'sex');
         foreach ($arrSexVal as $data) {
             $this->arrVal[] = $data;
         }
     }
     // 職業
     if (!isset($this->arrSql['search_job'])) {
         $this->arrSql['search_job'] = '';
     }
     if (is_array($this->arrSql['search_job'])) {
         if (in_array('不明', $this->arrSql['search_job'])) {
             $arrJobVal = $this->setItemTermWithNull($this->arrSql['search_job'], 'job');
         } else {
             $arrJobVal = $this->setItemTerm($this->arrSql['search_job'], 'job');
         }
         if (is_array($arrJobVal)) {
             foreach ($arrJobVal as $data) {
                 $this->arrVal[] = $data;
             }
         }
     }
     // E-MAIL
     if (!isset($this->arrSql['search_email'])) {
         $this->arrSql['search_email'] = '';
     }
     if (strlen($this->arrSql['search_email']) > 0) {
         //カンマ区切りで複数の条件指定可能に
         $this->arrSql['search_email'] = explode(',', $this->arrSql['search_email']);
         $sql_where = '';
         foreach ($this->arrSql['search_email'] as $val) {
             $val = trim($val);
             //検索条件を含まない
             if ($this->arrSql['not_emailinc'] == '1') {
                 if ($sql_where == '') {
                     $sql_where .= 'dtb_customer.email NOT ILIKE ? ';
                 } else {
                     $sql_where .= 'AND dtb_customer.email NOT ILIKE ? ';
                 }
             } else {
                 if ($sql_where == '') {
                     $sql_where .= 'dtb_customer.email ILIKE ? ';
                 } else {
                     $sql_where .= 'OR dtb_customer.email ILIKE ? ';
                 }
             }
             $searchEmail = $this->addSearchStr($val);
             $this->arrVal[] = $searchEmail;
         }
         $this->setWhere($sql_where);
     }
     // E-MAIL(mobile)
     if (!isset($this->arrSql['search_email_mobile'])) {
         $this->arrSql['search_email_mobile'] = '';
     }
     if (strlen($this->arrSql['search_email_mobile']) > 0) {
         //カンマ区切りで複数の条件指定可能に
         $this->arrSql['search_email_mobile'] = explode(',', $this->arrSql['search_email_mobile']);
         $sql_where = '';
         foreach ($this->arrSql['search_email_mobile'] as $val) {
             $val = trim($val);
             //検索条件を含まない
             if ($this->arrSql['not_email_mobileinc'] == '1') {
                 if ($sql_where == '') {
                     $sql_where .= 'dtb_customer.email_mobile NOT ILIKE ? ';
                 } else {
                     $sql_where .= 'AND dtb_customer.email_mobile NOT ILIKE ? ';
                 }
             } else {
                 if ($sql_where == '') {
                     $sql_where .= 'dtb_customer.email_mobile ILIKE ? ';
                 } else {
                     $sql_where .= 'OR dtb_customer.email_mobile ILIKE ? ';
                 }
             }
             $searchemail_mobile = $this->addSearchStr($val);
             $this->arrVal[] = $searchemail_mobile;
         }
         $this->setWhere($sql_where);
     }
     // メールマガジンの場合
     if ($mode == 'customer') {
         // メルマガ受け取りの選択項目がフォームに存在する場合
         if (isset($this->arrSql['search_htmlmail'])) {
             $this->setWhere('status = 2');
             if (Utils::sfIsInt($this->arrSql['search_htmlmail'])) {
                 // メルマガ拒否している会員も含む場合は、条件を付加しない
                 if ($this->arrSql['search_htmlmail'] != 99) {
                     $this->setWhere('mailmaga_flg = ?');
                     $this->arrVal[] = $this->arrSql['search_htmlmail'];
                 }
             } else {
                 // メルマガ購読拒否は省く
                 $this->setWhere('mailmaga_flg <> 3');
             }
         }
     }
     // 配信メールアドレス種別
     if ($mode == 'customer') {
         if (isset($this->arrSql['search_mail_type'])) {
             $sqlEmailMobileIsEmpty = "(dtb_customer.email_mobile IS NULL OR dtb_customer.email_mobile = '')";
             switch ($this->arrSql['search_mail_type']) {
                 // PCメールアドレス
                 case 1:
                     $this->setWhere("(dtb_customer.email <> dtb_customer.email_mobile OR {$sqlEmailMobileIsEmpty})");
                     break;
                     // 携帯メールアドレス
                 // 携帯メールアドレス
                 case 2:
                     $this->setWhere("NOT {$sqlEmailMobileIsEmpty}");
                     break;
                     // PCメールアドレス (携帯メールアドレスを登録している会員は除外)
                 // PCメールアドレス (携帯メールアドレスを登録している会員は除外)
                 case 3:
                     $this->setWhere($sqlEmailMobileIsEmpty);
                     break;
                     // 携帯メールアドレス (PCメールアドレスを登録している会員は除外)
                 // 携帯メールアドレス (PCメールアドレスを登録している会員は除外)
                 case 4:
                     $this->setWhere('dtb_customer.email = dtb_customer.email_mobile');
                     break;
             }
         }
     }
     // 購入金額指定
     if (!isset($this->arrSql['search_buy_total_from'])) {
         $this->arrSql['search_buy_total_from'] = '';
     }
     if (!isset($this->arrSql['search_buy_total_to'])) {
         $this->arrSql['search_buy_total_to'] = '';
     }
     if (is_numeric($this->arrSql['search_buy_total_from']) || is_numeric($this->arrSql['search_buy_total_to'])) {
         $arrBuyTotal = $this->selectRange($this->arrSql['search_buy_total_from'], $this->arrSql['search_buy_total_to'], 'buy_total');
         foreach ($arrBuyTotal as $data) {
             $this->arrVal[] = $data;
         }
     }
     // 購入回数指定
     if (!isset($this->arrSql['search_buy_times_from'])) {
         $this->arrSql['search_buy_times_from'] = '';
     }
     if (!isset($this->arrSql['search_buy_times_to'])) {
         $this->arrSql['search_buy_times_to'] = '';
     }
     if (is_numeric($this->arrSql['search_buy_times_from']) || is_numeric($this->arrSql['search_buy_times_to'])) {
         $arrBuyTimes = $this->selectRange($this->arrSql['search_buy_times_from'], $this->arrSql['search_buy_times_to'], 'buy_times');
         foreach ($arrBuyTimes as $data) {
             $this->arrVal[] = $data;
         }
     }
     // 誕生日期間指定
     if (!isset($this->arrSql['search_b_start_year'])) {
         $this->arrSql['search_b_start_year'] = '';
     }
     if (!isset($this->arrSql['search_b_start_month'])) {
         $this->arrSql['search_b_start_month'] = '';
     }
     if (!isset($this->arrSql['search_b_start_day'])) {
         $this->arrSql['search_b_start_day'] = '';
     }
     if (!isset($this->arrSql['search_b_end_year'])) {
         $this->arrSql['search_b_end_year'] = '';
     }
     if (!isset($this->arrSql['search_b_end_month'])) {
         $this->arrSql['search_b_end_month'] = '';
     }
     if (!isset($this->arrSql['search_b_end_day'])) {
         $this->arrSql['search_b_end_day'] = '';
     }
     if (strlen($this->arrSql['search_b_start_year']) > 0 && strlen($this->arrSql['search_b_start_month']) > 0 && strlen($this->arrSql['search_b_start_day']) > 0 || strlen($this->arrSql['search_b_end_year']) > 0 && strlen($this->arrSql['search_b_end_month']) > 0 && strlen($this->arrSql['search_b_end_day']) > 0) {
         $arrBirth = $this->selectTermRange($this->arrSql['search_b_start_year'], $this->arrSql['search_b_start_month'], $this->arrSql['search_b_start_day'], $this->arrSql['search_b_end_year'], $this->arrSql['search_b_end_month'], $this->arrSql['search_b_end_day'], 'birth');
         foreach ($arrBirth as $data) {
             $this->arrVal[] = $data;
         }
     }
     // 誕生月の検索
     if (!isset($this->arrSql['search_birth_month'])) {
         $this->arrSql['search_birth_month'] = '';
     }
     if (is_numeric($this->arrSql['search_birth_month'])) {
         $this->setWhere(' EXTRACT(month from birth) = ?');
         $this->arrVal[] = $this->arrSql['search_birth_month'];
     }
     // 登録期間指定
     if (!isset($this->arrSql['search_start_year'])) {
         $this->arrSql['search_start_year'] = '';
     }
     if (!isset($this->arrSql['search_start_month'])) {
         $this->arrSql['search_start_month'] = '';
     }
     if (!isset($this->arrSql['search_start_day'])) {
         $this->arrSql['search_start_day'] = '';
     }
     if (!isset($this->arrSql['search_end_year'])) {
         $this->arrSql['search_end_year'] = '';
     }
     if (!isset($this->arrSql['search_end_month'])) {
         $this->arrSql['search_end_month'] = '';
     }
     if (!isset($this->arrSql['search_end_day'])) {
         $this->arrSql['search_end_day'] = '';
     }
     if (strlen($this->arrSql['search_start_year']) > 0 && strlen($this->arrSql['search_start_month']) > 0 && strlen($this->arrSql['search_start_day']) > 0 || strlen($this->arrSql['search_end_year']) > 0 && strlen($this->arrSql['search_end_month']) > 0 && strlen($this->arrSql['search_end_day']) > 0) {
         $arrRegistTime = $this->selectTermRange($this->arrSql['search_start_year'], $this->arrSql['search_start_month'], $this->arrSql['search_start_day'], $this->arrSql['search_end_year'], $this->arrSql['search_end_month'], $this->arrSql['search_end_day'], $regdate_col);
         foreach ($arrRegistTime as $data) {
             $this->arrVal[] = $data;
         }
     }
     // 最終購入日指定
     if (!isset($this->arrSql['search_buy_start_year'])) {
         $this->arrSql['search_buy_start_year'] = '';
     }
     if (!isset($this->arrSql['search_buy_start_month'])) {
         $this->arrSql['search_buy_start_month'] = '';
     }
     if (!isset($this->arrSql['search_buy_start_day'])) {
         $this->arrSql['search_buy_start_day'] = '';
     }
     if (!isset($this->arrSql['search_buy_end_year'])) {
         $this->arrSql['search_buy_end_year'] = '';
     }
     if (!isset($this->arrSql['search_buy_end_month'])) {
         $this->arrSql['search_buy_end_month'] = '';
     }
     if (!isset($this->arrSql['search_buy_end_day'])) {
         $this->arrSql['search_buy_end_day'] = '';
     }
     if (strlen($this->arrSql['search_buy_start_year']) > 0 && strlen($this->arrSql['search_buy_start_month']) > 0 && strlen($this->arrSql['search_buy_start_day']) > 0 || strlen($this->arrSql['search_buy_end_year']) > 0 && strlen($this->arrSql['search_buy_end_month']) > 0 && strlen($this->arrSql['search_buy_end_day']) > 0) {
         $arrRegistTime = $this->selectTermRange($this->arrSql['search_buy_start_year'], $this->arrSql['search_buy_start_month'], $this->arrSql['search_buy_start_day'], $this->arrSql['search_buy_end_year'], $this->arrSql['search_buy_end_month'], $this->arrSql['search_buy_end_day'], 'last_buy_date');
         foreach ($arrRegistTime as $data) {
             $this->arrVal[] = $data;
         }
     }
     // 購入商品コード
     if (!isset($this->arrSql['search_buy_product_code'])) {
         $this->arrSql['search_buy_product_code'] = '';
     }
     if (strlen($this->arrSql['search_buy_product_code']) > 0) {
         $this->setWhere('customer_id IN (SELECT customer_id FROM dtb_order WHERE order_id IN (SELECT order_id FROM dtb_order_detail WHERE product_code LIKE ?) AND del_flg = 0)');
         $search_buyproduct_code = $this->addSearchStr($this->arrSql['search_buy_product_code']);
         $this->arrVal[] = $search_buyproduct_code;
     }
     // 購入商品名称
     if (!isset($this->arrSql['search_buy_product_name'])) {
         $this->arrSql['search_buy_product_name'] = '';
     }
     if (strlen($this->arrSql['search_buy_product_name']) > 0) {
         $this->setWhere('customer_id IN (SELECT customer_id FROM dtb_order WHERE order_id IN (SELECT order_id FROM dtb_order_detail WHERE product_name LIKE ?) AND del_flg = 0)');
         $search_buyproduct_name = $this->addSearchStr($this->arrSql['search_buy_product_name']);
         $this->arrVal[] = $search_buyproduct_name;
     }
     // カテゴリを選択している場合のみ絞込検索を行う
     if (!isset($this->arrSql['search_category_id'])) {
         $this->arrSql['search_category_id'] = '';
     }
     if (strlen($this->arrSql['search_category_id']) > 0) {
         // カテゴリで絞込検索を行うSQL文生成
         list($tmp_where, $tmp_arrval) = $objDb->getCatWhere($this->arrSql['search_category_id']);
         // カテゴリで絞込みが可能の場合
         if ($tmp_where != '') {
             $this->setWhere(' customer_id IN (SELECT distinct customer_id FROM dtb_order WHERE order_id IN (SELECT distinct order_id FROM dtb_order_detail WHERE product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ') AND del_flg = 0)) ');
             $this->arrVal = array_merge((array) $this->arrVal, (array) $tmp_arrval);
         }
     }
     // 会員状態
     if (!isset($this->arrSql['search_status'])) {
         $this->arrSql['search_status'] = '';
     }
     if (is_array($this->arrSql['search_status'])) {
         $arrStatusVal = $this->setItemTerm($this->arrSql['search_status'], 'status');
         foreach ($arrStatusVal as $data) {
             $this->arrVal[] = $data;
         }
     }
     $this->setOrder('customer_id DESC');
 }
コード例 #12
0
ファイル: Tax.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 入力エラーチェック.
  *
  * @param FormParam $objFormParam
  * @return array $objErr->arrErr エラー内容
  */
 public function lfCheckError(&$objFormParam, TaxRuleHelper &$objTaxRule)
 {
     $arrErr = $objFormParam->checkError();
     $arrForm = $objFormParam->getHashArray();
     /* @var $objErr CheckError */
     $objErr = Application::alias('eccube.check_error', $arrForm);
     // tax_rule_id の正当性チェック
     if (!empty($arrForm['tax_rule_id'])) {
         if (!Utils::sfIsInt($arrForm['tax_rule_id']) || !$objTaxRule->getTaxRuleData($arrForm['tax_rule_id'])) {
             // tax_rule_idが指定されていて、且つその値が不正と思われる場合はエラー
             $arrErr['tax_rule_id'] = '※ 税規約IDが不正です<br />';
         }
     }
     // 適用日時チェック
     $objErr->doFunc(array('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day'), array('CHECK_DATE'));
     if (Utils::isBlank($objErr->arrErr['apply_date_year']) && $arrForm['tax_rule_id'] != '0') {
         $apply_date = Utils::sfGetTimestampistime($arrForm['apply_date_year'], sprintf("%02d", $arrForm['apply_date_month']), sprintf("%02d", $arrForm['apply_date_day']), sprintf("%02d", $arrForm['apply_date_hour']), sprintf("%02d", $arrForm['apply_date_minutes']));
         // 税規約情報読み込み
         $arrTaxRuleByTime = $objTaxRule->getTaxRuleByTime($apply_date);
         // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合
         if (!Utils::isBlank($arrTaxRuleByTime) && $arrTaxRuleByTime['tax_rule_id'] != $arrForm['tax_rule_id'] && $arrTaxRuleByTime['apply_date'] == $apply_date) {
             $arrErr['apply_date'] = '※ 既に同じ適用日時で登録が存在します。<br />';
         }
     }
     if (!Utils::isBlank($objErr->arrErr)) {
         $arrErr = array_merge($arrErr, $objErr->arrErr);
     }
     return $arrErr;
 }
コード例 #13
0
 /**
  * 会員検索パラメーター エラーチェック(管理画面用)
  *
  * @param FormParam $objFormParam FormParam インスタンス
  * @access public
  * @return array エラー配列
  */
 public function sfCheckErrorSearchParam(&$objFormParam)
 {
     // パラメーターの基本チェック
     $arrErr = $objFormParam->checkError();
     // エラーチェック対象のパラメータ取得
     $array = $objFormParam->getHashArray();
     // 拡張エラーチェック初期化
     /* @var $objErr CheckError */
     $objErr = Application::alias('eccube.check_error', $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 (Utils::sfIsInt($array['search_buy_total_from']) && Utils::sfIsInt($array['search_buy_total_to']) && $array['search_buy_total_from'] > $array['search_buy_total_to']) {
         $objErr->arrErr['search_buy_total_from'] .= '※ 購入金額の指定範囲が不正です。';
     }
     if (Utils::sfIsInt($array['search_buy_times_from']) && Utils::sfIsInt($array['search_buy_times_to']) && $array['search_buy_times_from'] > $array['search_buy_times_to']) {
         $objErr->arrErr['search_buy_times_from'] .= '※ 購入回数の指定範囲が不正です。';
     }
     if (!Utils::isBlank($objErr->arrErr)) {
         $arrErr = array_merge($arrErr, $objErr->arrErr);
     }
     return $arrErr;
 }
コード例 #14
0
ファイル: DbHelper.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 商品規格を設定しているか
  *
  * @param  integer $product_id 商品ID
  * @return bool    商品規格が存在する場合:true, それ以外:false
  */
 public function hasProductClass($product_id)
 {
     if (!Utils::sfIsInt($product_id)) {
         return false;
     }
     /* @var $objQuery Query */
     $objQuery = Application::alias('eccube.query');
     $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;
 }
コード例 #15
0
ファイル: Pdf.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  *
  * PDF作成フォームのデフォルト値の生成
  */
 public 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 (Utils::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;
 }
コード例 #16
0
ファイル: Mail.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  *
  * テンプレートの文言をフォームに入れる。
  * @param FormParam $objFormParam
  */
 public function changeData(&$objFormParam)
 {
     $template_id = $objFormParam->getValue('template_id');
     // 未選択時
     if (strlen($template_id) === 0) {
         $mailTemplates = null;
         // 有効選択時
     } elseif (Utils::sfIsInt($template_id)) {
         /* @var $objMailtemplate MailtemplateHelper */
         $objMailtemplate = Application::alias('eccube.helper.mailtemplate');
         $mailTemplates = $objMailtemplate->get($template_id);
         // 不正選択時
     } else {
         trigger_error('テンプレートの指定が不正。', E_USER_ERROR);
     }
     if (empty($mailTemplates)) {
         foreach (array('subject', 'header', 'footer') as $key) {
             $objFormParam->setValue($key, '');
         }
     } else {
         $objFormParam->setParam($mailTemplates);
     }
     return $objFormParam;
 }
コード例 #17
0
ファイル: Customer.php プロジェクト: ChigusaYasoda/ec-cube
 public function isLoginSuccess($dont_check_email_mobile = false)
 {
     // ログイン時のメールアドレスとDBのメールアドレスが一致している場合
     if (isset($_SESSION['customer']['customer_id']) && Utils::sfIsInt($_SESSION['customer']['customer_id'])) {
         $objQuery = Application::alias('eccube.query');
         $email = $objQuery->get('email', 'dtb_customer', 'customer_id = ?', array($_SESSION['customer']['customer_id']));
         if ($email == $_SESSION['customer']['email']) {
             // モバイルサイトの場合は携帯のメールアドレスが登録されていることもチェックする。
             // ただし $dont_check_email_mobile が true の場合はチェックしない。
             if (Application::alias('eccube.display')->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;
 }
コード例 #18
0
ファイル: Csv.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * CSV名からCSV_IDを取得する。
  *
  * @param  string  $subno_csv CSV名
  * @return integer CSV_ID
  */
 public function lfGetCsvId($subno_csv)
 {
     /* @var $objCSV CsvHelper */
     $objCSV = Application::alias('eccube.helper.csv');
     $arrKey = array_keys($objCSV->arrSubnavi, $subno_csv);
     $csv_id = $arrKey[0];
     if (!Utils::sfIsInt($csv_id)) {
         //初期値取りだし
         $arrKey = array_keys($objCSV->arrSubnavi);
         $csv_id = $arrKey[0];
     }
     return $csv_id;
 }
コード例 #19
0
ファイル: CsvSql.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 登録済みデータを削除する.
  *
  * @param  integer $sql_id 削除するデータのSQL_ID
  * @return boolean 実行結果 true:成功
  */
 public function lfDelData($sql_id)
 {
     $objQuery = Application::alias('eccube.query');
     $table = 'dtb_csv_sql';
     $where = 'sql_id = ?';
     if (Utils::sfIsInt($sql_id)) {
         $objQuery->delete($table, $where, array($sql_id));
         return true;
     }
     return false;
 }
コード例 #20
0
ファイル: Product.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 有効な商品IDかチェックする.
  *
  * @param int $product_id
  * @param bool $include_hidden
  * @param bool $include_deleted
  * @return bool
  */
 public function isValidProductId($product_id, $include_hidden = false, $include_deleted = false)
 {
     $where = '';
     if (!$include_hidden) {
         $where .= 'status = 1';
     }
     if (!$include_deleted) {
         if ($where != '') {
             $where .= ' AND ';
         }
         $where .= 'del_flg = 0';
     }
     if (Utils::sfIsInt($product_id) && !Utils::sfIsZeroFilling($product_id) && Application::alias('eccube.helper.db')->isRecord('dtb_products', 'product_id', array($product_id), $where)) {
         return true;
     }
     return false;
 }
コード例 #21
0
 /**
  * 有効なカテゴリーIDかチェックする.
  *
  * @param int $category_id
  * @param bool $include_deleted
  * @return bool
  */
 public function isValidCategoryId($category_id, $include_deleted = false)
 {
     if ($include_deleted) {
         $where = '';
     } else {
         $where = 'del_flg = 0';
     }
     if (Utils::sfIsInt($category_id) && !Utils::sfIsZeroFilling($category_id) && Application::alias('eccube.helper.db')->isRecord('dtb_category', 'category_id', array($category_id), $where)) {
         return true;
     }
     return false;
 }
コード例 #22
0
ファイル: ProductRank.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * @param DbHelper $objDb
  */
 public function lfRankMove(&$objDb, $parent_category_id, $product_id)
 {
     $key = 'pos-' . $product_id;
     $input_pos = mb_convert_kana($_POST[$key], 'n');
     if (Utils::sfIsInt($input_pos)) {
         $where = 'category_id = ' . Utils::sfQuoteSmart($parent_category_id);
         $objDb->moveRank('dtb_product_categories', 'product_id', $product_id, $input_pos, $where);
     }
 }
コード例 #23
0
ファイル: Index.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objNews NewsHelper */
     $objNews = Application::alias('eccube.helper.news');
     $objFormParam = Application::alias('eccube.form_param');
     $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 (isset($this->arrErr['news_id']) && !Utils::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);
             //自分にリダイレクト(再読込による誤動作防止)
             Application::alias('eccube.response')->reload();
             break;
             //---- 表示順位移動
         //---- 表示順位移動
         case 'up':
             $objNews->rankUp($news_id);
             // リロード
             Application::alias('eccube.response')->reload();
             break;
         case 'down':
             $objNews->rankDown($news_id);
             // リロード
             Application::alias('eccube.response')->reload();
             break;
         case 'moveRankSet':
             //---- 指定表示順位移動
             $input_pos = $this->getPostRank($news_id);
             if (Utils::sfIsInt($input_pos)) {
                 $objNews->moveRank($news_id, $input_pos);
             }
             Application::alias('eccube.response')->reload();
             break;
         default:
             break;
     }
     $this->arrNews = $objNews->getList();
     $this->line_max = count($this->arrNews);
     $this->arrForm = $objFormParam->getFormParamList();
 }
コード例 #24
0
 /**
  *
  * @param  Product $objProduct
  * @param FormParam $objFormParam
  * @return void
  */
 public function doDefault(&$objProduct, &$objFormParam)
 {
     //商品一覧の表示処理
     $strnavi = $this->objNavi->strnavi;
     // 表示文字列
     $this->tpl_strnavi = empty($strnavi) ? '&nbsp;' : $strnavi;
     // 規格1クラス名
     $this->tpl_class_name1 = $objProduct->className1;
     // 規格2クラス名
     $this->tpl_class_name2 = $objProduct->className2;
     // 規格1
     $this->arrClassCat1 = $objProduct->classCats1;
     // 規格1が設定されている
     $this->tpl_classcat_find1 = $objProduct->classCat1_find;
     // 規格2が設定されている
     $this->tpl_classcat_find2 = $objProduct->classCat2_find;
     $this->tpl_stock_find = $objProduct->stock_find;
     $this->tpl_product_class_id = $objProduct->product_class_id;
     $this->tpl_product_type = $objProduct->product_type;
     $js_fnOnLoad = '';
     // 商品ステータスを取得
     $this->productStatus = $this->arrProducts['productStatus'];
     unset($this->arrProducts['productStatus']);
     $this->tpl_javascript .= 'eccube.productsClassCategories = ' . Utils::jsonEncode($objProduct->classCategories) . ';';
     if (Application::alias('eccube.display')->detectDevice() === DEVICE_TYPE_PC) {
         //onloadスクリプトを設定. 在庫ありの商品のみ出力する
         foreach ($this->arrProducts as $arrProduct) {
             if ($arrProduct['stock_unlimited_max'] || $arrProduct['stock_max'] > 0) {
                 $js_fnOnLoad .= "fnSetClassCategories(document.product_form{$arrProduct['product_id']});";
             }
         }
     }
     //カート処理
     $target_product_id = intval($this->arrForm['product_id']);
     if ($target_product_id > 0) {
         // 商品IDの正当性チェック
         if (!Utils::sfIsInt($this->arrForm['product_id']) || !Application::alias('eccube.helper.db')->isRecord('dtb_products', 'product_id', $this->arrForm['product_id'], 'del_flg = 0 AND status = 1')) {
             Utils::sfDispSiteError(PRODUCT_NOT_FOUND);
         }
         // 入力内容のチェック
         $arrErr = $this->lfCheckError($objFormParam);
         if (empty($arrErr)) {
             $this->lfAddCart($this->arrForm);
             // 開いているカテゴリーツリーを維持するためのパラメーター
             $arrQueryString = array('category_id' => $this->arrForm['category_id']);
             Application::alias('eccube.response')->sendRedirect(CART_URL, $arrQueryString);
             Application::alias('eccube.response')->actionExit();
         }
         $js_fnOnLoad .= $this->lfSetSelectedData($this->arrProducts, $this->arrForm, $arrErr, $target_product_id);
     } else {
         // カート「戻るボタン」用に保持
         $netURL = new \Net_URL();
         //該当メソッドが無いため、$_SESSIONに直接セット
         $_SESSION['cart_referer_url'] = $netURL->getURL();
     }
     $this->tpl_javascript .= 'function fnOnLoad() {' . $js_fnOnLoad . '}';
     $this->tpl_onload .= 'fnOnLoad(); ';
 }
コード例 #25
0
ファイル: ProductEdit.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * DBに商品データを登録する
  *
  * @param  UploadFile  $objUpFile   UploadFileインスタンス
  * @param  UploadFile  $objDownFile UploadFileインスタンス
  * @param  array   $arrList     フォーム入力パラメーター配列
  * @return integer 登録商品ID
  */
 public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList)
 {
     $objQuery = Application::alias('eccube.query');
     /* @var $objDb DbHelper */
     $objDb = Application::alias('eccube.helper.db');
     // 配列の添字を定義
     $checkArray = array('name', 'status', 'main_list_comment', 'main_comment', 'deliv_fee', 'comment1', 'comment2', 'comment3', 'comment4', 'comment5', 'comment6', 'sale_limit', 'deliv_date_id', 'maker_id', 'note');
     $arrList = Utils::arrayDefineIndexes($arrList, $checkArray);
     // INSERTする値を作成する。
     $sqlval['name'] = $arrList['name'];
     $sqlval['status'] = $arrList['status'];
     $sqlval['main_list_comment'] = $arrList['main_list_comment'];
     $sqlval['main_comment'] = $arrList['main_comment'];
     $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['deliv_date_id'] = $arrList['deliv_date_id'];
     $sqlval['maker_id'] = $arrList['maker_id'];
     $sqlval['note'] = $arrList['note'];
     $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $arrRet = $objUpFile->getDBFileList();
     $sqlval = array_merge($sqlval, $arrRet);
     for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
         $sqlval['sub_title' . $cnt] = $arrList['sub_title' . $cnt];
         $sqlval['sub_comment' . $cnt] = $arrList['sub_comment' . $cnt];
     }
     $objQuery->begin();
     // 新規登録(複製時を含む)
     if ($arrList['product_id'] == '') {
         $product_id = $objQuery->nextVal('dtb_products_product_id');
         $sqlval['product_id'] = $product_id;
         // INSERTの実行
         $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
         $objQuery->insert('dtb_products', $sqlval);
         $arrList['product_id'] = $product_id;
         // カテゴリを更新
         $objDb->updateProductCategories($arrList['category_id'], $product_id);
         // 複製商品の場合には規格も複製する
         if ($arrList['copy_product_id'] != '' && Utils::sfIsInt($arrList['copy_product_id'])) {
             if (!$arrList['has_product_class']) {
                 //規格なしの場合、複製は価格等の入力が発生しているため、その内容で追加登録を行う
                 $this->lfCopyProductClass($arrList, $objQuery);
             } else {
                 //規格がある場合の複製は複製元の内容で追加登録を行う
                 // dtb_products_class のカラムを取得
                 /* @var $dbFactory DBFactory */
                 $dbFactory = Application::alias('eccube.db.factory');
                 $arrColList = $objQuery->listTableFields('dtb_products_class');
                 $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 = Utils::sfGetCommaList($arrColList);
                 $table = 'dtb_products_class';
                 $where = 'product_id = ?';
                 $objQuery->setOrder('product_class_id');
                 $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList['copy_product_id']));
                 // 規格データ登録
                 $objQuery = Application::alias('eccube.query');
                 foreach ($arrProductsClass as $arrData) {
                     $sqlval = $arrData;
                     $sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
                     $sqlval['deliv_fee'] = $arrList['deliv_fee'];
                     $sqlval['point_rate'] = $arrList['point_rate'];
                     $sqlval['sale_limit'] = $arrList['sale_limit'];
                     $sqlval['product_id'] = $product_id;
                     $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
                     $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
                     $objQuery->insert($table, $sqlval);
                 }
             }
         }
         // 更新
     } else {
         $product_id = $arrList['product_id'];
         // 削除要求のあった既存ファイルの削除
         $arrRet = $this->lfGetProductData_FromDB($arrList['product_id']);
         // TODO: UploadFile::deleteDBFileの画像削除条件見直し要
         $objImage = new Image($objUpFile->temp_dir);
         $arrKeyName = $objUpFile->keyname;
         $arrSaveFile = $objUpFile->save_file;
         $arrImageKey = array();
         foreach ($arrKeyName as $key => $keyname) {
             if ($arrRet[$keyname] && !$arrSaveFile[$key]) {
                 $arrImageKey[] = $keyname;
                 $has_same_image = $this->lfHasSameProductImage($arrList['product_id'], $arrImageKey, $arrRet[$keyname]);
                 if (!$has_same_image) {
                     $objImage->deleteImage($arrRet[$keyname], $objUpFile->save_dir);
                 }
             }
         }
         $objDownFile->deleteDBDownFile($arrRet);
         // UPDATEの実行
         $where = 'product_id = ?';
         $objQuery->update('dtb_products', $sqlval, $where, array($product_id));
         // カテゴリを更新
         $objDb->updateProductCategories($arrList['category_id'], $product_id);
     }
     // 商品登録の時は規格を生成する。複製の場合は規格も複製されるのでこの処理は不要。
     if ($arrList['copy_product_id'] == '') {
         // 規格登録
         if ($objDb->hasProductClass($product_id)) {
             // 規格あり商品(商品規格テーブルのうち、商品登録フォームで設定するパラメーターのみ更新)
             $this->lfUpdateProductClass($arrList);
         } else {
             // 規格なし商品(商品規格テーブルの更新)
             $arrList['product_class_id'] = $this->lfInsertDummyProductClass($arrList);
         }
     }
     // 商品ステータス設定
     /* @var $objProduct Product */
     $objProduct = Application::alias('eccube.product');
     $objProduct->setProductStatus($product_id, $arrList['product_status']);
     // 税情報設定
     if (OPTION_PRODUCT_TAX_RULE && !$objDb->hasProductClass($product_id)) {
         TaxRuleHelper::setTaxRuleForProduct($arrList['tax_rate'], $arrList['product_id'], $arrList['product_class_id']);
     }
     // 関連商品登録
     $this->lfInsertRecommendProducts($objQuery, $arrList, $product_id);
     $objQuery->commit();
     return $product_id;
 }
コード例 #26
0
ファイル: Refusal.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * 退会手続き完了メール送信する
  *
  * @access private
  * @param integer $customer_id 会員ID
  * @return void
  */
 public function lfSendRefusalMail($customer_id)
 {
     // 会員データの取得
     if (Utils::sfIsInt($customer_id)) {
         $arrCustomerData = Application::alias('eccube.helper.customer')->sfGetCustomerDataFromId($customer_id);
     }
     if (Utils::isBlank($arrCustomerData)) {
         return false;
     }
     $CONF = Application::alias('eccube.helper.db')->getBasisData();
     $objMailText = new SiteView();
     $objMailText->setPage($this);
     $objMailText->assign('CONF', $CONF);
     $objMailText->assign('name01', $arrCustomerData['name01']);
     $objMailText->assign('name02', $arrCustomerData['name02']);
     $objMailText->assignobj($this);
     /* @var $objHelperMail MailHelper */
     $objHelperMail = Application::alias('eccube.helper.mail');
     $objHelperMail->setPage($this);
     $subject = $objHelperMail->sfMakeSubject('退会手続きのご完了', $objMailText);
     $toCustomerMail = $objMailText->fetch('mail_templates/customer_refusal_mail.tpl');
     /* @var $objMail Sendmail */
     $objMail = Application::alias('eccube.sendmail');
     $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04'], $CONF['email01']);
     $objMail->setTo($arrCustomerData['email'], $arrCustomerData['name01'] . $arrCustomerData['name02'] . ' 様');
     $objMail->sendMail();
 }
コード例 #27
0
ファイル: Input.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * ページ番号が信頼しうる値かチェックする.
  *
  * @access private
  * @param  integer $pageno ページの番号
  * @return integer $clean_pageno チェック後のページの番号
  */
 public function lfCheckPageNo($pageno)
 {
     $clean_pageno = '';
     // $pagenoが0以上の整数かチェック
     if (Utils::sfIsInt($pageno) && $pageno > 0) {
         $clean_pageno = $pageno;
         // 例外は全て1とする
     } else {
         $clean_pageno = 1;
     }
     return $clean_pageno;
 }
コード例 #28
0
ファイル: CsvHelper.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * CSV 項目を出力する.
  *
  * @param  integer $csv_id CSV ID
  * @param  string  $where  SQL の WHERE 句
  * @param  array   $arrVal WHERE 句の要素
  * @param  array   $order  SQL の ORDER BY 句
  * @return array   CSV 項目の配列
  */
 public function sfGetCsvOutput($csv_id = '', $where = '', $arrVal = array(), $order = 'rank, no')
 {
     $objQuery = Application::alias('eccube.query');
     $cols = 'no, csv_id, col, disp_name, rank, status, rw_flg, mb_convert_kana_option, size_const_type, error_check_types';
     $table = 'dtb_csv';
     if (Utils::sfIsInt($csv_id)) {
         if ($where == '') {
             $where = 'csv_id = ?';
         } else {
             $where = "{$where} AND csv_id = ?";
         }
         $arrVal[] = $csv_id;
     }
     $objQuery->setOrder($order);
     $arrRet = $objQuery->select($cols, $table, $where, $arrVal);
     return $arrRet;
 }
コード例 #29
0
ファイル: Index.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // パラメーター管理クラス
     $objFormParam = Application::alias('eccube.form_param');
     $this->lfInitParamSearchCustomer($objFormParam);
     $objFormParam->setParam($_POST);
     // パラメーター読み込み
     $this->arrHidden = $objFormParam->getSearchArray();
     // 入力パラメーターチェック
     $this->arrErr = Application::alias('eccube.helper.customer')->sfCheckErrorSearchParam($objFormParam);
     $this->arrForm = $objFormParam->getFormParamList();
     if (!Utils::isBlank($this->arrErr)) {
         return;
     }
     // モードによる処理切り替え
     switch ($this->getMode()) {
         // 配信先検索
         case 'search':
         case 'back':
             list($this->tpl_linemax, $this->arrResults, $this->objNavi) = Application::alias('eccube.helper.customer')->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 (Utils::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 (Utils::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 (Utils::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/index.tpl';
                 Application::alias('eccube.helper.mail')->sfSendMailmagazine($this->lfRegisterData($objFormParam));
                 // DB登録・送信
                 Application::alias('eccube.response')->sendRedirect('./history.php');
             }
             break;
             // query:配信履歴から「確認」
         // query:配信履歴から「確認」
         case 'query':
             if (Utils::sfIsInt($_GET['send_id'])) {
                 $this->arrSearchData = $this->lfGetMailQuery($_GET['send_id']);
             }
             $this->setTemplate('mail/query.tpl');
             break;
             // query:配信履歴から「再送信」
         // query:配信履歴から「再送信」
         case 'retry':
             if (Utils::sfIsInt($_GET['send_id'])) {
                 Application::alias('eccube.helper.mail')->sfSendMailmagazine($_GET['send_id']);
                 // DB登録・送信
                 Application::alias('eccube.response')->sendRedirect('./history.php');
             } else {
                 $this->tpl_onload = "window.alert('メール送信IDが正しくありません');";
             }
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
コード例 #30
0
ファイル: Confirm.php プロジェクト: ChigusaYasoda/ec-cube
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     /* @var $objPurchase PurchaseHelper */
     $objPurchase = Application::alias('eccube.helper.purchase');
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     /* @var $objCartSess CartSession */
     $objCartSess = Application::alias('eccube.cart_session');
     /* @var $objSiteSess SiteSession */
     $objSiteSess = Application::alias('eccube.site_session');
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     $this->is_multiple = $objPurchase->isMultiple();
     // 前のページで正しく登録手続きが行われた記録があるか判定
     if (!$objSiteSess->isPrePage()) {
         Utils::sfDispSiteError(PAGE_ERROR, $objSiteSess);
     }
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     $this->cartKey = $objCartSess->getKey();
     // カート内商品のチェック
     $this->tpl_message = $objCartSess->checkProducts($this->cartKey);
     if (!Utils::isBlank($this->tpl_message)) {
         Application::alias('eccube.response')->sendRedirect(CART_URL);
         Application::alias('eccube.response')->actionExit();
     }
     $this->is_download = $this->cartKey == PRODUCT_TYPE_DOWNLOAD;
     // カートの商品を取得
     $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple);
     $this->arrCartItems = $objCartSess->getCartList($this->cartKey);
     // 合計金額
     $this->tpl_total_inctax = $objCartSess->getAllProductsTotal($this->cartKey);
     // 税額
     $this->tpl_total_tax = $objCartSess->getAllProductsTax($this->cartKey);
     $this->tpl_total_tax = $objCartSess->getAllProductsTax($this->cartKey);
     $objFormParam = new FormParam();
     $this->lfInitParam($objFormParam, $this->arrShipping);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     $objFormParam->trimParam();
     // 一時受注テーブルの読込
     $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
     // 配送業者を取得
     $objDelivery = new DeliveryHelper();
     $this->arrDeliv = $objDelivery->getList($this->cartKey, false, true);
     $this->tpl_is_single_deliv = $objDelivery->isSingleDeliv($this->cartKey);
     // お届け日一覧の取得
     $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $this->cartKey);
     if (Utils::sfIsInt($arrOrderTemp['deliv_id'])) {
         $this->arrPayment = $objPurchase->getSelectablePayment($objCartSess, $arrOrderTemp['deliv_id'], true);
         $this->arrDelivTime = DeliveryHelper::getDelivTime($arrOrderTemp['deliv_id']);
     }
     // カート集計を元に最終計算
     $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref($this->is_multiple), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id'], $arrOrderTemp['order_pref'], $arrOrderTemp['order_country_id']);
     $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults);
     foreach ($objFormParam->getHashArray() as $key => $param) {
         if (!Utils::isBlank($param) && Utils::isBlank($this->arrForm[$key])) {
             $this->arrForm[$key] = $param;
         }
     }
     // 会員ログインチェック
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = '******';
         $this->tpl_user_point = $objCustomer->getValue('point');
     }
     // 決済モジュールを使用するかどうか
     $this->use_module = Application::alias('eccube.helper.payment')->useModule($this->arrForm['payment_id']);
     switch ($this->getMode()) {
         case 'select_deliv':
             $sqlval = $objFormParam->getHashArray();
             if (Utils::isBlank($sqlval['use_point'])) {
                 $sqlval['use_point'] = '0';
             }
             $deliv_id = $objFormParam->getValue('deliv_id');
             $arrPayment = $objPurchase->getSelectablePayment($objCartSess, $deliv_id);
             $sqlval['payment_id'] = $arrPayment[0]['payment_id'];
             $sqlval['payment_method'] = $arrPayment[0]['payment_method'];
             $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval);
             Response::reload();
             break;
             // 前のページに戻る
         // 前のページに戻る
         case 'return':
             // 正常な推移であることを記録しておく
             $objSiteSess->setRegistFlag();
             Application::alias('eccube.response')->sendRedirect(SHOPPING_PAYMENT_URLPATH);
             Application::alias('eccube.response')->actionExit();
             break;
         case 'confirm':
             $this->saveShippings($objFormParam, $this->arrDelivTime);
             $deliv_id = $objFormParam->getValue('deliv_id');
             $arrPayment = $objPurchase->getSelectablePayment($objCartSess, $deliv_id);
             $this->lfRegistPayment($this->tpl_uniqid, $objFormParam->getHashArray(), $objPurchase, $arrPayment);
             /*
              * 決済モジュールで必要なため, 受注番号を取得
              */
             $this->arrForm['order_id'] = $objPurchase->getNextOrderID();
             $_SESSION['order_id'] = $this->arrForm['order_id'];
             // 集計結果を受注一時テーブルに反映
             $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, $objCustomer);
             // 正常に登録されたことを記録しておく
             $objSiteSess->setRegistFlag();
             // 決済モジュールを使用する場合
             if ($this->use_module) {
                 $objPurchase->completeOrder(ORDER_PENDING);
                 Application::alias('eccube.response')->sendRedirect(SHOPPING_MODULE_URLPATH);
                 // 購入完了ページ
             } else {
                 $objPurchase->completeOrder(ORDER_NEW);
                 PurchaseHelper::sendOrderMail($this->arrForm['order_id'], $this);
                 Application::alias('eccube.response')->sendRedirect(SHOPPING_COMPLETE_URLPATH);
             }
             Application::alias('eccube.response')->actionExit();
             break;
         default:
             break;
     }
 }