/home/mjc1/public_html/html/m/include/intro_list_board.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<script src="/js/bxslider/jquery.bxslider.min.js"></script>
<!--실시간구매현황 시작-->
<style>
/*실시간 구매현황*/
.real_time_buy{width:100%;margin:0 auto;border:5px solid #cdcdcd;height:60px;box-sizing: border-box;}
.real_time_buy h4{width: 30%;float: left;background:#fff;border:1px solid #ccc;box-sizing: border-box;height:50px;text-align: center;line-height: 50px;}
.real_time_buy_bx{width: 70%;float: left;background:#fff;}
.real_time_buy_bx ul li{line-height:50px;font-size:14px;font-weight:600;color:#191919;}
.real_time_buy .bx-viewport{    overflow: hidden;height: 50px !important;}
</style>
<script>
$(function(){
    $('.bx-slider1').bxSlider({
        minSlides: 10,
        maxSlides: 10,
        ticker: true,
        speed: 100000,
        tickerHover: true,
        slideWidth: 'auto', //슬라이드 안의 넓이, 숫자로도 가능합니다.
        slideMargin: 15 //슬라이드 사이의 마진값
    });
});//실시간 구매현황 bxslider
</script>
        <div class="real_time_buy">
            <h4><img src="./images/intro/m_list_tit02_1.png" style="width: 90px;margin-top: 10px;"></h4>
            <div class="real_time_buy_bx">
                <ul class="bx-slider1">
<?php
function cut_str2($msg,$cut_size) {
        if(
$cut_size<=0) return $msg;
        if(
ereg("\[re\]",$msg)) $cut_size=$cut_size+4;
        
$max_size $cut_size;
        
$i=0;
        while(
1) {
            if (
ord($msg[$i])>127){
                
//$i+=2; // euckr일경우
                
$i+=3// utf-8일경우
            
} else {
                
$i++;
            }
        if (
strlen($msg) < $i)
            return 
$msg;

        if (
$max_size == 0)
            return 
substr($msg,0,$i);
        else
            
$max_size--;
        }
    } 
$sql "set names utf-8;";
mysql_query($sql);

$cur_date date("Y-m-d");
//$cur_date = "2020-02-27";
$week_ago date("Y-m-d",time()-(60*60*24*7));
include_once(
$_SERVER['DOCUMENT_ROOT']."/html/adminmobile/manage/commonST.php");
$sql "select count(*) as cnt from sale_list where sdate = '{$cur_date}' and rmoney > 0";
$res mysql_query($sql);
$info mysql_fetch_array($res);
if(
$info['cnt']<30){
    
$sql "select custname,sdate from sale_list where sdate >= '{$week_ago}' and sdate <= '{$cur_date}' and rmoney > 0 group by custname order by sdate desc, code desc limit 70";
} else {
    
$sql "select custname,sdate from sale_list where sdate = '{$cur_date}' and rmoney > 0 /*and length(custname)<7*/ group by custname order by sdate desc, code desc limit 70";
}
//echo $sql;
$res mysql_query($sql);
while(
$info mysql_fetch_array($res)){
?>
                    <li>
    <?php 
                            $info
['custname'] = iconv("euckr","utf-8",$info['custname']);
                            
$tmp "";
                            
//echo substr($info['custname'],0,5);
                            
if(substr($info['custname'],0,5)=="(주)"){
                                
$info['custname'] = substr($info['custname'],5,strlen($info['custname']));
                                
$tmp "(주)";
                            }
                            
$len mb_strlen($info['custname'],'utf-8');
                            
$len1 round($len/2);
                            
//echo $len." ".$len1." ".iconv_substr($info['custname'],$len1);
                            
echo $tmp;
                            echo 
iconv_substr($info['custname'],0,$len1,'utf-8');
                            for(
$i=0;$i<$len-$len1;$i++){ echo "*"; }
                            echo 
"({$info['sdate']})";
                            
/*$info['custname'] = iconv("euckr","utf-8",$info['custname']);
                            $v = cut_str2($info['custname'],12);
                            if(substr($v,0,4)=="(주)"){
                                $v = str_replace("(주)","",$v);
                                $add_pre = "(주)";
                            } else {
                                $add_pre = "";
                            }

                            $strlen = strlen($v);
                            if($strlen>2 && $strlen<5){
                                //echo cut_str($v,2,"")."*";
                                if($add_pre!=''){
                                    $vx = cut_str($v,2,"")."*";
                                } else {
                                    $vx = $v;
                                }
                            } else if($strlen>4 && $strlen<7){
                                $vx = cut_str2($v,1)."*";
                            } else {
                                $v_len = (strlen($v)/2)-3;
                                $vx = cut_str2($v,$v_len)."**";
                            }
                            echo $add_pre.$vx;*/
    
?>
                    </li>
<?php
}
?>
                </ul>

            </div>
        </div>

        <!--실시간구매현황 끝-->