/home/banprang/domains/plai.go.th/public_html/coremain/module/blog/blog.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
<?php
if ($id_sub == 0) {
  
$data_name_menu_sub['name'] = "ติดต่อเรา";
}
$navig['blog'] = $data_name_menu_sub['name'];
navigator($navig);
echo 
"<br>";
bar_header($_SESSION['bar_name']); // Bar_Header
fieldset_top($_SESSION['bar_name']);

//########################## ข้อมูลทั่วไปของ อบต ###########
// cms_blog
$sql "SELECT * FROM `cms_blog` WHERE id_sub=0";
$re mysql_query($sql);
$data mysql_num_rows($re);
if (
$data == 0) {
  
$sql "INSERT INTO `cms_blog` (`id_blog`, `id_sub`, `fulltexts`) VALUES (NULL, '0', 'ประวัติ อบต.');";
  
$re mysql_query($sql);
}
// cms_menu_sub
$sql "SELECT * FROM `cms_menu_sub` WHERE id_top=0";
$re mysql_query($sql);
$data mysql_num_rows($re);
if (
$data == 0) {
  
$sql "INSERT INTO `abt`.`cms_menu_sub` (`id_sub` ,`id_top` ,`id_type` ,`name` ,`url` ,`position` ,`status`) VALUES ('0', '0', '1', 'ประวัติ อบต.', '0', '0', '0')";
  
$re mysql_query($sql);
}

//################### ติดต่อ อบต Contact_us ###########
// cms_blog
$sql "SELECT * FROM `cms_blog` WHERE id_sub=9999";
$re mysql_query($sql);
$data mysql_num_rows($re);
if (
$data == 0) {
  
$sql "INSERT INTO `cms_blog` (`id_blog`, `id_sub`, `fulltexts`) VALUES (NULL, '9999', 'ติอต่อ อบต.');";
  
$re mysql_query($sql);
}

if (
$_SESSION['admin_web'] == "admin" and id_sub_permission($id_sub) == and id_top_permission("e"))
  
button_edit("index.php?mod=blog_update&path=blog"); // Edit_Data

else if (id_sub_permission($id_sub) and $_SESSION['admin_web'] != "admin")
  
button_edit("index.php?mod=blog_update&path=blog"); // Edit_Data

else if (id_top_permission("e") and $id_sub == 0) {
  
button_edit("index.php?mod=blog_update&path=blog"); // Edit_Data
}

$sql "select * from cms_blog WHERE id_sub='$_SESSION[id_sub]'";
$result mysql_query($sql);
$data mysql_fetch_array($result);
echo
"<table width='98%' align='center'>";
echo 
"<tr>";
echo
"<td align='left'>$data[fulltexts]</td>";
echo
"</tr>";
// file1
if ($data[file1] != "") {
  echo 
"<tr>";
  echo
"<td align='center'><a href='$_SESSION[web_name]/mainfile/$data[file1]' target='blank'><img src='coremain/images/marker.gif' border=0> เอกสารประกอบ</a></td>";
  echo
"</tr>";
}
if (
$data[file2] != "") {
  echo 
"<tr>";
  echo
"<td align='center'><a href='$_SESSION[web_name]/mainfile/$data[file2]' target='blank'><img src='coremain/images/marker.gif' border=0> เอกสารประกอบ</a></td>";
  echo
"</tr>";
}
if (
$data[file3] != "") {
  echo 
"<tr>";
  echo
"<td align='center'><a href='$_SESSION[web_name]/mainfile/$data[file3]' target='blank'><img src='coremain/images/marker.gif' border=0> เอกสารประกอบ</a></td>";
  echo
"</tr>";
}
echo
"</table>";
fieldset_down();
?>