/home/mjc1/public_html/onlinecs/searchResult.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
<? session_start(); ?>
<?php 
include_once("_common.php");?>

<?
    
if(( $id == "" ) && ( $sid == "" )) { 
?>
<script>
    alert("e¼ö¹ßÁÖ ·Î±×ÀΠÈÄ¿¡ À̿밡´ÉÇÕ´Ï´Ù.");
    location.href = "../onlinecs/intro.php";
</script>
<?     
     
}

  include(
"../onlinecs/commonST.php");
?>
<script>
function convert(){    //10Áø¼ö->16Áø¼ö

        var num = document.getElementsByName("color"); 

        
        for(var i=0;i<num.length;i++)
        num[i].value = Number(num[i].value).toString(16);

        tdchg();
    }
function tdchg(){
    var color1 = 0;
    var color1 = document.getElementsByName("color"); 
    var color2 = document.getElementsByName("tdcolor");
    for(var i=0;i<color2.length;i++){

        if (color1[i].value.length < 2) {
             var chgcolor = '00000'+color1[i].value.substr(0,1);
             color2[i].style.backgroundColor = chgcolor;
        }
        else if (color1[i].value.length < 3) {
             var chgcolor = color1[i].value.substr(0,2)+'0000';
             color2[i].style.backgroundColor = chgcolor;
        }
        else if (color1[i].value.length < 4) {
             var chgcolor = '000'+color1[i].value.substr(0,3);
             color2[i].style.backgroundColor = chgcolor;
        }
        else if( color1[i].value.length < 6)
        {
            var chgcolor = color1[i].value.substr(2,2)+color1[i].value.substr(0,2)+'00';
                 color2[i].style.backgroundColor = chgcolor;

        } else {
             var chgcolor = color1[i].value.substr(4,2)+color1[i].value.substr(2,2)+color1[i].value.substr(0,2);
             color2[i].style.backgroundColor  = chgcolor;
        }
    


    }
    
}
</script>
<script>
        

        function oldsubmit(no){

            var idx = 0;
//            var oldidx = oldnum;
            var idx = document.getElementsByName("oldidx")[no].value;    //ÀÌÀü ¹øÈ£ -1ÀÌ ¹è¿­°ª ³Ñ¾î¿Ã¶§ »©°í ³Ñ¾î¿È 0ºÎÅÍ Ä«¿îÆ®¸¦ ¸·±âÀ§ÇÔ

            var code = document.getElementsByName("code")[no].value;    //Äڵ堳ѹö È÷µç°ª
            var qnt = document.getElementsByName("qnt")[no].value;        //¼ö·®
            var name = document.getElementsByName("name")[no].value;        //»óǰ¸í
            var norm = document.getElementsByName("norm")[no].value;        //±Ô°Ý
            var price2 = document.getElementsByName("price2")[no].value;        //°è»ê¿ë°¡°Ý
            var price = document.getElementsByName("price")[no].value;        //°¡°Ý
            var money2 = document.getElementsByName("money2")[no].value;        //°è»ê¿ë±Ý¾×
            var money = document.getElementsByName("money")[no].value;        //±Ý¾×



//            top.opener.test();

            top.parent.opener.document.getElementsByName("code[]")[idx].value = code;    //ÄÚµå
            top.parent.opener.document.getElementsByName("c_ordqnt[]")[idx].value = qnt;    //¼ö·®
            top.parent.opener.document.getElementsByName("c_pname[]")[idx].value = name;    //»óǰ¸í
            top.parent.opener.document.getElementsByName("c_pnorm[]")[idx].value = norm;    //±Ô°Ý
            top.parent.opener.document.getElementsByName("c_price[]")[idx].value = price;        //ÄÞ¸¶´Ü°¡
            top.parent.opener.document.getElementsByName("c_price2[]")[idx].value = price2;    //°è»ê¿ë´Ü°¡
            top.parent.opener.document.getElementsByName("c_money[]")[idx].value = money;        //ÄÞ¸¶±Ý¾×
            top.parent.opener.document.getElementsByName("c_money2[]")[idx].value = money2;    //°è»ê¿ë±Ý¾×

            top.opener.hap();        //ºÎ¸ðâ ÇÕ°è°è»ê ½ºÅ©¸³Æ® ½ÇÇà

            parent.close();    
        }
</script>

<body topmargin="0" marginwidth="0" marginheight="0" leftmargin="0" >
<?
    $num 
0;
    
$code2 substr($detail,-4);
 
