<?
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=EmulateIE8" />
<meta http-equiv="imagetoolbar" content="no" />
<title><?=$_SITE["NAME"]?> 관리자</title>
<link href="/backoffice/css/style_back.css" rel="stylesheet" type="text/css" />
<script src="/common/js/common.js" type="text/javascript"></script>
<script src="/common/js/prototype-1.6.0.3-euc-kr.js" type="text/javascript"></script>
<script src="/common/js/scriptaculous/scriptaculous.js" type="text/javascript"></script>
<script src="/common/js/scriptaculous/effects.js" type="text/javascript"></script>
<script src="/common/js/calendar.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>
</head>

<body>
<div id="wrap">
    <div id="header">
    	<div class="topArea">
            <h1 class="logo"><a href="/backoffice"><img src="/backoffice/images/logo_admin.jpg" alt="Administrator :: 사이트 관리자 페이지" /></a></h1>
            <div class="utilMenuSet">
                <p class="visitorName"><strong><?=$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["ID"]?>(<?=$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["NAME"]?><?=$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["CLASS"]?>)님 로그인</strong></p>
                <ul class="utilMenu">
                    <li><a href="/backoffice/index.php"><img src="/backoffice/images/btn_admin.gif" alt="관리자메인" /></a></li>
                    <li><a href="http://<?=$_SITE["DOMAIN"]?>" target="_blank"><img src="/backoffice/images/btn_homepage.gif" alt="내 홈페이지" /></a></li>
                    <li><a href="#"><img src="/backoffice/images/btn_adminEdit.gif" alt="관리자 정보수정" /></a></li>
                    <li><a href="/backoffice/auth/logout.php"><img src="/backoffice/images/btn_logout.gif" alt="로그아웃" /></a></li>
                </ul>
            </div>
            <p class="website"><a href="http://www.website.co.kr" target="_blank"><img src="/backoffice/images/logo_website.jpg" alt="WEBSITE" /></a></p>
   	  </div>

    
        <div class="gnbArea">
            <ul class="gnb">
                <? if(in_array("admin_manage", $arrayMyMenu) && (in_array("admin_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<li class="bg_none"><a href="/backoffice/module/admin/admin.php">관리자관리</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">제품 관리</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">상품 관리</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">주문 관리</a></li>
				<!-- 주문 관리 -->
				<?}?>

				<? if(in_array("shop_accounts_manage", $arrayMyMenu) && (in_array("shop_accounts_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 매출 관리 -->
				<li><a href="/backoffice/module/shop/accounts.php">매출 관리</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">메일 관리</a></li>
				<!-- 메일관리 -->
				<?}?>

				<? if(in_array("board_manage", $arrayMyMenu) && (in_array("board_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<!-- 게시판 관리 -->
				<li><a href="/backoffice/module/board/board.php">게시판 관리</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">온라인상담 관리</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">회원관리</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">배너관리</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">팝업관리</a></li>
				<?}?>

				<? if(in_array("html_manage", $arrayMyMenu) && (in_array("html_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]=="ROOT")){?>
				<li><a href="/backoffice/module/html_contents/html_contents.php">HTML 관리</a></li>
				<?}?>

				<? 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">투표관리</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">설문관리</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">접속통계</a></li>
				<?}?>
				<!-- 접속통계 -->

				<!--<li><a href="/backoffice/mailsms.php">메일,문자 발송</a></li>-->
				<li><a href="/backoffice/mailsms1.php">메일,문자 발송</a></li>

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