
<div class="breadcrumb">
    <h1>Log List</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>Log list</li>
    </ul>
</div>
<div class="separator-breadcrumb border-top"></div>
<form action="" method="post">
<div class="row">
    <div class="col-lg-12 col-md-12">
        <div class="card mb-5">
            <div class="card-body">
                <div class="row row-xs">
                    <div class="col-md-2  mt-3 mt-md-0">
                        <label for="log_id">Select Log</label>
                        <select class="form-control" id="log_id" name="log_id" required="true">
                            <option value="">Select Log</option>
                            <option value="1" <?php echo (isset($_REQUEST['log_id']) && $_REQUEST['log_id'] == '1') ? "selected='selected'" : ""; ?> >Appointment</option>
                            <option value="2" <?php echo (isset($_REQUEST['log_id']) && $_REQUEST['log_id'] == '2') ? "selected='selected'" : ""; ?>>Provider</option>
                            <option value="3" <?php echo (isset($_REQUEST['log_id']) && $_REQUEST['log_id'] == '3') ? "selected='selected'" : ""; ?>>Patient</option>
                            <option value="4" <?php echo (isset($_REQUEST['log_id']) && $_REQUEST['log_id'] == '4') ? "selected='selected'" : ""; ?>>Guarantor</option>
                            <option value="5" <?php echo (isset($_REQUEST['log_id']) && $_REQUEST['log_id'] == '5') ? "selected='selected'" : ""; ?>>Prescreen</option>
                            <option value="6" <?php echo (isset($_REQUEST['log_id']) && $_REQUEST['log_id'] == '6') ? "selected='selected'" : ""; ?>>Reminder</option>
                        </select>
                    </div>
                    <div class="col-md-2 mt-3 mt-md-0">
                        <label for="">&nbsp;</label>
                        <button type="submit" class="btn btn-primary btn-block">Search</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</form>

<div class="widget-body">
    <div class="portlet-body">
                        
    <?php echo (isset($successMsg) && $successMsg!='') ? "<div class='alert alert-success'><button data-dismiss='alert' class='close' type='button'>×</button>".base64_decode($successMsg)."</div>" : '' ; ?>
    <?php echo (isset($failedMsg) && $failedMsg!='') ? "<div class='alert alert-danger'><button data-dismiss='alert' class='close' type='button'>×</button>".base64_decode($failedMsg)."</div>" : '' ?>
   
    <div id="status_msg" style="display: none;"><div class="alert alert-success"><button data-dismiss='alert' class='close' type='button'>×</button>&nbsp;</div></div>
    <div id="alert_msg" style="display: none;"><div class="alert alert-danger"><button data-dismiss='alert' class='close' type='button'>×</button>&nbsp;</div></div>

    </div>
</div>

<div class="row mb-4">
    <div class="col-md-12 mb-4">
        <div class="card text-left">

            <div class="card-body">
                <div class="table-responsive">
                  <form id="listFrm" name="listFrm" action="" method="post">       
                    <input type="hidden" id="action" name="action" value="">
                    <table id="list" class="display table table-striped table-bordered" style="width:100%">
                        <thead>
                            <tr>
                                <th>Sr.No</th>
                                <th>Log Data</th>
                            </tr>
                        </thead>
                    </table>
                  </form>
                </div>
            </div>
        </div>
    </div>
</div>


<?php if(isset($_REQUEST['log_id']) && $_REQUEST['log_id']!=""){ ?>
<script type="application/javascript">
   $(document).ready(function() {

    var log_id = $("#log_id").val();

    $('#list').DataTable( {  
          //"ajax": "loglist.php?act=load&log_id="+log_id,
          "ajax": {
            "url": "loglist.php",
            "type": "POST",
            "data": {
                "act":"load",
                "log_id": log_id
                }
            },
          "processing": true,
          "serverSide": true,
          "bFilter": false,
          "bPaginate": false,
          //"bInfo": false,
          "pageLength": 25,
                "aaSorting": [],
                "aoColumnDefs": [
                    { 'bSortable': false, 'aTargets': [] }
                ],
          language: {
              "processing" : "<div class='loader-bubble loader-bubble-primary m-5'></div>",
              "sEmptyTable" :  "No records found."
          }
          
      } );
     
    });
</script>

<?php } ?>