<?
//========================================
// dehead(config/function/lib) Include
//========================================
include $_SERVER['DOCUMENT_ROOT']."/front/include/dehead.php";

//========================================
// Meta Tag
//========================================
$metaAdd = ($sc) ? "report_list_".$sc : "report_list";
$metaTitle = $metaInfo[$metaAdd]['title'];
$metaDescription = $metaInfo[$metaAdd]['description'];
$metaKeyword = $metaInfo[$metaAdd]['keyword'];
$metaImage = $metaInfo[$metaAdd]['image'];
$metaNav = $metaInfo[$metaAdd]['nav'];
//echo $metaAdd;


//========================================
// Class Connect
//========================================
$Db = new Db(); // 데이터 베이스 클래스

//========================================
// Data Process
//========================================
$rowCount = $pageInfo['report']['rowCount']; // 한 페이지에 보여질 게시물 수
//$startNum = ($page - 1) * $rowCount; // limit 시작 위치
$param = array('no' => PARAMETER_NO, 'show' => PARAMETER_Y, 'del' => PARAMETER_N);


//$categoryArr = array('A' => "비중격만곡증", 'B' => "비염", 'C' => "축농증", 'D' => "코성형", 'E' => "코뼈골절"); // Config
$nTagArr=array('비중격만곡증','비염','축농증','비밸브','코질환재수술');//코질환 태그들
$mTagArr=array('코성형','코성형재수술','코뼈골절','휜코','짧은코','낮은코','매부리코','화살코','안장코','처진코끝','복코','넓은콧등','구축코','긴코'.'들창코','콧볼축소');//코성형 태그들



//========================================
// Search Query
//========================================
if($sc){
	if($sc=='N'){
		//코질환 카테고리
		$param['category1'] = 'A';
		$param['ctg2'] = 'B';
		$param['ctg3'] = 'C';
		$searchINS .= " AND (category = :category1 OR category = :ctg2 OR category = :ctg3)";
		//코질환 태그 
		for($nt=0; $nt<count($nTagArr); $nt++){
			$value = $Db->likeify($nTagArr[$nt]);
			if($nt==0){
				$searchINS .= " AND (";
			}else{
				$searchINS .= " OR ";
			}
			$searchINS .= "tag LIKE '%".$value."%'";

			if($nt==(count($nTagArr)-1)){
				$searchINS .= ")";
			}
		}
		//코성형 태그 빼기
		for($mt=0; $mt<count($mTagArr); $mt++){
			$value = $Db->likeify($mTagArr[$mt]);
			if($mt==0){
				$searchINS .= " AND (";
			}else{
				$searchINS .= " AND ";
			}
			$searchINS .= "tag NOT LIKE '%".$value."%'";
			if($mt==(count($mTagArr)-1)){
				$searchINS .= ")";
			}
		}

		
	}else if($sc=='M'){
		//코성형 태그하나라도 있을시에!
		for($mt=0; $mt<count($mTagArr); $mt++){
			$value =$Db->likeify($mTagArr[$mt]);
			if($mt==0){
				$searchINS .= " AND (";
			}else{
				$searchINS .= " OR ";
			}
			$searchINS .= "tag LIKE '%".$value."%'";
			if($mt==(count($mTagArr)-1)){
				$searchINS .= ")";
			}
		}
		
	}else{
		$param['category1'] = $sc;
		$param['category2'] = $Db->likeify($reportCategoryArr[$sc]);
		$searchINS .= " AND (category = :category1 OR tag LIKE :category2)";
	}
}

if($sk){
    if($sf){
        $param['keyword'] = $Db->likeify($sk);
    } else {
		
        $param = array_merge($param, array(
            'keyword_title' => $Db->likeify($sk),
            'keyword_content' => $Db->likeify($sk),
			'keyword_tag' => $Db->likeify($sk)
        ));
		
    }
	$metaTitle2 = $sk." 검색결과";


    $searchINS .= ($sf) ? " AND $sf LIKE :keyword" : " AND (title LIKE :keyword_title OR content LIKE :keyword_content OR tag LIKE :keyword_tag)";
	
}

if($st){
    $param['tag'] = $Db->likeify($st);
    $searchINS .= " AND tag LIKE :tag";
	$metaTitle2 = $st." 검색결과";
}


//$metaTitle2 = $metaTitle2." ".$page;

