<html>
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        
        
        <!-- Fav icon -->
        <link rel="icon" href="<?php echo e(url('emr_assets/img/favicon.png')); ?>" type="image/png" sizes="16x16"> 
        
        <!--Bootstrap icons-->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
        
       <!--  <link rel="stylesheet" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.min.css"> -->
       <link rel="stylesheet" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
        <!-- Bootstrap -->
        <!-- CSS only -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
        
         <!-- Custom CSS -->
        <link rel="stylesheet" href="<?php echo e(url('emr_assets/css/style.css')); ?>">
        <style type="text/css">
            .lbls
            {
              float: left;text-align: ;font-weight: 500;height: 45px;
            }
            .lbls_span
            {
                float: left;height: 45px;
            }
            .col-lg-1
            {
                width: 2%;
            }
        </style>
        <title>Meddbot</title>
    </head>
    <body>
      
       <main>
           <div class="sidebar">
               <div class="logo-section">
                   <img src="<?php echo e(url('emr_assets/img/logo.png')); ?>">
               </div>
               <div class="menu">
                   <ul>
                       <li>
                          <a class=" nav-link active " data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
                            <img src="<?php echo e(url('emr_assets/img/hospital-icon.svg')); ?>">
                              <span> EMR Admin</span>
                          </a>

                        <div class="collapse show" id="collapseExample">
                           <ul class="sub-menu" >
                               <li> <a  href="<?php echo e(url('/api/district_hospital/add_symptoms')); ?>"><i class="bi bi-dash-lg"></i> Symptoms</a> </li>
                               <li> <a href="<?php echo e(url('/api/district_hospital/add_diagnosis')); ?>"><i class="bi bi-dash-lg"></i> Diagnosis</a> </li>
                               <li> <a href="<?php echo e(url('/api/district_hospital/add_specialisation')); ?>"><i class="bi bi-dash-lg"></i> Specialisation</a> </li>
                               <li> <a  href="<?php echo e(url('/api/district_hospital/add_lab')); ?>"><i class="bi bi-dash-lg"></i> Labs</a> </li>
                               <li> <a href="<?php echo e(url('/api/district_hospital/add_lab_test')); ?>"><i class="bi bi-dash-lg"></i> Lab Test</a> </li>
                               <li> <a  href="<?php echo e(url('/api/district_hospital/add_med_types')); ?>"><i class="bi bi-dash-lg"></i>Medicine Types</a> </li>
                               <li> <a href="<?php echo e(url('/api/district_hospital/add_med_dosages')); ?>"><i class="bi bi-dash-lg"></i>Medicine Dosages</a> </li>
                               <li> <a class="active" href="<?php echo e(url('/api/district_hospital/add_facility')); ?>"><i class="bi bi-dash-lg"></i> Facility</a> </li>
                               <!-- <li> <a href="<?php echo e(url('/api/district_hospital/labs')); ?>"><i class="bi bi-dash-lg"></i> Labs</a> </li> -->
                            </ul>
                        </div>
                       </li>
                      <!--  <li>
                           <a href="#" class="nav-link" >
                                <img src="<?php echo e(url('emr_assets/img/notifications-icon.svg')); ?>">
                              <span>Notifications</span>
                           </a>
                       </li>
                       <li>
                           <a href="#" class="nav-link" >
                                <img src="<?php echo e(url('emr_assets/img/pharmacy-icon.svg')); ?>">
                              <span>Pharmacy</span>
                           </a>
                       </li>
                       <li>
                           <a href="#" class="nav-link" >
                                <img src="<?php echo e(url('emr_assets/img/request-icon.svg')); ?>">
                              <span>Requests</span>
                           </a>
                       </li> -->
                   </ul>
               </div>
           </div>
           <div class="content-section">
               <header>
                   <div class="header-details">
                       <button class="btn-primary togg-sidebar" ><i class="bi bi-list"></i>  </button>
                       <h4>Facility</h4>
                   </div>
                   <div class="header-itms">
                       <ul>
                           <li>
                               <a href="#"><button class="btn-settings btn header-buttons" ><i class="bi bi-gear-fill"></i></button></a>
                           </li>
                           <li>
                               <a href="#"><button class="btn-settings btn header-buttons" ><i class="bi bi-bell-fill"></i></button></a>
                           </li>
                       </ul>
                       <div class="user-section">
                           <h5>DH</h5>
                          
                           <div class="dropdown">
                                  <button class=" btn-secondary dropdown-toggle user-profile" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                                    <span class="" >A</span>
                                  </button>
                                  <ul class="dropdown-menu">
                                    <li><a class="dropdown-item" href="#">Action</a></li>
                                    <li><a class="dropdown-item" href="#">User Profile</a></li>
                                    <li><a class="dropdown-item" href="#">Logout</a></li>
                                  </ul>
                                </div>
                           
                           
                       </div>
                   </div>
               </header>
               <div class="main-section">
                   <div class="action-sec d-flex justify-content-between">
                    <!-- <form method="GET" action="<?php echo e(url('district_hospital/search_hospital')); ?>" enctype="multipart/form-data"> -->
                       <!--  <?php echo csrf_field(); ?> -->
                       <div class="search">
                        
                                <input type="text" name='add_facility' id="add_facility" placeholder="Enter Facility" class="form-control" >
                           <button class="btn-primary search-hos" id="add_facility_button"> Save</button>
                        
                           
                       </div>
                       <!-- </form> -->
                       <!-- <div class="actions">
                           <button class="btn-primary add-new" data-bs-toggle="modal" data-bs-target="#exampleModal"> Add new</button>
                       </div> -->
                   </div>
                   <div class="medd-content shadow-sm p-4 mt-4" id="list_view">
                       
                       <div class="row align-items-center">
                           <div class="col-lg-8">
                               <h6 style="margin-bottom: 25px;">Facility List</h6>
                           
                           </div>
                           <div class="col-lg-4">
                               <!-- <input type="text" style="    font-family: bootstrap-icons !important;" placeholder="&#xF52A; Search A Hospital" class="form-control rounded-5" > -->
                           </div>
                       </div>
                       
                       
                       
                       <!-- <div class="table table-responsive">
                           <table class="table mt-3 "> -->
                            <table id="example" class="table table-striped" style="width:100%">
                          <thead>
                            <tr>
                               <th style="width:10%;" scope="col">SL No</th>
                              <th style="width:20%;" scope="col">Facility</th>
                              <th style="width:15%;" scope="col">Date</th>
                              <th style="width:10%;" scope="col">Actions</th>
                            </tr>
                          </thead>
                          <tbody>
                           <?php $i=1;?>
                            <?php $__currentLoopData = $details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doctor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                        
                        
                            <tr>
                              <td><?php echo e($i); ?></td>
                              <td scope="row"><a href="#"><?php echo e($doctor->facility_name); ?></a> </td>
                        
                              <td> <?php echo e($doctor->created_at); ?></td>
                              <td>
                                  <div class="action-buttons">
                                     <!--  <button class="edit" > <span><i class="bi bi-pencil-square"></i></span>Edit</button> -->
                                      <button class="delete" onclick="delete_hospital('<?php echo e($doctor->id); ?>');"> <span><i class="bi bi-trash3"></i></span>Delete</button>
                                  </div>
                                </td>
                            </tr>
                            <?php $i++;?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              
                          </tbody>
                        </table>
                       <!-- </div> -->
                   </div>

                   <div class="medd-content shadow-sm p-4 mt-4" id="search_view" style="display:none;">
                       
                       <div class="row align-items-center">
                           <div class="col-lg-4" style="text-align:center ;margin-bottom: 40px;">
                               <h6>Hospital Details</h6>
                           
                           </div>
                           
                       </div>
                       
                       
                       
                       <div class="table table-responsive">
                           <div class="col-lg-2 lbls" >
                              Establishment Name 
                          </div>
                          <div class="col-lg-1 lbls" >: &nbsp;
                          </div>
                          <div class="col-lg-9 lbls_span">
                              <span id="name_view"></span>
                          </div>
                          <div class="col-lg-2 lbls">
                              Establishment Type 
                          </div>
                          <div class="col-lg-1 lbls" >: &nbsp;
                          </div>
                          <div class="col-lg-9 lbls_span">
                              <span id="type_view"></span>
                          </div>
                          <div class="col-lg-2 lbls">
                              Establishment Address 
                          </div>
                          <div class="col-lg-1 lbls" >: &nbsp;
                          </div>
                          <div class="col-lg-9 lbls_span">
                              <span id="address_view"></span>
                          </div>
                          
                          <div class="col-lg-2 lbls">
                              Contact Person Name 
                          </div>
                          <div class="col-lg-1 lbls" >: &nbsp;
                          </div>
                          <div class="col-lg-9 lbls_span">
                              <span id="contact_person_view"></span>
                          </div>
                          <div class="col-lg-2 lbls">
                              Contact Number 
                          </div>
                          <div class="col-lg-1 lbls" >: &nbsp;
                          </div>
                          <div class="col-lg-9 lbls_span">
                              <span id="contact_number_view"></span>
                          </div>
                          
                       </div>
                   </div>

               </div>
               <div class="footer">
                   <span>Copyright © 2022, Meddbot</span>
               </div>
           </div>
        </main>
        
        
        
        


