mysql db 업데이트가 안됩니다 - 코드가 길어 욕먹겠지만 한번만 봐주세요
본문
코드가 길어 욕먹을 것 같지만 그래도 무식하게 올려봅니다 ^^
관리자에 새로운 테이블을 하나 만들어 폼형식으로 db를 업데이트 하려고 하는데 먹히질 않습니다.
새로운 테이블과 구조까지는 생성이 잘 됩니다.
그다음 폼을 작성한 뒤에 업데이트가 되지를 않네요..
mwb_config.php 와 mwb_config_update.php 두 파일입니다.
먼저 mwb_config.php 파일입니다.
<?php
$sub_menu = '950100';
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
$g5['title'] = '기본 정보 관리';
if(!sql_query(" DESCRIBE {$g5['mwb_config_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['mwb_config_table']}` (
`company_name` text NOT NULL DEFAULT '',
`company_owner` text NOT NULL DEFAULT '',
`company_address_new` text NOT NULL DEFAULT '',
`company_address_old` text NOT NULL DEFAULT '',
`company_phone` text NOT NULL DEFAULT '',
`company_tel_1` text NOT NULL DEFAULT '',
`company_tel_2` text NOT NULL DEFAULT '',
`company_fax` text NOT NULL DEFAULT '',
`business_no` text NOT NULL DEFAULT '',
`tongsin_no` text NOT NULL DEFAULT '',
`bank_name` text NOT NULL DEFAULT '',
`account_no` text NOT NULL DEFAULT '',
`account_owner` text NOT NULL DEFAULT '',
`checkin_time` text NOT NULL DEFAULT '',
`checkout_time` text NOT NULL DEFAULT '',
`checkin_limit_time` text NOT NULL DEFAULT '',
`ddnayo_id` text NOT NULL DEFAULT '',
`facebook_id` text NOT NULL DEFAULT '',
`twitter_id` text NOT NULL DEFAULT '',
`og_description` text NOT NULL DEFAULT '',
`og_image` text NOT NULL DEFAULT '',
`naver_map_api_key` text NOT NULL DEFAULT '',
`naver_map_x` text NOT NULL DEFAULT '',
`naver_map_y` text NOT NULL DEFAULT '',
`period_s1` text NOT NULL DEFAULT '',
`period_s2` text NOT NULL DEFAULT '',
`period_s3` text NOT NULL DEFAULT '',
`period_s4` text NOT NULL DEFAULT '',
`period_s5` text NOT NULL DEFAULT '',
`period_s6` text NOT NULL DEFAULT '',
`period_w1` text NOT NULL DEFAULT '',
`period_w2` text NOT NULL DEFAULT '',
`period_w3` text NOT NULL DEFAULT '',
`period_w4` text NOT NULL DEFAULT '',
`period_w5` text NOT NULL DEFAULT '',
`period_w6` text NOT NULL DEFAULT '',
`period_e1` text NOT NULL DEFAULT '',
`period_e2` text NOT NULL DEFAULT '',
`period_e3` text NOT NULL DEFAULT '',
`period_e4` text NOT NULL DEFAULT '',
`period_e_name` text NOT NULL DEFAULT '',
`user_guide` text NOT NULL DEFAULT '',
`refund_0` text NOT NULL DEFAULT '',
`refund_1` text NOT NULL DEFAULT '',
`refund_2` text NOT NULL DEFAULT '',
`refund_3` text NOT NULL DEFAULT '',
`refund_4` text NOT NULL DEFAULT '',
`refund_5` text NOT NULL DEFAULT '',
`refund_6` text NOT NULL DEFAULT '',
`refund_7` text NOT NULL DEFAULT '',
`refund_8` text NOT NULL DEFAULT '',
`refund_9` text NOT NULL DEFAULT '',
`refund_10` text NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
}
include_once (G5_ADMIN_PATH.'/admin.head.php');
include_once(G5_EDITOR_LIB);
$frm_submit = '<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="'.G5_URL.'/">메인으로</a>
</div>';
?>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<style>
section {margin-top: 50px; }
.ui-datepicker-trigger {cursor:pointer;}
</style>
<form name="fconfigform" id="fconfigform" method="post" onsubmit="return fconfigform_submit(this);">
<input type="hidden" name="token" value="" id="token">
<section>
<h2 class="h2_frm">사업장 정보 관리</h2>
<div class="local_desc02 local_desc">
<p>사업장 정보를 변경할 수 있습니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>사업장 정보 설정</caption>
<colgroup>
<col class="grid_4">
<col class="grid_8">
<col class="grid_4">
<col class="grid_8">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="cf_title">홈페이지 제목 <?php if($is_admin) { ?>(cf_title)<?php } ?></label></th>
<td>
<input type="text" name="cf_title" value="<?php echo $config['cf_title'] ?>" id="cf_title" required class="required frm_input" size="30">
</td>
<th scope="row"></th>
<td>
</td>
</tr>
<tr>
<tr>
<th scope="row"><label for="company_name">상호명</label></th>
<td>
<?php echo help("사업자 등록증의 상호를 입력합니다."); ?>
<input type="text" name="company_name" value="<?php echo $mwbcfg['company_name'] ?>" id="company_name" class="frm_input" size="30">
</td>
<th scope="row"><label for="company_owner">대표자 이름</label></th>
<td>
<?php echo help("사업자 등록증의 대표자 이름을 입력합니다."); ?>
<input type="text" name="company_owner" value="<?php echo $mwbcfg['company_owner'] ?>" id="company_owner" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="business_no">사업자 번호</label></th>
<td>
<?php echo help("사업자 번호를 입력합니다."); ?>
<input type="text" name="business_no" value="<?php echo $mwbcfg['business_no'] ?>" id="business_no" class="frm_input" size="30">
</td>
<th scope="row"><label for="tongsin_no">통신판매업 번호</label></th>
<td>
<?php echo help("통신판매업 번호를 입력합니다. 없는 경우 생략합니다."); ?>
<input type="text" name="tongsin_no" value="<?php echo $mwbcfg['tongsin_no'] ?>" id="tongsin_no" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="company_address_new">도로명 주소</label></th>
<td>
<?php echo help("도로명 주소를 입력합니다."); ?>
<input type="text" name="company_address_new" value="<?php echo $mwbcfg['company_address_new'] ?>" id="company_address_new" class="frm_input" size="30">
</td>
<th scope="row"><label for="company_address_old">지번 주소</label></th>
<td>
<?php echo help("지번 주소를 입력합니다."); ?>
<input type="text" name="company_address_old" value="<?php echo $mwbcfg['company_address_old'] ?>" id="company_address_old" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="company_phone">휴대전화 번호</label></th>
<td>
<?php echo help("휴대번화번호를 입력합니다.<br>모바일페이지에서 전화 바로걸기에 사용할 전화번호입니다."); ?>
<input type="text" name="company_phone" value="<?php echo $mwbcfg['company_phone'] ?>" id="company_phone" class="frm_input" size="30">
</td>
<th scope="row"><label for="company_fax">팩스 번호</label></th>
<td>
<?php echo help("팩스번호를 입력합니다."); ?>
<input type="text" name="company_fax" value="<?php echo $mwbcfg['company_fax'] ?>" id="company_fax" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="company_tel_1">전화번호 1</label></th>
<td>
<?php echo help("전화번호 1을 입력합니다. 첫번째로 노출됩니다.<br>휴대전화번호가 없으면 모바일페이지에서 전화 바로걸기에 사용할 전화번호입니다."); ?>
<input type="text" name="company_tel_1" value="<?php echo $mwbcfg['company_tel_1'] ?>" id="company_tel_1" class="frm_input" size="30">
</td>
<th scope="row"><label for="company_tel_2">전화번호 2</label></th>
<td>
<?php echo help("전화번호 2를 입력합니다. 두번째로 노출됩니다."); ?>
<input type="text" name="company_tel_2" value="<?php echo $mwbcfg['company_tel_2'] ?>" id="company_tel_2" class="frm_input" size="30">
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2 class="h2_frm">입금 계좌 관리</h2>
<div class="local_desc02 local_desc">
<p>입금 계좌 정보를 변경할 수 있습니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>입금 계좌 설정</caption>
<colgroup>
<col class="grid_4">
<col class="grid_8">
<col class="grid_4">
<col class="grid_8">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="bank_name">무통장 계좌 은행명</label></th>
<td>
<?php echo help("무통장 계좌의 은행명을 입력합니다."); ?>
<input type="text" name="bank_name" value="<?php echo $mwbcfg['bank_name'] ?>" id="bank_name" class="frm_input" size="30">
</td>
<th scope="row"><label for="account_no">무통장 계좌 번호</label></th>
<td>
<?php echo help("무통장 계좌의 번호를 입력합니다."); ?>
<input type="text" name="account_no" value="<?php echo $mwbcfg['account_no'] ?>" id="account_no" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="account_owner">무통장 계좌 예금주</label></th>
<td>
<?php echo help("무통장 계좌의 예금주를 입력합니다."); ?>
<input type="text" name="account_owner" value="<?php echo $mwbcfg['account_owner'] ?>" id="account_owner" class="frm_input" size="30">
</td>
<th scope="row"></th>
<td>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
<section>
<h2 class="h2_frm">입퇴실 시간 관리</h2>
<div class="local_desc02 local_desc">
<p>입퇴실 시간 정보를 변경할 수 있습니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>입퇴실 시간 설정</caption>
<colgroup>
<col class="grid_4">
<col class="grid_8">
<col class="grid_4">
<col class="grid_8">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="checkin_time">입실 시간</label></th>
<td>
<?php echo help("통상적인 입실시간을 입력합니다.<br>'오전(오후) XX시' 와 같이 입력합니다."); ?>
<input type="text" name="checkin_time" value="<?php echo $mwbcfg['checkin_time'] ?>" id="checkin_time" class="frm_input" size="30">
</td>
<th scope="row"><label for="checkin_limit_time">입실 마감 시간</label></th>
<td>
<?php echo help("통상적인 입실 마감시간을 입력합니다. (생략 가능)<br>'오전(오후) XX시' 와 같이 입력합니다."); ?>
<input type="text" name="checkin_limit_time" value="<?php echo $mwbcfg['checkin_limit_time'] ?>" id="checkin_limit_time" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="checkout_time">퇴실 시간</label></th>
<td>
<?php echo help("통상적인 퇴실시간을 입력합니다.<br>'오전(오후) XX시' 와 같이 입력합니다."); ?>
<input type="text" name="checkout_time" value="<?php echo $mwbcfg['checkout_time'] ?>" id="checkout_time" class="frm_input" size="30">
</td>
<th scope="row"></th>
<td>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2 class="h2_frm">떠나요 펜션 예약시스템 관리</h2>
<div class="local_desc02 local_desc">
<p>떠나요 예약시스템을 사용하는 펜션의 코드를 입력하면 됩니다</p>
<p>객실관리 페이지에서 펜션 코드를 입력하지 않아도 이 곳에 입력되어 있으면 사용 가능합니다.</p>
<p>각 객실의 코드는 객실관리에서 각각 입력합니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>떠나요 설정</caption>
<colgroup>
<col class="grid_4">
<col class="grid_8">
<col class="grid_4">
<col class="grid_8">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="ddnayo_id">떠나요 예약시스템 펜션 코드</label></th>
<td>
<?php echo help("떠나요 예약시스템의 펜션코드를 입력합니다.<br>'id_hotel'값의 숫자만 입력합니다."); ?>
<input type="text" name="ddnayo_id" value="<?php echo $mwbcfg['ddnayo_id'] ?>" id="ddnayo_id" class="frm_input" size="30">
</td>
<th scope="row"></th>
<td>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2 class="h2_frm">소셜 서비스 & SEO 관리</h2>
<div class="local_desc02 local_desc">
<p>소셜 서비스 및 SEO 정보를 변경할 수 있습니다.</p>
<p>SEO, 네이버 사이트 등록, SNS 공유 페이지 설정 등에 이용됩니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>SEO 설정</caption>
<colgroup>
<col class="grid_4">
<col class="grid_8">
<col class="grid_4">
<col class="grid_8">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="facebook_id">사업장 페이스</label></th>
<td>
<?php echo help("운영하는 페이스북 계정이 있으면 ID를 입력합니다."); ?>
<input type="text" name="facebook_id" value="<?php echo $mwbcfg['facebook_id'] ?>" id="facebook_id" class="frm_input" size="30">
</td>
<th scope="row"><label for="twitter_id">사업장 트위터</label></th>
<td>
<?php echo help("운영하는 트위터 계정이 있으면 ID를 입력합니다."); ?>
<input type="text" name="twitter_id" value="<?php echo $mwbcfg['twitter_id'] ?>" id="twitter_id" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="og_description">사업장 og 사이트 설명 <?php if($is_admin) { ?>(1)<?php } ?></label></th>
<td>
<?php echo help("og 메타에 들어가는 사이트 설명을 입력합니다<br>네이버, 카카오, 페이스북, 트위터, 인스타그램 등에 사용됩니다."); ?>
<input type="text" name="og_description" value="<?php echo $mwbcfg['og_description'] ?>" id="og_description" class="frm_input" size="50">
</td>
<th scope="row"><label for="og_image">og 이미지 파일명</label></th>
<td>
<?php echo help("og 메타에 들어가는 이미지의 파일명을 입력합니다.<br>네이버, 카카오, 페이스북, 트위터, 인스타그램 등에 사용됩니다."); ?>
<input type="text" name="og_image" value="<?php echo $mwbcfg['og_image'] ?>" id="og_image" class="frm_input" size="50">
</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
<section>
<h2 class="h2_frm">사업장 네이버 지도 관리</h2>
<div class="local_desc02 local_desc">
<p>사업장의 네이버 지도 정보를 변경할 수 있습니다.</p>
<p>네이버 지도를 약도로 대신하는 경우 네이버 지도 API에 가입해야 합니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>네이버 지도 설정</caption>
<colgroup>
<col class="grid_4">
<col class="grid_8">
<col class="grid_4">
<col class="grid_8">
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="naver_map_api_key">네이버 지도 키</label></th>
<td>
<?php echo help("네이버 지도 API의 키를 입력합니다.<br>설정값을 모르는 경우 수정하지 않습니다."); ?>
<input type="text" name="naver_map_api_key" value="<?php echo $mwbcfg['naver_map_api_key'] ?>" id="naver_map_api_key" class="frm_input" size="30">
</td>
<th scope="row"></th>
<td>
</td>
</tr>
<tr>
<th scope="row"><label for="naver_map_x">네이버 지도 좌표 x값</label></th>
<td>
<?php echo help("네이버 지도상의 펜션 x 좌표.<br>설정값을 모르는 경우 수정하지 않습니다."); ?>
<input type="text" name="naver_map_x" value="<?php echo $mwbcfg['naver_map_x'] ?>" id="naver_map_x" class="frm_input" size="30">
</td>
<th scope="row"><label for="naver_map_y">네이버 지도 좌표 y값 <?php if($is_admin) { ?>(38)<?php } ?></label></th>
<td>
<?php echo help("네이버 지도상의 펜션 y 좌표.<br>설정값을 모르는 경우 수정하지 않습니다."); ?>
<input type="text" name="naver_map_y" value="<?php echo $mwbcfg['naver_map_y'] ?>" id="naver_map_y" class="frm_input" size="30">
</td>
</tr>
</tbody>
</table>
</div>
</section>
<script>
jQuery(function($){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
numberOfMonths: [1,1], //달력의 갯수 2줄 3개씩 6개 표기
monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd (D)', //날짜표기방법 D = 요일 DD = 요일 길게
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ko']);
});
</script>
<section id="anc_cf_extra">
<h2 class="h2_frm">기간 설정</h2>
<div class="local_desc02 local_desc">
<p>기간을 변경할 수 있습니다</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>기간 설정</caption>
<colgroup>
<col class="grid_2">
<col class="grid_6">
<col class="grid_2">
<col class="grid_6">
<col class="grid_2">
<col class="grid_6">
</colgroup>
<tbody>
<tr style="background:#eee;">
<th scope="row"><label style="width:100px;" for="period_s1">여름시즌 준성수기</label></th>
<td class="td_extra">
<input type="text" name="period_s1" value="<?php echo $mwbcfg['period_s1'] ?>" id="period_s1" class="frm_input" size="30" style="width:110px"> ~ <input type="text" name="period_s2" value="<?php echo $mwbcfg['period_s2'] ?>" id="period_s2" class="frm_input" size="30" style="width:110px">
</td>
<th scope="row"><label style="width:100px;" for="period_s3">여름시즌 성수기</label></th>
<td class="td_extra">
<input type="text" name="period_s3" value="<?php echo $mwbcfg['period_s3'] ?>" id="period_s3" class="frm_input" size="30" style="width:110px"> ~ <input type="text" name="period_s4" value="<?php echo $mwbcfg['period_s4'] ?>" id="period_s4" class="frm_input" size="30" style="width:110px">
</td>
<th scope="row"><label style="width:100px;" for="period_s5">여름시즌 준성수기</label></th>
<td class="td_extra">
<input type="text" name="period_s5" value="<?php echo $mwbcfg['period_s5'] ?>" id="period_s5" class="frm_input" size="30" style="width:110px"> ~ <input type="text" name="period_s6" value="<?php echo $mwbcfg['period_s6'] ?>" id="period_s6" class="frm_input" size="30" style="width:110px">
</td>
</tr>
<tr style="background:#ddd;border-bottom-color:#ddd;border-top-color:#ddd;">
<th scope="row"><label style="width:100px;" for="period_w1">겨울시즌 준성수기</label></th>
<td class="td_extra">
<input type="text" name="period_w1" value="<?php echo $mwbcfg['period_w1'] ?>" id="period_w1" class="frm_input" size="30" style="width:110px"> ~ <input type="text" name="period_w2" value="<?php echo $mwbcfg['period_w2'] ?>" id="period_w2" class="frm_input" size="30" style="width:110px">
</td>
<th scope="row"><label style="width:100px;" for="period_w3">겨울시즌 성수기</label></th>
<td class="td_extra">
<input type="text" name="period_w3" value="<?php echo $mwbcfg['period_w3'] ?>" id="period_w3" class="frm_input" size="30" style="width:110px"> ~ <input type="text" name="period_w4" value="<?php echo $mwbcfg['period_w4'] ?>" id="period_w4" class="frm_input" size="30" style="width:110px">
</td>
<th scope="row"><label style="width:100px;" for="period_w5">겨울시즌 준성수기</label></th>
<td class="td_extra">
<input type="text" name="period_w5" value="<?php echo $mwbcfg['period_w5'] ?>" id="period_w5" class="frm_input" size="30" style="width:110px"> ~ <input type="text" name="period_w6" value="<?php echo $mwbcfg['period_w6'] ?>" id="period_w6" class="frm_input" size="30" style="width:110px">
</td>
</tr>
<tr style="background:#ccc;">
<th scope="row"><label for="period_e_name">지정 기간 별칭</label></th>
<td>
<?php echo help("지정 기간의 별칭을 입력합니다. 가급적 6글자 이내로 입력합니다."); ?>
<input type="text" name="period_e_name" value="<?php echo $mwbcfg['period_e_name'] ?>" id="period_e_name" class="frm_input" size="20">
</td>
<th scope="row"><label style="width:100px;" for="period_e1">지정기간 설정</label></th>
<td class="td_extra">
<input type="text" name="period_e1" value="<?php echo $mwbcfg['period_e1'] ?>" id="period_e1" class="frm_input" size="30" style="width:110px"> ~
<input type="text" name="period_e2" value="<?php echo $mwbcfg['period_e2'] ?>" id="period_e2" class="frm_input" size="30" style="width:110px">
</td>
<th scope="row"><label style="width:100px;" for="period_e3">할인기간 설정</label></th>
<td class="td_extra">
<input type="text" name="period_e3" value="<?php echo $mwbcfg['period_e3'] ?>" id="period_e3" class="frm_input" size="30" style="width:110px"> ~
<input type="text" name="period_e4" value="<?php echo $mwbcfg['period_e4'] ?>" id="period_e4" class="frm_input" size="30" style="width:110px">
</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
<section>
<h2 class="h2_frm">예약 관련 내용</h2>
<div class="local_desc02 local_desc">
<p>실시간 예약 페이지의 내용을 추가,수정할 수 있습니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>예약 관련 내용</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="user_guide">이용 안내</label></th>
<td>
<?php echo help("이용 안내에 들어가는 내용을 작성하세요."); ?>
<?php echo editor_html('user_guide', get_text($mwbcfg['user_guide'], 0)); ?>
</td>
<th scope="row"></th>
<td>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<style>
.bld {border-left:1px #c7c7c7 dashed !important; text-align:center; }
</style>
<h2 class="h2_frm">환불 금액</h2>
<div class="local_desc02 local_desc">
<p>실시간 예약 페이지의 환불 금액을 추가,수정할 수 있습니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>환불 금액</caption>
<colgroup>
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
<col class="grid_2">
</colgroup>
<tbody>
<tr>
<th scope="row">취소 날짜</th>
<td class="bld"><label for="refund_0">이용 당일</label></td>
<td class="bld"><label for="refund_1">이용 1일전</label></td>
<td class="bld"><label for="refund_2">이용 2일전</label></td>
<td class="bld"><label for="refund_3">이용 3일전</label></td>
<td class="bld"><label for="refund_4">이용 4일전</label></td>
<td class="bld"><label for="refund_5">이용 5일전</label></td>
<td class="bld"><label for="refund_6">이용 6일전</label></td>
<td class="bld"><label for="refund_7">이용 7일전</label></td>
<td class="bld"><label for="refund_8">이용 8일전</label></td>
<td class="bld"><label for="refund_9">이용 9일전</label></td>
<td class="bld"><label for="refund_10">이용 10일전</label></td>
</tr>
<tr>
<th scope="row">환불 금액</th>
<td class="bld">환불 <input type="text" name="refund_0" value="<?php echo $mwbcfg['refund_0'] ?>" id="refund_0" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_1" value="<?php echo $mwbcfg['refund_1'] ?>" id="refund_1" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_2" value="<?php echo $mwbcfg['refund_2'] ?>" id="refund_2" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_3" value="<?php echo $mwbcfg['refund_3'] ?>" id="refund_3" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_4" value="<?php echo $mwbcfg['refund_4'] ?>" id="refund_4" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_5" value="<?php echo $mwbcfg['refund_5'] ?>" id="refund_5" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_6" value="<?php echo $mwbcfg['refund_6'] ?>" id="refund_6" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_7" value="<?php echo $mwbcfg['refund_7'] ?>" id="refund_7" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_8" value="<?php echo $mwbcfg['refund_8'] ?>" id="refund_8" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_9" value="<?php echo $mwbcfg['refund_9'] ?>" id="refund_9" class="frm_input" size="4">%</td>
<td class="bld">환불 <input type="text" name="refund_10" value="<?php echo $mwbcfg['refund_10'] ?>" id="refund_10" class="frm_input" size="4">%</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
</form>
<script>
function fconfigform_submit(f)
{
<?php echo get_editor_js("user_guide"); ?>
f.action = "./mwb_config_update.php";
return true;
}
jQuery(function($){
$('#period_s1,#period_s2,#period_s3,#period_s4,#period_s5,#period_s6,#period_w1,#period_w2,#period_w3,#period_w4,#period_w5,#period_w6,#period_e1,#period_e2,#period_e3,#period_e4').datepicker({
showOn: 'button',
buttonImage: 'img/calendar.gif',
buttonImageOnly: true,
buttonText: "달력",
changeMonth: true,
changeYear: true,
showButtonPanel: true,
yearRange: 'c-99:c+99'
});
});
</script>
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');
?>
다음은 mwb_config_update.php 파일입니다.
<?php
$sub_menu = "950100";
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], 'w');
check_admin_token();
$sql = " update {$g5['mwb_config_table']}
set company_name = '{$_POST['company_name']}',
company_owner = '{$_POST['company_owner']}',
company_address_new = '{$_POST['company_address_new']}',
company_address_old = '{$_POST['company_address_old']}',
company_phone = '{$_POST['company_phone']}',
company_tel_1 = '{$_POST['company_tel_1']}',
company_tel_2 = '{$_POST['company_tel_2']}',
company_fax = '{$_POST['company_fax']}',
business_no = '{$_POST['business_no']}',
tongsin_no = '{$_POST['tongsin_no']}',
bank_name = '{$_POST['bank_name']}',
account_no = '{$_POST['account_no']}',
account_owner = '{$_POST['account_owner']}',
checkin_time = '{$_POST['checkin_time']}',
checkout_time = '{$_POST['checkout_time']}',
checkin_limit_time = '{$_POST['checkin_limit_time']}',
ddnayo_id = '{$_POST['ddnayo_id']}',
facebook_idtwitter_id = '{$_POST['facebook_idtwitter_id']}',
twitter_id = '{$_POST['twitter_id']}',
og_description = '{$_POST['og_description']}',
og_image = '{$_POST['og_image']}',
naver_map_api_key = '{$_POST['naver_map_api_key']}',
naver_map_x = '{$_POST['naver_map_x']}',
naver_map_y = '{$_POST['naver_map_y']}',
period_s1 = '{$_POST['period_s1']}',
period_s2 = '{$_POST['period_s2']}',
period_s3 = '{$_POST['period_s3']}',
period_s4 = '{$_POST['period_s4']}',
period_s5 = '{$_POST['period_s5']}',
period_s6 = '{$_POST['period_s6']}',
period_w1 = '{$_POST['period_w1']}',
period_w2 = '{$_POST['period_w2']}',
period_w3 = '{$_POST['period_w3']}',
period_w4 = '{$_POST['period_w4']}',
period_w5 = '{$_POST['period_w5']}',
period_w6 = '{$_POST['period_w6']}',
period_e1 = '{$_POST['period_e1']}',
period_e2 = '{$_POST['period_e2']}',
period_e3 = '{$_POST['period_e3']}',
period_e4 = '{$_POST['period_e4']}',
period_e_name = '{$_POST['period_e_name']}',
user_guide = '{$_POST['user_guide']}',
refund_0 = '{$_POST['refund_0']}',
refund_1 = '{$_POST['refund_1']}',
refund_2 = '{$_POST['refund_2']}',
refund_3 = '{$_POST['refund_3']}',
refund_4 = '{$_POST['refund_4']}',
refund_5 = '{$_POST['refund_5']}',
refund_6 = '{$_POST['refund_6']}',
refund_7 = '{$_POST['refund_7']}',
refund_8 = '{$_POST['refund_8']}',
refund_9 = '{$_POST['refund_9']}',
refund_10 = '{$_POST['refund_10']}'
";
sql_query($sql);
//sql_query(" OPTIMIZE TABLE `$g5[config_table]` ");
goto_url('./mwb_config.php', false);
?>
extend 폴더에 mwb_extend.php 파일을 만들어 두었습니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// mwb 상수 선언
define('MWB_DIR','mwb-gb');
define('MWB_PATH',G5_PATH.'/'.MWB_DIR);
define('MWB_URL',G5_URL.'/'.MWB_DIR);
define('MWB_ADMIN_DIR','mwb_admin');
define('MWB_ADMIN_PATH',G5_ADMIN_PATH.'/'.MWB_ADMIN_DIR);
define('MWB_ADMIN_URL',G5_ADMIN_URL.'/'.MWB_ADMIN_DIR);
//mwb 테이블명
$g5['mwb_prefix'] = 'mwb_';
$g5['mwb_config_table'] = $g5['mwb_prefix'] . 'config';
$mwbcfg = sql_fetch(" select * from {$g5['mwb_config_table']} ");
?>
요렇게 해놓으니 처음 관리자페이지에서
mwb_config.php를 실행하면
mwb_config 테이블을 만들어 해당 구조까지는 생성이 됩니다.
그다음 폼값에 블라블라~ 적어놓구 submit 버튼을 누르면 sql값이 업데이트가 되질 않네요..
고수님들의 도움 부탁드립니다.
!-->!-->!-->
답변 4
두번째 실제 업데이트 파일 $sql 변수를 echo로 출력한다음 phpmysqladmin에서 실행해보세요.
영향이 있는 업데이트 행이 존재하는지 ...^^
echo로 출력하니 업데이트문은 제대로 넘어가는 것 같은데
혹시 테이블 컬럼을 생성할때 primary key나 다른게 꼭 들어가야하는게 있는지 모르겠네요..
컬럼값 하나를 잘못 작성했나봅니다. 해결되었네요~
ㅎㅎ 축하드려요~~ SQL에 분명 답이 있습니다. ^^
답변을 작성하시기 전에 로그인 해주세요.