<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">

         <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDMSKOGGZK0R6RuqpTTrdj3uTu_k2LOGiM&libraries=places"></script> 
        
        <!--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')); ?>">
        
        <script src="https://cdn.jsdelivr.net/npm/sweetalert2@7.12.15/dist/sweetalert2.all.min.js"></script>  
        <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/sweetalert2@7.12.15/dist/sweetalert2.min.css'></link>
        
        <title>Meddbot</title>
    </head>
    <body>
      <style type="text/css">
        .pac-target-input{
                z-index: 10000 !important;
                /*width: auto !important;*/
                position: initial !important;
                left: 0 !important;
                right: 0 !important;
                display: block !important;
            }
            /*.pac-container:empty{
                display: none !important;
            }*/
            .pac-container { z-index: 2000 !important;  }
      </style>
       <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 " id="first" 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> Hospitals</span>
                          </a>

                        <div class="collapse show" id="collapseExample">
                           <ul class="sub-menu" >
                               <li> <a href="<?php echo e(url('/api/district_hospital/dashboard')); ?>"><i class="bi bi-dash-lg"></i> PHC / CHC</a> </li>
                               <li> <a  href="<?php echo e(url('/api/district_hospital/doctors')); ?>"><i class="bi bi-dash-lg"></i> Doctors</a> </li>
                               <li> <a href="<?php echo e(url('/api/district_hospital/medicines')); ?>"><i class="bi bi-dash-lg"></i> Medicines</a> </li>
                               <li> <a class="active" href="<?php echo e(url('/api/district_hospital/labs')); ?>"><i class="bi bi-dash-lg"></i> Labs</a> </li>
                              <!--  <li> <a href="<?php echo e(url('/api/district_hospital/lab_test_request')); ?>"><i class="bi bi-dash-lg"></i> Lab Test Request</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> -->
                           <a class=" nav-link  " id="second" data-bs-toggle="collapse" href="#collapseExample_1" role="button" aria-expanded="false" aria-controls="collapseExample">
                                <img src="<?php echo e(url('emr_assets/img/pharmacy-icon.svg')); ?>">
                              <span>Pharmacy</span>
                           </a>
                           <div class="collapse " id="collapseExample_1">
                           <ul class="sub-menu" >
                               <li> <a  href="<?php echo e(url('/api/district_hospital/pharmacy')); ?>"><i class="bi bi-dash-lg"></i>Pharmacy List</a> </li>
                               <li> <a  href="<?php echo e(url('/api/district_hospital/pharmacy_med_list')); ?>"><i class="bi bi-dash-lg"></i>Medicine Dispatch</a> </li>
                               <li> <a   href="<?php echo e(url('/api/district_hospital/pharmacy_med_list_low')); ?>"><i class="bi bi-dash-lg"></i>Stock Report</a> </li>
                               <li> <a   href="<?php echo e(url('/api/district_hospital/medicine_request_list')); ?>"><i class="bi bi-dash-lg"></i> Medicine Request List</a> </li>
                               <li> <a   href="<?php echo e(url('/api/district_hospital/others_request_list')); ?>"><i class="bi bi-dash-lg"></i> Other Request List</a> </li>
                               
                            </ul>
                        </div>
                       </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>Labs</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>abbou health[Group Buyer]</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">
                       <div class="search">
                           <!-- <input type="text" placeholder="Search A Lab" class="form-control" >
                           <button class="btn-primary search-hos" > Submit</button> -->
                       </div>
                       <div class="actions">
                           <!-- <button class="btn-primary add-new" data-bs-toggle="modal" data-bs-target="#"> Approvals</button>
                           <button class="btn-primary add-new" data-bs-toggle="modal" data-bs-target="#"> Assign</button> -->
                           <button class="btn-primary add-new" data-bs-toggle="modal" data-bs-target="#exampleModal"> Add new</button>
                       </div>
                       <!-- <div class="actions">
                           <button class="btn-primary add-new" data-bs-toggle="modal" data-bs-target="#"> Assign</button>
                       </div>
                       <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">
                       
                       <div class="row align-items-center">
                           <div class="col-lg-8">
                               <h6>Lab 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 id="example" class="table table-striped" style="width:100%">
                          <thead>
                            <tr>
                              <th scope="col">SL No</th>
                              <th scope="col">Name</th>
                              <th scope="col">Address</th>
                              <th scope="col">Contact No</th>
                              <th scope="col">Email</th>
                              <th scope="col">Certification</th>
                              <th scope="col">Working Hours</th>
                              <th 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->name); ?></a> </td>
                              <td><?php echo e($doctor->location); ?></td>
                              <td><?php echo e($doctor->contact_no); ?></td>
                              <td><?php echo e($doctor->email); ?></td>
                              <td><?php echo e($doctor->certification); ?></td>
                              <td><?php echo e($doctor->workinghours); ?></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_lab('<?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>
               <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 Labs</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-4">
                <input type="text" class="form-control custom-fields mt-3" id="name" placeholder="Name">
            </div> 
            <div class="col-lg-8">
               <input id="searchTextField" type="text"  class="form-control custom-fields mt-3" name="searchTextField" placeholder="Address">
                <!-- <input type="text" class="form-control custom-fields mt-3" id="address" placeholder="Address"> -->
            </div>
            <div class="col-lg-4">
                <select class="form-control custom-fields mt-3" id="Clinic">
                    <option value="" >Clinic Name</option>
                    <?php $__currentLoopData = $clinics; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $clinic): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                        <option value="<?php echo e($clinic->id); ?>"><?php echo e($clinic->name); ?></option>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div> 
            <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="contact_no" maxlength="10" placeholder="Contact No">
            </div>
           <!-- <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="Specialisation" placeholder="Specialisation">
            </div> -->
            
            <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="Email" placeholder="Email">
            </div> 
            <div class="col-lg-4">
                <input type="password" class="form-control custom-fields mt-3" id="Password" placeholder="Password *">
            </div> 
            <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="certification" placeholder="Certification">
            </div> 
           <div class="col-lg-4">
                <input type="text" class="form-control custom-fields mt-3" id="workinghours" placeholder="Working Hours">
            </div>

            
            
            <input type="hidden" id="cityLat" name="">
            <input type="hidden" id="cityLng" name="">
            
       </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary save-button" id="save_lab">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();
        }); 

        function initialize() {
  // var input = document.getElementById('searchTextField');
  // new google.maps.places.Autocomplete(input);

  var input = document.getElementById('searchTextField');
          var autocomplete = new google.maps.places.Autocomplete(input);
        //  swal(autocomplete);
            google.maps.event.addListener(autocomplete, 'place_changed', function () {
                var place = autocomplete.getPlace();
                // swal('sec');
                // swal(place.name);
                // swal(place.geometry.location.lat());
                // swal(place.geometry.location.lng());
                $("#cityLat").val(place.geometry.location.lat());
                $("#cityLng").val(place.geometry.location.lng());
               // document.getElementById('city2').value = place.name;
               // document.getElementById('cityLat').value = place.geometry.location.lat();
                //document.getElementById('cityLng').value = place.geometry.location.lng();
            });


}

