<?
session_start();
include $_SERVER["DOCUMENT_ROOT"] . "/common/conf/config.inc.php";
include $_SERVER["DOCUMENT_ROOT"] . "/backoffice/module/admin/admin.lib.php";
include $_SERVER["DOCUMENT_ROOT"] . "/backoffice/auth/auth.php";
include $_SERVER["DOCUMENT_ROOT"] . "/backoffice/whereis.php";

//DB연결
$dblink = SetConn($_conf_db["main_db"]);

$arrMenuList = getAdminMenu();
for($i=0;$i<$arrMenuList["total"];$i++){
	$arrayMyMenu[] = $arrMenuList["list"][$i][m_code];
	$arrayMenuList[$arrMenuList["list"][$i][m_code]] = $arrMenuList["list"][$i][m_name];
}

//DB해제
SetDisConn($dblink);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="imagetoolbar" content="no" />
<title><?=$_SITE["NAME"]?> 관리자</title>
<link href="/backoffice/css/style.css" rel="stylesheet" type="text/css" />
<script src="/backoffice/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="/common/js/json.js" type="text/javascript"></script>
<script type="text/javascript" src="/common/js/datePicker/jquery-ui-1.8.18.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="/common/js/datePicker/jquery-ui.css" />
<script src="/backoffice/js/myjs.js" type="text/javascript"></script>
<script type="text/javascript">
	jQuery.noConflict();
	var $ = jQuery;
</script>
<script>
$(function() {
// $.datepicker.setDefaults($.datepicker.regional["ko"]);
    $(".datePicker").datepicker({
     dateFormat: 'yy-mm-dd',
     monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
     dayNamesMin: ['일','월','화','수','목','금','토'],
	 weekHeader: 'Wk',
     changeMonth: true, //월변경가능
     changeYear: true, //년변경가능
     showMonthAfterYear: true //년 뒤에 월 표시
  });
 });
</script>
<script language="JavaScript">
	function printTime() {
	var clock = document.getElementById("clock");
	var now = new Date();

	clock.innerHTML = now.getFullYear() + "/" +
	(now.getMonth()+1) + "/" +
		now.getDate() + " " +
		now.getHours() + ":" +
		now.getMinutes() + ":" +
		now.getSeconds();

		setTimeout("printTime()", 1000);
	}

	window.onload = function() {
	printTime();
	};
</script>

<script src="/common/js/common.js" type="text/javascript"></script>
<script src="/common/js/layer.js" type="text/javascript"></script>
<script src="/common/js/shop.js" type="text/javascript"></script>
<script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script>

<!-- 로그인연장 함수 실행 -->
<!-- <script type="text/javascript">
    // 주기적으로 실행될 함수
    function onScheduler(){
        // 빈 페이지를 요청
        //var dataobj = document.frames["hiddenFrame"];
		var dataobj = $("#hiddenFrame");
        if(dataobj){
            dataobj.attr("href","/backoffice/auth/auth_long.php");
        }
        // 10분 간격(세션 설정값에 따라 변경)
        setTimeout("onScheduler()", 1000*60*10);
    }

    // 초기 실행(form의 onLoad에 위치하여도 됨)
    onScheduler();
</script>  -->
</head>

<body>
<iframe id="hiddenFrame" style="display:none" width="0" height="0" ></iframe>

