Server IP : 119.59.102.212 / Your IP : 3.15.182.56 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/public_html/coremain/ |
Upload File : |
<?php //#5.3#//if($p_id_!="") { $id_=trim($p_id_); } $id_ = isset($p_id_) ? $p_id_ : ''; //#5.3#//if($p_id_del_top!="") { $id_del_top=trim($p_id_del_top); } $id_del_top = isset($p_id_del_top) ? $p_id_del_top : ''; //#5.3#//if($p_id_show!="") { $id_show=trim($p_id_show); } $id_show = isset($p_id_show) ? $p_id_show : ''; //#5.3#//if($p_tables!="") { $tables=trim($p_tables); } $tables = isset($p_tables) ? $p_tables : ''; //#5.3#//if($p_fields!="") { $fields=trim($p_fields); } $fields = isset($p_fields) ? $p_fields : ''; //#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_move_right!="") { $move_right=trim($p_move_right); } $move_right = isset($p_move_right) ? $p_move_right : ''; //#5.3#//if($p_id_order!="") { $id_order=trim($p_id_order); } $id_order = isset($p_id_order) ? $p_id_order : ''; //#5.3#//if($p_module!="") { $module=trim($p_module); } $module = isset($p_module) ? $p_module : ''; // #################### ####################### if ($id_ != "" and $id_show == 1) { $sql = "UPDATE `$tables` SET `status` = '0' WHERE `$fields` ='$id_'"; $result = mysql_query($sql); }if ($id_ != "" and $id_show == 2) { $sql = "UPDATE `$tables` SET `status` = '1' WHERE `$fields` ='$id_'"; $result = mysql_query($sql); } // ########################################## if ($id_ != "" and $id_order != "") { $sql = "SELECT * FROM `$tables` WHERE left_right='$left_right' and id_top='$id_'"; $re = mysql_query($sql); $data = mysql_fetch_array($re); if ($id_order == 1) { $up = $data['position'] - 1; } if ($id_order == 2) { $up = $data['position'] + 1; } // $sql = "UPDATE `$tables` SET position='$up' WHERE left_right='$left_right' and id_top ='$data[id_top]'"; $re = mysql_query($sql); // $sql = "UPDATE `$tables` SET position='$data[position]' WHERE left_right='$left_right' and id_top !='$data[id_top]' and position='$up'"; $re = mysql_query($sql); #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php?f=$id_" ); exit(0); } // ################### ##################### if ($id_ != "" and $move_right != "") { // if($move_right == '3'){ // set_position($tables, $id_); // // $sql_num = "SELECT MAX(position) position FROM $tables WHERE left_right = '$move_right'"; // $re_num = mysql_query($sql_num); // $data_num = mysql_fetch_array($re_num); // $posit = $data_num[0] + 1; // // // }else{ if ($move_right == "2") $move_ = 1; else if ($move_right == "1") $move_ = 2; if(isset($p_top) && $p_top == '1'){ $posit = 1; $update1 = "UPDATE `$tables` SET `left_right` = '$move_' WHERE `left_right` = '$move_right' AND `position` = '$posit'"; mysql_query($update1); $update2 = "UPDATE `$tables` SET `position` = '$posit', `left_right` = '$move_right' WHERE `id_top`='$id_'"; mysql_query($update2); }else{ set_position($tables, $id_); #$sql_num="SELECT count(*) FROM `$tables` WHERE left_right='$move_right'"; $sql_num = "SELECT MAX(position) position FROM $tables WHERE left_right = '$move_right'"; $re_num = mysql_query($sql_num); $data_num = mysql_fetch_array($re_num); $posit = $data_num[0] + 1; $update = "UPDATE `$tables` SET `position` = '$posit',`left_right` = '$move_right' WHERE `id_top`='$id_'"; // update table menu_top mysql_query($update); } // } #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php?f=$id_" ); exit(0); } //################## ################### if ($id_del_top != "" and $module == "link") { // find id_sub form id_del_top $sql = "SELECT id_sub FROM cms_menu_sub WHERE id_top='$id_del_top' order by id_sub asc"; $re = mysql_query($sql); $count_num = mysql_num_rows($re); if ($count_num > 1) { while ($data_id_sub = mysql_fetch_array($re)) { // cms_news_page $sql1 = "select id_sub,pic1,pic2,pic3,pic4,files from cms_news_page where id_sub='$data_id_sub[id_sub]'"; $result1 = mysql_query($sql1); while ($data1 = mysql_fetch_array($result1)) { if ($data1['pic1'] != "") { unlink("$_SESSION[web_name]/mainfile/$data1[1]"); } if ($data1['pic2'] != "") { unlink("$_SESSION[web_name]/mainfile/$data1[2]"); } if ($data1['pic3'] != "") { unlink("$_SESSION[web_name]/mainfile/$data1[3]"); } if ($data1['pic4'] != "") { unlink("$_SESSION[web_name]/mainfile/$data1[4]"); } if ($data1['files'] != "") { unlink("$_SESSION[web_name]/mainfile/$data1[5]"); } $sql = "delete from cms_news_page where id_sub='$data1[id_sub]'"; $result = mysql_query($sql) or die(mysql_error()); } // cms_link $sql_1 = "SELECT id_group FROM cms_link_group WHERE id_sub='$data_id_sub[id_sub]'"; $re_1 = mysql_query($sql_1); while ($data_1 = mysql_fetch_array($re_1)) { $sql_2 = "select id_link,picture from cms_link where id_group='$data_1[id_group]' order by id_link"; $re_2 = mysql_query($sql_2); while ($data_2 = mysql_fetch_array($re_2)) { if ($data_2['picture'] != "") { unlink("$_SESSION[web_name]/mainfile/$data_2[picture]"); } $sql = "DELETE FROM cms_link WHERE id_link=$data_2[id_link]"; $result = mysql_query($sql); } $sql_3 = "DELETE FROM cms_link_group WHERE id_sub='$data_id_sub[id_sub]'"; $result_3 = mysql_query($sql_3); } // cms_blog $sql_4 = "DELETE FROM `cms_blog` WHERE id_sub='$data_id_sub[id_sub]'"; $re_4 = mysql_query($sql_4) or die(mysql_error()); // cms_faq $sql = "DELETE FROM `cms_faq` WHERE id_sub='$data_id_sub[id_sub]'"; $re = mysql_query($sql) or die(mysql_error()); } // cms_menu_sub $sql = "DELETE FROM cms_menu_sub WHERE id_top='$id_del_top'"; $result = mysql_query($sql); } set_position('cms_menu_top', $id_del_top); // cms_menu_top $sql = "DELETE FROM cms_menu_top WHERE id_top='$id_del_top'"; $result = mysql_query($sql) or die(mysql_error()); #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php" ); exit(0); } //################## ################### if ($id_del_top != "" and $module == "picture") { //cms_link_picture $sql = "SELECT id_pic ,pic_name FROM cms_link_picture WHERE id_top='$id_del_top'"; $re = mysql_query($sql); while ($data = mysql_fetch_array($re)) { if ($data['pic_name'] != "") { unlink("$_SESSION[web_name]/module_picture/$data[pic_name]"); } $sql = "delete from cms_link_picture where id_pic='$data[id_pic]'"; $result = mysql_query($sql) or die(mysql_error()); } set_position('cms_menu_top', $id_del_top); // cms_menu_top $sql = "DELETE FROM cms_menu_top WHERE id_top='$id_del_top'"; $result = mysql_query($sql) or die(mysql_error()); #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php" ); exit(0); } //################## ################### if ($id_del_top != "" and $module == "sponser") { //cms_link_picture $sql = "SELECT id_sponser ,pic_name FROM cms_link_sponser WHERE id_top='$id_del_top'"; $re = mysql_query($sql); while ($data = mysql_fetch_array($re)) { if ($data[pic_name] != "") { unlink("$_SESSION[web_name]/module_sponser/$data[pic_name]"); } $sql = "delete from cms_link_sponser where id_sponser='$data[id_sponser]'"; $result = mysql_query($sql) or die(mysql_error()); } set_position('cms_menu_top', $id_del_top); // cms_menu_top $sql = "DELETE FROM cms_menu_top WHERE id_top='$id_del_top'"; $result = mysql_query($sql) or die(mysql_error()); #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php" ); exit(0); } //################## ################### if ($id_del_top != "" and $module == "boss_message") { //cms_link_picture $sql = "SELECT id_message ,picture FROM cms_boss_message WHERE id_top='$id_del_top'"; $re = mysql_query($sql); while ($data = mysql_fetch_array($re)) { if ($data[picture] != "") { unlink("$_SESSION[web_name]/module_boss_message/$data[picture]"); } $sql = "delete from cms_boss_message where id_message='$data[id_message]'"; $result = mysql_query($sql) or die(mysql_error()); } set_position('cms_menu_top', $id_del_top); // cms_menu_top $sql = "DELETE FROM cms_menu_top WHERE id_top='$id_del_top'"; $result = mysql_query($sql) or die(mysql_error()); #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php" ); exit(0); } //################## CODE ################### if ($id_del_top != "" and $module == "code") { set_position('cms_menu_top', $id_del_top); // cms_code $sql = "DELETE FROM cms_menu_top WHERE id_top='$id_del_top'"; $result = mysql_query($sql) or die(mysql_error()); $sql = "DELETE FROM cms_code WHERE id_top='$id_del_top'"; $result = mysql_query($sql) or die(mysql_error()); #echo "<meta http-equiv='refresh' content='0; url=index.php'>"; header( "location: index.php" ); exit(0); } function set_position($table, $id){ $sql = "SELECT position, left_right FROM `$table` WHERE `id_top`='$id'"; $re = mysql_query($sql); $data = mysql_fetch_array($re); $sel = "SELECT * FROM `$table` WHERE `position` > '$data[position]' AND left_right = '$data[left_right]' ORDER BY position"; $re = mysql_query($sel); while ($new = mysql_fetch_array($re)) { $position = $new['position'] - 1; $sql = "UPDATE `$table` SET `position` = '$position' WHERE `id_top` ='$new[id_top]'"; mysql_query($sql); } } ?>