/home/mjc1/public_html/html/ebizmall/popup_layer.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!-- ################################################# -->
<!-- 팝업 띄우기 레이어 버젼-->
<?php
    
// 팝업을 여러개를 띄울경우 여기라인 부터 아래에 이것과 같은 라인까지 복사하고 순번을 따로 주고 나머지 항목을 다르게 주면 됨
    
$nw['nw_id'] = 1// 순번
    
$nw['nw_enable'] = 1// 팝업 사용 1 - 사용, 0 - 사용안함
    
$nw['nw_top'] = 30//상단 위치 상단 headr높이 아래부터 적용 컨테이너부터 적용된다 생각하면됨 높이 올릴려면 -숫자 적용
    
$nw['nw_left'] = 0//좌측 위치 컨테이너 기준으로 숫자 적용해야함
    
$nw['nw_width'] = 400//팝업 가로 넓이
    
$nw['nw_height'] = 310//팝업 세로 넓이
    
$nw['nw_disable_hours'] = 24;  // 닫는 시간
?>
<style>
    /* 팝업레이어 */
    #hd_pop {z-index:1000;position:relative;margin:0 auto;width:1050px;height:0}
    #hd_pop h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
    .hd_pops {position:absolute;background:#fff}
    .hd_pops_con {}
    .hd_pops_footer {padding:10px;background:#000;color:#fff;text-align:right}
    .hd_pops_footer button {margin-right:5px;padding:5px 10px;border:0;background:#393939;color:#fff;cursor:pointer}
</style>
<?
    
if($nw['nw_enable']==1){
        if(!
$_COOKIE['hd_pops_'.$nw['nw_id']]){
?>
<div id="hd_pop">
    <h2>팝업레이어 알림</h2>
    <div id="hd_pops_<?php echo $nw['nw_id'?>" class="hd_pops" style="top:<?php echo $nw['nw_top']?>px;left:<?php echo $nw['nw_left']?>px">
        <div class="hd_pops_con" style="width:<?php echo $nw['nw_width'?>px;height:<?php echo $nw['nw_height'?>px">
            <!-- 팝업 내용 -->
                <a href="./api_pro.php"><img src='./images/popup/notice_ebiz_market.png' alt="오픈마켓공지"></a>
            <!-- 팝업 내용 끝 -->
        </div>
        <div class="hd_pops_footer">
            <button class="hd_pops_reject hd_pops_<?php echo $nw['nw_id']; ?> <?php echo $nw['nw_disable_hours']; ?>"><strong><?php echo $nw['nw_disable_hours']; ?></strong>시간 동안 다시 열람하지 않습니다.</button>
            <button class="hd_pops_close hd_pops_<?php echo $nw['nw_id']; ?>">닫기</button>
        </div>
    </div>
</div>
<?
        
}
    }
    
// 팝업을 여러개를 띄울경우 여기라인 까지 주석 포함 똑같이 복사하고 상단내용처럼 처리하면 됨
?>


<script>
$(function() {
    // 쿠키 입력
    function set_cookie(name, value, expirehours, domain)
    {
        var today = new Date();
        today.setTime(today.getTime() + (60*60*1000*expirehours));
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
        if (domain) {
            document.cookie += "domain=" + domain + ";";
        }
    }

    $(".hd_pops_reject").click(function() {
        var id = $(this).attr('class').split(' ');
        var ck_name = id[1];
        var exp_time = parseInt(id[2]);
        $("#"+id[1]).css("display", "none");
        set_cookie(ck_name, 1, exp_time, '<?php $_SERVER["HTTP_HOST"]?>');
    });
    $('.hd_pops_close').click(function() {
        var idb = $(this).attr('class').split(' ');
        $('#'+idb[1]).css('display','none');
    });
    $("#hd").css("z-index", 1000);
});
</script>
<!-- 팝업 띄우기 끝 -->
<!-- ################################################# -->