/home/mjc1/public_html/j3demo/popup.inc.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
<style>
    /* 팝업레이어 */
    #hd_pop {z-index:1000;position:relative;margin:0 auto;width:100%;height:0;<?php if($is_mobile){ echo "font-size:0.8em;"; }?>}
    #hd_pop h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
    .hd_pops {position:fixed;border:1px solid #e9e9e9;background:#fff}
    .hd_pops_con {}
    .hd_pops_footer {padding:10px 0;background:#000;color:#fff;text-align:right}
    .hd_pops_footer button {margin-right:5px;padding:5px 10px;border:0;background:#393939;color:#fff}
</style>
<div id="hd_pop">
<?php
    
if($is_mobile=='1'){ // 모바일 일 경우
        
$where " and pu_pos in('all','mo') ";
    } else {
        
$where " and pu_pos in('all','pc') ";
    }
    
$sql "select * from shop_popup where 1=1 and pu_sdate <= '".G5_TIME_YMDHIS."' and pu_edate >='".G5_TIME_YMDHIS."' {$where} ";
    
$res mysql_query($sql,$connect_j3);
    while(
$info mysql_fetch_array($res)){
        
$pu_array[] = $info;
    }
    foreach(
$pu_array as $key=>$nw){
        if(
$_COOKIE["hd_pops_{$nw['idx']}"]){ continue; } // 쿠키 있으면 패스
?>
    <div id="hd_pops_<?php echo $nw['idx'?>" class="hd_pops" style="top:<?php echo $nw['pu_top']?>px;left:<?php echo $nw['pu_left']?>px">
        <div class="hd_pops_con" style="width:<?php echo $nw['pu_width'?>px;height:<?php echo $nw['pu_height'?>px">
            <?php echo $nw['pu_content']; ?>
        </div>
        <div class="hd_pops_footer">
            <button class="hd_pops_reject hd_pops_<?php echo $nw['idx']; ?>"><strong></strong><?php echo "24"?> 시간 동안 다시 열람하지 않습니다.</button>
            <button class="hd_pops_close hd_pops_<?php echo $nw['idx']; ?>">닫기</button>
        </div>
    </div>
<?php
    
}
?>
</div>
<script>
$(function(){
    $(".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, "");
        //setsave(ck_name, 1, exp_time);
    });
    $('.hd_pops_close').click(function() {
        var idb = $(this).attr('class').split(' ');
        $('#'+idb[1]).css('display','none');
    });
});
</script>