Server IP : 119.59.102.212 / Your IP : 18.218.54.80 Web Server : Apache/2 System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64 User : yangkam ( 1022) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/yangkam/domains/yangkam.go.th/private_html/coremain/ |
Upload File : |
<?php session_start(); include ("function_import_request.php"); echo"<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>"; echo"<link href='coremain/ccs/style.php' rel='stylesheet' type='text/css'>"; import_request_variables('pG', 'p_'); //#5.3#//if($p_folder_name!="") { $folder_name=trim($p_folder_name); } $folder_name = isset($p_folder_name) ? $p_folder_name : ''; //#5.3#//if($_SESSION[folder_name]=="") { $_SESSION[folder_name]=$folder_name; } $_SESSION['folder_name'] = $_SESSION['folder_name'] == '' ? $folder_name : $_SESSION['folder_name']; //#5.3#//if($p_add_menu!="") { $add_menu=trim($p_add_menu); } $add_menu = isset($p_add_menu) ? $p_add_menu : ''; //#5.3#//if($p_name!="") { $name=trim($p_name); } $name = isset($p_name) ? $p_name : ''; //#5.3#//if($p_namemenu!="") { $namemenu=trim($p_namemenu); } $namemenu = isset($p_namemenu) ? $p_namemenu : ''; //#5.3#//if($p_type_module!="") { $type_module=trim($p_type_module); } $type_module = isset($p_type_module) ? $p_type_module : ''; //#5.3#//if($p_left_right!="") { $left_right=trim($p_left_right); } $left_right = isset($p_left_right) ? $p_left_right : ''; //#5.3#//if($p_theme_!="") { $theme_=trim($p_theme_); } $theme_ = isset($p_theme_) ? $p_theme_ : ''; //#5.3#//if($p_id_modules!="") { $id_modules=trim($p_id_modules); } $id_modules = isset($p_id_modules) ? $p_id_modules : ''; //#5.3#//if($p_id_graph!="") { $id_graph=trim($p_id_graph); } $id_graph = isset($p_id_graph) ? $p_id_graph : ''; //#5.3#//if($id_modules=="") $id_modules=1; $id_modules = $id_modules == '' ? 1 : $id_modules; //#5.3#//if($_SESSION[themes_]=="") $_SESSION[themes_]=$theme_; $_SESSION['themes_'] = $_SESSION['themes_'] == '' ? $theme_ : $_SESSION['themes_']; include("../coremain/connec_out.php"); include("../coremain/function_msg.php"); include("function_form.php"); include("function_sql_query.php"); echo "<title>จัดการเมนูกราฟฟิค</title>"; $userfile1_name = isset($_FILES['userfile1']['name']) ? trim($_FILES['userfile1']['name']) : ''; if ($userfile1_name != "") { $strings = substr($userfile1_name, -4); if ($strings != ".gif" and $strings != ".jpg" and $strings != ".GIF" and $strings != ".JPG") { echo"<center><br>ไฟล์ที่ $numberfile ชนิดไฟล์ไม่ถูกต้อง <br>ไฟล์ต้องมีนามสกุลเป็น .gif หรือ .jpg เท่านั้น <br>และขนาดไฟล์ต้องไม่เกิน 2 Mb.<br><br>"; echo "<FORM METHOD=POST ACTION='header_addmenu.php'>"; echo"<INPUT TYPE='hidden' name='id_modules' value='$id_modules'>"; echo"<INPUT TYPE='submit' value='Back' onmouseover='this.style.cursor=hand'>"; echo"</FORM>"; exit; } } // Create_Filename if ($userfile1_name != "") { $name1 = create_filename($userfile1_name); $dlink = "../coremain/images/menu/$_SESSION[themes_]/1/" . $name1; upload_file_to_server($dlink, $_FILES['userfile1']); // CHECK ขนาดความกว้างและสูงของไฟล์เมนู list($width, $height, $type, $attr) = getimagesize("../coremain/images/menu/$_SESSION[themes_]/1/$name1"); if ($width > 190 or $width < 190) { unlink("../coremain/images/menu/$_SESSION[themes_]/1/$name1"); print "<br><br><br><center>ความกว้างของไฟล์เมนูต้องเท่ากับ 190 Pixel<br>"; echo "<FORM METHOD=POST ACTION='header_addmenu.php'>"; echo"<INPUT TYPE='hidden' name='id_modules' value='$id_modules'>"; echo"<INPUT TYPE='submit' value='Back' onmouseover='this.style.cursor=hand'>"; echo"</FORM>"; exit; } if ($height > 38 or $height < 38) { unlink("../coremain/images/menu/$_SESSION[themes_]/1/$name1"); print "<br><br><br><center>ความสูงของไฟล์เมนูต้องเท่ากับ 38 Pixel<br>"; echo "<FORM METHOD=POST ACTION='header_addmenu.php'>"; echo"<INPUT TYPE='hidden' name='id_modules' value='$id_modules'>"; echo"<INPUT TYPE='submit' value='Back' onmouseover='this.style.cursor=hand'>"; echo"</FORM>"; exit; } // Insert base $sql = "INSERT INTO `cms_graphic` (`id_graphic` ,`id_module` ,`name` ) VALUES (NULL , '$id_modules', '$name1')"; mysql_query($sql); } // Delete Graphic if ($id_graph != "" and $id_modules != "") { delete_filename("cms_graphic", "name", $id_graph, "../coremain/images/menu/$_SESSION[themes_]/1/", "id_graphic"); $s = "DELETE FROM cms_graphic WHERE id_graphic='$id_graph'"; mysql_query($s); } /* if($add_menu==1){ ?> <script language="JavaScript"> window.opener.location.href='../index.php'; window.close(); </script> <?php } */ ?> <fieldset><center> <form name="add"> <!--<FORM METHOD=POST ACTION='header_addmenu.php?id_modules=$id_modules' name='add' onSubmit='return checkadd()' enctype='multipart/form-data'>--> <table width=100% border=0 align=center cellpadding=1 cellspacing=1> <tr height='50'> <td><img src='coremain/images/marker.gif'> จัดการเมนูกราฟฟิค : </td> <td> <select name='id_modules' style='width:200' class="sl_id_modules"><!-- onchange=change_link(this.value);>--> <option value="5" <?= $id_modules == 5 ? 'selected' : '' ?>>ใส่ Code Freed RSS</option> <option value="4" <?= $id_modules == 4 ? 'selected' : '' ?>>สาส์นจากผู้บริหาร</option> <option value="3" <?= $id_modules == 3 ? 'selected' : '' ?>>ลิงค์แสดงรูปใน Blog</option> <option value="2" <?= $id_modules == 2 ? 'selected' : '' ?>>สถานที่ท่องเที่ยว / OTOP</option> <option value="1" <?= $id_modules == 1 ? 'selected' : '' ?>>เมนูย่อย</option> </select> </td> </tr> <tr> <td colspan=2> <table width=98% border=0 align=center cellpadding=1 cellspacing=1> <?php $s = "SELECT * FROM cms_graphic WHERE id_module='$id_modules' order by id_graphic"; $r = mysql_query($s); $count = 0; while ($da = mysql_fetch_array($r)) { if(file_exists('images/menu/'. $_SESSION['themes_'] .'/1/'. $da['name'])){ $mots = $count % 3; if ($mots == 0) { ?> <tr height='50'> <td width='33%'> <img src='coremain/images/menu/<?= $_SESSION['themes_'] ?>/1/<?= $da['name'] ?>'><br> <?php if ($da['id_graphic'] > 52) { ?> <a href='header_addmenu.php?id_modules=<?= $id_modules ?>&id_graph=<?= $da['id_graphic'] ?>'><img src='coremain/images/del1.gif' border=0 onclick='return goURLdel();'></a> ลบเมนู<br> <?php } ?> <br> </td> <?php } else if ($mots == 1) { ?> <td width='33%'> <img src='coremain/images/menu/<?= $_SESSION['themes_'] ?>/1/<?= $da['name'] ?>'><br> <?php if ($da['id_graphic'] > 52) { ?> <a href='header_addmenu.php?id_modules=<?= $id_modules ?>&id_graph=<?= $da['id_graphic'] ?>'><img src='coremain/images/del1.gif' border=0 onclick='return goURLdel();'></a> ลบเมนู<br> <?php } ?> <br> </td> <?php } elseif ($mots == 2) { ?> <td width='33%'> <img src='coremain/images/menu/<?= $_SESSION['themes_'] ?>/1/<?= $da['name'] ?>'><br> <?php if ($da['id_graphic'] > 52) { ?> <a href='header_addmenu.php?id_modules=<?= $id_modules ?>&id_graph=<?= $da['id_graphic'] ?>'><img src='coremain/images/del1.gif' border=0 onclick='return goURLdel();'></a> ลบเมนู<br> <?php } ?> <br> </td> </tr> <?php } $count++; } } ?> </table> </td> </tr> <tr height='80'> <td valign=center><img src='coremain/images/marker.gif'> เลือกเมนูที่เพิ่ม : </td> <td valign=center> <input name='userfile1' type='file' size=32> <br><font color='ff0000'>รูปต้องมีขนาด กว้าง 190 สูง 38 Pixel</font> </td> </tr> <tr height='10'> <td colspan=2 align='center'> <INPUT TYPE='submit' value='เพิ่มเมนูกราฟฟิค' onmouseover=this.style.cursor='hand'> <INPUT TYPE='hidden' name='add_menu' value='1'> </td> </tr> </table> </FORM> </center></fieldset> <script language="javascript"> // function checkadd() { // if(document.add.namemenu.value=="") { // alert("กรุณากรอก ชื่อ Blog !") ; // document.add.namemenu.focus() ; // return false ; // }else // return true ; // } var arr_select = { '1' : 'link', '2' : 'picture', '3' : 'sponser', '4' : 'boss_message', '5' : 'code', }; $('.sl_id_modules').change(function(){ var id_modules = $(this).val(); var arrData = [ { name: 'id_modules', value: id_modules } ]; $.ajax({ type: 'post', url: 'coremain/header_addmenu.php', data: arrData, success: function(result){ $('#dialog-popup').html(result); } }); }); function goURLdel() { var blnLink; blnLink = confirm("Click OK เพื่อยืนยันการลบข้อมูล?") if (!blnLink) { return false; } return true; } </script>