334 lines
13 KiB
PHP
334 lines
13 KiB
PHP
<?
|
|
$_adminpage = true;
|
|
|
|
if (!$argu['p']) $argu['p'] = 1;
|
|
if(empty($argu['mode'])) $argu['mode'] = "LIST_FORM";
|
|
|
|
$default_querystring = "pagecode=".$argu["pagecode"]."&subpage=".$argu["subpage"];
|
|
|
|
switch ($argu['mode']) {
|
|
case "LIST_FORM":
|
|
$_list = $Obj_board->get_boardconf_list($argu,$total);
|
|
|
|
break;
|
|
case "INSERT_FORM":
|
|
$_row=array(
|
|
"b_role_category" => "N",
|
|
"b_role_w" => "1",
|
|
"b_role_r" => "10",
|
|
"b_role_l" => "10",
|
|
"b_role_rp" => "1",
|
|
"b_role_cm" => "7",
|
|
"b_role_hp" => "N",
|
|
"b_role_em" => "N",
|
|
"b_role_mms" => "N",
|
|
"b_role_md" => "Y",
|
|
"b_role_cmt" => "N",
|
|
"b_role_secret" => "N",
|
|
"b_role_fn" => "2",
|
|
"b_category_print" => "",
|
|
"b_listnum" => "20",
|
|
"b_type" => "1",
|
|
"b_status" => "Y",
|
|
"b_size" => "732",
|
|
"b_header_file" => "include/top.php",
|
|
"b_footer_file" => "include/footer.php",
|
|
"b_role_thumb" => "N",
|
|
"b_role_thumb_w" => "0",
|
|
"b_role_notice" => "N",
|
|
"b_role_editor" => "Y",
|
|
"b_role_content" => "Y"
|
|
);
|
|
break;
|
|
case "MODIFY_FORM":
|
|
$_row = $data = $Obj_board->get_boardconf_view($argu['b_class']);
|
|
foreach($_row as $key => $value){
|
|
$_row[$key] = trim($value);
|
|
}
|
|
break;
|
|
case "INSERT_ACTION":
|
|
if($Obj_board->set_boardconf_insert($argu)){
|
|
go_url("?mode=LIST_FORM&".$default_querystring,"등록 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
case "MODIFY_ACTION":
|
|
if($Obj_board->set_boardconf_modify($argu)){
|
|
go_url("?mode=LIST_FORM&p={$argu['p']}&".$default_querystring,"수정 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
case "DELETE_ACTION":
|
|
if($Obj_board->set_boardconf_delete($argu)){
|
|
go_url("?mode=LIST_FORM&p={$argu['p']}&".$default_querystring,"삭제 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
case "LIST_DELETE_ACTION2":
|
|
$Obj_board->set_boardconf_delete_list($argu);
|
|
go_url("?".$default_querystring."&mode=LIST_FORM&p={$argu['p']}","삭제 되었습니다.");
|
|
exit;
|
|
break;
|
|
}
|
|
|
|
?>
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<h1 class="page-header">게시판 설정</h1>
|
|
</div>
|
|
</div>
|
|
<!-- /.row -->
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="panel panel-default">
|
|
<div class="panel-body">
|
|
<?
|
|
/***********************************
|
|
===== 리스트 폼일경우 =====
|
|
***********************************/
|
|
if ($argu['mode'] == "LIST_FORM") {
|
|
?>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered table-hover">
|
|
<colgroup>
|
|
<col width="5%" />
|
|
<col width="10%" />
|
|
<col width="*" />
|
|
<col width="10%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th>번호</th>
|
|
<th>b_class</th>
|
|
<th>게시판명</th>
|
|
<th>스킨</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?
|
|
if(count($_list) > 0){
|
|
for($i=0;$i<count($_list);$i++){
|
|
foreach($_list[$i] as $key => $value){
|
|
$_list[$i][$key] = trim($value);
|
|
}
|
|
$view_url="?".$default_querystring."&mode=MODIFY_FORM&p={$argu['p']}&b_class=".$_list[$i]["b_class"];
|
|
?>
|
|
|
|
<tr>
|
|
<td><?=($total - $Obj_board->_LIST_NUM * ($argu[p] - 1) - $i)?></td>
|
|
<td><a href="<?=$view_url?>" class="view"><?=$_list[$i]["b_class"]?></a></td>
|
|
<td><a href="<?=$view_url?>" ><?=$_list[$i]["bc_name"]?></a></td>
|
|
<td><?=$_list[$i]['b_type']?></td>
|
|
</tr>
|
|
<?
|
|
}
|
|
}
|
|
else{
|
|
?>
|
|
<tr>
|
|
<td colspan="5">등록된 데이터가 없습니다.</td>
|
|
</tr>
|
|
<?
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- /.table-responsive -->
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<button type="button" class="btn btn-outline btn-primary" onclick="go_url('<?=$_SEVER["PHP_SELF"]?>?<?=$default_querystring?>&mode=INSERT_FORM');">등록</button>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="dataTables_paginate paging_simple_numbers">
|
|
<ul class="pagination">
|
|
<?=page_index_admin($total,$argu['p'],preg_replace(array("/^p=(\d+)/","/&p=(\d+)/","/&p=/i","/&p=(\d+)/","/&p=/i"),"",$_SERVER["QUERY_STRING"]),$Obj_board->_LIST_NUM,$scale=10,BOARD_FIRST_IMG,BOARD_LAST_IMG,BOARD_PREV_IMG,BOARD_NEXT_IMG);?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?
|
|
}
|
|
/***********************************
|
|
===== 등록/수정 폼일경우 =====
|
|
***********************************/
|
|
elseif ($argu['mode'] == "INSERT_FORM" || $argu['mode'] == "MODIFY_FORM") {
|
|
$_w_mode=($argu['mode'] == "INSERT_FORM") ? "INSERT_ACTION" : "MODIFY_ACTION";
|
|
$argu["p"]=($argu['mode'] == "INSERT_FORM") ? 1 : $argu["p"];
|
|
?>
|
|
<form role="form" name="f" method="post" enctype="multipart/form-data" action="<?=$_SERVER["PHP_SELF"]?>">
|
|
<input type="hidden" name="pagecode" value="<?=$argu["pagecode"]?>">
|
|
<input type="hidden" name="subpage" value="<?=$argu["subpage"]?>">
|
|
<input type="hidden" name="mode" value="<?=$_w_mode?>">
|
|
<input type="hidden" name="p" value="<?=$argu["p"]?>">
|
|
<input type="hidden" name="b_status" value="<?=$_row["b_status"]?>">
|
|
<input type="hidden" name="b_class" value="<?=$argu["b_class"]?>">
|
|
<div class="col-lg-6">
|
|
<?if($argu['mode'] == "MODIFY_FORM"){?>
|
|
<div class="form-group">
|
|
<label>게시판 고유번호</label>
|
|
<p class="form-control-static"><strong><?=$_row['b_class']?></strong></p>
|
|
</div>
|
|
<?}?>
|
|
<div class="form-group">
|
|
<label for="bc_name" >게시판명</label>
|
|
<input type="text" class="form-control {label:'게시판명',required:true}" id="bc_name" name="bc_name" placeholder="게시판명" value="<?=$_row['bc_name']?>">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>카테고리 사용</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['b_role_category']) ? " checked" : "";
|
|
?>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="b_role_category" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
<?}?>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="bc_name" >카테고리</label>
|
|
<input type="text" class="form-control" id="b_category" name="b_category" placeholder="카테고리" value="<?=$_row['b_category']?>">
|
|
<p class="help-block" style="color:#ff0000">카테고리명은 ` | ` 구분지어 넣으세요 ex) TEST1|TEST2 </p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="user_pwd">스킨</label>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<select name="b_type" class="form-control {label:'스킨',required:true}">
|
|
<?
|
|
$handle=opendir('../board/skin');
|
|
|
|
$dircount=0;
|
|
while ($dir_list = readdir($handle)) {
|
|
if ($dir_list != "." && $dir_list != ".." ){
|
|
$skindir[$dircount]=$dir_list;
|
|
$dircount++;
|
|
}
|
|
}
|
|
closedir($handle);
|
|
|
|
for ($i=0;$i<sizeof($skindir);$i++){
|
|
if ($_row["b_type"]==$skindir[$i]) $skin_check="selected";
|
|
else $skin_check="";
|
|
$selname=$skindir[$i];
|
|
?>
|
|
<option value="<?=$selname?>" <?=$skin_check?>><?=$selname?></option>
|
|
<?
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>공지 사용</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['b_role_notice']) ? " checked" : "";
|
|
?>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="b_role_notice" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
<?}?>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>내용입력 사용</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['b_role_content']) ? " checked" : "";
|
|
?>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="b_role_content" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
<?}?>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>에디터 사용</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['b_role_editor']) ? " checked" : "";
|
|
?>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="b_role_editor" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
<?}?>
|
|
</div>
|
|
<button type="submit" class="btn btn-outline btn-success">확인</button>
|
|
<button type="button" class="btn btn-outline btn-info" onclick="go_url('<?=$_SEVER["PHP_SELF"]?>?<?=$default_querystring?>&mode=LIST_FORM');">목록</a></button>
|
|
<button type="button" class="btn btn-outline btn-danger" onclick="if(confirm('삭제 하시겠습니까?')){go_url('<?=$_SEVER["PHP_SELF"]?>?<?=$default_querystring?>&mode=DELETE_ACTION&p=<?=$argu['p']?>&b_class=<?=$_row['b_class']?>');}">삭제</button>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
|
|
<div class="form-group">
|
|
<label>썸네일 사용</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['b_role_thumb']) ? " checked" : "";
|
|
?>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="b_role_thumb" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
<?}?>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="b_role_thumb_w">썸네일 사이즈</label>
|
|
<input type="text" class="form-control" id="b_role_thumb_w" name="b_role_thumb_w" placeholder="썸네일 사이즈" value="<?=$_row['b_role_thumb_w']?>" style="width:50%">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="b_role_thumb_vertical_w">세로형 썸네일 사이즈</label>
|
|
<input type="text" class="form-control" id="b_role_thumb_vertical_w" name="b_role_thumb_vertical_w" placeholder="세로형 썸네일 사이즈" value="<?=$_row['b_role_thumb_vertical_w']?>" style="width:50%">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="b_role_thumb_list_w">리스트 썸네일 사이즈</label>
|
|
<input type="text" class="form-control" id="b_role_thumb_list_w" name="b_role_thumb_list_w" placeholder="리스트 썸네일 사이즈" value="<?=$_row['b_role_thumb_list_w']?>" style="width:50%">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>첨부파일 출력</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['b_role_md']) ? " checked" : "";
|
|
?>
|
|
<label class="radio-inline">
|
|
<input type="radio" name="b_role_md" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
<?}?>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="b_role_fn">첨부파일 갯수</label>
|
|
<input type="text" class="form-control" id="b_role_fn" name="b_role_fn" placeholder="첨부파일 갯수" value="<?=$_row['b_role_fn']?>" style="width:50%">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="b_listnum">게시물 갯수</label>
|
|
<input type="text" class="form-control" id="b_listnum" name="b_listnum" placeholder="게시물 갯수" value="<?=$_row['b_listnum']?>" style="width:50%">
|
|
</div>
|
|
|
|
|
|
<input type="hidden" name="bc_class" value="1">
|
|
<input type="hidden" name="b_role_w" value="1">
|
|
<input type="hidden" name="b_role_r" value="10">
|
|
<input type="hidden" name="b_role_l" value="10">
|
|
<input type="hidden" name="b_role_rp" value="0">
|
|
<input type="hidden" name="b_role_rp" value="0">
|
|
<input type="hidden" name="b_role_cm" value="0">
|
|
<input type="hidden" name="b_role_hp" value="N">
|
|
<input type="hidden" name="b_role_em" value="N">
|
|
<input type="hidden" name="b_role_cmt" value="N">
|
|
<input type="hidden" name="b_role_secret" value="N">
|
|
<input type="hidden" name="b_align" value="732">
|
|
<input type="hidden" name="b_align" value="1">
|
|
<input type="hidden" name="b_header_file" value="include/top.php">
|
|
<input type="hidden" name="b_footer_file" value="include/footer.php">
|
|
<input type="hidden" name="user_id" value="admin">
|
|
<input type="hidden" name="b_align" value="1">
|
|
</div>
|
|
</form>
|
|
<?
|
|
}
|
|
?>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
</div>
|
|
</div>
|