google.maps.event.addDomListener(window, 'load', initialize);


        </script>
<script type="text/javascript">
    $("#save_lab").click(function()
    {
        var baseurl='https://www.meddbot.com/api/district_hospital/';
        //swal();
        var name=$("#name").val();
        var locattion=$("#searchTextField").val();
        var contact_no=$("#contact_no").val();
        var Email=$("#Email").val();
        var Password=$("#Password").val();
        var certification=$("#certification").val();
        var workinghours=$("#workinghours").val();
        var cityLat=$("#cityLat").val();
        var cityLng=$("#cityLng").val();
        var Clinic=$("#Clinic").val();
        if (Password.length < 6) 
        {
            swal("Your password needs a minimum of six characters");
            return false;
        }
        if (Password.search(/[a-z]/) == -1)
        {
            swal("Your password needs a lower case letter");
            return false;
        }
        if (Password.search(/[A-Z]/) == -1) 
        {
            swal("Your password needs an uppser case letter");
            return false;
        }
        if(Password.search (/[0-9]/) == -1) 
        {
            swal("Your password needs a number");
            return false;
        }
        else
        {
          var data = {

                     name      :name,
                     locattion   :locattion,
                     contact_no : contact_no,
                     Email : Email,
                     Password:Password,
                     certification : certification,
                     workinghours : workinghours,
                     cityLat : cityLat,
                     cityLng : cityLng,
                     Clinic : Clinic,
                    
                  }

             $.ajax({url:baseurl+'add_lab_save_new',
                            type:"POST",
                            data:data,
                            success: function (res) {
                                if(res!='')
                                {
                                    swal('Lab Successfully Saved!!');
                                }
                                
                                console.log(res);
                                //location.reload();
                                window.setTimeout(function(){ 
                                    location.reload();
                                } ,3000);
                            }
                        });
        }
       // swal(name);

        
    });


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

                     id      :id
                  }

             $.ajax({url:baseurl+'delete_lab_new',
                            type:"POST",
                            data:data,
                            success: function (res) {
                                if(res!='')
                                {
                                    swal('Lab Deleted!!');
                                }
                                
                                console.log(res);
                               // location.reload();
                               window.setTimeout(function(){ 
                                    location.reload();
                                } ,3000);
                                console.log(res);
                                
                            }
                        });  
          } 
          else 
          {
            
          }
    }
    $("#first").click(function()
    {
      $('#first').addClass('active');
      $('#collapseExample').addClass('show');
      $('#second').removeClass('active');
      $('#collapseExample_1').removeClass('show');
    });
    $("#second").click(function()
    {
      $('#second').addClass('active');
      $('#collapseExample_1').addClass('show');
      $('#first').removeClass('active');
      $('#collapseExample').removeClass('show');
    })
</script><?php /**PATH /home/meddbot/public_html/resources/views/district_hospital/lab_list.blade.php ENDPATH**/ ?>