<script type="text/javascript">

function delete_entry(){
  swal({
        title: 'Are you sure?',
        text: "Are you sure you would like to delete this clinic. If you confirm, all the patient, guarantor, provider and appointment data will be permanently deleted. This operation can not be undone.",
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#0CC27E',
        cancelButtonColor: '#FF586B',
        confirmButtonText: 'CONFIRM',
        cancelButtonText: 'CANCEL',
        confirmButtonClass: 'btn btn-success mr-5',
        cancelButtonClass: 'btn btn-danger',
        buttonsStyling: false
    }).then(function () {
        $.ajax({
            type: 'post',
            url: 'practice_reactive.php?act=submitValue',
            data: $('#frmactive').serialize(),
            success: function () {
                $("#showmsgdata").html('Process is going on');
                $.toast({
                    //heading: 'Positioning',
                    heading: '</em>',
                    text: "Update successfully.Process will start within few minutes.",
                    position: 'top-right',
                    stack: false,
                    showHideTransition: 'slide',
                    icon: 'success'
                });
                checkData();
            }
        });
    }, function (dismiss) {
      return false; 
    });
}
$(document).ready(function(){
setInterval(checkData,30000);
});
function checkData(){
    $.ajax({
        type: 'GET',
        url: 'practice_reactive.php?check=checkProgress&id=<?php echo $_GET['id']?>',
        success: function (res) {
            $("#logdata").html(res);
        }   
    });    
}
</script>
<div class="breadcrumb">
    <h1>Reactive Practice</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>Delete Practice / Clinic data for re active clinic.</li>
    </ul>
</div>
<div class="separator-breadcrumb border-top"></div>
<?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 class="row">
    <div class="col-md-12">
        <div class="card mb-4">
            <div class="card-body">
                <form action="" id="frmactive" name="frmactive" method="post" enctype="multipart/form-data">
                    <div class="row">
                        <h5><?php echo $practiceDetails->practice_name; ?></h5>
                    </div>
                    <div class="row">
                        <input type="hidden" name="hdn_practice_id" id="hdn_practice_id" value="<?php echo $_GET['id']; ?>">
                        <!-- <div class="col-md-2  mt-3 mt-md-0" id="div_clinic_id">
                            <label for="practice_reactivation_delete">Is Delete</label>
                            <select class="form-control" id="practice_reactivation_delete" name="practice_reactivation_delete">
                                <option value="0" <?php echo $practiceDetails->practice_reactivation_delete==0?"selected='selected'":"" ?>>0</option>
                                <option value="1" <?php echo $practiceDetails->practice_reactivation_delete==1?"selected='selected'":"" ?>>1</option>
                            </select>
                        </div> -->
                        <input type="hidden" name="practice_reactivation_delete" id="practice_reactivation_delete" value="1">
                        <br/>
                        <div class="col-md-12">
                            <button class="btn btn-primary" id="
                            " name="submit" type="button" onclick="delete_entry();">Delete Practice</button>
                        </div>
                        <div class="col-md-12" id="showmsgdata" align="center"></div>
                        <div class="col-md-12" id="logdata" align="center"></div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<link rel="stylesheet" href="./assets/styles/css/jquery.toast.css">
<script src="./assets/js/jquery.toast.js"></script>