Changeset 17876 for branches/version-2_4/data/class
- Timestamp:
- 2009/03/06 19:08:36 (17 years ago)
- Location:
- branches/version-2_4/data/class/pages/admin
- Files:
-
- 1 added
- 1 edited
-
customer/LC_Page_Admin_Customer_SearchCustomer.php (added)
-
order/LC_Page_Admin_Order_Edit.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
r17804 r17876 156 156 157 157 if(count($this->arrErr) == 0) { 158 #if(count($this->arrErr) == 0) { 159 if ($_POST['mode'] == 'add') { 160 $this->lfRegistNewData(); 161 $text = "'新規受注を登録しました。'"; 162 } else { 163 $this->lfRegistData($_POST['order_id']); 164 $text = "'受注履歴を編集しました。'"; 165 } 166 // DBから受注情報を再読込 167 $this->lfGetOrderData($order_id); 168 $this->tpl_onload = "window.alert(".$text.");"; 169 #} 158 if ($_POST['mode'] == 'add') { 159 $order_id = $this->lfRegistNewData(); 160 161 $this->tpl_order_id = $order_id; 162 $this->tpl_mode = 'edit'; 163 164 $arrData['order_id'] = $order_id; 165 $this->objFormParam->setParam($arrData); 166 167 $text = "'新規受注を登録しました。'"; 168 } else { 169 $this->lfRegistData($_POST['order_id']); 170 $text = "'受注履歴を編集しました。'"; 171 } 172 // DBから受注情報を再読込 173 $this->lfGetOrderData($order_id); 174 $this->tpl_onload = "window.alert(".$text.");"; 170 175 } 171 176 break; … … 225 230 // 入力値の変換 226 231 $this->objFormParam->convParam(); 232 break; 233 /* 顧客検索ポップアップより顧客指定後、顧客情報取得*/ 234 case 'search_customer': 235 // POST情報で上書き 236 $this->objFormParam->setParam($_POST); 237 238 // 検索結果から顧客IDを指定された場合、顧客情報をフォームに代入する 239 $this->lfSetCustomerInfo($_POST['edit_customer_id']); 240 227 241 break; 228 242 /* F-REGI決済モジュール連携用 */ … … 389 403 $this->objFormParam->addParam("受注番号", "order_id"); 390 404 $this->objFormParam->addParam("受注日", "create_date"); 405 $this->objFormParam->addParam("発送日", "commit_date"); 391 406 } 392 407 … … 587 602 } 588 603 } 589 $order_id = $objQuery->nextval('dtb_order', 'order_id'); 604 605 // postgresqlとmysqlとで処理を分ける 606 if (DB_TYPE == "pgsql") { 607 $order_id = $objQuery->nextval("dtb_order","order_id"); 608 }elseif (DB_TYPE == "mysql") { 609 $order_id = $objQuery->get_auto_increment("dtb_order"); 610 } 611 590 612 $sqlval['order_id'] = $order_id; 591 613 $sqlval['create_date'] = "Now()"; … … 652 674 } 653 675 $objQuery->commit(); 676 677 return $order_id; 654 678 } 655 679 … … 697 721 return $arrProduct; 698 722 } 723 724 /** 725 * 検索結果から顧客IDを指定された場合、顧客情報をフォームに代入する 726 * @param int $edit_customer_id 顧客ID 727 */ 728 function lfSetCustomerInfo($edit_customer_id = ""){ 729 // 顧客IDが指定されている場合のみ、処理を実行する 730 if( $edit_customer_id === "" ) return ; 731 732 // 検索で選択された顧客IDが入力されている場合 733 if( is_null($edit_customer_id) === false && 0 < strlen($edit_customer_id) && SC_Utils_Ex::sfIsInt($edit_customer_id) ){ 734 $objQuery = new SC_Query(); 735 736 // 顧客情報を取得する 737 $arrCustomerInfo = $objQuery->select('*', 'dtb_customer', 'customer_id = ? AND del_flg = 0', array($edit_customer_id)); 738 739 // 顧客情報を取得する事が出来たら、テンプレートに値を渡す 740 if( 0 < count($arrCustomerInfo) && is_array($arrCustomerInfo) === true){ 741 // カラム名にorder_を付ける(テンプレート側でorder_がついている為 742 foreach($arrCustomerInfo[0] as $index=>$customer_info){ 743 // customer_idにはorder_を付けないようにする 744 $order_index = ($index == 'customer_id') ? $index : 'order_'.$index; 745 $arrCustomer[$order_index] = $customer_info; 746 } 747 } 748 749 // hiddenに渡す 750 $this->edit_customer_id = $edit_customer_id; 751 752 // 受注日に現在の時刻を取得し、表示させる 753 $create_date = $objQuery->getall('SELECT now() as create_date;'); 754 $arrCustomer['create_date'] = $create_date[0]['create_date']; 755 756 // 情報上書き 757 $this->objFormParam->setParam($arrCustomer); 758 // 入力値の変換 759 $this->objFormParam->convParam(); 760 } 761 } 699 762 } 700 763 ?>
Note: See TracChangeset
for help on using the changeset viewer.
