Index: /branches/version-2_11-dev/html/install/sql/insert_data.sql
===================================================================
--- /branches/version-2_11-dev/html/install/sql/insert_data.sql	(revision 20852)
+++ /branches/version-2_11-dev/html/install/sql/insert_data.sql	(revision 20854)
@@ -321,7 +321,116 @@
 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (214, 6, 'down_realfilename', 'ダウンロード実ファイル', 14, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'LTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,DOWN_FILE_EXISTS');
 
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, status, create_date, update_date) VALUES (215, 7, 'customer_id', '顧客ID', 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (216, 7, 'name01', '顧客名(姓)', 2, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (217, 7, 'name02', '顧客名(名)', 3, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (218, 7, 'kana01', '顧客名(フリガナ・姓)', 4, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVCa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (219, 7, 'kana02', '顧客名(フリガナ名)', 5, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVCa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (220, 7, 'zip01', '郵便番号1', 6, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'ZIP01_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,NUM_COUNT_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (221, 7, 'zip02', '郵便番号2', 7, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'ZIP02_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,NUM_COUNT_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (222, 7, '(SELECT name FROM mtb_pref WHERE mtb_pref.id = dtb_order.order_pref) as pref', '都道府県', 8, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (223, 7, 'addr01', '住所１', 9, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (224, 7, 'addr02', '住所２', 10, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (225, 7, 'email', 'メールアドレス', 11, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'null', 'NO_SPTAB,EMAIL_CHECK,EMAIL_CHAR_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (226, 7, 'email_mobile', '携帯メールアドレス', 12, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'null', 'NO_SPTAB,EMAIL_CHECK,EMAIL_CHAR_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (227, 7, 'tel01', '電話番号1', 13, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (228, 7, 'tel02', '電話番号2', 14, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (229, 7, 'tel03', '電話番号3', 15, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (230, 7, 'fax01', 'FAX1', 16, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (231, 7, 'fax02', 'FAX2', 17, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (232, 7, 'fax03', 'FAX3', 18, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (233, 7, 'sex', '性別', 19, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (234, 7, 'job', '職種', 20, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (235, 7, 'birth', '生年月日', 21, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'MTEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (236, 7, 'password', 'パスワード', 22, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,ALNUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (237, 7, 'reminder', 'パスワード確認用の質問', 23, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (238, 7, 'reminder_answer', 'パスワード確認用の質問の答え', 24, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (239, 7, 'first_buy_date', '初回購入日', 25, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (240, 7, 'last_buy_date', '最終購入日', 26, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (241, 7, 'buy_times', '購入回数', 27, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (242, 7, 'buy_total', '累積購入金額', 28, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (243, 7, 'point', 'ポイント残高', 29, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (244, 7, 'note', 'SHOP用メモ', 30, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'LTEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (245, 7, 'status', '会員状態', 31, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (246, 7, 'create_date', '作成日時', 32, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (247, 7, 'update_date', '更新日時', 33, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (248, 7, 'del_flg', '削除フラグ', 34, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, status, create_date, update_date) VALUES (249, 7, 'mobile_phone_id', '携帯端末ID', 35, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (250, 7, 'mailmaga_flg', 'メルマガフラグ', 36, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+
 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (251, 8, 'product_id', '商品ID', 1, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (252, 8, 'category_id', 'カテゴリID', 2, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
 INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (253, 8, 'rank', '表示ランク', 3, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (254, 9, 'order_id', '注文番号', 1, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (255, 9, 'customer_id', '顧客ID', 2, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (256, 9, 'message', '要望等', 3, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (257, 9, 'order_name01', '顧客名(姓)', 4, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (258, 9, 'order_name02', '顧客名(名)', 5, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (259, 9, 'order_kana01', '顧客名(フリガナ・姓)', 6, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVCa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (260, 9, 'order_kana02', '顧客名(フリガナ名)', 7, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVCa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (261, 9, 'order_email', 'メールアドレス', 8, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'null', 'NO_SPTAB,EMAIL_CHECK,EMAIL_CHAR_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (262, 9, 'order_tel01', '電話番号1', 9, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (263, 9, 'order_tel02', '電話番号2', 10, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (264, 9, 'order_tel03', '電話番号3', 11, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (265, 9, 'order_fax01', 'FAX1', 12, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (266, 9, 'order_fax02', 'FAX2', 13, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (267, 9, 'order_fax03', 'FAX3', 14, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (268, 9, 'order_zip01', '郵便番号1', 15, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'ZIP01_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,NUM_COUNT_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (269, 9, 'order_zip02', '郵便番号2', 16, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'ZIP02_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,NUM_COUNT_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (270, 9, '(SELECT name FROM mtb_pref WHERE mtb_pref.id = dtb_order.order_pref) as pref', '都道府県', 17, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (271, 9, 'order_addr01', '住所１', 18, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (272, 9, 'order_addr02', '住所２', 19, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (273, 9, 'order_sex', '性別', 20, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (274, 9, 'order_birth', '生年月日', 21, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (275, 9, 'order_job', '職種', 22, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (276, 9, 'shipping_name01', '配送先氏名(姓)', 23, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'STEXT_LEN', 'MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (277, 9, 'shipping_name02', '配送先名(名)', 24, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'STEXT_LEN', 'MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (278, 9, 'shipping_kana01', '配送先氏名カナ(姓)', 26, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'STEXT_LEN', 'MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (279, 9, 'shipping_kana02', '配送先氏名カナ(名)', 27, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'STEXT_LEN', 'MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (280, 9, 'shipping_tel01', '配送先電話番号1', 28, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (281, 9, 'shipping_tel02', '配送先電話番号2', 29, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (282, 9, 'shipping_tel03', '配送先電話番号3', 30, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (283, 9, 'shipping_fax01', '配送先FAX1', 31, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (284, 9, 'shipping_fax02', '配送先FAX2', 32, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (285, 9, 'shipping_fax03', '配送先FAX3', 33, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'TEL_ITEM_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (286, 9, 'shipping_zip01', '配送先郵便番号1', 34, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'ZIP01_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,NUM_COUNT_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (287, 9, 'shipping_zip02', '配送先郵便番号2', 35, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'ZIP02_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,NUM_COUNT_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (288, 9, 'shipping_pref', '配送先都道府県', 36, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (289, 9, 'shipping_addr01', '配送先住所１', 37, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (290, 9, 'shipping_addr02', '配送先住所１', 38, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (291, 9, 'subtotal', '小計', 39, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (292, 9, 'discount', '値引き', 40, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (293, 9, 'deliv_id', '配送業者ID', 41, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (294, 9, 'deliv_fee', '送料', 42, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (295, 9, 'charge', '手数料', 43, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (296, 9, 'use_point', '使用ポイント', 44, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (297, 9, 'add_point', '加算ポイント', 45, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (298, 9, 'birth_point', '誕生日ポイント', 46, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (299, 9, 'tax', '税金', 47, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (300, 9, 'total', '合計', 45, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (301, 9, 'payment_total', 'お支払い合計', 48, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'PRICE_LEN', 'MAX_LENGTH_CHECK,NUM_CHECK,EXIST_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (302, 9, 'payment_id', '支払方法ID', 49, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (303, 9, 'payment_method', '支払い方法', 50, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (304, 9, 'time_id', 'お届け時間ID', 51, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (305, 9, 'payment_method', 'お届け時間', 52, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'STEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (306, 9, 'note', 'SHOPメモ', 53, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'KVa', 'LLTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (307, 9, 'status', '対応状況', 54, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (308, 9, 'create_date', '作成日時', 55, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (309, 9, 'update_date', '更新日時', 56, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (310, 9, 'commit_date', '発送完了日時', 57, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (311, 9, 'payment_date', '入金日', 58, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (312, 9, 'device_type_id', '端末種別ID', 59, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (313, 9, 'del_flg', '削除フラグ', 60, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'n', 'INT_LEN', 'NUM_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (314, 9, 'shipping_date', 'お届け日', 61, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'a', 'STEXT_LEN', 'MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (315, 9, 'memo01', 'メモ1', 62, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (316, 9, 'memo02', 'メモ2', 63, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (317, 9, 'memo03', 'メモ3', 64, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (318, 9, 'memo04', 'メモ4', 65, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (319, 9, 'memo05', 'メモ5', 66, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (320, 9, 'memo06', 'メモ6', 67, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (321, 9, 'memo07', 'メモ7', 68, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (322, 9, 'memo08', 'メモ8', 69, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (323, 9, 'memo09', 'メモ9', 70, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
+INSERT INTO dtb_csv (no, csv_id, col, disp_name, rank, rw_flg, status, create_date, update_date, mb_convert_kana_option, size_const_type, error_check_types) VALUES (324, 9, 'memo10', 'メモ10', 71, 1, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '', 'MTEXT_LEN', 'SPTAB_CHECK,MAX_LENGTH_CHECK');
 
 INSERT INTO dtb_deliv (deliv_id, product_type_id, name, service_name, confirm_url, rank, status, del_flg, creator_id, create_date, update_date) VALUES (1, 1, 'サンプル業者', 'サンプル業者', NULL, 2, 1, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
Index: /branches/version-2_11-dev/html/admin/order/upload_csv.php
===================================================================
--- /branches/version-2_11-dev/html/admin/order/upload_csv.php	(revision 20854)
+++ /branches/version-2_11-dev/html/admin/order/upload_csv.php	(revision 20854)
@@ -0,0 +1,35 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once '../require.php';
+require_once CLASS_EX_REALDIR . 'page_extends/admin/order/LC_Page_Admin_Order_UploadCSV_Ex.php';
+
+// }}}
+// {{{ generate page
+
+$objPage = new LC_Page_Admin_Order_UploadCSV_Ex();
+register_shutdown_function(array($objPage, 'destroy'));
+$objPage->init();
+$objPage->process();
+?>
Index: /branches/version-2_11-dev/data/Smarty/templates/admin/order/upload_csv.tpl
===================================================================
--- /branches/version-2_11-dev/data/Smarty/templates/admin/order/upload_csv.tpl	(revision 20854)
+++ /branches/version-2_11-dev/data/Smarty/templates/admin/order/upload_csv.tpl	(revision 20854)
@@ -0,0 +1,68 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+*}-->
+<form name="form1" id="form1" method="post" action="?" enctype="multipart/form-data"">
+<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
+<input type="hidden" name="mode" value="csv_upload" />
+<div id="products" class="contents-main">
+    <!--{if $tpl_errtitle != ""}-->
+        <div class="message">
+            <span class="attention"><!--{$tpl_errtitle}--></span><br />
+            <!--{foreach key=key item=item from=$arrCSVErr}-->
+                <span class="attention"><!--{$item}-->
+                <!--{if $key != 'blank'}-->
+                    [値：<!--{$arrParam[$key]}-->]
+                <!--{/if}-->
+                </span><br />
+            <!--{/foreach}-->
+        </div>
+    <!--{/if}-->
+
+    <!--▼登録テーブルここから-->
+    <table>
+        <tr>
+            <th>CSVファイル</th>
+            <td>
+                <!--{if $arrErr.csv_file}-->
+                    <span class="attention"><!--{$arrErr.csv_file}--></span>
+                <!--{/if}-->
+                <input type="file" name="csv_file" size="40" /><span class="attention">(1行目タイトル行)</span>
+            </td>
+        </tr>
+        <tr>
+            <th>登録情報</th>
+            <td>
+                <!--{foreach name=title key=key item=item from=$arrTitle}-->
+                    <!--{$smarty.foreach.title.iteration}-->項目：<!--{$item}--><br />
+                <!--{/foreach}-->
+            </td>
+        </tr>
+    </table>
+    <!--▲登録テーブルここまで-->
+    <div class="btn-area">
+        <ul>
+            <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'csv_upload', '', ''); return false;"><span class="btn-next">この内容で登録する</span></a></li>
+        </ul>
+    </div>
+</div>
+</form>
Index: /branches/version-2_11-dev/data/Smarty/templates/admin/order/subnavi.tpl
===================================================================
--- /branches/version-2_11-dev/data/Smarty/templates/admin/order/subnavi.tpl	(revision 20764)
+++ /branches/version-2_11-dev/data/Smarty/templates/admin/order/subnavi.tpl	(revision 20854)
@@ -23,10 +23,7 @@
 *}-->
 <ul class="level1">
-    <li id="navi-order-index"
-        class="<!--{if $tpl_mainno == 'order' && $tpl_subno == 'index'}-->on<!--{/if}-->"
-    ><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/<!--{$smarty.const.DIR_INDEX_PATH}-->"><span>受注管理</span></a></li>
-    <li id="navi-order-add"
-        class="<!--{if $tpl_mainno == 'order' && $tpl_subno == 'add'}-->on<!--{/if}-->"
-    ><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/edit.php?mode=add"><span>新規受注入力</span></a></li>
+    <li id="navi-order-index" class="<!--{if $tpl_mainno == 'order' && $tpl_subno == 'index'}-->on<!--{/if}-->"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/<!--{$smarty.const.DIR_INDEX_PATH}-->"><span>受注管理</span></a></li>
+    <li id="navi-order-add" class="<!--{if $tpl_mainno == 'order' && $tpl_subno == 'add'}-->on<!--{/if}-->"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/edit.php?mode=add"><span>新規受注入力</span></a></li>
+    <li id="navi-order-uploadcsv" class="<!--{if $tpl_mainno == 'order' && $tpl_subno == 'upload_csv'}-->on<!--{/if}-->"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->order/upload_csv.php"><span>新規受注登録CSV</span></a></li>
     <li id="navi-order-status"
         class="<!--{if $tpl_mainno == 'order' && $tpl_subno == 'status'}-->on<!--{/if}-->"
Index: /branches/version-2_11-dev/data/Smarty/templates/admin/order/upload_csv_complete.tpl
===================================================================
--- /branches/version-2_11-dev/data/Smarty/templates/admin/order/upload_csv_complete.tpl	(revision 20854)
+++ /branches/version-2_11-dev/data/Smarty/templates/admin/order/upload_csv_complete.tpl	(revision 20854)
@@ -0,0 +1,55 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+*}-->
+<div id="products" class="contents-main">
+    <div class="message">
+        <span>CSV登録を実行しました。</span>
+    </div>
+    <!--{if $arrRowErr}-->
+        <table class="form">
+            <tr>
+                <td>
+                    <!--{foreach item=err from=$arrRowErr}-->
+                        <span class="attention"><!--{$err}--></span>
+                    <!--{/foreach}-->
+                </td>
+            </tr>
+        </table>
+    <!--{/if}-->
+    <!--{if $arrRowResult}-->
+        <table class="form">
+            <tr>
+                <td>
+                    <!--{foreach item=result from=$arrRowResult}-->
+                    <span><!--{$result}--><br/></span>
+                    <!--{/foreach}-->
+                </td>
+            </tr>
+        </table>
+    <!--{/if}-->
+    <div class="btn-area">
+        <ul>
+            <li><a class="btn-action" href="./upload_csv.php"><span class="btn-prev">戻る</span></a></li>
+        </ul>
+    </div>
+</div>
Index: /branches/version-2_11-dev/data/class_extends/page_extends/admin/order/LC_Page_Admin_Order_UploadCSV_Ex.php
===================================================================
--- /branches/version-2_11-dev/data/class_extends/page_extends/admin/order/LC_Page_Admin_Order_UploadCSV_Ex.php	(revision 20854)
+++ /branches/version-2_11-dev/data/class_extends/page_extends/admin/order/LC_Page_Admin_Order_UploadCSV_Ex.php	(revision 20854)
@@ -0,0 +1,68 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_REALDIR . 'pages/admin/order/LC_Page_Admin_Order_UploadCSV.php';
+
+/**
+ * CSV アップロード のページクラス(拡張).
+ *
+ * LC_Page_Admin_Products_UploadCSV をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $$Id: LC_Page_Admin_Products_UploadCSV_Ex.php 20764 2011-03-22 06:26:40Z nanasess $$
+ */
+class LC_Page_Admin_Order_UploadCSV_Ex extends LC_Page_Admin_Order_UploadCSV {
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        parent::process();
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+}
+?>
Index: /branches/version-2_11-dev/data/class/pages/admin/order/LC_Page_Admin_Order_UploadCSV.php
===================================================================
--- /branches/version-2_11-dev/data/class/pages/admin/order/LC_Page_Admin_Order_UploadCSV.php	(revision 20854)
+++ /branches/version-2_11-dev/data/class/pages/admin/order/LC_Page_Admin_Order_UploadCSV.php	(revision 20854)
@@ -0,0 +1,635 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
+require_once CLASS_EX_REALDIR . 'helper_extends/SC_Helper_CSV_Ex.php';
+
+/**
+ * 受注登録CSVのページクラス.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ *
+ */
+class LC_Page_Admin_Order_UploadCSV extends LC_Page_Admin_Ex {
+
+    // }}}
+    // {{{ functions
+
+    /** TAGエラーチェックフィールド情報 */
+    var $arrTagCheckItem;
+
+    /** 受注テーブルカラム情報 (登録処理用) **/
+    var $arrOrderColumn;
+
+    /** 配送先テーブルカラム情報 (登録処理用) **/
+    var $arrShippingColumn;
+
+    /** 登録フォームカラム情報 **/
+    var $arrFormKeyList;
+
+    var $arrRowErr;
+
+    var $arrRowResult;
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init() {
+        parent::init();
+        $this->tpl_mainpage = 'order/upload_csv.tpl';
+        $this->tpl_subnavi = 'order/subnavi.tpl';
+        $this->tpl_mainno = 'order';
+        $this->tpl_subno = 'upload_csv';
+        $this->tpl_subtitle = '新規受注登録CSV';
+        $this->csv_id = '9';
+
+        $masterData = new SC_DB_MasterData_Ex();
+        $this->arrDISP = $masterData->getMasterData("mtb_disp");
+        $this->arrSTATUS = $masterData->getMasterData("mtb_status");
+        $this->arrOrderSTATUS = $masterData->getMasterData("mtb_order_status");
+        $this->arrDELIVERYDATE = $masterData->getMasterData("mtb_delivery_date");
+        $this->arrPayments = SC_Helper_DB_Ex::sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
+        $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
+        $this->arrAllowedTag = $masterData->getMasterData("mtb_allowed_tag");
+        $this->arrTagCheckItem = array();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process() {
+        $this->action();
+        $this->sendResponse();
+    }
+
+    /**
+     * Page のアクション.
+     *
+     * @return void
+     */
+    function action() {
+        $this->objDb = new SC_Helper_DB_Ex();
+
+        // CSV管理ヘルパー
+        $objCSV = new SC_Helper_CSV_Ex();
+        // CSV構造読み込み
+        $arrCSVFrame = $objCSV->sfGetCsvOutput($this->csv_id);
+
+        // CSV構造がインポート可能かのチェック
+        if(!$objCSV->sfIsImportCSVFrame($arrCSVFrame) ) {
+            // 無効なフォーマットなので初期状態に強制変更
+            $arrCSVFrame = $objCSV->sfGetCsvOutput($this->csv_id, '', array(), 'no');
+            $this->tpl_is_format_default = true;
+        }
+        // CSV構造は更新可能なフォーマットかのフラグ取得
+        $this->tpl_is_update = $objCSV->sfIsUpdateCSVFrame($arrCSVFrame);
+
+        // CSVファイルアップロード情報の初期化
+        $objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR);
+        $this->lfInitFile($objUpFile);
+
+        // パラメータ情報の初期化
+        $objFormParam = new SC_FormParam_Ex();
+        $this->lfInitParam($objFormParam, $arrCSVFrame);
+
+        $objFormParam->setHtmlDispNameArray();
+        $this->arrTitle = $objFormParam->getHtmlDispNameArray();
+
+        switch($this->getMode()) {
+        case 'csv_upload':
+            $this->doUploadCsv($objFormParam, $objUpFile);
+            break;
+        default:
+            break;
+        }
+    }
+
+    /**
+     * 登録/編集結果のメッセージをプロパティへ追加する
+     *
+     * @param integer $line_count 行数
+     * @param stirng $message メッセージ
+     * @return void
+     */
+    function addRowResult($line_count, $message) {
+        $this->arrRowResult[] = $line_count . "行目：" . $message;
+    }
+
+    /**
+     * 登録/編集結果のエラーメッセージをプロパティへ追加する
+     *
+     * @param integer $line_count 行数
+     * @param stirng $message メッセージ
+     * @return void
+     */
+    function addRowErr($line_count, $message) {
+        $this->arrRowErr[] = $line_count . "行目：" . $message;
+    }
+
+    /**
+     * CSVアップロードを実行します.
+     *
+     * @return void
+     */
+    function doUploadCsv(&$objFormParam, &$objUpFile) {
+        // ファイルアップロードのチェック
+        $objUpFile->makeTempFile('csv_file');
+        $arrErr = $objUpFile->checkExists();
+        if (count($arrErr) > 0) {
+            $this->arrErr = $arrErr;
+            return;
+        }
+        // 一時ファイル名の取得
+        $filepath = $objUpFile->getTempFilePath('csv_file');
+        // CSVファイルの文字コード変換
+        $enc_filepath = SC_Utils_Ex::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_REALDIR);
+        // CSVファイルのオープン
+        $fp = fopen($enc_filepath, 'r');
+        // 失敗した場合はエラー表示
+        if (!$fp) {
+             SC_Utils_Ex::sfDispError("");
+        }
+
+        // 登録先テーブル カラム情報の初期化
+        $this->lfInitTableInfo();
+
+        // 登録フォーム カラム情報
+        $this->arrFormKeyList = $objFormParam->getKeyList();
+
+        // 登録対象の列数
+        $col_max_count = $objFormParam->getCount();
+        // 行数
+        $line_count = 0;
+
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $objQuery->begin();
+
+        $errFlag = false;
+        $all_line_checked = false;
+
+        while (!feof($fp)) {
+            $arrCSV = fgetcsv($fp, CSV_LINE_MAX);
+
+            // 全行入力チェック後に、ファイルポインターを先頭に戻す
+            if (feof($fp) && !$all_line_checked) {
+                rewind($fp);
+                $line_count = 0;
+                $all_line_checked = true;
+                continue;
+            }
+
+            // 行カウント
+            $line_count++;
+            // ヘッダ行はスキップ
+            if ($line_count == 1) {
+                continue;
+            }
+            // 空行はスキップ
+            if (empty($arrCSV)) {
+                continue;
+            }
+            // 列数が異なる場合はエラー
+            $col_count = count($arrCSV);
+            if ($col_max_count != $col_count) {
+                $this->addRowErr($line_count, "※ 項目数が" . $col_count . "個検出されました。項目数は" . $col_max_count . "個になります。");
+                $errFlag = true;
+                break;
+            }
+            // シーケンス配列を格納する。
+            $objFormParam->setParam($arrCSV, true);
+            $arrRet = $objFormParam->getHashArray();
+            $objFormParam->setParam($arrRet);
+            // 入力値の変換
+            $objFormParam->convParam();
+            // <br>なしでエラー取得する。
+            $arrCSVErr = $this->lfCheckError($objFormParam);
+
+            // 入力エラーチェック
+            if (count($arrCSVErr) > 0) {
+                foreach ($arrCSVErr as $err) {
+                    $this->addRowErr($line_count, $err);
+                }
+                $errFlag = true;
+                break;
+            }
+
+            if ($all_line_checked) {
+                $order_id = $this->lfRegistOrder($objQuery, $line_count, $objFormParam);
+                $arrParam = $objFormParam->getHashArray();
+
+                $this->addRowResult($line_count, "受注ID：".$order_id );
+            }
+        }
+
+        // 実行結果画面を表示
+        $this->tpl_mainpage = 'order/upload_csv_complete.tpl';
+
+        fclose($fp);
+
+        if ($errFlag) {
+            $objQuery->rollback();
+            return;
+        }
+
+        $objQuery->commit();
+
+        // 商品件数カウント関数の実行
+        $this->objDb->sfCountCategory($objQuery);
+        $this->objDb->sfCountMaker($objQuery);
+        return;
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy() {
+        parent::destroy();
+    }
+
+    /**
+     * ファイル情報の初期化を行う.
+     *
+     * @return void
+     */
+    function lfInitFile(&$objUpFile) {
+        $objUpFile->addFile("CSVファイル", 'csv_file', array('csv'), CSV_SIZE, true, 0, 0, false);
+    }
+
+    /**
+     * 入力情報の初期化を行う.
+     *
+     * @param array CSV構造設定配列
+     * @return void
+     */
+    function lfInitParam(&$objFormParam, &$arrCSVFrame) {
+        // 固有の初期値調整
+        $arrCSVFrame = $this->lfSetParamDefaultValue($arrCSVFrame);
+        // CSV項目毎の処理
+        foreach($arrCSVFrame as $item) {
+            if($item['status'] == CSV_COLUMN_STATUS_FLG_DISABLE) continue;
+            //サブクエリ構造の場合は AS名 を使用
+            if(preg_match_all('/\(.+\)[ ]*as[ ]*(.+)$/i', $item['col'], $match, PREG_SET_ORDER)) {
+                $col = $match[0][1];
+            }else{
+                $col = $item['col'];
+            }
+            // HTML_TAG_CHECKは別途実行なので除去し、別保存しておく
+            if(strpos(strtoupper($item['error_check_types']), 'HTML_TAG_CHECK') !== FALSE) {
+                $this->arrTagCheckItem[] = $item;
+                $error_check_types = str_replace('HTML_TAG_CHECK', '', $item['error_check_types']);
+            }else{
+                $error_check_types = $item['error_check_types'];
+            }
+            $arrErrorCheckTypes = explode(',', $error_check_types);
+            foreach($arrErrorCheckTypes as $key => $val) {
+                if(trim($val) == "") {
+                    unset($arrErrorCheckTypes[$key]);
+                }else{
+                    $arrErrorCheckTypes[$key] = trim($val);
+                }
+            }
+            // パラメーター登録
+            $objFormParam->addParam(
+                    $item['disp_name']
+                    , $col
+                    , constant($item['size_const_type'])
+                    , $item['mb_convert_kana_option']
+                    , $arrErrorCheckTypes
+                    , $item['default']
+                    , ($item['rw_flg'] != CSV_COLUMN_RW_FLG_READ_ONLY) ? true : false
+                    );
+        }
+    }
+
+    /**
+     * 入力チェックを行う.
+     *
+     * @return void
+     */
+    function lfCheckError(&$objFormParam) {
+        // 入力データを渡す。
+        $arrRet =  $objFormParam->getHashArray();
+        $objErr = new SC_CheckError_Ex($arrRet);
+        $objErr->arrErr = $objFormParam->checkError(false);
+        // HTMLタグチェックの実行
+        foreach($this->arrTagCheckItem as $item) {
+            $objErr->doFunc(array( $item['disp_name'], $item['col'], $this->arrAllowedTag), array("HTML_TAG_CHECK"));
+        }
+        // このフォーム特有の複雑系のエラーチェックを行う
+        if(count($objErr->arrErr) == 0) {
+            $objErr->arrErr = $this->lfCheckErrorDetail($arrRet, $objErr->arrErr);
+        }
+        return $objErr->arrErr;
+    }
+
+    /**
+     * 保存先テーブル情報の初期化を行う.
+     *
+     * @return void
+     */
+    function lfInitTableInfo() {
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $this->arrOrderColumn = $objQuery->listTableFields('dtb_order');
+        $this->arrShippingColumn = $objQuery->listTableFields('dtb_shipping');
+    }
+
+    /**
+     * 新規受注登録を行う.
+     *
+     *
+     * @param SC_Query $objQuery SC_Queryインスタンス
+     * @param string|integer $line 処理中の行数
+     * @return void
+     */
+    function lfRegistOrder($objQuery, $line = "", &$objFormParam) {
+        // 登録データ対象取得
+        $arrList = $objFormParam->getHashArray();
+        // 登録時間を生成(DBのnow()だとcommitした際、すべて同一の時間になってしまう)
+        $arrList['update_date'] = $this->lfGetDbFormatTimeWithLine($line);
+
+        // 商品テーブルのカラムに存在しているもののうち、Form投入設定されていないデータは上書きしない。
+        $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $this->arrOrderColumn);
+
+        // 必須入力では無い項目だが、空文字では問題のある特殊なカラム値の初期値設定
+        $sqlval = $this->lfSetOrderDefaultData($sqlval);
+
+        if($sqlval['order_id'] != "") {
+            $sqlval['create_date'] = $arrList['update_date'];
+            // INSERTの実行
+            $objQuery->insert("dtb_order", $sqlval);
+            // シーケンスの調整
+            $seq_count = $objQuery->currVal('dtb_order_order_id');
+            if($seq_count < $sqlval['order_id']){
+                $objQuery->setVal('dtb_order_order_id', $sqlval['order_id'] + 1);
+            }
+            $order_id = $sqlval['order_id'];
+        } else {
+            // 新規登録
+            $sqlval['order_id'] = $objQuery->nextVal('dtb_order_order_id');
+            $order_id = $sqlval['order_id'];
+            $sqlval['create_date'] = $arrList['update_date'];
+            // INSERTの実行
+            $objQuery->insert("dtb_order", $sqlval);
+        }
+        // 配送先情報を登録する
+        $this->lfRegistShipping($objQuery, $arrList, $order_id);
+        return $order_id;
+    }
+
+    /**
+     * 配送先登録を行う.
+     *
+     * @param SC_Query $objQuery SC_Queryインスタンス
+     * @param array $arrList 受注登録情報配列
+     * @param integer $order_id 受注ID
+     * @return void
+     */
+     function lfRegistShipping($objQuery, $arrList, $order_id) {
+        // 配送先登録情報を生成する。
+        // 配送先テーブルのカラムに存在しているもののうち、Form投入設定されていないデータは上書きしない。
+        $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $this->arrShippingColumn);
+        // 必須入力では無い項目だが、空文字では問題のある特殊なカラム値の初期値設定
+        $sqlval = $this->lfSetShippingDefaultData($sqlval);
+        
+        $objQuery->delete("dtb_shipping", "order_id = ?", array($order_id));
+        
+        // 配送日付を timestamp に変換
+        if (!SC_Utils_Ex::isBlank($sqlval['shipping_date'])) {
+            $d = mb_strcut($sqlval["shipping_date"], 0, 10);
+            $arrDate = explode("/", $d);
+            $ts = mktime(0, 0, 0, $arrDate[1], $arrDate[2], $arrDate[0]);
+            $sqlval['shipping_date'] = date("Y-m-d", $ts);
+        }
+        // 非会員購入の場合は shipping_id が存在しない
+        if (!is_numeric($sqlval['shipping_id'])) {
+            $sqlval['shipping_id'] = '0';
+        }
+        $sqlval['order_id'] = $order_id;
+        //$sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
+        $sqlval['create_date'] = $arrList['update_date'];
+        // INSERTの実行
+        $objQuery->insert("dtb_shipping", $sqlval);
+    }
+
+    /**
+     * 初期値の設定
+     *
+     * @param array $arrCSVFrame CSV構造配列
+     * @return array $arrCSVFrame CSV構造配列
+     */
+    function lfSetParamDefaultValue(&$arrCSVFrame) {
+        foreach($arrCSVFrame as $key => $val) {
+            switch($val['col']) {
+                case 'status':
+                    $arrCSVFrame[$key]['default'] = '1';
+                    break;
+                case 'del_flg':
+                    $arrCSVFrame[$key]['default'] = '0';
+                    break;
+                default:
+                    break;
+            }
+        }
+        return $arrCSVFrame;
+    }
+
+    /**
+     * 受注データ登録前に特殊な値の持ち方をする部分のデータ部分の初期値補正を行う
+     *
+     * @param array $sqlval 受注登録情報配列
+     * @return $sqlval 登録情報配列
+     */
+    function lfSetOrderDefaultData(&$sqlval) {
+        if($sqlval['del_flg'] == ""){
+            $sqlval['del_flg'] = '0'; //有効
+        }
+        return $sqlval;
+    }
+
+    /**
+     * 配送先データ登録前に特殊な値の持ち方をする部分のデータ部分の初期値補正を行う
+     *
+     * @param array $sqlval 配送先登録情報配列
+     * @return $sqlval 登録情報配列
+     */
+    function lfSetShippingDefaultData(&$sqlval) {
+        return $sqlval;
+    }
+
+    /**
+     * このフォーム特有の複雑な入力チェックを行う.
+     *
+     * @param array 確認対象データ
+     * @param array エラー配列
+     * @return array エラー配列
+     */
+    function lfCheckErrorDetail($item, $arrErr) {
+        // 顧客IDの存在チェック
+        if(!$this->lfIsDbRecord('dtb_customer', 'customer_id', $item)) {
+            $arrErr['product_class_id'] = "※ 指定の顧客IDは、登録されていません。";
+        }
+        // 対応状況の存在チェック
+        if(!$this->lfIsArrayRecord($this->arrOrderSTATUS, 'status', $item)) {
+            $arrErr['status'] = "※ 指定の対応状況は、登録されていません。";
+        }
+        // 支払い方法IDの存在チェック
+        if(!$this->lfIsArrayRecordMulti($this->arrPayments, 'product_payment_ids', $item, ',')) {
+            $arrErr['product_payment_ids'] = "※ 指定の支払い方法IDは、登録されていません。";
+        }
+        // 削除フラグのチェック
+        if(array_search('del_flg', $this->arrFormKeyList) !== FALSE
+                and $item['del_flg'] != "") {
+            if(!($item['del_flg'] == "0" or $item['del_flg'] == "1")) {
+                $arrErr['del_flg'] = "※ 削除フラグは「0」(有効)、「1」(削除)のみが有効な値です。";
+            }
+        }
+
+        return $arrErr;
+    }
+
+    // TODO: ここから下のルーチンは汎用ルーチンとして移動が望ましい
+
+    /**
+     * 指定された行番号をmicrotimeに付与してDB保存用の時間を生成する。
+     * トランザクション内のnow()は全てcommit()時の時間に統一されてしまう為。
+     *
+     * @param string $line_no 行番号
+     * @return string $time DB保存用の時間文字列
+     */
+    function lfGetDbFormatTimeWithLine($line_no = '') {
+        $time = date("Y-m-d H:i:s");
+        // 秒以下を生成
+        if($line_no != '') {
+            $microtime = sprintf("%06d", $line_no);
+            $time .= ".$microtime";
+        }
+        return $time;
+    }
+
+    /**
+     * 指定されたキーと複数値の有効性の配列内確認
+     *
+     * @param string $arr チェック対象配列
+     * @param string $keyname フォームキー名
+     * @param array  $item 入力データ配列
+     * @param string $delimiter 分割文字
+     * @return boolean true:有効なデータがある false:有効ではない
+     */
+    function lfIsArrayRecordMulti($arr, $keyname, $item, $delimiter = ',') {
+        if(array_search($keyname, $this->arrFormKeyList) === FALSE) {
+            return true;
+        }
+        if($item[$keyname] == "") {
+            return true;
+        }
+        $arrItems = explode($delimiter, $item[$keyname]);
+        //空項目のチェック 1つでも空指定があったら不正とする。
+        if(array_search("", $arrItems) !== FALSE) {
+            return false;
+        }
+        //キー項目への存在チェック
+        foreach($arrItems as $item) {
+            if(!array_key_exists($item, $arr)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 指定されたキーと複数値の有効性のDB確認
+     *
+     * @param string $table テーブル名
+     * @param string $tblkey テーブルキー名
+     * @param string $keyname フォームキー名
+     * @param array  $item 入力データ配列
+     * @param string $delimiter 分割文字
+     * @return boolean true:有効なデータがある false:有効ではない
+     */
+    function lfIsDbRecordMulti($table, $tblkey, $keyname, $item, $delimiter = ',') {
+        if(array_search($keyname, $this->arrFormKeyList) === FALSE) {
+            return true;
+        }
+        if($item[$keyname] == "") {
+            return true;
+        }
+        $arrItems = explode($delimiter, $item[$keyname]);
+        //空項目のチェック 1つでも空指定があったら不正とする。
+        if(array_search("", $arrItems) !== FALSE) {
+            return false;
+        }
+        $count = count($arrItems);
+        $where = $tblkey ." IN (" . implode(",", array_fill(0, $count, "?")) . ")";
+
+        $objQuery =& SC_Query_Ex::getSingletonInstance();
+        $db_count = $objQuery->count($table, $where, $arrItems);
+        if($count != $db_count) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 指定されたキーと値の有効性のDB確認
+     *
+     * @param string $table テーブル名
+     * @param string $keyname キー名
+     * @param array  $item 入力データ配列
+     * @return boolean true:有効なデータがある false:有効ではない
+     */
+    function lfIsDbRecord($table, $keyname, $item) {
+        if(array_search($keyname, $this->arrFormKeyList) !== FALSE  //入力対象である
+                and $item[$keyname] != ""   // 空ではない
+                and !$this->objDb->sfIsRecord($table, $keyname, (array)$item[$keyname]) //DBに存在するか
+                ) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 指定されたキーと値の有効性の配列内確認
+     *
+     * @param string $arr チェック対象配列
+     * @param string $keyname キー名
+     * @param array  $item 入力データ配列
+     * @return boolean true:有効なデータがある false:有効ではない
+     */
+    function lfIsArrayRecord($arr, $keyname, $item) {
+        if(array_search($keyname, $this->arrFormKeyList) !== FALSE //入力対象である
+                and $item[$keyname] != "" // 空ではない
+                and !array_key_exists($item[$keyname], $arr) //配列に存在するか
+                ) {
+            return false;
+        }
+        return true;
+    }
+}
