/home/bjcompany/domains/benjabhorn.com/public_html/BJconcrete/control/main.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<?php session_start();
            
date_default_timezone_set("Asia/Bangkok");
            
ini_set('allow_call_time_pass_reference',"ON");
             if(!isset(
$_SESSION['adminID'])){
                         
session_destroy();
                        
?><script language="javascript">
                                window.location.href='index.php';
                        </script> 
                        <?php 
                 
}else{ 
            
$_SESSION['language']=1;
            require_once(
"config.inc.php");
            include(
"function.inc.php");
            require_once(
"define_language.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");
            
//mysql_db_query($cfgServers['selectdb'],"SET NAMES utf8"); // ตั่งค่าให้ อ่านแบบ utf8 // ตั่งค่าให้ อ่านแบบ utf8
            //---------------------------------------------------------------------------------------------------------------------------------------------------
            
$path_product="../uploadfile/";        
            
$path_product_thb="../uploadfile/thb/";    
            
$path_product_thb2="../uploadfile/thb2/";    
            
            
//$txtEreg="http://localhost:81/";
//-----------------------------------------    
        
$monthnames2 = Array("01"=>"มกราคม","02"=>"กุมภาพันธ์","03"=>"มีนาคม","04"=>"เมษายน","05"=>"พฤษภาคม","06"=>"มิถุนายน","07"=>"กรกฏาคม","08"=>"สิงหาคม","09"=>"กันยายน","10"=>"ตุลาคม","11"=>"พฤศจิกายน","12"=>"ธันวาคม");    
        
$Range543=543;
        


?>
<!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>BJconcrete Control. {<?php echo $_SESSION['admin_name']?>}</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="ddaccordion.js">
/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({
    headerclass: "expandable", //Shared CSS class name of headers group that are expandable
    contentclass: "categoryitems", //Shared CSS class name of contents group
    revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
    mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
    defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
    onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
    animatedefault: false, //Should contents open by default be animated into view?
    persiststate: true, //persist state of opened contents within browser session?
    toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
        //do nothing
    },
    onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
        //do nothing
    }
})


</script>

<style type="text/css">

.arrowlistmenu{
width: 270px; /*width of accordion menu*/
}

.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
font: bold 14px Arial;
color: white;
background: black url(titlebar.png) repeat-x center left;
margin-bottom: 10px; /*bottom spacing between header and rest of content*/
text-transform: uppercase;
padding: 4px 0px 2px 1px; /*header text is indented 10px*/
cursor: hand;
cursor: pointer;
}

.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/
background-image: url(titlebar-active.png);
}

.arrowlistmenu ul{ /*CSS for UL of each sub menu*/
list-style-type: none;
margin: 0;
padding: 0;
margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
}

.arrowlistmenu ul li{
padding-bottom: 2px; /*bottom spacing between menu items*/
}

.arrowlistmenu ul li a{
color: #A70303;
background: url(arrowbullet.png) no-repeat center left; /*custom bullet list image*/
display: block;
padding: 2px 0;
padding-left: 19px; /*link text is indented 19px*/
text-decoration: none;
font-weight: bold;
border-bottom: 1px solid #dadada;
font-size: 12px;
}

.arrowlistmenu ul li a:visited{
color: #A70303;
}

.arrowlistmenu ul li a:hover{ /*hover state CSS*/
color: #A70303;
background-color: #F3F3F3;
}

body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
</style>
<script language="javascript">
            function windowOpener(windowHeight, windowWidth, windowName, windowUri)
            {
                    var centerWidth = (window.screen.width - windowWidth) / 2;
                    var centerHeight = (window.screen.height - windowHeight) / 2;
                    newWindow = window.open(windowUri, windowName, 'resizable=1,scrollbars=yes,width=' + windowWidth +  ',height=' + windowHeight +  ',left=' +centerWidth + ',top=' + centerHeight);
                    newWindow.focus();
                    return newWindow.name;
        }
