<script>
  function del(iden,action){
    var dataString = "id="+iden+"&action="+action;
    var status = $("#status").val();
    var identity = $('#loading')+iden;
    var confirms = confirm("Clicking this will delete this person, are you sure you want to continue?");
    if (confirms == true) {
    $.ajax({
        type: "POST",
        url: "control.php",
        cache : false,
        data : dataString,
        beforeSend : function(){
            $('#del'+iden).hide();
            $('#loading'+iden).show();
        },
        success : function(response){
            $('#loading'+iden).hide();
            document.getElementById('inputHere').innerHTML = response;
            $('#myModal').modal('show');
            window.location.reload(1);
        }
    });
}
}


function refr(iden,action){
    var dataString = "id="+iden+"&action="+action;
    var status = $("#status").val();
    var identity = $('#loading')+iden;
    var confirms = confirm("Clicking this will refresh password, are you sure you want to continue?");
    if (confirms == true) {
    $.ajax({
        type: "POST",
        url: "control.php",
        cache : false,
        data : dataString,
        beforeSend : function(){
            $('#refr'+iden).hide();
            $('#refre'+iden).show();
        },
        success : function(response){
            $('#refre'+iden).hide();
            document.getElementById('inputHere').innerHTML = response;
            $('#myModal').modal('show');
        }
    });
}
}
</script>

                  <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3><a href="main.php">Dashboard</a>/<a href=" ">Help Desk</a></h3>
              </div>
            </div>

            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-4 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Load Chat</h2>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content" id="tabledatas" style="max-height: 100%; overflow: scroll;">
                   
                </div>

                </div>
              </div>


            <div class="col-md-8 col-sm-12 col-xs-12">
                <?php include('pages/chating.php'); ?>
              </div> 


            </div>
          </div>
        </div>
        <!-- /page content -->



<div class="modal fade" id="myModal2" role="dialog">
    <div class="modal-dialog modal-sm">
      <div class="modal-content">
        <div class="modal-body text-center">
        <?php  
        if (isset($mess)) {
        echo "$mess";
        }
        ?>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button>
        </div>
      </div>
    </div>
  </div>

<?php
if(isset($mess)){
?>
<script type="text/javascript">
   $(window).load(function(){
   $('#myModal2').modal('show');
   }); 
</script>
<?php
  }
?>

<script type="text/javascript">
  
  window.onload = getTime



        function getTime()
        {


            t=setTimeout(function(){getTime()},2000);
            var action = "findtab";
            var dataString = "action="+action;
            $.ajax({
                type: "POST",
                url: "control.php",
                cache : false,
                data : dataString,
                success : function(response){
                 document.getElementById('tabledatas').innerHTML = response;
                }
            });

            var action = "ache";
            var dataString = "action="+action;
            $.ajax({
                type: "POST",
                url: "control.php",
                cache : false,
                data : dataString,
                success : function(response){
                 document.getElementById('acheck').innerHTML = response;
                }
            });

        }
</script>