/home/mjc1/public_html/manage/dealer_admin.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?
include("./include/admin_include_header.php");

$admin_info admin_member_info();
if(
$admin_info['psn_auth']=='0' || substr($admin_info['psn_rwed'],0,1)=='0'){
    echo 
"<script>alert('ÇØ´ç Á¢±Ù±ÇÇÑÀÌ ¾ø½À´Ï´Ù.');window.history.go(-1);</script>"; exit;
}
auth_access_log("LIST");

$string substr(strtolower(md5(uniqid(rand(),1))),0,5);
$string str_replace('1','a',$string);

$cm_nCount                =    30;
$cm_item_nCount        =    30;


function 
pageListing($cur_page$total_page$n$url$mode$SearchMdiv ,$SearchMup,$SearchMper,$searchCode ,$keyword ,$SearchMsw1 $cm_nCount$menu$sub  ) {
    
$retValue "<div class='paging'>";
    if (
$cur_page 1) {

        
$retValue .= "<a href='" $url . ($cur_page-1) ."' class='page'><span class='next'>ÀÌÀü</span></a>";
    } else {
        
$retValue .= "";
        
$retValue .= "";
    }

    
$retValue .= "";

    
$start_page = ( ( (int)( ($cur_page ) / 10 ) ) * 10 ) + 1;

    
$end_page $start_page 9;
    if (
$end_page >= $total_page$end_page $total_page;
        if (
$start_page 1$retValue .= "<a href='" $url . ($start_page-1) . "' class='page'><span class='next10'>ÀÌÀü 10°³</span></a>";

            if (
$total_page 1)
                for (
$k=$start_page;$k<=$end_page;$k++)
            if (
$cur_page != $k$retValue .= "<a href='$url$k'>$k</a>";
                else 
$retValue .= "<a href='$url$k' class='on'>$k</a>";

    if (
$total_page $end_page$retValue .= "<a href='" $url . ($end_page+1) . "' class='page'><span class='pro10'>´ÙÀ½ 10°³</span></a>";

    
$retValue .= "";

    if (
$cur_page $total_page) {
        
$retValue .= "<a href='$url. ($cur_page+1) ."' class='page'><span class='pro'>´ÙÀ½</span></a>";

    } else {
        
$retValue .= "";
        
$retValue .= "";
    }

    
$retValue .= "</div>";
    return 
$retValue;
}

$where "";
if(
$flg != "" && $flg == "n") {
    
$where " and d_ok = 0";
}


$total_sql  .=   " select * from mBoard_dealer where d_cname like '%$keyword%' $where ";

$result      mysql_query($total_sql) or die (mysql_error());
$nTotalCount mysql_num_rows($result);
$nPage       ceil($nTotalCount $cm_nCount);
if (
$pg == ""$pg 1;
if (
$_POST['search_mode'] == "Y"){ // °Ë»ö ½Ã ÆäÀÌ¡³Ñ¹ö ³¯¸®±â À§ÇØ ¾Æ·§ÂÊ hidden °ª Æ÷ÇÔÇÏ¿© ¼±¾ð 2013.12.02 by.jyh
  
$pg 1;      
}

$nFrom = ($pg 1) * $cm_nCount;
$sql    $total_sql "  order by d_date DESC limit $nFrom$cm_nCount ";
$total_result mysql_query($sql) or die (mysql_error());

if(
$mode=="update_chk"&& $d_num) {
    
$d_r " select * from mBoard_dealer where d_num='$d_num' and d_pass='$pass' ";
    
$d_rResult  =  mysql_query($d_r);

    if( 
mysql_num_rows($d_rResult) > 0) {
        
$d_d mysql_fetch_array($d_rResult);
        
$d_d_code explode("-",$d_d['d_code']);
        
$d_d_tel explode("-",$d_d['d_tel']);
        
$d_d_mob explode("-",$d_d['d_mob']);
        
$d_d_info stripslashes($d_d['d_info1']);
    }
    else {
        echo 
"<script>alert('ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.');location.href = 'dealer_admin.php';</script>";
        
$d_num "";
    }
}
?>
<script>
function Search(){
    document.getElementById('search_mode').value = "Y";
    searchFrm.submit();    
}

//󸮻óź¯°æ
function Cha_DealerJoin(idx,val){
    changeIframe.location.href = "dealerorderProcess.php?exCode=Cha_DealerJoin&idx=" + idx + "&val=" + val;
}

function delete_dealer($d_num){
    if(confirm('Á¤¸»·Î »èÁ¦ÇϽðڽÀ´Ï±î?')){
        changeIframe.location.href = "dealerorderProcess_del.php?exCode=alldel&d_num=" + $d_num;
    }
}

$(function(){
    $(".click_tr").click(function(){
        var td_idx = $(this).find("input[name='orderForm[]']");
        form_data = "td_idx="+$(td_idx).val();
        $.ajax({type:"post", url:"ajax_dealeradmin_view_log.php",data:form_data, dataType : "html", 
            success:function(xml){    
            },
            error:function(rtn,status,error){

            }
        });
    });
});
</script>
<link rel='stylesheet' type='text/css' href='./css/new.css'>
<div class="container">
    <div class="border_contents">
        <div class="admin_table">
            <h3 class="list_ttl">
                µô·¯°¡ÀÔ°ü¸®
                <span class="list_sub_ttl bgy">µô·¯ ³»¿ª È®ÀΠ¹× ¼öÁ¤Çϴ ÆäÀÌÁöÀÔ´Ï´Ù.</span>
                <span>* ÇöÀç °Ë»ö µô·¯ : <b><?=$nTotalCount?></b></span>
            </h3>


            <form name='searchFrm' method=post>
                <input type="hidden" name="search_mode" id="search_mode">
                <div class="searchArea searchAreaPlus">
                    <span class="searchAreaL"></span>
                    <span class="searchAreaR"></span>
                    <dl class="search_tender requestSearchArea" style="width:477px;">
                        <dd>
                            <input type="checkbox" name="flg" value="n" <?php if($flg == "n"){ echo "checked"; }?> id="flg">
                            <label for="flg">¹Ì󸮰Ǹ¸ º¸±â</label>
                        </dd>
                        <dd class="relative">
                            <p class="arrow"></p>
                            <select name='searchCode' class="nonearrow">
                                <option value=1  <?    if($searchCode == '1'){ echo "selected"; } ?>>»óÈ£</option>
                            </select>
                        </dd>
                        <dd>
                            <input type='text' name='keyword' size='10' value='<?=$keyword;?>' onKeyDown="javascript:if(event.keyCode == 13) Search();"  style="width:143px;height:29px;" class="keyword">
                        </dd>
                        <dd class="searchbtnarea">
                            <a href='javascript:Search();' class="searchBtn bgy">°Ë»ö</a>
                            <input type='hidden' name='mode' value='search'>
                        </dd>
                    </dl><!--search_tender-->
                </div><!-- //searchArea1-->
            </form>



            <form name='F2'>
                <div class="borderWarp" style="border-bottom:0 none;">
                    <table class="borderTable dealerarea">
                        <tr>
                            <th>NO</th>
                            <th>Áö¿ª</th>
                            <th>»óÈ£(À̸§)</th>
                            <th>ÀüÈ­</th>
                            <th>ÇÚµåÆù</th>
                            <th>À̸ÞÀÏ</th>
                            <th>½ÂÀο©ºÎ</th>
                            <th class="last">°ü¸®</th>
                        </tr>
                        <?
                            
if(  mysql_num_rows($total_result) > ){

                                
$i 1;

                                while(
$m_row  mysql_fetch_array($total_result)) {

                                    if(
$pg == "")  $num  =  $i;
                                        else 
$num  = ( ( $pg $cm_nCount ) -30 ) + $i ;

                                    if(
$m_row['d_tel']=="--"$tel "&nbsp;";
                                        else 
$tel $m_row['d_tel'];

                                    if(
$m_row['d_ok'] == '0'$OK "½Åû";
                                        else
                                            if(
$m_row['d_ok'] == '1'$OK "½ÂÀÎ";
                                                else 
$OK "¹Ì½ÂÀÎ";


                                    if(
$m_row['d_mob']=="--"$mob "&nbsp;";
                                        else 
$mob $m_row['d_mob'];

                                    if(
$m_row['d_cname']) $cname $m_row['d_cname'];
                                        else 
$cname "&nbsp;";

                                    if(
$m_row['d_cname']) $name "(".$m_row['d_name'].")";
                                        else {
                                            
$cname=""$name $m_row['d_name'];
                                        }
                                    if(
$m_row['d_select']=='0'){$sname "±³À°´ã´ç½Åû";} else {$sname="µô·¯½Åû";}

                                    
$info="<div class='replyArea'>
                                                        <p class='title'>[ ÁÖ¹®Á¤º¸ ]</p>
                                                        <ul>
                                                            <li><em>°¡ÀÔÀÏ : </em><span class='family'>"
.substr($m_row['d_date'],0,10)."</span></li>";
                                    
                                    if(
$m_row['d_code']!="--"$info.="<li><em>»ç¾÷ÀÚ : </em><span class='family'>".$m_row['d_code']."</span></li>";
                                    if(
$m_row['d_type']) $info.="<li><em>¾÷Å : </em>".$m_row['d_type']."</li>";
                                    if(
$m_row['d_kind']) $info.="<li><em>¾÷Á¾ : </em>".$m_row['d_kind']."</li>";
                                    if(
$m_row['d_info1']) $info.="<li><em>Ãë±Þ¾÷¹« : </em>".nl2br(stripslashes($m_row['d_info1']))."</li>";
                                    if(
$m_row['d_select']!=''$info.="<li><em>¸ðÁýÁ¾·ù : </em>".$sname."</li>";
                                    if(
$m_row['d_file']) {
                                        if(
file_exists($_SERVER['DOCUMENT_ROOT']."/save_dir/dealer/".$m_row['d_file'])){
                                            
$info.="<li class='download'><em>»ç¾÷ÀÚµî·ÏÁõ : </em><a href='download2.php?type=dealer&filename={$m_row['d_file']}'>[´Ù¿î·Îµå]</a></li>";
                                        }
                                    }
                                    
$info.="</ul></div>";

                                    
$info stripslashes($info);
                        
?>

                        <tr align='center' style='cursor:pointer;' onclick="if(document.all('tr_<?=$i;?>').style.display==''){document.all('tr_<?=$i;?>').style.display='none'; } else { document.all('tr_<?=$i;?>').style.display=''}" onmouseover="this.style.background='EAF5FB'" onmouseout="this.style.background='ffffff'" style="cursor:pointer;" class="click_tr"> 

                            <td><?=$num;?><input type='hidden' name='orderForm[]' value='<?=$m_row['d_num'];?>'></td>
                            <td><?=$m_row['d_area'];?></td>
                            <td><?=$cname;?></td>
                            <td class="family"><?=$tel;?></td>
                            <td class="family"><?=$mob;?></td>
                            <td class="family"><?=$m_row['d_email'];?></td>
                            <td class="family">
                                <select name='rSuccYnFrm' onchange="Cha_DealerJoin('<?=$m_row['d_num'];?>',this.value);" style='width:60px;'>
                                    <option value='0' <? if( $m_row['d_ok'] == "0"){ echo "selected";}?>>½Åû</option>
                                    <option value='1' <? if( $m_row['d_ok'] == "1"){ echo "selected";}?>>½ÂÀÎ</option>
                                    <option value='2' <? if( $m_row['d_ok'] == "2"){ echo "selected";}?>>¹Ì½ÂÀÎ</option>
                                </select>
                            </td>
                            <td class="last"><a href="javascript:delete_dealer('<?php echo $m_row['d_num'];?>')">[»èÁ¦]</a></td>
                        </tr>

                        <tr id='tr_<?=$i;?>' class="orderinfo" style='display:none;'>
                            <td colspan="8" class="detail last">
                                <?=$info;?>
                            </td>
                        </tr>
                        <?
                                    $i
++;
                                }
                            } else {
                                echo 
"<tr>
                                    <td colspan='7' class='detail last'>µô·¯Á¤º¸°¡ ¾ø½À´Ï´Ù.</td>
                                </tr>"
;
                            }
                        
?>
                    </table><!-- //memberTable -->
                </div><!-- //memberWarp -->
            </form>
            
            <?= pageListing($pg$nPage$cm_nCount"dealer_admin.php?menu=2&sub=4&search_mode=$search_mode&searchCode=$searchCode&keyword=$keyword&mode=$mode&pg=" );?>
            <?//print_r($_REQUEST)?>
            
            <iframe name='changeIframe' width="0" height="0"></iframe>

        </div><!-- //admin_table -->

        <p class="navi">°ü¸®ÀÚ¸ðµå > È¸¿ø°ü¸® > µô·¯°ü¸®</p>

        <div class="footer">
            <?    include("./include/admin_include_footer.php"); ?>
        </div><!-- //footer -->


    </div><!-- //border_contents -->
</div><!-- //container -->
</div><!-- //wrap -->
</body>
</html>