$mqry =    "SELECT m.code, m.code2, m.bcode, m.name, m.norm, m.taxmode, m.packqnt, m.classcode, m.unit, m.bmanage, m.hidden, m.color, m.onlinehidden, m.bigo, d.pcode, d.ocode, d.saleprice
            FROM product_m AS m LEFT JOIN product_d AS d ON(m.code=d.pcode) 
            WHERE onlinehidden = 0 AND hidden = 0 AND ocode='
$sacode' AND classcode = '$code2'";

 
$resultm mysql_query($mqry);

?>
        <table width="800" height="25" border="0" cellpadding="0" cellspacing="0" >
        <form name="result">
<? 
    $i 
0;
    while(
$row mysql_fetch_array($resultm)){

                
        if (
$row[taxmode] == "1"){
            
$taxmode "°ú¼¼";
        }
        if (
$row[taxmode] == "0"){
            
$taxmode "ºñ°ú¼¼";
        }

        if (
$idx 0){
            
$numidx  $idx-1;
        } else if (
$nidx 0){
            
$numidx  $nidx-1;
        }



?>


                <tr>
                    <td width="1">
                    <!-- 10Áø¼ö¸¦ 16Áø¼ö·Î ¹Ù²Ù±â À§ÇÑ ÀԷ°ª -->
<!--                    <input type="text"  name="color3" value="<?=$row[color]?>"> -->
                    <input type="hidden"  name="color" value="<?=$row[color]?>">
                    <input type="hidden" name="oldidx" value="<?=$numidx?>">                
                    
                    </td>
                    <td width="100%" class="txt07" valign="middle">
                        <table border="0" cellpadding="0" cellspacing="0" width="800" class="txt07">
                            <tr>
                                <td width="4%" align="center" valign="middle">
                                    <? if ($idx >= 0){ ?> <!-- ±âÁ¸Á¦Ç° Å¬¸¯-->
<img src="../onlinecs/img/common/popselect.gif" style="cursor:hand;" onclick="oldsubmit(<?=$num?>)">    
                                    <? } else if ($nidx >= 0){ ?>
<img src="../onlinecs/img/common/month.gif" style="cursor:hand;" onclick="oldsubmit(<?=$num?>)">    
                                    <? ?>
                                    <? $num++; ?>

                                </td>
                                <td width="7%" align="center" valign="middle">
                                    <input type="text" name="code" value="<?=$row[code]?>" readonly onclick="oldsubmit()" style="width:50px">
                                </td>
                                <td width="4%" align="center" valign="middle">
                                    <input type="text" value="1" name="qnt" onclick="this.select();" onkeypress='if (event.keyCode<48|| event.keyCode>57)  event.returnValue=false;' style='IME-MODE:disabled;width:35px;text-align:center;' onkeyup="hap()">
                                </td>
                                <td width="19%" align="center" valign="middle">
                                    <input type="text" name="name" value="<?=$row[name]?>" style="width:145px;">
                                </td>
                                <td width="19%" align="center" valign="left">
                                    <input type="text" name="norm" value="<?=$row[norm]?>" style="width:140;">
                                </td>
                                <td width="5%" align="center" valign="middle">
                                    <input type="text" name="unit" value="<?=$row[unit]?>" style="width:30px;">
                                </td>
                                <td width="5%" align="center" valign="middle">
                                    <!-- 16Áø¼ö·Î º¯È¯ÇÑ Ä÷¯¸¦ º¸¿©Áִ input -->
                                    <input type="button" name="tdcolor" value="" style="border:1px solid #aaaaaa;background-color:#eeeeee;width:20px;" disabled>
                                </td>
                                <td width="5%" align="center" valign="middle" class="txt07">
                                    <input type="text" name="taxmode" value="<?=$taxmode?>" style="width:40px;font-size:9pt;text-align:right;">
                                </td>
                                <td width="10%" align="center" valign="middle">
                                    <input name="price" type="text" value="<?=number_format($row[saleprice])?>" style="width:75px;text-align:right;">
                                    <input name="price2" type="hidden" value="<?=$row[saleprice]?>">
                                    <input name="money" type="hidden" value="<?=number_format($row[saleprice])?>">
                                    <input name="money2" type="hidden" value="<?=number_format($row[saleprice])?>">
                                </td>
                                <td width="15%" align="center" valign="middle">
                                    <input name="bigo" type="text" value="<?=$row[bigo]?>" style="width:110px;text-align:right;">
                                </td>
                                <td width="5%" align="center" valign="middle">
                                    <input name="packqnt" type="text" value="<?=$row[packqnt]?>" style="width:30px;text-align:right;">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="11" height="1" bgcolor="#efefef">
                                </td>
                            <tr>
                                    
                        </table>
                    </td>
                    <td width="2">
                    </td>


<? 
    $i
++;
?>
                </tr>
            </table>
</body>
</html>
<script>
    convert();
</script>