//echo $searchINS;
//$orderINS .= ($sd) ? "$sd DESC" : "insert_date DESC";
$orderINS .= ($sd and $sd != 'best') ? "$sd DESC" : "insert_date DESC";
$addPath = "&sc=$sc&sd=$sd&st=$st&sf=$sf&sk=$sk&sb=$sb";

//========================================
// Data Load
//========================================
//20170530 sct적용시 베스트 없애기위해 조건추가

if(!$sct){	
	if($sb == "" || $sb == "N"){
    	$bestParam = array_merge($param, array('best' => PARAMETER_Y));
	    $best = $Db->query("SELECT no, store, insert_date, name, title, content, hit,category, etc1, etc2 FROM $TABLE_REPORT WHERE no > :no AND d_show = :show AND del = :del  AND best = :best $searchINS ORDER BY insert_date DESC LIMIT 5", $bestParam);
		$bestCount = $Db->single("SELECT COUNT(*) FROM $TABLE_REPORT WHERE no > :no AND d_show = :show AND del = :del  AND best = :best $searchINS ORDER BY insert_date DESC LIMIT 5", $bestParam);
    	foreach ($best as $key => $val){
        	$strTmp .= $val['no'].",";
	    }
	    $noStr = ($best) ? "AND no NOT IN (".substr($strTmp, 0, -1).")" : "";
	} else {
	    $noStr = "";
	}
}else{
	$best = array();
}
$totalCount = $Db->single("SELECT COUNT(*) FROM $TABLE_REPORT WHERE no > :no AND d_show = :show AND del = :del  $searchINS", $param);
$totalPages = ceil($totalCount / $rowCount);

$startNum = ($page - 1) * ($rowCount-$bestCount); // limit 시작 위치
$param = array_merge($param, array('startNum' => $startNum, 'rowCount' => $rowCount-$bestCount));
$list = $Db->query("SELECT no, best, store, insert_date, name, title, content, hit, category, etc1, etc2 FROM $TABLE_REPORT WHERE no > :no AND d_show = :show AND del = :del  $noStr $searchINS ORDER BY $orderINS LIMIT :startNum, :rowCount", $param);
//echo "SELECT no, best, store, insert_date, name, title, content, hit, category, etc1, etc2 FROM $TABLE_REPORT WHERE no > :no AND d_show = :show AND del = :del  $noStr $searchINS ORDER BY $orderINS LIMIT :startNum, :rowCount";
$keyword = explode("|", $Db->single("SELECT keyword FROM $TABLE_KEYWORD WHERE code = :code", array('code' => "B")));
$Db->CloseConnection;

for($i=0; $i<4; $i++){
    $countCut[$i] = mb_substr(sprintf("%04d", $totalCount), $i, 1);
}

$metaNav[0] = $metaNav[0]." ".$page;

//========================================
// header Include
//========================================
include PATH_INCLUDE."header.php";

//========================================
// SNS Auth
//========================================
require PATH_LIB."naverLogin.php";
require PATH_LIB."kakaoLogin2.php";
require PATH_LIB."googleLogin.php";
require PATH_LIB."facebookLogin.php";
if($_GET['returnUrl']=='real_view' && $_GET['no']!=''){
	$gogoUrl='real_view/'.$_GET['no'];
}else if($_GET['returnUrl']=='self_view' && $_GET['no']!=''){
	$gogoUrl='self_view/'.$_GET['no'];
}else if($_GET['returnUrl']=='sstv_view' && $_GET['no']!=''){
	$gogoUrl='sstv_view/'.$_GET['no'];
}else{
	$gogoUrl='index';
}

$naver = new Naver(array(
    "CLIENT_ID" => NAVER_LOGIN_ID,        // (*필수)클라이언트 ID  
    "CLIENT_SECRET" => NAVER_LOGIN_SECRET,    // (*필수)클라이언트 시크릿
    "RETURN_URL" => NAVER_LOGIN_REDIRECT_URL,      // (*필수)콜백 URL
    "AUTO_CLOSE" => true,              // 인증 완료후 팝업 자동으로 닫힘 여부 설정 (추가 정보 기재등 추가행동 필요시 false 설정 후 추가)
    "SHOW_LOGOUT" => false              // 인증 후에 네이버 로그아웃 버튼 표시/ 또는 표시안함
    )
);
$kakao = new Kakao(array(
	"Rcode" => $returnCode,
    "CLIENT_ID" => KAKAO_CLIENT_ID,        // (*필수)클라이언트 ID  
    "RETURN_URL" => KAKAO_CALLBACK_URL,
    "AUTO_CLOSE" => true,              // 인증 완료후 팝업 자동으로 닫힘 여부 설정 (추가 정보 기재등 추가행동 필요시 false 설정 후 추가)
    "SHOW_LOGOUT" => false              // 인증 후에 네이버 로그아웃 버튼 표시/ 또는 표시안함
    )
);


