productionPortraitView.php 9.22 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?>
<?
	$obj		= new AdminOperate($_REQUEST, "");
	//$info		= $obj->getInfoOfShop();
	
	//$cateCodeList = $obj->getShopCategoryCodeList();
	//$shopImgList = $obj->getShopImgList($info["no"]);
	
	$admin_type = $obj->admUser["admin_type"]; 
	
	
	$rurl		= pack("H*", $_REQUEST["rurl"]) ;
?>
<script src="/admin/inc/fileUpload/fileUploadJS.js"></script>
<script type="text/javascript">
	var _rurl = "<?=$rurl?>";
	var _no = "<?=$_REQUEST[no]?>";

	function MultiArticle(sTitle, sC, sCt, sImg){
		this.title = sTitle;
		this.categoryNumber = sC;
		this.contents = sCt;
		this.imgContainer = sImg;
	}
	
	$(document).ready(function(){

		var multiArray = new Array();

		for(var i = 1; i <= 10; i++){
			multiArray[i] = new MultiArticle("", i, "", 0);
		}

		init();

		<?if($admin_type == 3) { ?>
			setReadOnly();
		<?} ?>
		//=====프레입웤 변수들==================================================================================//
		var FORM_TARGET_CLS_NM		= ".data"	;		// 폼을 동적 wrap 할 타겟 ID이름
		var FORM_NAME				= "alf"		;		// 폼이름
		var FORM_METHOD				= "POST"		;		// 폼 메쏘드
		var FORM_USE_FILE			= false		;		// 파일폼 사용 여부
		var FORM_ACTION				= "/action_front.php" ; 
		
		
		var NEXT_CMD				= ""		;		// 다은 수행 할 cmd
		//=====================================================================================================//

		var jForm = $(FORM_TARGET_CLS_NM).mf({ "name" : FORM_NAME , "method" : FORM_METHOD , "action" : FORM_ACTION , "useFile" : FORM_USE_FILE }) ;

		$(".jCancel").click2(function(){
			location.href = _rurl;
		});

		var prev;

		function init(){
			initFileUpload(101);
			initFileUpload(102);
			initFileUpload(103);
			initFileUpload(104);
			initFileUpload(105);
			initFileUpload(106);
			initFileUpload(107);
			initFileUpload(108);
			initFileUpload(109);
			initFileUpload(110);

			toggleHide(1);
		}
		
		$("#category").click(function(){
			var currentNum = $(this).val();
			multiArray[currentNum].title = $("#mTitle").val();
			multiArray[currentNum].contents = $("#mContent").val();
		});
		
		$("#category").change(function(){
			var currentNum = $(this).val();
			$("#mTitle").val(multiArray[currentNum].title);
			$("#mContent").val(multiArray[currentNum].contents);
			toggleHide(currentNum);
			
		});

		function toggleHide(number){
			for(var q = 1; q <= 10; q++){
				if(q != number) $(".imgFiles[no="+q+"]").hide();
				else $(".imgFiles[no="+q+"]").show();
			}
		}
		
		$(".jSave").click2(function(){

			$("#jData").ajaxSubmit({
				url:"/action_front.php?cmd=AdminOperate.saveShop",
				type : "post",
				forceSync : true,
				dataType : "json",
				success : function(data){
					alert(data.returnMessage);
					location.href = _rurl;
				}

			});
		});

		$("#jCategorCd").change(function(){
			setPromotion();
		});

		setPromotion();

	}) ;

	

	function setPromotion()
	{
		if($("#jCategorCd").val() == "1")
		{
			$("#jPromotionSelect").val("1");
			$("#jPromotionSelect").prop("disabled", true);
			$("#jPromotionHidden").prop("disabled", false);
		}
		else
		{
			$("#jPromotionSelect").prop("disabled", false);
			$("#jPromotionHidden").prop("disabled", true);
		}
	}

	function setReadOnly(){
		$("[name=name]").attr("readonly", true);
		$("[name=tel]").attr("readonly", true);
		$("[name=addr_old]").attr("readonly", true);
		$("[name=addr_new]").attr("readonly", true);
		$("[name=discount_rate]").attr("readonly", true);
		$("[name=discount_desc]").attr("readonly", true);
	}

	
</script>

<div id="Contents"  class="notice">

	<h1>게시판 관리 -등록</h1>

	<!-- location area -->
	<h2>
		업체 관리 > 
		<?
		if($_REQUEST["boardType"] == "NO")
			echo "공지사항";
		else
			echo "이벤트"
		?>
		> 
		<span><?
		if($_REQUEST["no"]=="")
			echo "등록";
		else
			echo "상세보기";
		?></span>
	</h2>
	<!-- location area -->

	
	<div class="data" style="width:80%;">
		
		<form id="jData" method="post" enctype="multipart/form-data">
			<input type="hidden" name="no" value="<?=$_REQUEST[no]?>" />
			<table class="datav" style="width:100%;">
				<colgroup>
					<col width="10%" />
					<col width="90%" />
				</colgroup>
				<tr>
					<th style="height:25px;">제목</th>
					<td class="l">
						<input type="text" id="mTitle" class="wl" style="width:70%;" value="" />
					</td>
				</tr>
				<tr>
					<th style="height:25px;">카테고리</th>
					<td>
					<select id="category">
						<option value=1>컨텐츠1</option>
						<option value=2>컨텐츠2</option>
						<option value=3>컨텐츠3</option>
						<option value=4>컨텐츠4</option>
						<option value=5>컨텐츠5</option>
						<option value=6>컨텐츠6</option>
						<option value=7>컨텐츠7</option>
						<option value=8>컨텐츠8</option>
						<option value=9>컨텐츠9</option>
						<option value=10>컨텐츠10</option>
					</select>
					</td>
				</tr>
				<tr>
					<th style="height:25px;">내용</th>
					<td class="l">
						<textarea name="special_contract" rows="7" id="mContent" style="width:90%;resize:vertical;"><?=$info["special_contract"]?></textarea>
					</td>
				</tr>

				<tr>
					<th style="height:25px;">이미지</th>
					<td class="imgFiles" no=1>
						<?
							$fileIndex	= "101";
							$fileName	= "img01";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=2>
						<?
							$fileIndex	= "102";
							$fileName	= "img02";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=3>
						<?
							$fileIndex	= "103";
							$fileName	= "img03";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=4>
						<?
							$fileIndex	= "104";
							$fileName	= "img04";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=5>
						<?
							$fileIndex	= "105";
							$fileName	= "img05";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=6>
						<?
							$fileIndex	= "106";
							$fileName	= "img06";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=7>
						<?
							$fileIndex	= "107";
							$fileName	= "img07";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=8>
						<?
							$fileIndex	= "108";
							$fileName	= "img08";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=9>
						<?
							$fileIndex	= "109";
							$fileName	= "img09";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					<td class="imgFiles" no=10>
						<?
							$fileIndex	= "110";
							$fileName	= "img10";
							$filePath	= ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]);
							$fileNumber	= ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]);
							include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php";
						?>
					</td>
					
				</tr>
			</table>
		</form>
		
		<div class="btngroupcenter">
			<span class="button bigrounded blue jCancel">취소 </span>
			<span class="button bigrounded blue jSave" >저장</span>
		</div>

	</div>
</div>