/home/mjc1/public_html/onlinecs/cateAddProcess.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
<? session_start(); ?>
<?php 
include_once("_common.php");?>
<?
    
if( $adminid == "" ){ 
?>
<SCRIPT LANGUAGE='JavaScript'> 
    alert("°ü¸®ÀÚ ·Î±×ÀΠÈÄ¿¡ À̿밡´ÉÇÕ´Ï´Ù.");
    parent.location.href = "../onlinecs/adminintro.php";
    self.close();
</script>
<?     
     
}

 
$admin str_replace("admin+","",$adminid);
 include(
"../onlinecs/commonSTADMIN.php");
 
?>

<?
//window.open("cateAddProcess.php?fullpath="+fullpath+"&name="+name,"saveproduct","width=0,height=0,scrollbars=yes");
    
if($plevel == ""){    //±âÁ¸ÀÚ·á´Â plevelÀÌ ¾øÀ½
        
$upqry "UPDATE pclass set name = '$name' where fullpath = '$fullpath'";
        
mysql_query($upqry);

    echo (
$upqry);
    } else if (
$plevel == "2"){    //½Å±ÔÀÚ·á¶ó¼­ Plevel insert
        
$codeqry "SELECT max(code) as maxcode FROM pclass";
        
$coderesult mysql_query($codeqry);
        
$coderow mysql_fetch_array($coderesult);

        
$maxcode $coderow[maxcode] + 1;
        
$newmaxcode str_pad($maxcode,4,"0",STR_PAD_LEFT); //¾ÕÀÚ¸® 0ä¿ì±â 4ÀÚ¸®·Î ±¸¼º
        
$fullpath substr($fullpath,0,4).$newmaxcode;

        
$isqry "INSERT into pclass ( code, name, plevel, fullpath) values ( '$newmaxcode', '$name', '$plevel', '$fullpath')";
        
mysql_query($isqry);
?>
    <SCRIPT LANGUAGE="JavaScript">
    parent.document.getElementsByName("fullpath3[]")[e3-1].value= <?=$fullpath?>;
    </SCRIPT>
<?
            
echo ($isqry);
    } else {    
//½Å±ÔÀÚ·á¶ó¼­ Plevel insert
        
$codeqry "SELECT max(code) as maxcode FROM pclass";
        
$coderesult mysql_query($codeqry);
        
$coderow mysql_fetch_array($coderesult);

        
$maxcode $coderow[maxcode] + 1;
        
$newmaxcode str_pad($maxcode,4,"0",STR_PAD_LEFT); //¾ÕÀÚ¸® 0ä¿ì±â 4ÀÚ¸®·Î ±¸¼º

        
$isqry "INSERT into pclass ( code, name, plevel, fullpath) values ( '$newmaxcode', '$name', '$plevel', '$fullpath')";
        
mysql_query($isqry);
            echo (
$isqry);
    }
?>