/home/mjc1/public_html/manage/noticeBoardProcess.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
<?
    session_start
();
   include(
"category/common.php");

    
$id $_SESSION['ADMINID'];
    
$path "../save_dir/notice";

   if( 
$mode == "insert"){

     
$_content     addslashes($content);  
     
$reg_date     =  Time();
     
$insertQry     =  " INSERT INTO mBoard_notice 
                                    ( name, company, subject, content, hit, reg_date,temp )
                            values  ( '
$name','$sitetype','$subject','$_content','$hit','$reg_date','$temp')";
     
      
mysql_query($insertQry);
  
     
$sel      =  "select uid from mBoard_notice order by uid desc limit 1";
     
$result   =   mysql_query($sel);
     
$row      =   mysql_fetch_array($result);
    
$uid $row[0];

    if( isset(
$add_file) && $add_file !== "" ){
      
        
$body_file_name  strstr($add_file_name,"."); 
  
        if(
$body_file_name == ".php" || $body_file_name == ".html" || $body_file_name == ".cgi" || $body_file_name == ".pl"  ||
                  
$body_file_name == ".htm" || $body_file_name == ".php3" || $body_file_name == ".php4") {          
?> 
                <script language="JavaScript">
                    alert("ÀÌ Çü½ÄÀÇ ÆÄÀÏÀº ¾÷·Îµå ÇÒ ¼ö ¾ø½À´Ï´Ù."); 
                    history.back(); 
                </script>
<?                                    
          

     
        
$dir        =   "../save_dir/notice/";
       
        
$filename  $uid."-".$id."_".$add_file_name;
     
        
copy($add_file ,$dir.$filename );
        
unlink($add_file);  
    }

    if(
$filename!=''){
        
$sql "update mBoard_notice set add_file = '{$filename}' where uid = '$uid' ";
        
$result   =   mysql_query($sql);
    }
?>
<script>
 parent.location.href = 'noticeBoardMody.php?uid=<?=$row[0];?>&menu=<?=$menu?>&sub=<?=$sub?>';
</script>
<?
    
}
    
 
  if(
$mode == "edit" && $uid !== ""){

      
$sql "select * from mBoard_notice where uid = '$uid' ";
      
$res mysql_query($sql);  
      
$info mysql_fetch_array($res);
      if(
$add_file_del=='Y'){
            
$file_url 
            
unlink($path."/".$info['add_file']);
            
$sql "update mBoard_notice set add_file = '' where uid = '$uid' ";
            
$res   =   mysql_query($sql);
      }
    
      
$_content      =     addslashes($content);
       
      
$updateQry  =  " update mBoard_notice SET 
                         subject = '
$subject', content = '$_content', hit = '$hit', company = '$sitetype', temp = '$temp'
                      
                       WHERE uid = '
$uid'
                       "
;
                       
      
mysql_query($updateQry);  

   
    if( isset(
$add_file) && $add_file !== "" ){
      
        
$body_file_name  strstr($add_file_name,"."); 
  
        if(
$body_file_name == ".php" || $body_file_name == ".html" || $body_file_name == ".cgi" || $body_file_name == ".pl"  ||
                  
$body_file_name == ".htm" || $body_file_name == ".php3" || $body_file_name == ".php4") {          
?> 
                <script language="JavaScript">
                    alert("ÀÌ Çü½ÄÀÇ ÆÄÀÏÀº ¾÷·Îµå ÇÒ ¼ö ¾ø½À´Ï´Ù."); 
                    history.back(); 
                </script>
<?                                    
          

     
        
$dir        =   "../save_dir/notice/";
       
        
$filename  $uid."-".$id."_".$add_file_name;
     
        
copy($add_file ,$dir.$filename );
        
unlink($add_file);  
    }

    if(
$filename!=''){
        
$sql "update mBoard_notice set add_file = '{$filename}' where uid = '$uid' ";
        
$result   =   mysql_query($sql);
    }
     
?>
<script>
 //parent.location.href = 'noticeBoardMody.php?uid=<?=$uid;?>&menu=<?=$menu?>&sub=<?=$sub?>';
 alert("¼öÁ¤ µÇ¾ú½À´Ï´Ù.");
</script>
<?
    

    
     if(
$exCode == "alldel"){ 
       
      for (
$i 0$i count$noticeForm ); $i++) { 

      
$alldel   =  " delete from  mBoard_notice where uid = '$noticeForm[$i]' ";  
                      
MYSQL_QUERY($alldel);
              
      }
?>
<script>
 parent.location.href = 'noticeBoard.php';
</script>
<?      
               
  

?>