/home/mjc1/public_html/j3demo/shop/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
<style>
    .hd_pops_close, .hd_pops_reject { height:25px; margin-top:3px; padding:0px 3px; }
</style>
<?php
    $sql 
"select * from shop_popup where pu_sdate <= '".date("Y-m-d H:i:s")."' and pu_edate >= '".date("Y-m-d H:i:s")."' and pu_pos in ('all','pc') "// pc일 경우
    
$res mysql_query($sql,$connect_j3);
    while(
$info=mysql_fetch_array($res)){
        
$pu_array[] = $info;
    }

    foreach(
$pu_array as $key=>$pu){
        if(
$_COOKIE["modal_notice_box_".$pu['idx']]!="Y"){
?>
<div id="modal_notice_box_<?php echo $pu['idx'];?>" class='pu_modal' style="width:<?php echo $pu['pu_width']?>px;height:<?php echo $pu['pu_height']?>px;border:1px solid #ccc;position:absolute;left:<?php echo $pu['pu_left']?>px;top:<?php echo $pu['pu_top']?>px;background-color:#FFFFFF;z-index:1001;" title="공지사항">
    <?php echo $pu['pu_content'];?>
    <div class="hd_pops_footer" style='position:absolute;bottom:-30px;height:30px;line-height:25px;width:<?php echo $pu['pu_width']?>px;background:#c0c0c0;'>
        &nbsp;<button class="hd_pops_reject" value='<?php echo $pu['idx']; ?>'><strong>24시간동안 열람안함</button>
        <button class="hd_pops_close" value='<?php echo $pu['idx']; ?>'>닫기</button>
    </div>
</div>
<?php 
        
}
    }
?>
<script>
$(function(){
    $(".hd_pops_close").click(function(){
        $idx = $(this).val();
        $("#modal_notice_box_"+$idx).hide();
    });

    $(".hd_pops_reject").click(function(){
        $idx = $(this).val();
        $("#modal_notice_box_"+$idx).hide();
        setsave("modal_notice_box_"+$idx, "Y", 1);
    });
});
</script>