<?php
define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

include_once(G5_THEME_PATH.'/head.ok.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
//Okone_basic
$okone_bn = sql_fetch(" select * from `okone_basic` where idx='1' ");
//okone_okmenu
$sql_common = " from `okone_okmenu` order by me_order asc ";
$sql = " select * {$sql_common} ";
$result = sql_query($sql);
//Okone_mainbg
$okone_mainbg = sql_fetch(" select * from `okone_mainbg` where idx='1' ");
?>
<!-- header main Navi area start -->
<nav class="navbar navbar-inverse navbar-fixed-top">
				<div class="container">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse"
						data-target="#okone-navbar"><span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span></button>
						<a class="navbar-brand"	href="#menu0">
						<?php
						$tr_logo = G5_PATH."/data/file/".$okone_bn['okone_file_name'];
					if($okone_bn['okone_file_name'] && file_exists($tr_logo)){?>
					<img src="<?php echo G5_URL ?>/data/file/<?php echo $okone_bn['okone_file_name']?>" alt="<?php echo $config['cf_title']; ?>">
					<?php } else {?>
					<img src="<?php echo G5_THEME_IMG_URL; ?>/logo.png" alt="">
					<?php }?>
						</a>
					</div>
					<div class="collapse navbar-collapse" id="okone-navbar">
						<ul class="nav navbar-nav navbar-right">
							<?php
							for ($i=0; $row=sql_fetch_array($result); $i++) { ?>
								<li class='<?php if($i==0){echo "active ";}?>'><a href="#menu<?php echo $i;?>"><?php echo $row['me_name']?></a>
									<?php
					    }
					    if ($i == 0){?>
								<li><a href="#">메뉴가 추가되지 않았습니다.</a>
							<?php }
					    ?>
						</ul>
					</div>
				</div>
</nav>

<!-- header area end -->

<?php
//okone_okmenu_detail start
		$sql_common1 = " from `okone_okmenu` order by me_order asc ";

		$sql1 = " select * {$sql_common1} ";
		$result1 = sql_query($sql1);
		for ($j=0; $row1=sql_fetch_array($result1); $j++) {
				$okone_type = $row1['me_type'];

				switch($okone_type){

					// main부분 슬라이더
					case 'slider' :
						include_once(G5_THEME_PATH.'/okone_slide.php');
						break;

					// main부분 비디오
					case 'video' :
	//					include_once(G5_THEME_PATH.'/okone_slide.php');
						include_once(G5_THEME_PATH.'/okone_video.php');
						break;

						// 회사소개 - 내용관리 글
					case 'about' :
						include_once(G5_THEME_PATH.'/okone_about.php');
						break;

						// 제품소개 - 게시판
					case 'product' :
						include_once(G5_THEME_PATH.'/okone_product.php');
						break;

						// Faq - 게시판
						case 'faq' :
							include_once(G5_THEME_PATH.'/okone_faq.php');
							break;

							// 파트너 - 게시판
						case 'sponsor' :
							include_once(G5_THEME_PATH.'/okone_partner.php');
							break;

							// 고객센터 - sendmail & google map 사용
						case 'contactus' :
							include_once(G5_THEME_PATH.'/okone_contactus.php');
							break;

						default:
							echo "   ";
							break;

				}
		}
//okone_okmenu_detail end
?>


<!-- footer area start -->
<footer class="copyright-section">
			<div class="container">
				<div class="row">
					<div class="col-12 text-center">
						<p>Copyright &copy; <b><?php if($okone_bn['okone_company']) { echo $okone_bn['okone_company']; } else { echo $config['cf_title'];}?>.</b> All rights reserved. </p>
					</div>
				</div>
			</div>
</footer>
<!-- footer area end -->

<!-- scrolltotop start -->
<div>
	<a href="#" class="scrollToTop text-center" >
			<i class="scroll-fa fa fa-angle-up" aria-hidden="true"></i>
	</a>
</div><!-- scrolltotop end -->

<?php
include_once(G5_THEME_PATH.'/tail.ok.php');
?>
