/home/banprang/domains/plai.go.th/public_html/coremain/main_ajax.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
<style>
  /* The Modal (background) */
  .modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  }

  /* Modal Content/Box */
  .modal-content {
    background-color: #fefefe;
    margin: 10px auto; /* 15% from the top and centered */
    padding: 10px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
  }
  
  .modal-md{
    width: 50%; /* Full width */
  }

  /* The Close Button */
  .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
  }

  .close:hover,
  .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }
  
  .close-center {
    color: #888;
    background: #ddd;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: bold;
  }

  .close-center:hover,
  .close-center:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }
  
  .ui-dialog{
    left: 10%;
    top: 5%;
  }
  .no-close .ui-dialog-titlebar-close {
    display: none
  }
</style>

<script language="JavaScript">
  
  function showDialog(id){
      $('#'+id).dialog({
        resizable: true,
        height: "auto",
        width: '80%',
        modal: true,
        position: 'top',
        closeOnEscape: false,
        close: function(event, ui) {
          location.reload();
        }
      });
  }
  // Get the modal
  var modal = document.getElementById("myModal");
  // Get the <span> element that closes the modal
  var span = document.getElementsByClassName("close");
  // When the user clicks on <span> (x), close the modal
  span.onclick = function() {
    modal.style.display = "none";
  };
  // When the user clicks anywhere outside of the modal, close it
  window.onclick = function(event) {
    if (event.target == modal) {
      modal.style.display = "none";
    }
  };
  function windowClose(){
    document.getElementById("myModal").style.display = "none";
  }
  
  
  //## get Text Editor to json ##//
  function getTextEditData(form){
    var arrayData = [];
    var fEle = $(form).find('textarea');
    if(fEle.length > 0){
      var row = {};
      row.name = fEle.attr('name');
      row.value = CKEDITOR.instances[fEle.attr('id')].getData();
      arrayData.push(row);
    }
    
    return arrayData;
  }

</script>