<?php include '../../conn.php'?>
<?php include '../pages/header.php'?>
<?php include '../pages/navbar.php'?>

<!--//////////////////////////////doctorServices fetch array///////////////-->
 <?php
           
    $doctorServicessql="select * from veterinarySpecialties order by id desc";
    $doctorServicesresult = mysqli_query($con,$doctorServicessql);
    $doctorServicessarry=array(); 
    while($doctorServicesrow = mysqli_fetch_array($doctorServicesresult)){
        $doctorServicesarry[]=$doctorServicesrow;
    }
             
 ?>
<!--//////////////////////////////doctorServices fetch array///////////////-->
<!-- ///////////////////delete  up funcation////////////////// -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
  function deletedoctorServices(param1){

  $.ajax({
   url: "api/delete.php",
   type: "POST",
   data: "id=" + param1 ,

   success: function(data)
      {
    // alert(data);
    if(data == 101)
    {
      location.reload(true);
    }
    
    else{
      alert(data);
    }
      }
      ,
     error: function(e) 
      {
   $("#successmessage").html("Some thing went  worng").fadeIn().style.color.red;
      }          
    });
}
</script>
<!-- //////////////////delete   funcation//////////////////////////// -->
<div class="content-wrapper">

<div class="container-fluid">

<div class="row">
<div class="col-sm-12 p-0">
<div class="main-header">
<h4>Veterinary SpecialtiesTable</h4>
<ol class="breadcrumb breadcrumb-title breadcrumb-arrow">
<li class="breadcrumb-item">
<a href="#">
<i class="icofont icofont-home"></i>
</a>
</li>
<li class="breadcrumb-item"><a href="#">Veterinary Specialties Table</a></li>
</ol>
</div>
</div>
</div>


<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">

<a href="add.php">
    <button type="button" class="btn btn-primary waves-effect waves-light add"> </i> Add Veterinary Specialties
</button>
</a>
</div>
<div class="card-block">
<table id="advanced-table" class="table dt-responsive table-striped table-bordered nowrap">
<thead>
<tr>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<?php foreach($doctorServicesarry as $data){ ?>    
<tr>

<td><?php echo $data['name'];?></td>
<td>
                                        <div class="tabledit-toolbar btn-toolbar" style="text-align: left;">
                                           <div class="btn-group btn-group-sm" style="float: none;">
                                          <a href="edit.php?id=<?php echo $data['id'];?>"><button type="button" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;margin: 5px;"><span class="icofont icofont-ui-edit"></span></button></a> 
                                         <a><button type="button"  onclick="deletedoctorServices(<?php echo $data['id'];?>)" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;margin: 5px;"><span class="icofont icofont-ui-delete"></span></button></div></a>
                                          
                                        </div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

</div>
</div>




<?php include '../pages/footer.php'?>

