Server IP : 119.59.102.212 / Your IP : 3.149.249.184 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/module/muban_chart/ |
Upload File : |
<?php import_request_variables('pG', 'p_'); if($p_id_sub!="") { $id_sub=trim($p_id_sub); } if($p_id_chart!="") { $id_chart=trim($p_id_chart); } if($p_edit_profile!="") { $edit_profile=trim($p_edit_profile); } if($p_header_change!="") { $header_change=trim($p_header_change); } if($p_ed!="") { $ed=trim($p_ed); } // กรณีเข้ามาเป็นครั้งแรก if($id_sub!="" and $id_type==1){ $sql="SELECT * FROM cms_muban_profile WHERE id='$id_sub'"; $re=mysql_query($sql); $data=mysql_fetch_array($re); if($data[0]==""){ $sql="INSERT INTO `cms_muban_profile` (`id` ,`fulltexts`) VALUES ('$id_sub', 'กรอกข้อมูลพื้นฐานของหมู่บ้าน')"; $re=mysql_query($sql); } } if($id_sub!="" and $edit_profile=="1") { $sql="UPDATE `cms_muban_profile` SET `fulltexts` = '$fulltexts' WHERE `id`='$id_sub'"; $re=mysql_query($sql); } // ส่วนจัดการ สำหรับ admin เท่านั้น if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) { // เพิ่มแถวหลักใหม่ if ($_GET[add_row]) { $max_row_count = select_max_query("row_count","cms_muban_chart","id_sub",$id_sub); if($max_row_count[0]=="") $max_row_count[0] = 0; $sql = "INSERT INTO cms_muban_chart (id_sub,row_count) values ($id_sub,".$max_row_count[0].")"; query ($sql); } // แก้ไขหัว if ($_POST[btn_edit_header]) { $sql = "UPDATE cms_muban_chart SET header_text = '$header_change' WHERE id_sub=$id_sub"; query($sql); } // ซ่อน แสดงผล if($_GET[status]!=""){ $sql = "UPDATE cms_muban_chart_profile SET status = $_GET[status] WHERE id_profile = $_GET[profile]"; query ($sql); } if($_GET[delete]){ $sql="SELECT picture FROM cms_muban_chart_profile WHERE id_profile = $_GET[profile]"; $re=mysql_query($sql); $data=mysql_fetch_array($re); if($data[0]!=""){ unlink("$_SESSION[web_name]/muban_chart/$id_sub/$data[0]"); } $sql = "DELETE FROM cms_muban_chart_profile WHERE id_profile = $_GET[profile]"; query ($sql); } if($_GET[row]){ $sql = "DELETE FROM cms_muban_chart WHERE row_count = $_GET[row] and id_sub = $id_sub"; query ($sql); } } $navig['link_picture']=$data_name_menu_sub[name]; navigator($navig); echo "<br>"; bar_header("$data_name_menu_sub[name]"); // Bar_Header fieldset_top($data_name_menu_sub[name]); // header info $dat_info = select_query_object("header_text","cms_muban_chart","id_sub",$id_sub," and header_text!=''"); $header_info = $dat_info->header_text; echo "<center>"; if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1){ echo "<form name='header_form' method='post' action='index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub'>"; echo print_arr1(); echo " <b>แก้ไขส่วนหัว</b> : <input type='text' name='header_change' value='$header_info'>"; echo " <input type='submit' name='btn_edit_header' value='แก้ไข'>"; echo "</form>"; } else{ echo "<b>$header_info </b>"; } echo "</center>"; // query sturcture table $sql = "SELECT * FROM cms_muban_chart WHERE id_sub = $id_sub group by row_count"; $res = query($sql); while ($struct_table = mysql_fetch_array ($res)) { // get result column number for get table width percent $sql_count = "SELECT COUNT(*) as numcount FROM cms_muban_chart_profile as d1 inner join cms_muban_chart as d2 on (d1.id_chart = d2.id_chart and d2.id_sub = $id_sub and d1.id_chart =$struct_table[id_chart])"; $res_count = query($sql_count); $dat_count = mysql_fetch_object ($res_count); $count_col = $dat_count ->numcount; if ($count_col!=0) $width_table = 100/$count_col; else $width_table = 100; echo "<table width='98%' border='0'>"; echo "<tr>"; if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) // แยกการมองเห็น ตามสถานะ $sql = "SELECT * FROM cms_muban_chart_profile WHERE id_chart =".$struct_table["id_chart"]; else $sql = "SELECT * FROM cms_muban_chart_profile WHERE id_chart =".$struct_table["id_chart"]." and status=1"; $res_col = query($sql); if($count_col==0 and ($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1)) { echo "<td align='center' width='$width_table%'>"; print_nopic(); echo "</td>"; } while ($data_col = mysql_fetch_array ($res_col)) { echo "<td align='center' width='$width_table%'>"; if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) { echo "<br/>"; if($data_col[status]==1) box_hide("index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub&profile=$data_col[id_profile]&status=0"); else box_show("index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub&profile=$data_col[id_profile]&status=1"); box_update("index.php?mod=muban_edit_profile&path=muban_chart&id_profile=$data_col[id_profile]&id_sub=$id_sub&id_chart=$struct_table[id_chart]"); box_delete("index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub&profile=$data_col[id_profile]&delete=1","del_confirm"); echo "<br/>"; } if (file_exists($_SESSION['web_name']."/muban_chart/$id_sub/$data_col[picture]")) { echo "<a href='index.php?mod=personel_profile&path=muban_chart&id_sub=$id_sub&id_profile=$data_col[id_profile]'>"; echo "<img src='".$_SESSION['web_name']."/muban_chart/$id_sub/$data_col[picture]' border='0'>"; // show image echo "</a>"; // profile echo "<br/>"; echo "<br/><b>"; echo $data_col["name"]; echo "</b><br/><b>"; echo $data_col["position"]; echo "</b><br/>"; } else print_nopic(); echo "</td>"; } echo "</tr>"; echo "</table>"; if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) { echo "<table align='center' width='98%'>"; echo "<tr>"; echo "<td align='right'>"; echo "<a href='index.php?mod=muban_add&path=muban_chart&id_sub=$id_sub&id_chart=".$struct_table[id_chart]."'>"; print_arr_add(); echo "เพิ่มข้อมูลผู้บริหาร"; echo "</a>"; echo "<td>"; echo "</tr>"; echo "</table>"; echo "<hr/>"; } } // ส่วนปุ่มกดเพื่อเพิ่มแถว if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) { echo "<table width='98%'>"; echo "<tr>"; echo "<td align='center'>"; echo "<a href='index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub&add_row=1'>"; print_arr_add(); echo "เพิ่มแถบผู้บริหาร"; echo "</a>"; echo "</td>"; echo "</td>"; echo "</table>"; } echo "<br><br>"; //################## ข้อมูลทั่วไปของหมู่บ้าน ############# $sql="SELECT * FROM cms_muban_profile WHERE id='$id_sub'"; $re=mysql_query($sql); $data=mysql_fetch_array($re); if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) { echo"<table align='center'>"; echo "<tr bgcolor='ffcc00' height='1'>"; echo"<td><img src='coremain/images/edit.gif' border=0><a href='index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub&id_type=1&ed=1'> แก้ไขข้อมูลทั่วไปของหมู่บ้าน</a></td>"; echo"</tr>"; echo"</table>"; } if($ed==1){ if($_SESSION[admin_web]=="admin" or id_sub_permission($id_sub)==1) { echo"<form action='index.php?mod=muban_chart&path=muban_chart&id_sub=$id_sub&id_type=$id_type&edit_profile=1' method='post'>"; echo"<table width='98%' border='0' align='center' cellpadding='1' cellspacing='3'>"; text_editor("450","260",$data[fulltexts],"ข้อมูล"); // Text Editor text_button_update(); // ปุ่มแก้ไข echo"</table>"; echo"</form> "; }} if($ed!=1){ echo"<table width='98%' border='0' align='center' cellpadding='1' cellspacing='3'>"; echo "<tr>"; echo "<td>"; echo "<b>ข้อมูลทั่วไปของหมู่บ้าน</b><br>"; echo "$data[fulltexts]"; echo "</td>"; echo "</tr>"; echo"</table>"; } fieldset_down(); ?> <script language="javascript"> function del_confirm(){ return confirm("ต้องการลบบุคคลนี้ใช่หรือไม่"); } function del_row(){ return confirm("ต้องการลบแถวนี้ใช่หรือไม่ ประวัติทุกคนในแถวนี้จะถูกดำเนินการลบไปด้วย"); } </script>