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
|
<? session_start(); ?> <?php include_once("_common.php");?>
<? $admin = str_replace("admin+","",$adminid); include("../onlinecs/commonSTADMIN.php");
?>
<? if($type == "product"){ //»óǰ echo $target; for ($i = 0; $i < count( $cate4); $i++) { $c4sql = "UPDATE product_m set classcode = '$target' WHERE code = '$cate4[$i]'"; echo $c4sql; mysql_query($c4sql); } ?>
<SCRIPT LANGUAGE="JavaScript"> parent.alert("À̵¿µÇ¾ú½À´Ï´Ù"); // parent.location.href="adminloadResult.php"; </SCRIPT> <? } ?>
<? if($type == "cate3"){ //¼ÒºÐ·ù $target=substr($target,0,4); // echo $target; for ($i = 0; $i < count( $cate3); $i++) { $source = substr($cate3[$i],4,4); $newtarget = $target.$source; if($code3[$i] ==""){ } else { $c4sql = "UPDATE pclass set fullpath = '$newtarget' WHERE fullpath = '$cate3[$i]'"; echo $c4sql; mysql_query($c4sql); } } ?>
<SCRIPT LANGUAGE="JavaScript"> parent.alert("À̵¿µÇ¾ú½À´Ï´Ù"); // parent.location.href="adminloadResult.php"; </SCRIPT> <? } ?>
<? if($type == "cate2"){ //Áߺзù
$target=substr($target,0,2); $maxsql = "SELECT max(fullpath) AS maxpath FROM pclass WHERE fullpath like '$target%0000'"; $mresult = mysql_query($maxsql); $mrow = mysql_fetch_array($mresult); $scode = $mrow[maxpath]; $scode = substr($scode,2,2)+1;
echo $target; //echo count($cate2);
for ($i = 0; $i < count($cate2); $i++) { $scode = str_pad($scode,2,"0",STR_PAD_LEFT); $newtarget = $target.$scode."0000"; if($code2[$i] ==""){ } else { $c4sql = "UPDATE pclass set fullpath = '$newtarget' WHERE fullpath = '$cate2[$i]'"; echo $c4sql; mysql_query($c4sql);
$catecut1 = substr($cate2[$i],0,4)."0000"; //¼ÒºÐ·ùµµ º¯°æ $catecut2 = substr($cate2[$i],0,4)."9999"; $ssql = "SELECT * FROM pclass WHERE fullpath BETWEEN '$catecut1' AND '$catecut2'"; echo "<br>"; echo $ssql; $sresult = mysql_query($ssql); while($srow = mysql_fetch_array($sresult)){ $oldcodecut = substr($srow[fullpath],4,4); $targetcut = substr($newtarget,0,4); $susql = "UPDATE pclass SET fullpath = '$targetcut$oldcodecut' WHERE fullpath = '$srow[fullpath]'"; mysql_query($susql); }
} $scode++; }
?> <SCRIPT LANGUAGE="JavaScript"> parent.alert("À̵¿µÇ¾ú½À´Ï´Ù"); // parent.location.href="adminloadResult.php"; </SCRIPT> <? } ?>
|