</script>
<!--<script language="JavaScript" type="text/javascript" src="wysiwyg2.js"></script> -->
<script language="Javascript1.2"><!-- // load htmlarea
/*//_editor_url = "http://localhost/cv4/citymall/lib/htmlarea/";                     // URL to htmlarea files
_editor_url = 'htmlarea/'; 
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// -->*/</script>
<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
/*tinymce.init({
    selector: "textarea",
    theme: "modern", width: 750, height: 300,
    plugins: [
        "advlist autolink lists link image charmap print preview hr anchor pagebreak",
        "searchreplace wordcount visualblocks visualchars code fullscreen",
        "insertdatetime media nonbreaking save table contextmenu directionality",
        "emoticons  paste textcolor colorpicker textpattern"
    ],
    toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
    toolbar2: "print preview media | forecolor backcolor ",
    image_advtab: true,
   
});*/

 tinymce.init({
    selector: "textarea",
    theme: "modern", width: 750, height: 300,
    plugins: [
        "advlist autolink lists link image charmap print preview hr anchor pagebreak",
        "searchreplace wordcount visualblocks visualchars code fullscreen",
        "insertdatetime media nonbreaking save table contextmenu directionality",
        "emoticons template paste textcolor colorpicker textpattern "
    ],
    toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
    toolbar2: "print preview media | forecolor backcolor ",
    image_advtab: true,
     relative_urls: false
    
});
</script>
</script> 

</head>

<body >
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="36%"  height="60" align="left" valign="middle" style="background:url(images/bg-head.png); padding-left:50px; "><img src="../images/logo-bj-concrete.png" width="216" height="43" /></td>
    <td width="64%" align="left" valign="middle" style="background:url(images/bg-head.png); padding-left:50px; "><table width="98%" border="0" align="right">
      <tr>
        <td align="right" style="padding-bottom:5px;"><span class="txt10-black" style="padding-right:5px;"><img src="images/black_icon/16x16/contact_card.png" alt="" width="16" height="16" style="vertical-align:middle; border:none; padding-right:5px;" /><?php echo $_SESSION['admin_name']?></span>&nbsp;&nbsp;&nbsp;<a href="logout.php" ><img src="images/black_icon/16x16/on-off.png" alt="" width="16" height="16" style="vertical-align:middle; border:none; padding-right:5px;" /><span class="txt10-black">ออกจากระบบ</span></a></td>
      </tr>
    </table></td>
  </tr>
 
  <tr>
    <td colspan="2" bgcolor="#e3e3e3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="270" align="left" valign="top">
       
        <div class="arrowlistmenu">
             <!--  <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />รายงาน</h3>
        <ul class="categoryitems">
            <li><a href="main.php?work=">รายการสั่งซื้อใหม่</a></li>
            <li><a href="main.php?work=">รายการสั่งซื้อไม่ยืนยัน / ผิดพลาด</a></li> 
            <li><a href="main.php?work=">ประวัติการสั่งซื้อ</a></li>            
            <li><a href="main.php?work=memberList">รายชื่อสมาชิก</a></li>
             <li><a href="main.php?work=">รายงานประจำเดือน / ปี</a></li>  
            <li><a href="main.php?work=reportMainYear">รายงานประจำปี </a></li>     
        </ul>   
          <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />สินค้า</h3>
        <ul class="categoryitems">
             <li><a href="main.php?work=addProductCategory">หมวดผลิตภัณฑ์</a></li>
             <li><a href="main.php?work=AddProduct">เพิ่มผลิตภัณฑ์</a></li>
              <li><a href="main.php?work=productList">ดูรายละเอียด /แก้ไขข้อมูล</a></li>            
             
        </ul>   -->   
          <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />จัดการข้อมูลสินค้า</h3>
        <ul class="categoryitems">
              <li><a href="main.php?work=addProductCategory">หมวดผลิตภัณฑ์</a></li>
             <li><a href="main.php?work=AddProduct">เพิ่มผลิตภัณฑ์</a></li>
              <li><a href="main.php?work=productList">ดูรายละเอียด /แก้ไขข้อมูล</a></li>           
        </ul>  
        
             <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />ผลงาน</h3>
        <ul class="categoryitems">
      
             <li><a href="main.php?work=portfolioAdd">เพิ่มข้อมูล</a></li>
             <li><a href="main.php?work=showPortfolio">แก้ไขข้อมูล</a></li>
        </ul>    
                  
             <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />ระบบวีดีโอ</h3>
        <ul class="categoryitems">
             <li><a href="main.php?work=videoAdd">เพิ่มข้อมูล</a></li>
             <li><a href="main.php?work=videoList">แก้ไขข้อมูล</a></li>
        </ul>    
     
           <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />ข้อมูลแบนเนอร์</h3>
        <ul class="categoryitems">
         <li><a href="main.php?work=bannerAdd&type=1">เพิ่ม / แก้ไข  แบนเนอร์</a></li>
        </ul> 
             
                              
        <h3 class="menuheader expandable"><img src="images/black_icon/16x16/brackets2.png" width="16" height="16" hspace="5" align="absmiddle" />จัดการข้อมูล Administrator</h3>
        <ul class="categoryitems">
         <?php if($_SESSION['admin_type']==1){ ?>
            <li><a href="main.php?work=User">เพิ่ม Admin</a></li>
            <?php }?>
            <li><a href="main.php?work=chpass">เปลี่ยนรหัสผ่าน</a></li>
            <li><a href="logout.php">ออกจากระบบ <img src="images/black_icon/16x16/on-off.png" width="16" height="16"  style="border:none; vertical-align:middle"/></a></li>
        </ul>        