<div id="admin-wrapper">
	<div id="admin-header">
    	<div class="admin-top-content">
            <h1 class="top-logo"><a href="/backoffice"><img src="/backoffice/images/logo_admin.gif" alt="관리자모드" /></a></h1>
            <div class="top-util">
                <div class="visitor-name"><strong><?=$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["ID"]?>(<?=$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["NAME"]?><?=$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["CLASS"]?>)님 로그인</strong></div>
				<ul class="util-menu">
					<li><a href="/backoffice/index.php" title="관리자메인"><img src="/backoffice/images/top_m1.gif" alt="관리자메인" /></a></li>
					<li><a href="http://<?=$_SITE["DOMAIN"]?>" target="_blank" title="내 홈페이지-새창열림"><img src="/backoffice/images/top_m2.gif" alt="내 홈페이지" /></a></li>
					<li><a href="/backoffice/auth/logout.php" title="로그아웃"><img src="/backoffice/images/top_m3.gif" alt="로그아웃" /></a></li>
					<li><a href="http://open.website.co.kr" target="_blank" title="유지보수신청-새창열림"><img src="/backoffice/images/top_m4.gif" alt="유지보수신청" /></a></li>
				</ul>
			</div>
		</div>
		<div class="admin-middle-content">
			<ul class="admin-gnb">
				<? if(in_array("admin_manage", $arrayMyMenu) && (in_array("admin_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<li><a href="/backoffice/module/admin/admin_set.php"><img src="/backoffice/images/gnb1_off.gif" alt="관리자관리" class="rollover" /></a></li>
				<?}?>
				<? if(in_array("product_manage", $arrayMyMenu) && (in_array("product_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 제품 관리 -->
				<li><a href="/backoffice/module/product/product.php"><img src="/backoffice/images/gnb13_off.gif" alt="제품" class="rollover" /></a></li>
				<!-- 제품 관리 -->
				<?}?>

				<? if(in_array("shop_good_manage", $arrayMyMenu) && (in_array("shop_good_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 상품 관리 -->
				<li><a href="/backoffice/module/shop/good.php"><img src="/backoffice/images/gnb2_off.gif" alt="상품" class="rollover" /></a></li>
				<!-- 상품 관리 -->
				<?}?>

				<? if(in_array("shop_order_manage", $arrayMyMenu) && (in_array("shop_order_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 주문 관리 -->
				<li><a href="/backoffice/module/shop/order.php"><img src="/backoffice/images/gnb3_off.gif" alt="주문" class="rollover" /></a></li>
				<!-- 주문 관리 -->
				<?}?>

				<? if(in_array("mail_manage", $arrayMyMenu) && (in_array("mail_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT") || in_array("send_manage", $arrayMyMenu) && (in_array("send_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT") ){?>
				<!-- 메일관리 -->
				<li><a href="/backoffice/module/mail/mail.php"><img src="/backoffice/images/gnb5_off.gif" alt="메일" class="rollover" /></a></li>
				<!-- 메일관리 -->
				<?}?>

				<? if(in_array("board_manage", $arrayMyMenu) && (in_array("board_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 게시판 관리 -->
				<?if($siteip_chk==true){?>
				<li><a href="/backoffice/module/board/admin_board.php"><img src="/backoffice/images/gnb6_off.gif" alt="게시판" class="rollover" /></a></li>
				<?}else{?>
				<li><a href="/backoffice/module/board/board.php"><img src="/backoffice/images/gnb6_off.gif" alt="게시판" class="rollover" /></a></li>
				<?}?>
				<!-- 게시판 관리 -->
				<?}?>

				<? if(in_array("online_manage", $arrayMyMenu) && (in_array("online_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 견적관리 -->
				<li><a href="/backoffice/module/online/online_list.php?o_type=1"><img src="/backoffice/images/gnb16_off.gif" alt="온라인상담" class="rollover" /></a></li>
				<!-- 견적관리 -->
				<?}?>

				<? if(in_array("member_manage", $arrayMyMenu) && (in_array("member_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 회원관리 -->
				<li><a href="/backoffice/module/member/member.php"><img src="/backoffice/images/gnb7_off.gif" alt="회원" class="rollover" /></a></li>
				<!-- 회원관리 -->
				<?}?>

				<? if(in_array("banner_manage", $arrayMyMenu) && (in_array("banner_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 배너관리 -->
				<li><a href="/backoffice/module/banner/banner.php"><img src="/backoffice/images/gnb8_off.gif" alt="배너관리" class="rollover" /></a></li>
				<!-- 배너관리 -->
				<?}?>

				<? if(in_array("popup_manage", $arrayMyMenu) && (in_array("popup_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 팝업관리 -->
				<li><a href="/backoffice/module/popup/popup_list.php"><img src="/backoffice/images/gnb9_off.gif" alt="팝업관리" class="rollover" /></a></li>
				<!-- 팝업관리 -->
				<?}?>

				<? if(in_array("html_manage", $arrayMyMenu) && (in_array("html_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- HTML 관리 -->
				<li><a href="/backoffice/module/html_contents/html_contents.php"><img src="/backoffice/images/gnb10_off.gif" alt="컨텐츠관리" class="rollover" /></a></li>
				<!-- HTML 관리 -->
				<?}?>

				<? if(in_array("poll_manage", $arrayMyMenu) && (in_array("poll_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 투표관리 -->
				<li><a href="/backoffice/module/poll/poll.php"><img src="/backoffice/images/gnb14_off.gif" alt="투표" class="rollover" /></a></li>
				<!-- 투표관리 -->
				<?}?>


				<? if(in_array("research_manage", $arrayMyMenu) && (in_array("research_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 설문관리 -->
				<li><a href="/backoffice/module/research/research.php"><img src="/backoffice/images/gnb15_off.gif" alt="설문" class="rollover" /></a></li>
				<!-- 설문관리 -->
				<?}?>

				<? if(in_array("log_manage", $arrayMyMenu) && (in_array("log_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 접속통계 -->
				<li><a href="/backoffice/module/log/log_hourly_view.php"><img src="/backoffice/images/gnb11_off.gif" alt="접속통계" class="rollover" /></a></li>
				<?}?>
				<!-- 접속통계 -->
				
				<?if($_SITE["POSTMAN_ID"] != "test_website"){?>
				<li><a href="/backoffice/mailsms1.php"><img src="/backoffice/images/gnb12_off.gif" alt="메일/문자 발송" class="rollover" /></a></li>
				<?}?>

			</ul>
		</div>
    </div>
