/home/bjcompany/domains/benjabhorn.com/public_html/benjabhorn_group/control/reserv_status_file.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
<?php  require_once("config.inc.php");?>
<?php 
include("function.inc.php");?>
<?php
            
// $link = mysql_connect($cfgServers['host'],$cfgServers['stduser'],$cfgServers['stdpass'])or die("Can't connect Server");
             //mysql_select_db($cfgServers['selectdb']) or die("Can't connect databases");
                   
$link mysql_connect($cfgServers['host'],$cfgServers['stduser'],$cfgServers['stdpass']) or  die("<script>window.location.href='error_server_busy.php'</script>");
            
mysql_select_db($cfgServers['selectdb']) or die("<script>window.location.href='error_server_busy.php'</script>");
              
//------------------------------
              
$uploadfolder="../uploadfile/";
              
$uploadfolderThb="../uploadfile/thb/";
              
$uploadfolderThbx="../uploadfile/tempx/";
              
//---------------------------------
              
if($_POST['action']=='change'){
                       if(
$_FILES['uploadfile']['name']!=""){
                                        
$tempFileName $_FILES['uploadfile']['name'];
                                        
GetNewFileName($_FILES['uploadfile']['tmp_name'],$_FILES['uploadfile']['name'],$i);
                                        
move_uploaded_file($_FILES['uploadfile']['tmp_name'], $uploadfolder.$_FILES['uploadfile']['name']);
                                
$query="UPDATE tbl_home_code SET code_desc= '".$_FILES['uploadfile']['name']."' WHERE  id= '".$_GET['CodeID']."' ";
                                
mysql_query($query);
                                @
unlink($uploadfolder.$_POST['OldFile']);
                            echo 
"<script> window.opener.location.href='main.php?work=".$_GET['work']."&MenuID=".$_GET['MenuID']."'; window.close();</script> ";
                        }
                  }
              
        
//------------------------------------------------------------------------      
       
$query="SELECT * FROM tbl_home_code WHERE id= '".$_GET['CodeID']."' ";
       
$result=mysql_query($query);
       
$data=mysql_fetch_assoc($result);

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Change Member</title>
<style>
body {
    font: .88em/150% Arial, Helvetica, sans-serif;
    margin: 0px auto;
}
h1 {
    font: bold 80%/120% Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    margin: 0 0 10px;
    color: #999;
}
h2 {
    font-size: 2.5em;
    margin: 0 0 8px;
}
h3 {
    font-size: 1.6em;
    margin: 20px 0 5px;
}
a {
    color: #69C;
    text-decoration: none;
}
a:hover {
    color: #F30;
}
p {
    margin: 0 0 10px;
}
em {
    font: italic 100% "Times New Roman", Times, serif;
}
.credits {
    border-bottom: solid 1px #eee;
    padding-bottom: 10px;
    margin: 0 0 30px;
}
#pagewrap {
    margin: 0 auto;
    position: relative;
}

/*
Back to top button 
*/
#back-top {
    position: fixed;
    bottom: 30px;
    margin-left: -150px;
}
#back-top a {
    width: 108px;
    display: block;
    text-align: center;
    font: 11px/100% Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    color: #bbb;
    /* background color transition */
    -webkit-transition: 1s;
    -moz-transition: 1s;
    /*transition: 1s;*/
}
#back-top a:hover {
    color: #000;
}
/* arrow icon (span tag) */
#back-top span {
    width: 108px;
    height: 108px;
    display: block;
    margin-bottom: 7px;
    background: #ddd url(images/up-arrow.png) no-repeat center center;
    /* rounded corners */
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    /* background color transition */
    -webkit-transition: 1s;
    -moz-transition: 1s;
    /*transition: 1s;*/
}
#back-top a:hover span {
    background-color: #777;
}
</style>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body><p>&nbsp;</p>
<form action="<?php $_SERVER['PHP_SELF']?>" method="post" name="form1" enctype="multipart/form-data">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="5" class="border">
  <tr>
    <td height="111" align="left" bgcolor="#E9E9E9"><table width="100%" border="0" cellpadding="2" cellspacing="2">
      <tr>
        <td width="35%" align="right" class="txt10-black"><span class="txt10-black">ไฟล์เก่า</span></td>
        <td width="65%" class="txt-white"><span class="txt10-black">&nbsp;
          <?php $info =  pathinfo($uploadfolder.$data['code_desc']);
                           
$info[extension]=strtolower($info[extension]); 
                           if(
$info[extension]){  ?>
             <a href="<?php echo $uploadfolder.$data['code_desc']?>">
             <img src="images/black_icon/16x16/doc_lines.png" width="16" height="16" hspace="2" border="0" align="absmiddle">download</a>
             <?php }else{ ?>no file<?php }?>
             <input type="hidden" name="OldFile" value="<?php echo $data['code_desc']?>" />
             </span></td>
        </tr>
      <tr>
        <td align="right" class="txt10-black">เปลียนไฟล์ใหม่</td>
        <td><span class="txt10-black">
          <input type="file" name="uploadfile" />
        </span></td>
        </tr>
      <tr>
        <td align="right" class="txt-white"><span class="txt10-black">
          <input type="hidden" name="action" id="action" value="change" />
        </span></td>
        <td class="txt10-black"><span class="txt10-black">
          <input type="submit" name="button" id="button" value="Change" />
        </span></td>
        </tr>
    </table></td>
  </tr>
</table>
<br /><div align="center"><a href="#" onclick="window.close()">Close</a></div>
</form>
</body>
</html>