</div></td>
        <td  valign="top"><table id="Table_" width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="3">&nbsp;</td>
          </tr>
          <tr>
            <td width="10" bgcolor="#E3E3E3">&nbsp;</td>
            <td  width="727" height="550" valign="top"  bgcolor="#FFFFFF" class="copyRight"><?php 
                        
                     
switch($_GET['work']) {
                                            
//--------------PRODUCT-------------//
                            
case   'addProductCategory' :
                                include(
"addProductCategory.php");    
                                 break;    
                            case   
'addProductCategory2' :
                                include(
"addProductCategory2.php");    
                                 break;                            
                            case   
'AddProduct' :
                                include(
"product_add.php");    
                                 break;                                
                            case   
'productList' :
                                include(
"productList.php");    
                                 break;        
                            
//case   'productList' :
                            //    include("productList.php");    
                            //     break;            
                            
case   'showSubCategory' :
                                include(
"productList2.php");    
                                 break;        
                            case   
'showProduct' :
                                include(
"showProductList.php");    
                                 break;                                                                                                       
         
                        
//----------------PORTFOLIO------------                                                               
                     
                         
case   'portfolioAdd' :
                                include(
"portfolioAdd.php");    
                                 break;                                         
                         case   
'showPortfolio' :
                                include(
"showPortfolioList.php");    
                                 break;                                                                                                                                                                       
                        
//----------------videoAdd------------                                                               
                        
case   'videoAdd' :
                                include(
"videoAdd.php");    
                                 break;                                         
                        case   
'videoList' :
                                include(
"videoList.php");    
                                 break;                                     
                        
//-------------------User----------//                                
                        
case 'bannerAdd' :
                                include(
"bannert_add.php");    
                                break;
                        
//-------------------User----------//                                
                        
case 'User' :
                                include(
"user.php");    
                                break;
                        case 
'chpass':
                                include(
"chpass.php");                                                                                                                                                                                                                    
                                break;
                        case 
'UserPermission':
                                include(
"UserPermission.php");                                                                                                                                                                                                                    
                                break;            
                        case 
'adminLog':
                                include(
"adminLog.php");                                                                                                                                                                                                                    
                                break;                                        
                                break;            
                        case 
'LanguageManage':
                                include(
"LanguageManage.php");    
                                break;        
                        
//-----------------disallow-----------
                        
case 'disallow':
                                include(
"disallow.php");
                                break;        
                     }
                     
                
              
?></td>
            <td bgcolor="#E3E3E3" width="8">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table>
   </td>
  </tr>
  
  <tr>
    <td height="40" colspan="2" align="center" bgcolor="#3763A4" class="txt-8"><a href="http://www.me-fi.com" target="_blank"><font color="#FFFFFF">[system by www.me-fi.com]</font></a></td>
  </tr>
</table>
</body>
</html>
<?php mysql_close()?>
<?php 
?>