/home/banprang/domains/plai.go.th/public_html/coremain/template/t01/body.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
<?php
// ################ Background 2 ##################
//ปรับความกว้างตามขนาดจอภาพ
//========== menu & content table ============
$step2 $_SESSION['web_width'] + 3;

if(
$_SESSION['admin_web'] == ''){
  
$sql_tleft "SELECT id_top, name, position, left_right, status, module_type FROM cms_menu_top WHERE left_right='1' and status='1' and permission != 'admin' and module_type != 'other' and `lock`='1' order by position asc";
  
$que_tleft mysql_query($sql_tleft);
  
$num_tleft mysql_num_rows($que_tleft);
  
  
$sql_tright "SELECT id_top, name, position, left_right, status, module_type FROM cms_menu_top WHERE left_right='2' and status='1' and permission != 'admin' and module_type != 'other' and `lock`='1' order by position asc";
  
$que_tright mysql_query($sql_tright);
  
$num_tright mysql_num_rows($que_tright);
  
  
$chk_tleft $num_tleft 0;
  
$chk_tright $num_tright 0;
  
$chk_tside $chk_tleft $chk_tright;
  
$width_tcenter $chk_tside == '60%' : ($chk_tside == '80%' '100%');
}else{
  
$chk_tleft 1;
  
$chk_tright 1;
  
$width_tcenter '60%';
}
?>
<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <td>
      <table width='<?= $step2 ?>' align=center border='0' cellspacing='0' cellpadding='0' bgcolor='<?= $_SESSION['bg_menu'// สี่พื้นเมนู ซ้ายและขวา ?>'>
        <tr>
          <?php if($chk_tleft == '1'){ ?>
          <td valign='top' align='center' width="20%">
            <?php
              
if($_SESSION['dbname'] == 'nversion_36'){
                include(
'coremain/left_block1.php');    //L-Block
              
}else{
                include(
'coremain/left_block.php');        //L-Block
              
}
            
?>
          </td>
          <?php ?>
          <td width='<?= $width_tcenter ?>' align='center' valign='top'>
          <?php
            
if($mod==""){
              
$mod="first_page";
              
$path="first_page";
              
$sql="SELECT count(*) FROM cms_first_page  WHERE id_first_page='1'";
              
$re=mysql_query($sql);
              
$data=mysql_fetch_array($re);
              if(
$data[0]=="0") {
                
$sql="INSERT INTO cms_first_page (id_first_page ,fulltexts ) VALUES (Null, '')";
                
mysql_query($sql);
              }
            }
            
            echo 
'<fieldset class="canvas-corner">';
              include(
'coremain/display.php');
              
$module module($mod$path);
              include(
$module);
            echo 
'</fieldset>';
            
//            if ($mod == "first_page") {
//              include('coremain/first_page.php');
//            }
          
?>
          </td>
          <?php if($chk_tright == '1'){ ?>
          <!-- //========= Right Blog =================// -->
          <td valign='top' align='center' width="20%">
            <?php
            
if ($_SESSION['dbname'] == "nversion_36"){
              include(
'coremain/right_block1.php'); //R-Block
            
}else{
              include(
'coremain/right_block.php');  //R-Block
            
}
            
?>
          </td>
          <?php ?>
        </tr>
      </table>
      
    </td>
  </tr>
</table>

<script language="JavaScript">
  
  $('.edit_manage_header').click(function(){
    var arr = $(this).attr('id').split('#@#');
    var arrData = [
      { name: 'id_top', value: arr[0] },
      { name: 'module_type', value: arr[1] }
    ];
    var dialog = 'dialog-popup';
    var popup = $('#'+dialog);
    showDialog(dialog);
    popup.dialog('option', 'title', 'จัดการเมนู');
    
    $.ajax({
      type: 'post',
      url: 'coremain/module/link/manage_header.php',
      data: arrData,
      success: function(result){
        popup.html(result);
      }
    });
  });
  
  $('.btn_addblog').click(function(){
    var val = $(this).attr('id');
    var arrData = [
      { name: 'left_right', value: val }
    ];
    var dialog = 'dialog-popup';
    var popup = $('#'+dialog);
    showDialog(dialog);
    popup.dialog('option', 'title', 'เพิ่ม Blog');
    
    $.ajax({
      type: 'post',
      url: 'coremain/header_addblog.php',
      data: arrData,
      success: function(result){
        popup.html(result);
      }
    });
  });
  
  $('.btn_addmenu').click(function(){
    var left_right = $(this).attr('id');
    var arrData = [
      { name: 'left_right', value: left_right }
    ];
    var dialog = 'dialog-popup';
    var popup = $('#'+dialog);
    showDialog(dialog);
    popup.dialog('option', 'title', 'เพิ่ม Blog');
    
    $.ajax({
      type: 'post',
      url: 'coremain/header_addmenu.php',
      data: arrData,
      success: function(result){
        popup.html(result);
      }
    });
  });
  
</script>