Files
firstgarden-web-gnu/adm/rb/reservation_set.php
2025-07-02 14:13:16 +09:00

138 lines
5.4 KiB
PHP

<?php
$sub_menu = '000810';
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "w");
add_stylesheet('<link rel="stylesheet" href="./css/style.css">', 0);
$g5['rb_prefix'] = G5_TABLE_PREFIX.'rb_'; // 리빌더 테이블명 접두사
$rb_table_name = $g5['rb_prefix'].'reservation'; // g5_rb_reservation
//테이블이 있는지 검사한다.
if(!sql_query(" DESCRIBE {$rb_table_name} ", false)) {
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$rb_table_name}` (
`res_is` int(4) NOT NULL COMMENT '사용여부',
`res_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
}
$columns_to_add = [
'it_types' => 'INT(10) NOT NULL DEFAULT 0',
'it_date_s' => 'DATE NOT NULL',
'it_date_e' => 'DATE NOT NULL',
'it_date_n' => 'LONGTEXT NOT NULL DEFAULT \'\'',
'it_date_t' => 'LONGTEXT NOT NULL DEFAULT \'\'',
'it_date_j' => 'INT(4) NOT NULL DEFAULT 0',
'it_date_g' => 'INT(4) NOT NULL DEFAULT 0',
'it_not_c' => 'INT(10) NOT NULL DEFAULT 0',
'it_not_d' => 'INT(10) NOT NULL DEFAULT 0',
'it_not_s' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_min' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_max' => 'INT(10) NOT NULL DEFAULT 0',
'it_date_min' => 'INT(10) NOT NULL DEFAULT 0',
'it_date_max' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_min1' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_max1' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_min2' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_max2' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_min3' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_max3' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_pri1' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_pri2' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_pri3' => 'INT(10) NOT NULL DEFAULT 0',
'it_user_use1' => 'INT(4) NOT NULL DEFAULT 0',
'it_user_use2' => 'INT(4) NOT NULL DEFAULT 0',
'it_user_use3' => 'INT(4) NOT NULL DEFAULT 0',
'it_user_txt1' => 'VARCHAR(100) NOT NULL DEFAULT \'\'',
'it_user_txt2' => 'VARCHAR(100) NOT NULL DEFAULT \'\'',
'it_user_txt3' => 'VARCHAR(100) NOT NULL DEFAULT \'\'',
];
foreach ($columns_to_add as $column => $attributes) {
// 컬럼이 있는지 확인
$column_check = sql_query("SHOW COLUMNS FROM {$g5['g5_shop_item_table']} LIKE '{$column}'", false);
if (!sql_num_rows($column_check)) {
// 컬럼 추가
sql_query("ALTER TABLE {$g5['g5_shop_item_table']} ADD {$column} {$attributes}", true);
}
}
$columns_to_add2 = [
'ct_types' => 'INT(10) NOT NULL DEFAULT 0',
'ct_date_s' => 'DATE NOT NULL', //시작일
'ct_date_e' => 'DATE NOT NULL', //종료일
'ct_date_d' => 'INT(10) NOT NULL DEFAULT 0', //일수
'ct_date_t' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //선택옵션
'ct_user_txt1' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //추가옵션1 항목
'ct_user_txt2' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //추가옵션2 항목
'ct_user_txt3' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //추가옵션3 항목
'ct_user_qty1' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션1 수량
'ct_user_qty2' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션2 수량
'ct_user_qty3' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션3 수량
'ct_user_pri1' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션금액1
'ct_user_pri2' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션금액2
'ct_user_pri3' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션금액3
];
foreach ($columns_to_add2 as $column => $attributes) {
// 컬럼이 있는지 확인
$column_check = sql_query("SHOW COLUMNS FROM {$g5['g5_shop_cart_table']} LIKE '{$column}'", false);
if (!sql_num_rows($column_check)) {
// 컬럼 추가
sql_query("ALTER TABLE {$g5['g5_shop_cart_table']} ADD {$column} {$attributes}", true);
}
}
$sql = " select * from {$rb_table_name} limit 1";
$res = sql_fetch($sql);
$pg_anchor = '<ul class="anchor">
<li><a href="#anc_rb1">기본설정</a></li>
</ul>';
$g5['title'] = '예약 설정';
include_once (G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="rb_form" id="rb_form" action="./reservation_set_update.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="token" value="" id="token">
<section id="anc_rb1">
<h2 class="h2_frm">기본 설정</h2>
<?php echo $pg_anchor ?>
<div class="tbl_frm01 tbl_wrap">
<table>
<colgroup>
<col class="grid_4">
<col>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">예약기능 사용여부</th>
<td colspan="3">
<?php echo help('체크를 해제 하시면 예약기능을 사용하지 않습니다.') ?>
<input type="checkbox" name="res_is" value="1" id="res_is" <?php echo isset($res['res_is']) && $res['res_is'] == 1 ? 'checked' : ''; ?>> <label for="res_is">예약기능을 사용 합니다.</label>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<div class="btn_fixed_top">
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
</div>
</form>
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');