/home/banprang/domains/plai.go.th/public_html/coremain/module/link/change_menu.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
<?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.css' rel='stylesheet' type='text/css'>";
echo 
"<title>จัดการเมนู</title>";
import_request_variables('pG''p_');
//#5.3#//if($p_name_menu!="")        {       $name_menu=trim($p_name_menu);    }
$name_menu = isset($p_name_menu) ? $p_name_menu '';
//#5.3#//if($p_id_top!="")                {         $id_top=trim($p_id_top);                        }
$id_top = isset($p_id_top) ? $p_id_top '';
$module_type = isset($p_module_type) ? $p_module_type '';
$where_module '';
if(
$module_type != ''){
  
$get_module "select * from cms_main_module where type_module = '$module_type'";
  
$que_module mysql_query($get_module);
  if(
$que_module){
    
$obj_module mysql_fetch_assoc($que_module);
    
$id_module $obj_module['id_module'];
    
$where_module " where id_module = '$id_module' ";
  }
}

//if($_SESSION['themes_']=="") $_SESSION['themes_'] = $theme_;
include("../../../coremain/connec_out.php");
?>

<fieldset>
  <center>
    <b>เลือกรูปเมนู</b>
    <button type="button" class="ui-button ui-widget ui-corner-all previous-page" style="text-align: center"> กลับ</button>
    <br><br>
  </center>
  
<form id="fm_change_menu">
<!--<form action='manage_header.php?id_top=<?//= $id_top ?>' method='post' >-->
  <table align=center>
<?php
    
/*$s="SELECT * FROM cms_graphic $where_module 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='65'>
      <td width='33%'>
        <img src='coremain/images/menu/<?= $_SESSION['themes_'] ?>/1/<?= $da['name'] ?>'>
        <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        <input name='change_theme' type='radio' value='<?= $da['name'] ?>'>
      </td>
<?php }else if($mots==1){ ?>
      <td width='33%'>
        <img src='coremain/images/menu/<?= $_SESSION['themes_'] ?>/1/<?= $da['name'] ?>'>
        <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        <input name='change_theme' type='radio' value='<?= $da['name'] ?>'>
      </td>
<?php }else if($mots==2){ ?>
      <td width='33%'>
        <img src='coremain/images/menu/<?= $_SESSION['themes_'] ?>/1/<?= $da['name'] ?>'>
        <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        <input name='change_theme' type='radio' value='<?= $da['name'] ?>'>
      </td>
    </tr>
<?php }
      $count++;
      }
    }*/
?>
    <tr>
      <td>ชื่อเมนู</td>
      <td colspan="2"><input type="text" name="change_theme" size="30" value="<?= $name_menu ?>" /></td>
    </tr>
    <tr height='20'>
      <td colspan=3 align='center'>
        <!--<INPUT TYPE='submit' value='เปลี่ยนเมนู' onmouseover=this.style.cursor='hand'>-->
        <button type="button" class="ui-button ui-widget ui-corner-all" id="btn_change_theme">เปลี่ยนเมนู</button>
      </td>
    </tr>
  </table>
</form>

<script>
  var arrData = [
          { name: 'id_top', value: '<?= $id_top ?>' },
          { name: 'module_type', value: '<?= $module_type ?>' }
      ];
  
  $('#btn_change_theme')
          .button()
          .click(function(){
//            var change_theme = $('input[name=change_theme]:checked').val();
            var change_theme = $('input[name=change_theme]').val();
            if(change_theme !== undefined){
              arrData.push({ name: 'change_theme', value: change_theme });
            }
    
            $('#dialog-popup').parent().removeClass('no-close');
            manage_header(arrData);
  });
  
  $('.previous-page')
        .button()
        .click(function(){
          $('#dialog-popup').parent().removeClass('no-close');
          manage_header(arrData);
        });
  
  function manage_header(arrData){
    $.ajax({
      type: 'post',
      url: 'coremain/module/link/manage_header.php',
      data: arrData,
      success: function(result){
        $('#dialog-popup').html(result);
      }
    });
  }
  
</script>