375 lines
14 KiB
PHP
375 lines
14 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"];
|
|
if(isset($argu["division"]) && $argu['division']) $default_querystring .= "&division=".urlencode($argu['division']);
|
|
|
|
|
|
switch ($argu['mode']) {
|
|
case "LIST_FORM":
|
|
$_list = $Obj_banner->get_list($argu,$total);
|
|
|
|
break;
|
|
case "INSERT_FORM":
|
|
$_row['published'] = "Y";
|
|
$_row['text_use'] = "N";
|
|
$_row["target"] = "_blank";
|
|
break;
|
|
case "MODIFY_FORM":
|
|
$_row = $data = $Obj_banner->get_view($argu['b_id']);
|
|
foreach($_row as $key => $value){
|
|
$_row[$key] = trim($value);
|
|
}
|
|
|
|
break;
|
|
case "INSERT_ACTION":
|
|
if($Obj_banner->set_insert($argu)){
|
|
go_url("?mode=LIST_FORM&".$default_querystring,"등록 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
case "MODIFY_ACTION":
|
|
if($Obj_banner->set_modify($argu)){
|
|
go_url("?mode=LIST_FORM&p={$argu['p']}&".$default_querystring,"수정 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
case "DELETE_ACTION":
|
|
if($Obj_banner->set_delete($argu['b_id'])){
|
|
go_url("?mode=LIST_FORM&p={$argu['p']}&".$default_querystring,"삭제 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
case "LIST_DELETE_ACTION2":
|
|
$Obj_banner->set_delete_list($argu);
|
|
go_url("?".$default_querystring."&mode=LIST_FORM&p={$argu['p']}","삭제 되었습니다.");
|
|
exit;
|
|
break;
|
|
case "ORDER_ACTION":
|
|
if($Obj_banner->set_order($argu)){
|
|
go_url("?mode=LIST_FORM&p={$argu['p']}&".$default_querystring,"수정 되었습니다");
|
|
exit;
|
|
}
|
|
break;
|
|
}
|
|
|
|
//if($argu["division"] == "T"){
|
|
$_title = "배너 관리";
|
|
/*}
|
|
else if($argu["division"] == "R"){
|
|
$_title = "우측배너 관리";
|
|
}*/
|
|
?>
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<h1 class="page-header"><?=$_title?></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") {
|
|
?>
|
|
<form role="form" name="f" method="get" action="<?=$_SERVER["PHP_SELF"]?>">
|
|
<input type="hidden" name="mode" id="mode" value="LIST_FORM">
|
|
<input type="hidden" name="pagecode" value="<?=$argu['pagecode']?>">
|
|
<input type="hidden" name="subpage" value="<?=$argu['subpage']?>">
|
|
<input type="hidden" name="division" value="<?=$argu['division']?>">
|
|
<div class="row">
|
|
<!-- <div class="col-sm-2">
|
|
<div class="form-group">
|
|
<select class="form-control" name="gubun" onchange="document.f.submit();">
|
|
<option value="">언어구분</option>
|
|
<option value="ko" <?if($argu["gubun"] == "ko") echo "selected";?>>국문</option>
|
|
<option value="en" <?if($argu["gubun"] == "en") echo "selected";?>>영문</option>
|
|
</select>
|
|
</div>
|
|
</div> -->
|
|
<div class="col-sm-2">
|
|
<div class="form-group">
|
|
<select class="form-control" name="division" onchange="document.f.submit();">
|
|
<option value="">구분</option>
|
|
<option value="PM" <?if($argu["division"] == "PM") echo "selected";?>>MAIN</option>
|
|
<!-- <option value="PL" <?if($argu["division"] == "PL") echo "selected";?>>PC-LEFT</option>
|
|
<option value="PRT" <?if($argu["division"] == "PRT") echo "selected";?>>PC-RIGHT TOP</option>
|
|
<option value="PRB" <?if($argu["division"] == "PRB") echo "selected";?>>PC-RIGHT BOTTOM</option>
|
|
<option value="MM" <?if($argu["division"] == "MM") echo "selected";?>>MOBILE-MAIN</option> -->
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="form-group input-group">
|
|
<input type="text" class="form-control" name="s_string" value="<?=htmlspecialchars($argu['s_string'])?>">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type="submit"><i class="fa fa-search"></i>
|
|
</button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered table-hover">
|
|
<colgroup>
|
|
<!-- <col width="5%" /> -->
|
|
<col width="19%" />
|
|
<col width="19%" />
|
|
<col width="*" />
|
|
<col width="19%" />
|
|
<col width="10%" />
|
|
<col width="10%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<!-- <th>번호</th> -->
|
|
<th>이미지</th>
|
|
<th>구분</th>
|
|
<th>제목</th>
|
|
<th>링크</th>
|
|
<th>구분</th>
|
|
<th>사용여부</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?
|
|
if(count($_list) > 0){ // 리스트가 있을경우
|
|
for($i=0;$i<count($_list);$i++){
|
|
|
|
$_list_link="?".$default_querystring."&mode=MODIFY_FORM&p={$argu['p']}&b_id=".$_list[$i]["b_id"];
|
|
|
|
$_use = ($_list[$i]["published"] == "Y") ? " <button type=\"button\" class=\"btn btn-success btn-xs tooltips\">Publish</button>" : " <button type=\"button\" class=\"btn btn-bricky btn-xs tooltips\" >Unpublish</button>";
|
|
|
|
$_target = ($_list[$i]["target"] == "_self") ? " <button type=\"button\" class=\"btn btn-default btn-xs tooltips\">현재창</button>" : " <button class=\"btn btn-default btn-xs tooltips\" >새창</button>";
|
|
|
|
$_image_path = $Obj_banner->_PDS.$_list[$i]["image"];
|
|
|
|
$thumbImage = $_image_path;
|
|
|
|
$thumbImage = "/common/phpThumb/phpThumb.php?src=".$thumbImage."&w=600&h=300";
|
|
|
|
if($_list[$i]["division"] == "PM"){
|
|
$_division = "MAIN";
|
|
}
|
|
else if($_list[$i]["division"] == "PL"){
|
|
$_division = "PC-LEFT";
|
|
}
|
|
else if($_list[$i]["division"] == "PRT"){
|
|
$_division = "PC-RIGHT TOP";
|
|
}
|
|
else if($_list[$i]["division"] == "PRB"){
|
|
$_division = "PC-RIGHT BOTTOM";
|
|
}
|
|
else{
|
|
$_division = "MOBILE-MAIN";
|
|
}
|
|
|
|
?>
|
|
<tr>
|
|
<!-- <td><?=$_list[$i]['order_num']?></td> -->
|
|
<td>
|
|
<div class="col-lg-10">
|
|
<a href="<?=$_list_link?>" class="thumbnail">
|
|
<?if($_list[$i]["image"]){?>
|
|
<img src="/pds/banner/<?=$_list[$i]["image"]?>" >
|
|
<?}?>
|
|
</a>
|
|
</div>
|
|
</td>
|
|
<td><?=$_division?></td>
|
|
<td><a href="<?=$_list_link?>"><?=$_list[$i]['title']?></a></td>
|
|
<td><?=$_list[$i]['url']?></td>
|
|
<td><?=$_target?></td>
|
|
<td><?=$_use?></td>
|
|
</tr>
|
|
<?
|
|
}
|
|
}else{ // 리스트가 없을경우
|
|
?>
|
|
<tr>
|
|
<td colspan="4">등록된 내용이 없습니다</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_banner->_LIST_NUM,$scale=10,BOARD_FIRST_IMG,BOARD_LAST_IMG,BOARD_PREV_IMG,BOARD_NEXT_IMG);?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<?
|
|
}
|
|
/***********************************
|
|
===== 등록/수정 폼일경우 =====
|
|
***********************************/
|
|
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"];
|
|
|
|
$thumbImage = $Obj_banner->_PDS.$_row["image"];
|
|
|
|
$thumbImage = "/common/phpThumb/phpThumb.php?src=".$thumbImage."&w=600&h=300";
|
|
|
|
if($argu["division"] == "T"){
|
|
//$_size = "최적사이즈 960 X 190";
|
|
}
|
|
else{
|
|
//$_size = "최적사이즈 220 X 134";
|
|
}
|
|
?>
|
|
<form name="f" method="post" enctype="multipart/form-data" style="margin:0;" >
|
|
<input type="hidden" name="mode" value="<?=$_w_mode?>">
|
|
<input type="hidden" name="pagecode" value="<?=$argu['pagecode']?>">
|
|
<input type="hidden" name="subpage" value="<?=$argu['subpage']?>">
|
|
<input type="hidden" name="b_id" value="<?=$argu['b_id']?>">
|
|
<!-- <input type="hidden" name="division" value="<?=$argu['division']?>"> -->
|
|
<input type="hidden" name="division" value="PM">
|
|
<input type="hidden" name="gubun" value="ko">
|
|
<!-- <div class="form-group">
|
|
<label for="b_title" >구분</label>
|
|
<select class="form-control {label:'구분',required:true}" name="division" id="division" onchange="link_show(this.value);">
|
|
<option value="">구분선택</option>
|
|
<option value="PM" <?if($_row["division"] == "PM") echo "selected";?>>PC-MAIN</option>
|
|
<option value="PL" <?if($_row["division"] == "PL") echo "selected";?>>PC-LEFT</option>
|
|
<option value="PRT" <?if($_row["division"] == "PRT") echo "selected";?>>PC-RIGHT TOP</option>
|
|
<option value="PRB" <?if($_row["division"] == "PRB") echo "selected";?>>PC-RIGHT BOTTOM</option>
|
|
<option value="MM" <?if($_row["division"] == "MM") echo "selected";?>>MOBILE-MAIN</option>
|
|
</select>
|
|
</div> -->
|
|
<div class="form-group">
|
|
<label>제목</label>
|
|
<input type="text" class="form-control {label:'제목',required:true}" id="title" name="title" placeholder="제목" value="<?=$_row["title"]?>">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>이미지</label>
|
|
<?
|
|
if($argu['mode'] == "MODIFY_FORM"){
|
|
?>
|
|
<div class="row">
|
|
<?if($_row["image"]){?>
|
|
<div class="col-xs-6 col-md-4">
|
|
<div class="thumbnail">
|
|
<img src="/pds/banner/<?=$_row["image"]?>">
|
|
</div>
|
|
</div>
|
|
|
|
<input type="hidden" name="tmp_image" value="<?=$_row["image"]?>" />
|
|
<?}?>
|
|
|
|
<input type="file" name="image"/>
|
|
<p class="help-block" style="color:#ff3300"><?=$_size?></p>
|
|
</div>
|
|
<?
|
|
}
|
|
else{
|
|
?>
|
|
<div style="margin-bottom:5px">
|
|
<input type="file" name="image" class="{label:'이미지',required:true}">
|
|
<p class="help-block" style="color:#ff3300"><?=$_size?></p>
|
|
</div>
|
|
<?
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="form-group" id="link">
|
|
<label>링크</label>
|
|
<input type="text" class="form-control" id="url" name="url" placeholder="링크" value="<?=$_row["url"]?>">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>구분</label>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="target" value="_self" <?if($_row["target"]=="_self") echo "checked"?>> 현재창
|
|
</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="target" value="_blank" <?if($_row["target"]=="_blank") echo "checked"?>> 새창
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<?
|
|
if($argu['mode'] == "MODIFY_FORM"){
|
|
if($_row["division"] == "PM" || $_row["division"] == "MM"){
|
|
?>
|
|
<!-- <div class="form-group" id="link">
|
|
<label>링크</label>
|
|
<input type="text" class="form-control" id="url" name="url" placeholder="링크" value="<?=$_row["url"]?>">
|
|
</div> -->
|
|
<?
|
|
}
|
|
}
|
|
else{
|
|
?>
|
|
<!-- <div class="form-group" style="display:none" id="link">
|
|
<label>링크</label>
|
|
<input type="text" class="form-control" id="url" name="url" placeholder="링크">
|
|
</div> -->
|
|
<?
|
|
}
|
|
?>
|
|
<div class="form-group">
|
|
<label>사용여부</label>
|
|
<?
|
|
foreach($_BOARD_CONFIG_CODE[2] as $key => $value){
|
|
$_checked=($key==$_row['published']) ? " checked" : "";
|
|
?>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="published" value="<?=$key?>"<?=$_checked?>> <?=$value?>
|
|
</label>
|
|
</div>
|
|
<?}?>
|
|
</div>
|
|
<!-- <div class="form-group">
|
|
<label>구분</label>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="gubun" value="ko" <?if($_row["gubun"]=="ko") echo "checked"?>> 국문
|
|
</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
<input type="radio" name="gubun" value="en" <?if($_row["gubun"]=="en") echo "checked"?>> 영문
|
|
</label>
|
|
</div>
|
|
</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>
|
|
<?
|
|
if($argu['mode'] == "MODIFY_FORM"){
|
|
?>
|
|
<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_id=<?=$_row['b_id']?>');}">삭제</button>
|
|
<?
|
|
}
|
|
?>
|
|
</form>
|
|
<?
|
|
}
|
|
?>
|
|
</div>
|
|
<!-- /.panel-body -->
|
|
</div>
|
|
</div>
|
|
</div>
|