<!-- Modal -->
<div class="modal fade" id="exampleModal" data-bs-backdrop="static" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h1 class="modal-title fs-5" id="exampleModalLabel">Add Hospitals</h1>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body addnew">
       <div class="row mb-3">
            <div class="col-lg-8">
                <input type="text" class="form-control custom-fields mt-3" id="Establishment_name" placeholder="Establishment Name *">
            </div> 
            <div class="col-lg-4">
                <select class="form-control custom-fields mt-3" id="Type">
                    <option value="">Type *</option>
                    
                                                                    
                                                                        <option value="CHC">CHC</option>
                                                                        <option value="PHC">PHC</option>
                                                                    
                </select>
            </div> 
            
           <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="Pincode" placeholder="Pincode *">
            </div>
            <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="Contact_name" placeholder="Contact Person Name *">
            </div> 
            <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="Contact_number" placeholder="Contact Number *">
            </div> 
           <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="email" placeholder="Email Id *">
            </div>
            <div class="col-lg-4">
                <input type="password" class="form-control custom-fields mt-3" id="Password" placeholder="Password *">
            </div> 
       </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary save-button" id="save_hospital">Save Now</button>
      </div>
    </div>
  </div>
</div> 
        
        
        
        
        
        
        
        
       <!-- JS Start -->

       <!-- jq script -->   
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

      <!-- bootstrap script --> 
      <!-- JavaScript Bundle with Popper -->
      <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

      <!-- fontawesome script -->   
      <script src="https://kit.fontawesome.com/c026154490.js" crossorigin="anonymous"></script>  
      <script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js" crossorigin="anonymous"></script>  
      <script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js" crossorigin="anonymous"></script> 
      <script src="<?php echo e(url('emr_assets/js/myjs.js')); ?>"></script>  
      
        
      

     
    </body>
