/home/banprang/domains/plai.go.th/public_html/coremain/module/text_running/text_running.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
if($_SESSION['admin_web']!="admin")    {    
    
permission_fail();
}
// Status Package Module
$status_module=select_query("status_module","cms_status_module","id","33");
if(
$status_module[0]!=1)    {    
    
fieldset_no_module();
}
$navig['text_running']="จัดการ Text Running";
navigator($navig);
echo 
"<br>";
bar_header("จัดการ Text Running"); // Bar_Header
fieldset_top("จัดการ Text Running");
import_request_variables('pG''p_');

//if($p_hiddata!="")                            {  $hiddata=trim($p_hiddata);                                            }
//$num = "'";
//$hiddata = ereg_replace('"', $num, $hiddata);

// Update
//if ($hiddata != "") {
if(isset($p_modes) && $p_hidden_var == '1'){
  
$hiddata $p_evar;
  
$sql "UPDATE cms_text_running SET texts ='$hiddata' WHERE id='1'";
  
$result mysql_query($sql);
  
  echo 
"<meta http-equiv='refresh' content='0; url=index.php?mod=text_running&path=text_running'>";
}

// SLEECT
$sqluser "select * from cms_text_running  where id='1'";
$resultuser mysql_query($sqluser);
$datauser mysql_fetch_array($resultuser);

// ภาษาไทย
$data_id 'abc';
$hidden_var_id 'hiddata';
?>

<form  action="index.php?mod=text_running&path=text_running" method="post">
  <table width='98%' border='0' cellspacing='0' align='center' height='20'>
    <div id="text_running"></div>
    <tr id="show_span">
      <td colspan="2" align=center>
        <span id="abc" ><?php echo $datauser['texts'?></span>
        <br/>
<!--        <input type="hidden" id="data_id" value="<?php echo $data_id ?>" />
        <input type="hidden" id="hidden_var_id" value="<?php echo $hidden_var_id ?>" />-->
        <a href="javascript:void(0);" id="edit_text_running"><img src="coremain/images/edit.gif" border="0" title="แก้ไขข้อมูล" /> แก้ไขข้อมูล</a>
        <!--<span onclick="OpenMidWin('coremain/core_editor.php?data_id=$data_id&hidden_var_id=$hidden_var_id', 'edit_window', '580','400');"><img src='coremain/images/edit.gif' border='0' title='แก้ไขข้อมูล' onmouseover=this.style.cursor='hand'> แก้ไขข้อมูล</span>-->
      </td>
    </tr>
    
    <?php //button_text('แก้ไขข้อมูล', 'modes', 4); ?>
<!--    <tr>
      <td colspan='4'>
        <center><br>
          <input id="hiddata" type="hidden" name ="hiddata" value="<?php //echo $datauser['text_th'] ?>">
          <input id="hiddata1" type="hidden" name ="hiddata1" value="<?php //echo $datauser['text_eng'] ?>">
          <input type="submit" name ="modes" value="แก้ไขข้อมูล" onmouseover=this.style.cursor='hand'>
        </center>
      </td>
    </tr>-->
    <input type="hidden" id="hidden_var" name="hidden_var" value="0" />
  </table>
</form>

<?php
fieldset_down
();
?>

<script language="JavaScript" type="text/javascript">
  
  $('#edit_text_running').click(function(){
    var arrData = [
      { name: 'fn_name', value: 'text_editor' },
      { name: 'arguments', value: ['500', '349', 'แก้ไข Text Running', '2', 'abc'] }
    ];
    $.ajax({
      type: 'post',
      url: 'coremain/module/text_running/text_editor.php',
      data: arrData,
      success: function(result){
        $('#show_span').css('display', 'none');
        $('#text_running').html(result);
      }
    });
  });
  
//  $('#edit_text_running').click(function(){
//    var txt_id = $('#data_id').val();
//    var arrData = [
//      { name: 'data_id', value: txt_id },
//      { name: 'hidden_var_id', value: $('#hidden_var_id').val() },
////      { name: 'text_running', value: $('#'+txt_id).text() }
//    ];
//    var dialog = 'dialog-popup';
//    var popup = $('#'+dialog);
//    showDialog(dialog);
//    popup.dialog('option', 'title', 'แก้ไขข้อมูล');
//    
//    $.ajax({
//      type: 'post',
//      url: 'coremain/core_editor.php',
//      data: arrData,
//      success: function(result){
//        popup.html(result);
//      }
//    });
//  });

//  function OpenMidWin(url, name,width,height) {
//    var left = parseInt( (screen.availWidth/2) - (width/2));
//    var top = parseInt( (screen.availHeight/2) - (height/2));
//    var windowFeatures ="width=" + width + ",height=" + height + ",alwaysRaised=yes,menubar=yes,titlebar=yes, toolbar=yes, scrollbars=yes, status=yes, resizable, left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top;
//    myWindow = window.open(url, name, windowFeatures).focus();
//  }

</script>