//$gogoUrl='report_list'; //구글과 카카오를 위한 (로그인 후 넘어가는 페이지)


?>
<?
//픽셀코드
//if($)
?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
<script src="/front/landing/js/jquery.countup.js"></script>
<script src="/front/landing/js/jquery.counterup.min.js"></script>
<style>
.ico_box{
	position:absolute; margin-left:230px;
}
.ico_box .ico{
	width:38px;
	height:38px;
}
@media screen and (max-width:640px){
	.ico_box{
		position:absolute; margin-left:120px;
	}
	.ico_box .ico{
		width:25px;
		height:25px;
	}	
}


.sep_tab_box1{width:100%;height:210px;display:inline-block;}
.sep_tab_box1.first{height:50px;}

.sep_tab ul{display: flex;flex-wrap: wrap;justify-content: flex-start;width:100%;}
.sep_tab ul li{float: none;width: auto;flex: 0 0 16%;margin-bottom:15px;margin-right:12px;}
.sep_tab ul li:nth-child(6n){margin-right:0;}
.sep_tab ul li.on{margin-bottom:0;}

.sep_list ul{width:100%;display:flex;flex-wrap:wrap;justify-content:space-between;border-top:0;}
.sep_list ul li{flex : 0 0 49%;border:1px solid #eee;background:#f6f6f6;}
.sep_list ul li .txt_box{width:75%;padding:0 !important;float:left;margin-left:30px;}
.sep_list ul li .txt_box .subject{color:#33a5fc;font-size:18px;margin-bottom:10px;display:inline-block;}
.sep_list ul li a {display: inline-flex;width: 100%;align-items: center;height:auto;padding:30px;box-sizing: border-box;}
.sep_list ul li a .txt_box .name{white-space:wrap;line-height:1.4;max-height:5.6em;}
.sep_list ul li a .img_box{width:150px;height:150px;position:relative;left:auto;top:auto;float:left;overflow:visible;}
.sep_list ul li a .img_box .cover{width:150px ;height:150px ;background-size: 100%;}
.sep_list ul li a .img_box .best{margin-top:60px;border:0;font-size:0;}
.sep_list ul li a .img_box .yt_icon{position:absolute;left:-10px;top:-10px;z-index:15;}
.sep_list ul li.best a .img_box .cover{background-size: 100%;}
.sep_list ul li a .date_box{margin-top:5px;position:relative;right:auto;top:auto;}
.sep_list ul li a .date_box .bar{display:inline-block;vertical-align:middle;width: 1px;height: 12px;background: #aaa;margin: 0 10px;}
.sep_list ul li a .date_box p{font-size:16px;}
.sep_list ul li a .date_box p:first-child{margin-bottom:10px;}
@media screen and (max-width:1620px){ 
	.sep_tab_box1{height:190px;}
	.sep_tab ul{width:100%;}
	.sep_tab ul li{flex:0 0 15.7%;margin-left:0;margin-right:10px;}
	.sep_tab ul li:nth-child(6n){margin-right:0;}
	.sep_orderby{position: relative;float: none;text-align: center;top: auto;right: auto;margin-top: 80px;}
	.sep_list ul li a .img_box{width:120px;height:120px;}
	.sep_list ul li a .img_box .cover{width:120px;height:120px;}
	.sep_list ul li a .img_box .yt_icon{left:0;top:0;}
	.sep_list ul li a .img_box .yt_icon img{width:40px;}
	.sep_list ul li a .txt_box{width: calc(100% - 180px);}
	.sep_list ul li a .txt_box .subject{font-size:16px;}
	.sep_list ul li a .txt_box .name{font-size:20px;}
	.sep_list ul li a .txt_box .date_box p{font-size:13px;}
}
@media screen and (max-width:1024px){ 
	.sep_tab{position:relative;z-index:3;}
	.sep_tab ul{display:none;}
	.sep_tab_box1{height:auto;}
	.sep_orderby{margin-top:0;}
	.sep_list ul li{flex : 0 0 100%;}
	.sep_list ul li .txt_box{padding:20px 0;}
	.sep_list ul li a{height:auto;}
	.sep_list ul li a .date_box{left:auto;bottom:auto;}
	.sep_list ul li a .img_box{width:120px;height:120px;}
	.sep_list ul li a .img_box .cover{width:120px;height:120px;background-size: 100%;}
	.sep_list ul li a .img_box .yt_icon img{width:40px;}
	.sep_list ul li a .txt_box .name{white-space:normal;width:80%;line-height:1.4;max-height:100%;}
}
@media screen and (max-width:640px){ 
	.sep_list ul li a{padding:10px;}
	.sep_list ul li .txt_box{margin-left:10px;}
	.sep_list ul li a .txt_box .name{width:70%;font-size:17px;}
	.sep_list ul li a .txt_box .subject{font-size:14px;}
}



</style>

        <div id="container">
            <div class="sub_visual_wrap case">
                <div class="inner_box">
                    <div class="location">
                        <a href="/"><img src="<?=PATH_IMAGES?>/common/ico_home.png" alt="HOME" /></a> &nbsp;&gt;&nbsp;
                        <?php
						if($metaNav[4]){ echo "<span>".$metaNav[4]."</span> &nbsp;&gt;&nbsp;"; }
						if($metaNav[3]){ echo "<span>".$metaNav[3]."</span> &nbsp;&gt;&nbsp;"; }
						if($metaNav[2]){ echo "<span>".$metaNav[2]."</span> &nbsp;&gt;&nbsp;"; }
						if($metaNav[1]){ echo "<span>".$metaNav[1]."</span> &nbsp;&gt;&nbsp;"; }
						echo "<strong>".$metaNav[0]."</strong>";
						?>
                    </div>
                    <h1 class="tit">Case Report</h1>
                    <p>수술사례보고서로 치료방법과 결과를 환자분께 투명하게 공유드립니다.</span></p>
                </div>
            </div>
            <div id="contents" class="sub_epilogue">
                <div class="sep_tab_box1 first">                    
                    <div class="search_box_se">
                        <form id="searchFrm" method="GET" action="#contents">
                        <input type="hidden" id="no" name="no" value="" />
                        <input type="hidden" id="page" name="page" value="<?=$page?>" />
						<!--input type="hidden" id="page" name="page" value="<?=$page?>" /-->
                        <input type="hidden" id="sc" name="sc" value="<?=$sc?>" />
                        <input type="hidden" id="sd" name="sd" value="<?=$sd?>" />
                        <input type="hidden" id="st" name="st" value="<?=$st//=urlencode($st)?>" />
                        <select id="sf" name="sf" title="검색">
                            <option value="" selected="selected">전체</option>
                            <option value="title" <? if($sf == 'title') echo "selected=\"selected\""; ?>>제목</option>
                            <option value="content" <? if($sf == 'content') echo "selected=\"selected\""; ?>>내용</option>
							<!-- <option value="tag" <? if($sf == 'tag') echo "selected=\"selected\""; ?>>태그</option> -->
                        </select>
                        <input type="text" id="sk" name="sk" value="<?=$sk?>" />
                        <input type="hidden" id="sb" name="sb" value="<?=$sb?>" />
                        <input type="submit" value="검색" />
                        </form>
                    </div>
                </div>

                <!-- <div class="sep_counter">
                    <span class="number">
                        <? foreach ($countCut as $key => $val){ ?>
                        <em class="cnt_number"><?=$val?></em>
                        <? } ?>
                    </span>
                    <strong>개의</strong>
                     수/술/자/필/후/기가 있습니다.
                </div> -->

                <div class="sep_tab_box1" style="display:none;">
                    <div class="sep_tab">
                        <h3 class="tit"><a href="#self">
						<?php
						if(!$sc){ echo "전체보기";
						}else { 
							echo $reportCategoryArr[$sc];							
						}
						?>
						</a></h3>
                        <ul id="moveList">                            
                            <li <? if(!$sc) echo "class=\"on\""; ?>><a href="#sc=">전체보기</a></li>
							<? foreach ($reportCategoryArr as $key => $val){ ?>                                                
							<li <? if($sc === $key) echo "class=\"on\""; ?>><a href="#sc=<?=$key?>"><?=$val?></a></li>
							<? } ?>
                        </ul>
                    </div>
                    <!-- <ul id="moveList" class="sep_orderby">
                        <li <? if(!$sd) echo "class=\"on\""; ?>><a href="#sd=#sb=">최신순</a></li>
                        <li <? if($sd === "likes") echo "class=\"on\""; ?>><a href="#sd=likes#sb=">추천순</a></li>
                        <li <? if($sd === "hit") echo "class=\"on\""; ?>><a href="#sd=hit#sb=">조회순</a></li>
                        <li <? if($sd === "best") echo "class=\"on\""; ?>><a href="#sd=best#sb=Y">베스트순</a></li>
                    </ul> -->
                </div>
                
                <div class="sep_list">
                    <ul id="moveView">
                    <?
                    if($sb == "" || $sb == "N"){
                        foreach ($best as $key => $val){
                            $no = $val['no'];
                            $store = $reportStoreNameArr[$val['store']];
                            $storeColor = StoreColorClass($val['store']);
							$director = $reportDirectorArr[$val['store']];
							$directorImg = $reportDirectorImgArr[$val['store']];
                            $name = Utf8SubstrReplace(stripslashes($val['name']), "o");
                            $title = stripslashes($val['title']);
                            $content = stripslashes($val['content']);
							$category = $reportCategoryArr[$val['category']];
                            $hit = $val['hit'];
                            $insert_date = DateConv($val['insert_date'], 7);
							$etc1 = ($val['etc1'] === "Y") ? "yt" : "";									
							
                    ?>
                        <li class="best">
                            <a href="#<?=$no?>">
                                <span class="img_box">
									<?if($etc1=="yt"){ ?>
									<span class="yt_icon"><img src="/front/images/epilogue/yt_icon.png" alt="유튜브" /></span>
									<? } ?>
									<img src="/front/images/epilogue/<?=$directorImg?>" alt="" />
                                    <span class="cover"></span>
                                    <span class="best">BEST</span>
                                </span>
                                <div class="txt_box">
									<div class="ico_box"></div>
									<span class="subject"><?=$category?></span>
                                    <span class="name"><?=nl2br($title)?></span>
									 <span class="date_box">
										<p><?=$insert_date?>	</p>			
										<p><?=$store?> <!--원장<i class="bar"></i><?=$director?>--></p>
									</span>
                                </div>                               
                            </a>
                        </li>
                    <?
                        }
                    }					
                    if($totalCount > 0){						
                        foreach($list as $key => $val){
                            $no = $val['no'];
                            $best = ($val['best'] === "Y" && $sb === "Y") ? "best" : "";
                            $store = $reportStoreNameArr[$val['store']];
                            $storeColor = StoreColorClass($val['store']);
							$director = $reportDirectorArr[$val['store']];
							$directorImg = $reportDirectorImgArr[$val['store']];
                            $name = Utf8SubstrReplace(stripslashes($val['name']), "o");
                            $title = stripslashes($val['title']);
                            $content = stripslashes($val['content']);
							$category = $reportCategoryArr[$val['category']];							                            
                            $hit = $val['hit'];
                            $insert_date = DateConv($val['insert_date'], 7);
							$etc1 = ($val['etc1'] === "Y") ? "yt" : "";
														
														
                    ?>
                        <li class="<?=$best?>">
                            <a href="#<?=$no?>">
                                <span class="img_box">
									<?if($etc1=="yt"){ ?>
									<span class="yt_icon"><img src="/front/images/epilogue/yt_icon.png" alt="유튜브" /></span>
									<? } ?>
									<img src="/front/images/epilogue/<?=$directorImg?>" alt="" />
                                    <span class="cover"></span>
                                    <span class="best">BEST</span>
                                </span>
                                <div class="txt_box">
									<div class="ico_box"></div>
									<span class="subject"><?=$category?></span>
                                    <span class="name"><?=nl2br($title)?></span>
									 <span class="date_box">
										<p><?=$insert_date?>	</p>			
										<p><?=$store?> <!--원장<i class="bar"></i><?=$director?>--></p>
									</span>
                                </div>
                            </a>
                        </li>
                    <?
                        }
                    }
                    ?>
                    </ul>
                </div>

                <div class="pagination_wrap">
                    <? if($totalPages > 0) Pageing($totalPages, $blockCount, $page, $addPath); ?>
                </div>
			
            </div>					
			
			
			
				<!-- Add Pagination -->
			</div>
			<script src="<?=PATH_JS?>/swiper.min.js"></script>        
			<script>
			var swiper = new Swiper('.swiper-container', {
				pagination: '.swiper-pagination',
				paginationClickable: true,
				nextButton: '.swiper-button-next',
				prevButton: '.swiper-button-prev',
				loop: true,
				autoplay: 5000,
				autoplayDisableOnInteraction: true
			});
			</script>			
			
			
			
			
			
			
        </div><!-- end : container -->

		<div class="login_layerpopup" id="login_layerpopup">
            <div class="back" onclick="UI.layerPopup('#login_layerpopup','close')"></div>
            <div class="inner_box">
                <div class="layer_top">
                    <h2 class="tit">로그인</h2>
                </div>
                <div class="layer_conts">
                    <div class="login_box">
                        <form name="loginFrm" method="POST" action="<?=PATH?>/member/login_proc_ssdream.php">
                        <input type="hidden" id="rurl" name="rurl" value="" />
						<input type="hidden" id="login_chk" value="">
                            <div class="input_box">
                                <label for="mId">아이디</label>
                                <input type="text" id="mId" name="mId" />
                            </div>
                            <div class="input_box">
                                <label for="mPw">비밀번호</label>
                                <input type="password" id="mPw" name="mPw" />
                            </div>
                            <div class="id_pass_chk">
                                <a href="#self">· 아이디/비밀번호 찾기</a>
                            </div>
                            <input type="submit" class="submit" value="확인" />
                        </form>
                    </div>
                    <div class="btn_box" Style="padding-top:20px;">
						<p Style="text-align:center;padding-bottom:10px;">SNS 계정으로 간편하게 회원가입/로그인하세요.<br />탈퇴가 자유로우니 부담 갖지 마세요.</p>
                        <?php 
						    //$naver->login('real_list')
						?>
						<a href="#self" id="naverLogin" class="btn_green" onclick="Naver.openWindow('https://nid.naver.com/oauth2.0/authorize?client_id=vORamOrcdMDLtQSN4vHN&amp;response_type=code&amp;redirect_uri=http%3A%2F%2Fwww.ssdream.co.kr%2Ffront%2Fmember%2Flogin_proc.php&amp;state=6f4804a7e337aedb7cb815a458c95b1f', 'oAuth', 'real_list')" style="background-image:url(/uploads/sns4.png); background-repeat:no-repeat;background-position:2% 50%;">네이버 계정으로 로그인</a>

						<?php
						    //$kakao->login('real_list')
						?>
						<a href="#self" class="kakaoAlink" onclick="Kakao.openWindow('https://kauth.kakao.com/oauth/authorize?client_id=c86cf4caf552bb1c3c9294ba597b2e42&amp;response_type=code&amp;scope=account_email&amp;redirect_uri=http%3A%2F%2Fwww.ssdream.co.kr%2Ffront%2Fmember%2Flogin_proc2.php&amp;state=76172d14be8e0d30bdc7802ec9cf33f2', '카카오 계정으로 로그인', 'real_list')" style="color:#000;  background-image:url(/uploads/sns2.png); background-repeat:no-repeat;background-position:2% 50%;">카카오계정 로그인</a>

						<a href="javascript:facebooklogin();" class="btn_green btn_facebook" Style="background-color:#3B5999; background-image:url(/uploads/sns1.png); background-repeat:no-repeat; margin-right:10px; ">페이스북 로그인</a>
						<button id="ggloginBtn" Class="googleLoginBtn" Style="background-image:url(/uploads/sns3.png); background-repeat:no-repeat;background-position:2% 50%; " disabled>구글 로그인</button>
						<input type="hidden" id="afterUrl" value="<?php echo $gogoUrl; ?>">

                        <!-- <a href="#self" class="btn_navers">네이버 계정으로 로그인</a> -->
                        <!-- <a href="#self" id="naverLogin" class="btn_navers" onclick="Naver.openWindow('../member/naverLogin.php', 'naverLoginApi', '')">네이버 계정으로 로그인</a> -->
                        <a href="<?=PATH?>/member/join1.php" class="btn_joins" Style="margin-left:0; background-image:url(/uploads/sns5.png); background-repeat:no-repeat;background-position:2% 50%;">삼성드림 회원가입</a>
                    </div>
                </div>
                <a href="javascript:UI.layerPopup('#login_layerpopup','close')" class="close"><img src="<?=PATH_IMAGES?>/common/btn_layer_close.png" alt="창닫기" /></a>
            </div>
        </div>
        
<style>

.googleLoginBtn, .kakaoAlink{margin-bottom: 20px; display:block; width: 100%; height: 58px; text-align:center; border: solid 0px #fff; color:#fff; font-size:24px; line-height:58px;}
.googleLoginBtn{background-color:#E84C3D;color:#fefefe;border:0;cursor:pointer;}
.kakaoAlink{background-color:#F8EA01;}
.btn_green{margin-bottom: 10px;}

.btn_facebook {background-size:45px; background-position:1% 20%;  }

@media screen and (max-width: 640px){
	.googleLoginBtn, .kakaoAlink{
		margin-bottom: 10px; height: 35px; font-size:15px; line-height:35px; background-size:30px;
	}
	.btn_facebook{
		background-position:0% 20%;
	}
}


</style>
<script>
$(document).ready(function(){
    $("#moveView li > a").click(function(){
		$("#no").val($(this).attr("href").replace("#", ""));
        if("<?=$_SESSION['MEMBER_LOGIN_EXIST']?>" == true){// || $.browser.mobile){
            $('#page').val('1');
            $("#searchFrm").attr('action', 'report_view.php').submit();
        } else {
            var url = "/front/epilogue/report_view.php?no="+$(this).attr("href").replace("#", "")+"&page=<?=$page?>&sd=<?=$sb?>&st=<?=$st?>&sf=<?=$sf?>&sk=<?=$sk?>&sb=<?=$sb?>";

            $("#rurl").val(url);

            UI.layerPopup('#login_layerpopup','open');
        }
    });

    $("#moveList li > a").click(function(){
        var href = $(this).attr("href").split("#");
		$.each(href, function(index,value){
			var val = value.split("=");
			if(val[0] != ""){
		        $("#"+val[0]).val(val[1]);
			}
			if(val[0] == "st" || val[0] == "sc"){
				$("#page").val(1);
			}
		});

        $("#searchFrm").attr('action', 'report_list.php#contents').submit();
    });
	
	$(".new_slider_cont ul li > a").click(function(){
        if("<?=$_SESSION['MEMBER_LOGIN_EXIST']?>" == true){// || $.browser.mobile){
			var cat = $(this).data('cat');
			var cat2 = $(this).data('cat2');
			
			$('#cat').val(cat);
			$('#cat2').val(cat2);
			$('#cu').val('Y');
            $("#no").val($(this).attr("href").replace("#", ""));
            $("#searchFrm").attr('action', 'report_view.php#contents').submit();
			
        } else {
			
			var cat = $(this).data('cat');
			var cat2 = $(this).data('cat2');
			
            var url = "/front/epilogue/report_view.php?no="+$(this).attr("href").replace("#", "")+"&page=<?=$page?>&sc=<?=$sc?>&sd=<?=$sb?>&st=<?=$st?>&sf=<?=$sf?>&sk=<?=$sk?>&sb=<?=$sb?>&cu=Y&cat="+cat+"&cat2="+cat2;

            $("#rurl").val(url);
           
        }
    });
	
	
});

Kakao = {
    openWindow: function(url, winName, returnUrl){
        var win = window.open(url, winName, 'width=320, height=480, toolbar=no, location=no');
        if(win != null){
            var timer = setInterval(function() {   
                var login_chk_val = "";
                if(document.getElementById('login_chk')){
                    login_chk_val = document.getElementById('login_chk').value;
                }

                if(win.closed && login_chk_val == 'true') {
                    // 로그인 후 돌아오면 새로고침
                    if(returnUrl == 'report_list') {
                        location.href = 'report_list.php'; 
                    } else {
                        window.location.reload(); 
                    }
                }
                
                // 팝업이 닫혔는데 로그인이 안 된거면 새로고침 하지않고 타이머만 종료
                if(win.closed){
                    clearInterval(timer);
                }
            }, 1000);
        }
        return win;
    }
}
</script>

<?
//========================================
// quick bar Include
//========================================
include PATH_INCLUDE."quick.php";

//========================================
// footer Include
//========================================
include PATH_INCLUDE."footer.php";
?>