</html>
<script>
        $(document).ready(function () 
        {
            $('#example').DataTable();
        });
        </script>
<script type="text/javascript">


    
    function delete_hospital(id)
    {
        //alert(id);
        var baseurl='https://www.meddbot.com/api/district_hospital/';
        let text = "Are you sure to delete Facility!";
          if (confirm(text) == true) 
          {
            var data = {

                     id      :id
                  }

             $.ajax({url:baseurl+'delete_facility',
                            type:"POST",
                            data:data,
                            success: function (res) {
                                if(res!='')
                                {
                                    alert('Facility Deleted!!');
                                }
                                
                                console.log(res);
                                location.reload();
                                console.log(res);
                                
                            }
                        });  
          } 
          else 
          {
            
          }
    }

    $("#add_facility_button").click(function()
    {
        
        var baseurl='https://www.meddbot.com/api/district_hospital/';
        var add_facility=$("#add_facility").val();
        //alert(add_symptoms);
        if(add_facility=='')
        {
            alert('Please Enter Facility')
        }
        else
        {
            var data = {

                     add_facility      :add_facility
                  }

             $.ajax({url:baseurl+'add_facility_save',
                            type:"POST",
                            data:data,
                            success: function (res) {
                               
                                if(res=='')
                                {
                                    alert('No Facility added !!');
                                    location.reload();
                                }
                                else
                                {
                                    alert('Facility added successfully !!');
                                    location.reload();
                                }
                                
                                
                                
                            }
                        });
        }
        
    })
</script><?php /**PATH /home/meddbot/public_html/resources/views/district_hospital/add_facility.blade.php ENDPATH**/ ?>