【ステップ2】
・/data/class/SC_CustomerList.php (L122あたり)
//性別
if (!isset($this->arrSql[‘sex’])) $this->arrSql[‘sex’] = “”;
if ( is_array( $this->arrSql[‘sex’] ) ){
$arrSexVal = $this->setItemTerm( $this->arrSql[‘sex’] ,”sex” );
foreach ($arrSexVal as $data) {
$this->arrVal[] = $data;
}
}
//会員ランク
if (!isset($this->arrSql[‘customer_rank’])) $this->arrSql[‘customer_rank’] = “”;
if ( is_array( $this->arrSql[‘customer_rank’] ) ){
$arrCustomer_rankVal = $this->setItemTerm( $this->arrSql[‘customer_rank’] ,”customer_rank” );
foreach ($arrCustomer_rankVal as $data) {
$this->arrVal[] = $data;
}
}
//職業
(L360あたり)
// 検索用SQL
function getList() {
$this->select = “SELECT customer_id,name01,name02,kana01,kana02,sex,email,tel01,tel02,tel03,pref,status,customer_rank FROM dtb_customer “;
return $this->getSql(0);
}
(L395あたり)
function getMailMagazineColumn($is_mobile= false) {
if($is_mobile == true) {
$email_column = “dtb_customer.email_mobile as email”;
} else {
$email_column = “dtb_customer.email”;
}
$column =”dtb_customer.customer_id,
dtb_customer.name01,
dtb_customer.name02,
dtb_customer.kana01,
dtb_customer.kana02,
dtb_customer.sex,
$email_column,
dtb_customer.tel01,
dtb_customer.tel02,
dtb_customer.tel03,
dtb_customer.pref,
dtb_customer.create_date,
dtb_customer.mailmaga_flg,
dtb_customer.customer_rank”;
return $column;
}
・/data/class/helper/SC_Helper_DB.php (L366あたり)
// 価格の登録
$objCustomer = new SC_Customer();
$objQuery = new SC_Query();
if($objCustomer->isLoginSuccess()) {
$customer_rank = $objCustomer->getValue(‘customer_rank’);
$discount_rank = $objQuery->get(“mtb_customer_discount”, “name”, “rank=?”, array($customer_rank));
if ($discount_rank != “”) {
if ($arrData[‘price02’] != “”) {
$objCartSess->setProductValue($arrCart[‘id’], ‘price’, $arrData[‘price02’]*$discount_rank);
$objPage->arrProductsClass[$cnt][‘uniq_price’] = $arrData[‘price02’]*$discount_rank;
} else {
$objCartSess->setProductValue($arrCart[‘id’], ‘price’, $arrData[‘price01’]*$discount_rank);
$objPage->arrProductsClass[$cnt][‘uniq_price’] = $arrData[‘price01’]*$discount_rank;
}
}else{
if ($arrData[‘price02’] != “”) {
$objCartSess->setProductValue($arrCart[‘id’], ‘price’, $arrData[‘price02’]);
$objPage->arrProductsClass[$cnt][‘uniq_price’] = $arrData[‘price02’];
} else {
$objCartSess->setProductValue($arrCart[‘id’], ‘price’, $arrData[‘price01’]);
$objPage->arrProductsClass[$cnt][‘uniq_price’] = $arrData[‘price01’];
}
}
}
※最後の「}」を忘れないように注意!
・/data/class/helper/SC_Helper_CSV.php(L53あたり)
※これは、もしかしたら不要かも。。。
* デフォルトコンストラクタ.
*/
function SC_Helper_CSV() {
$this->init();
$masterData = new SC_DB_MasterData_Ex();
$this->arrPref = $masterData->getMasterData(“mtb_pref”,
array(“pref_id”, “pref_name”, “rank”));
$this->arrSex = $masterData->getMasterData(“mtb_sex”);
$this->arrDISP = $masterData->getMasterData(“mtb_disp”);
$this->arrRECOMMEND = $masterData->getMasterData(“mtb_recommend”);
$this->arrCustomer_rank = $masterData->getMasterData(“mtb_customer_rank”);
}
・/data/class/page/admin/customer/SC_Page_Admin_Customer.php (L62あたり)
$this->arrJob = $masterData->getMasterData(“mtb_job”);
$this->arrJob[“不明”] = “不明”;
$this->arrSex = $masterData->getMasterData(“mtb_sex”);
$this->arrPageRows = $masterData->getMasterData(“mtb_page_rows”);
$this->arrMAILMAGATYPE = $masterData->getMasterData(“mtb_mail_magazine_type”);
$this->arrCustomer_rank = $masterData->getMasterData(“mtb_customer_rank”);
$this->arrHtmlmail[”] = “すべて”;
(L154あたり)
25 => array(“sql” => “cast(create_date as date) AS create_date”,
“csv” => “create_date”,
“header” => “登録日”),
26 => array(“sql” => “cast(update_date as date) AS update_date”,
“csv” => “update_date”,
“header” => “更新日”),
27 => array(“sql” => “customer_rank”,
“csv” => “customer_rank”,
“header” => “会員ランク”)
);
}
※26 =>・・・の最後に、「,」が入っています。お見逃し無く。
(L188あたり)
// 検索ワードの引き継ぎ
foreach ($_POST as $key => $val) {
switch($key) {
case ‘sex’:
case ‘status’:
case ‘customer_rank’:
$this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
if(!is_array($val)) {
$this->arrForm[$key] = split(“-“, $val);
}
break;
・/data/class/page/admin/customer/SC_Page_Admin_Customer_Edit.php(L58あたり)
function init() {
parent::init();
$this->tpl_mainpage = ‘customer/edit.tpl’;
$this->tpl_mainno = ‘customer’;
$this->tpl_subnavi = ‘customer/subnavi.tpl’;
$this->tpl_subno = ‘index’;
$this->tpl_pager = TEMPLATE_DIR . ‘admin/pager.tpl’;
$this->tpl_subtitle = ‘顧客マスタ’;
$masterData = new SC_DB_MasterData_Ex();
$this->arrPref = $masterData->getMasterData(“mtb_pref”, array(“pref_id”, “pref_name”, “rank”));
$this->arrJob = $masterData->getMasterData(“mtb_job”);
$this->arrSex = $masterData->getMasterData(“mtb_sex”);
$this->arrReminder = $masterData->getMasterData(“mtb_reminder”);
$this->arrCustomer_rank = $masterData->getMasterData(“mtb_customer_rank”);
}
(L109あたり)
array( “column” => “reminder”, “convert” => “n” ),
array( “column” => “reminder_answer”, “convert” => “aKV” ),
array( “column” => “mailmaga_flg”, “convert” => “n” ),
array( “column” => “note”, “convert” => “aKV” ),
array( “column” => “point”, “convert” => “n” ),
array( “column” => “status”, “convert” => “n” ),
array( “column” => “customer_rank”, “convert” => “n” )
);
(L320あたり)
$objErr->doFunc(array(“ご性別”, “sex”) ,array(“SELECT_CHECK”, “NUM_CHECK”));
$objErr->doFunc(array(“ご職業”, “job”) ,array(“NUM_CHECK”));
$objErr->doFunc(array(“会員ランク”, “customer_rank”) ,array(“SELECT_CHECK”, “NUM_CHECK”));
if ($array[“password”] != DEFAULT_PASSWORD) {
$objErr->doFunc(array(“パスワード”, ‘password’, PASSWORD_LEN1, PASSWORD_LEN2), array(“EXIST_CHECK”, “ALNUM_CHECK”, “NUM_RANGE_CHECK”));
}
・/data/class/page/admin/mail/SC_Page_Admin_Mail.php (L57あたり)
$masterData = new SC_DB_MasterData_Ex();
$this->arrPref = $masterData->getMasterData(“mtb_pref”, array(“pref_id”, “pref_name”, “rank”));
$this->arrJob = $masterData->getMasterData(“mtb_job”);
$this->arrJob[“不明”] = “不明”;
$this->arrSex = $masterData->getMasterData(“mtb_sex”);
$this->arrCustomer_rank = $masterData->getMasterData(“mtb_customer_rank”);
$this->arrMailType = $masterData->getMasterData(“mtb_mail_type”);
$this->arrPageRows = $masterData->getMasterData(“mtb_page_rows”);
// ページナビ用
(L96あたり)
//—- 検索項目
$this->arrSearchColumn = array(
array( “column” => “name”, “convert” => “aKV”),
array( “column” => “pref”, “convert” => “n” ),
array( “column” => “kana”, “convert” => “CKV”),
array( “column” => “sex”, “convert” => “” ),
array( “column” => “customer_rank”, “convert” => “” ),
array( “column” => “tel”, “convert” => “n” ),
array( “column” => “job”, “convert” => “” ),
array( “column” => “email”, “convert” => “a” ),
(L191あたり)
// 配信形式
$list_data[‘htmlmail_disp’] = $this->arrHtmlmail[$list_data[‘htmlmail’]];
// 性別の変換
if (count($list_data[‘sex’]) > 0) {
foreach($list_data[‘sex’] as $key => $val){
$list_data[‘sex’][$key] = $this->arrSex[$val];
$sex_disp .= $list_data[‘sex’][$key] . ” “;
}
$list_data[‘sex_disp’] = $sex_disp;
}
// 会員ランクの変換
if (count($list_data[‘customer_rank’]) > 0) {
foreach($list_data[‘customer_rank’] as $key => $val){
$list_data[‘customer_rank’][$key] = $this->arrCustomer_rank[$val];
$customer_rank_disp .= $list_data[‘customer_rank’][$key] . ” “;
}
$list_data[‘customer_rank_disp’] = $customer_rank_disp;
}
// 職業の変換
if (count($list_data[‘job’]) > 0) {
foreach($list_data[‘job’] as $key => $val){
$list_data[‘job’][$key] = $this->arrJob[$val];
$job_disp .= $list_data[‘job’][$key] . ” “;
}
$list_data[‘job_disp’] = $job_disp;
}
}