/home/mjc1/public_html/onlinecs/adminselldetailexcel.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
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
<? session_start(); ?>
<?php 
include_once("_common.php");?>
<? 
header
"Content-type: application/vnd.ms-excel" ); 
header"Content-Disposition: attachment; filename=¹ßÁÖ»ó¼¼³»¿ª(ÁÖ¹®¹øÈ£-$uid).xls" ); 
header"Content-Description: PHP4 Generated Data" ); 
?> 
<link href="../onlinecs/css/style.css" media="print" rel="stylesheet" type="text/css">
<?
    
if( $adminid == "" ){ 
?>
<SCRIPT LANGUAGE='JavaScript'> 
    alert("°ü¸®ÀÚ ·Î±×ÀΠÈÄ¿¡ À̿밡´ÉÇÕ´Ï´Ù.");
    location.href = "../onlinecs/adminintro.php";
</script>

<?     
     
}

 
$admin str_replace("admin+","",$adminid);
 include(
"../onlinecs/commonSTADMIN.php");
 
?>
<script>
var boxnum = document.getElementsByName("c_ordbox[]");    //¹Ú½º¼ö·®
var nat = document.getElementsByName("c_ordunit[]");    //³¹°³¼ö·®
var ordqnt = document.getElementsByName("c_ordqnt[]");    //¼ö·®
var delqnt = document.getElementsByName("c_packqnt[]");//³»Ç°¼ö

function surangresult(n){    //¼ö·®

    var m = n;
    var div = Number(ordqnt[m].value) / Number(delqnt[m].value);
    var div2 = Number(ordqnt[m].value) % Number(delqnt[m].value);
    if(delqnt[m].value == '0'){
    nat[m].value = parseInt(ordqnt[m].value);
    boxnum[m].value = '0';
    } else {
    boxnum[m].value = parseInt(div);
    nat[m].value = parseInt(div2);
    }
//    hap();
}
</script>

        <!-- °Å·¡Ã³¿øÀå ¸®½ºÆ® -------------------------- ½ÃÀÛ -->
            <table width="950" height="25" border="1" cellpadding="0" cellspacing="0" bordercolor="#0000ff" bgcolor="#3d83bd">
                <tr>
                    <td width="100%" class="txt07" valign="middle">
                        <table border="1" cellpadding="0" cellspacing="0" width="100%" height="100%" class="txt03">
                            <tr>
                                <td width="5%" align="center" valign="middle">
                                    <b>¹øÈ£
                                </td>
                                <td width="25%" align="center" valign="middle">
                                    <b>»óǰ¸í    
                                </td>
                                <td width="25%" align="center" valign="middle">
                                    <b>±Ô°Ý    
                                </td>
                                <td width="5%" align="center" valign="middle">
                                    <b>¼ö·®
                                </td>
                                <td width="8%" align="center" valign="middle">
                                    <b>´Ü°¡
                                </td>
                                <td width="8%" align="center" valign="middle">
                                    <b>±Ý¾×    
                                </td>
                                <td width="20%" align="center" valign="middle">
                                    <b>ºñ°í    
                                </td>
                            </tr>
                        </table>


                    </td>
                </tr>
            </table>





    
<?  
        $detailqry 

                SELECT  d.seq, d.pname, d.pcode, d.pnorm, d.ordqnt, d.price, (d.ordqnt * d.price) AS money, d.bigo, m.ordno, m.ccode, p.code, p.packqnt
                FROM product_m AS p LEFT JOIN (ordbook_d AS d LEFT JOIN ordbook_m AS m ON(d.ordno = m.ordno)) ON (p.code =  d.pcode)
                WHERE d.ordno = '
$uid'
                "
;
        
$detailresult mysql_query($detailqry) or die (mysql_error());




$i 1;
    while(
$Drows =  mysql_fetch_array($detailresult)){

            
$tdtotal $Drows[price] * $Drows[ordqnt];
$line $i 2;
if(
$line =="0"){
 
$tdcolor "#f6f6f6";
} else { 
 
$tdcolor "#ffffff";
}
?>

                        <table border="1" cellpadding="0" cellspacing="0"  class="txt07">
                            <tr>
                                <td width="5%" align="center" valign="middle" height="20">
                                    <?=$i;?>
                                </td>
                                <td width="18%" align="left" valign="middle">
                                    <?=$Drows[pname]?>    
                                </td>
                                <td width="19%" align="left" valign="middle">
                                    <?=$Drows[pnorm]?>    
                                </td>
                                <td width="4%" align="center" valign="middle">
                                    <?=$Drows[ordqnt];?>
                                </td>
                                <td width="9%" align="right" valign="middle">
                                    &nbsp;<?=number_format($Drows[price])?>&nbsp;    
                                </td>
                                <td width="9%" align="right" valign="middle">
                                    &nbsp;<?=number_format($Drows[money])?>&nbsp;    
                                </td>
                                <td width="18%" align="left" valign="middle">
                                    &nbsp;<?=$Drows[bigo]?>    
                                </td>
                            </tr>
                        </table>

<script>
surangresult(<?=$i-1?>);
</script>                                

<? $i++;     } ?>