<div class="breadcrumb">
    <h1>Health Check Data</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>Health Check</li>
    </ul>
</div>
<div class="separator-breadcrumb border-top"></div>
<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>

<!-- <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">
                        <label for="search_api">Select Api</label>
                        <select class="form-control" id="search_api" name="search_api" required="true">
                            <option value="">Select Api</option>
                            <option value="1">Appointments</option>
                            <option value="2">Practice Events</option>
                            <option value="3">Appointment Status</option>
                            <option value="4">Guarantor</option>
                            <option value="5">Patient</option>
                        </select>
                    </div>

                    <div class="col-md-2" id="div_search_event" style="display: none;">
                        <label for="search_event">Select Event</label>
                        <select class="form-control" id="search_event" name="search_event">
                            <option value="">Select Event</option>
                            <option value="patients">Patients</option>
                            <option value="appointments">Appointments</option>
                            <option value="guarantors">Guarantors</option>
                        </select>
                    </div>

                    <div class="col-md-2  mt-3 mt-md-0">
                        <label for="patient_id">Patient Id</label>
                        <input type="text" class="form-control" name="patient_id" id="patient_id"/>
                    </div>
                    <div class="col-md-2">

                        <label for="clinic_id">Select clinic</label>
                        <select class="form-control" id="clinic_id" name="clinic_id" required="true">
                            <option value="">Select Client</option>
                            <?php if($allClinic && count($allClinic) > 0){ foreach($allClinic as $clinic){ ?>
                            <option value="<?php echo $clinic->clinic_id; ?>" ><?php echo $clinic->clinic_name; ?></option>
                            <?php } } ?>
                        </select>
                    </div>

                    <div class="col-md-2" id="div_serial_no" >
                      <label for="serial_no">Serial No</label>
                      <input type="text" class="form-control" id="serial_no" name="serial_no" >

                    </div>

                    <div class="col-md-2" id="div_provider">

                        <label for="Provider_id">Select Provider</label>
                        <select class="form-control" id="provider_id" name="provider_id">
                            <option value="">Select Provider</option>
                            
                        </select>
                    </div>

                    <div class="col-md-2" id="div_st_date">
                      <label for="start_date">Start Date</label>
                      <input type="date" class="form-control" id="start_date" name="start_date" >

                    </div>

                    <div class="col-md-2" id="div_end_date">
                      <label for="end_date" id="end_br_date">End Date</label>
                      <input type="date" class="form-control" id="end_date" name="end_date" >
                    </div>

                    <div class="col-md-2" id="div_interval_search" style="display: none;">
                      <br/>
                      <label for="interval_search">Interval</label>
                      <input type="text" class="form-control" id="interval_search" name="interval_search" >
                    </div>

                    <div class="col-md-2" id="div_firstname_search" style="display: none;">
                      <label for="firstname_search">Firsr Name</label>
                      <input type="text" class="form-control" id="firstname_search" name="firstname_search" >
                    </div>

                    <div class="col-md-2" id="div_lastname_search" style="display: none;">
                      <label for="lastname_search">Last Name</label>
                      <input type="text" class="form-control" id="lastname_search" name="lastname_search" >
                    </div>

                    <div class="col-md-2" id="div_email_search" style="display: none;">
                      <label for="email_search" id="email_br_search">Email</label>
                      <input type="text" class="form-control" id="email_search" name="email_search" >
                    </div>

                    <div class="col-md-2" id="div_cell_search" style="display: none;">
                      <br/>
                      <label for="cell_search">Cell</label>
                      <input type="text" class="form-control" id="cell_search" name="cell_search" >
                    </div>

                    <div class="col-md-2" id="div_guarantor_id" style="display: none;">
                      <br/>
                      <label for="guarantor_id">GuarantorId</label>
                      <input type="text" class="form-control" id="guarantor_id" name="guarantor_id" >
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0" id="searchdata_id">
                        <label for="" id="serach_br">&nbsp;</label>
                        <button type="submit" name="submit" class="btn btn-primary btn-block">Search</button>
                        
                    </div>

                    <div class="col-md-2 mt-3 mt-md-0" id="resetdata_id">
                        <label for="" id="reset_br">&nbsp;</label>
                        <button type="reset" name="reset" class="btn btn-primary btn-block" onClick="window.location.reload()">Reset</button>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
</form> -->

 <div class='loader-bubble loader-bubble-secondary m-5' align="center" style="display: none;"></div>
<div id="btnid"></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="" >       
                    <input type="hidden" id="action" name="action" value="">
                    
                    <div id="list_data" >
                    </div>
                  </form>
                </div>
            </div>
        </div>
    </div>
</div>


<script type="application/javascript">
   $(document).ready(function() {
    //event.preventDefault();
       
     function GetUrlParameter(sParam)
    {
        var sPageURL = window.location.href;
        var sURLVariables = sPageURL.split('&');
        for (var i = 0; i < sURLVariables.length; i++)
        {
            var sParameterName = sURLVariables[i].split('=');
            if (sParameterName[0] == sParam)
            {
                return sParameterName[1];
            }
        }
    }  
    var practice_office_id = GetUrlParameter('practice_office_id');
    console.log(practice_office_id);
    if(practice_office_id !== '')
    {
        $(".loader-bubble").show();
        $.ajax({
            url: "practice_healthcheck.php?act=healthcheck&practice_office_id="+practice_office_id,
            type:'POST',
            //data: postData,
            //dataType: 'json',
            success: function(output_string){
             $(".loader-bubble").hide();
             $("#list_data").html('');
             $("#list_data").append(output_string);
              
            }
        });
    }
    });  


</script>
