
<?php
Session::get('lab_email');
$id=Session::get('lab_id');
Session::put('lab_id', $id);
$id;
?>
<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')); ?>">
        
        <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>
        .modal-body.addnew input, .modal-body.addnew select {
    border: 5;
    border-radius: 6px;
    border-bottom: 2px solid #ccc;
    color: #6c6969;
}
.loader {
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #3498db;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
  margin-left: 40%;
    display: none;
}

/* Safari */
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes  spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
</style>
      <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 class="lab">
           <div class="sidebar lab">
               <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> Lab</span>
                          </a>

                        <div class="collapse show" id="collapseExample">
                           <ul class="sub-menu" >
                              
                              <li> <a  href="https://www.meddbot.com/district_hospital/lab_appointment/<?php echo e($id); ?>"><i class="bi bi-dash-lg"></i> Appointment</a> </li>
                               <li> <a class="active" href="https://www.meddbot.com/district_hospital/lab_test_request_login/<?php echo e($id); ?>"><i class="bi bi-dash-lg"></i> My Appointments</a> </li>
                              
                               <li> <a  href="https://www.meddbot.com/district_hospital/lab_test_request_uploaded_login/<?php echo e($id); ?>"><i class="bi bi-dash-lg"></i>Test Results</a> </li>
                               <li> <a  href="https://www.meddbot.com/district_hospital/lab_test_request_uploaded_login/<?php echo e($id); ?>"><i class="bi bi-dash-lg"></i>Doctors</a> </li>
                            </ul>
                        </div>
                       </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>Lab Test Requests</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><?php echo e(Session::get('lab_name')); ?></h5>
                          
                           <div class="dropdown">
                                  <button class=" btn-secondary dropdown-toggle user-profile" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                                    <span class="" >L</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="<?php echo e(url('/logout')); ?>">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 cuss-padd mt-0">
                       <div class="main-heading">
                           <h1>Lab Result </h1>
                       </div>
                       
                       <section class="Specimen_Info">
                       <div class="row">
                           <div class="col-lg-12" id="barcode-container">
                               <div class="barcode-container">
                                   <div class="bar-details justify-content-between">
                                       <div class="barcode-features">
                                           <div class="form-group">
                                               <label>Code No :</label>
                                               <div class="form-control codeno" >5389256</div>
                                           </div>
                                       </div>
                                       <div class="barcode-features">
                                           <div class="form-group">
                                               <label>Barcode :</label>
                                               <img class="bar-img" alt="img" src="<?php echo e(url('emr_assets/img/barcode.svg')); ?>">
                                           </div>
                                       </div>
                                   </div>
                               </div>
                           </div>
                           <div class="col-lg-4">
                               <div class="form-group">
                                   <label>Patient Name:</label>
                                   <input type="text" class="form-control" value="Arjun Das" >
                               </div>
                           </div>
                           <div class="col-lg-4">
                               <div class="form-group">
                                   <label>Bill No :</label>
                                   <input type="text" class="form-control" value="523648" >
                               </div>
                           </div>
                           <div class="col-lg-4">
                               <div class="form-group">
                                   <label>Address :</label>
                                   <input type="text" class="form-control" value="ABCD  House, xyz Residence ,Trivandrum" >
                               </div>
                           </div>
                           <div class="col-lg-3">
                               <div class="form-group">
                                   <label>Doctor Name :</label>
                                   <input type="text" class="form-control" value="Dr.Sherly Mathew" >
                               </div>
                           </div>
                           <div class="col-lg-3">
                               <div class="form-group">
                                   <label>Bill Date :</label>
                                   <input type="date" class="form-control" placeholder="09/10/2024" >
                               </div>
                           </div>
                           <div class="col-lg-3">
                               <div class="form-group">
                                   <label>Sample Date:</label>
                                   <input type="date" class="form-control" placeholder="09/10/2024" >
                               </div>
                           </div>
                           <div class="col-lg-3">
                               <div class="form-group">
                                   <label>Result Date:</label>
                                   <input type="date" class="form-control" placeholder="09/10/2024" >
                               </div>
                           </div>
                           
                           
                       </div>
                       </section>
                       <section class="Specimen_Info">
                           <div class="sub-heading mb-4">
                           <h2>laboratory Tests</h2>
                       </div>
                       <div class="row">
                           <div class="col-lg-12 mb-4">
                               <div class="test-result">
                                   <ul>
                                       <li>
                                           <div class="btn-add-res">
                                               <h3>Bio-chemistry Test</h3>
                                           <button class="add-test"><i class="bi bi-plus-lg"></i> ADD</button>
                                               <div class="update-lab d-flex align-items-center d-none">
                                                   <button class="add-test view"><i class="bi bi-eye"></i> View</button>
                                                   <button class="add-test edit"><i class="bi bi-pencil-square"></i> Update</button>
                                               </div>
                                           </div>
                                           <div class="testaddcontainer  pb-5"  style="display:none;">
                                               <div class="table-responsive">
                                                   <table class="table mt-3">
                                                      <thead>
                                                        <tr>
                                                          <th scope="col">#</th>
                                                          <th scope="col">Test name</th>
                                                          <th scope="col">Results</th>
                                                          <th scope="col">Biological Ref Range</th>
                                                        </tr>
                                                      </thead>
                                                      <tbody>
                                                        <tr>
                                                          <td scope="row">1</td>
                                                          <td>FBS- Fasting Glucose</td>
                                                          <td><input type="text" class="form-control" placeholder="101" > </td>
                                                          <td><label>70-110 mg/dl</label></td>
                                                        </tr>
                                                        <tr>
                                                          <td scope="row">2</td>
                                                          <td>Creatinine</td>
                                                          <td><input type="text" class="form-control" placeholder="0.99" > </td>
                                                          <td><label>0.7-1.2 mg/dl</label></td>
                                                        </tr>
                                                        <tr>
                                                          <td scope="row">3</td>
                                                          <td>Sodium</td>
                                                          <td><input type="text" class="form-control" placeholder="134" > </td>
                                                          <td><label>135-145 mEq/L</label></td>
                                                        </tr>
                                                        <tr>
                                                          <td scope="row">4</td>
                                                          <td>Potassium</td>
                                                          <td><input type="text" class="form-control" placeholder="5.1" > </td>
                                                          <td><label>3.5-5.0 mEq/L</label></td>
                                                        </tr>
                                                          <tr>
                                                          <td scope="row">5</td>
                                                          <td>Cholestrol (Total)</td>
                                                          <td><input type="text" class="form-control" placeholder="155" > </td>
                                                          <td><label>Desirable : <200 mg/dl<br>
                                                                Borderline : 200-239 mg/dl<br>
                                                                High: Above 240 mg/dl</label>
                                                              </td>
                                                        </tr>
                                                          <tr>
                                                          <td scope="row">6</td>
                                                          <td>Cholestrol (HDL)</td>
                                                          <td><input type="text" class="form-control" placeholder="36.2" > </td>
                                                          <td><label>Male : 40-55 mg/dl<br>
                                                                Female : 45-60 mg/dl<br>
                                                                Highrisk : <40 mg/dl</label>
                                                              </td>
                                                        </tr>
                                                          <tr>
                                                          <td scope="row">7</td>
                                                          <td>Cholestrol (LDL)</td>
                                                          <td><input type="text" class="form-control" placeholder="100.7" > </td>
                                                          <td><label>Desirable : <100 mg/dl<br>
                                                                Borderline : 130-159 mg/dl<br>
                                                                High: 160-189 mg/dl</label>
                                                              </td>
                                                        </tr>
                                                      </tbody>
                                                    </table>
                                               </div>
                                               <div class="btn-container mt-3">
                                                   <button class="lab-btn-common" >Save</button>
                                               </div>
                                           </div>
                                       </li>
                                       <li>
                                           <div class="btn-add-res">
                                                <h3>CBC Test</h3>
                                                <button class="add-test"><i class="bi bi-plus-lg"></i> ADD</button>
                                           </div>
                                           
                                       </li>
                                       <li>
                                           <div class="btn-add-res">
                                                <h3>Genetic Test</h3>
                                               <button class="add-test"><i class="bi bi-plus-lg"></i> ADD</button>
                                           </div>
                                           
                                       </li>
                                   </ul>
                               </div>
                           </div>
                           <div class="col-lg-12">
                               <div class="btn-container justify-content-center">
                                   <button class="lab-btn-common" >Submit</button>
                               </div>
                           </div>
                       </div>
                       </section>
                   </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">Upload Lab Report</h1>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body addnew">
        <div class="loader"></div>
       <div class="row mb-3">
         <div class="col-lg-12" style="margin-bottom: 10px;">
            <div class="col-lg-5" style="float: left;">
                <label>Dr.Name : </label>
            </div> 
            <div class="col-lg-7">
               <label id="dr_name"></label> 
            </div>
          </div>
          <div class="col-lg-12" style="margin-bottom: 10px;">
            <div class="col-lg-5" style="float: left;">
                <label>Patient Name:</label>
            </div> 
            <div class="col-lg-7" style="float: left;">
               <label id="patient_name"></label> 
            </div>
          </div>
          <div class="col-lg-12" style="margin-bottom: 10px;">
            <div class="col-lg-5" style="float: left;">
                <label>Lab Test Name:</label>
            </div> 
            <div class="col-lg-7" style="float: left;">
               <label id="lb_tst_name"></label> 
            </div>
          </div>

          <div class="col-lg-12" style="margin-bottom: 10px;">
            <div class="col-lg-5" style="float: left;">
                <label> Upload Result:</label>
            </div> 
            <div class="col-lg-7" style="float: left;">

              <form id="image-upload-form" method="post">
                <input type="hidden" id="user_token" name="_token" value="<?php echo e(csrf_token()); ?>"> 
                 <!--  <div id="targetLayer">Image Preview</div> -->
                  <div style="float: left;">
                   
                    <input name="userImage" id="userImage" type="file" class="inputFile" />
                  </div>
                  <div style="float: left;">
                    <button type="button" class="btn btn-primary save-button"  id="upload"> Upload</button> 
                  </div>
                </form>
                </div>
          </div>
          <div class="col-lg-12" style="margin-bottom: 10px;">
            <div class="col-lg-5" style="float: left;">
                <label>Uploaded Test Name:</label>
            </div> 
            <div class="col-lg-7" style="float: left;">
               <input style="border: 2px solid #ced4da;" type="text" class="form-control" id="test_result_name">
            </div>
          </div>
            
           

            
            
            <input type="hidden" id="consult_id" >
            <input type="hidden" id="imagename">
            <input type="hidden" id="test_result_id">
            
       </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary save-button" id="save_lab_reports">Save Now</button>
      </div>
    </div>
  </div>
</div> 
    <!-- <input type="hidden" id="user_token" name="_token" value="<?php echo e(csrf_token()); ?>">  -->    
        
        
        
        
        
        
        
       <!-- 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() {
  $('#Specimen-Type').change(function() {
    if ($(this).is(':checked')) {
      $('#Specimen-Type-Container').show();
    } else {
      $('#Specimen-Type-Container').hide();
    }
  });
    $('#Specimen-Source').change(function() {
    if ($(this).is(':checked')) {
      $('#Specimen-Source-Container').show();
    } else {
      $('#Specimen-Source-Container').hide();
    }
  });     
    $('#Laboratory-tests').change(function() {
    if ($(this).is(':checked')) {
      $('#Laboratory-tests-Container').show();
    } else {
      $('#Laboratory-tests-Container').hide();
    }
  }); 
        
    $(document).ready(function() {
  $('#showBarcodeButton').click(function() {
    $('#barcode-container').show();
  });
});    
        
        
});
    
   $(document).on('click', '.add-test', function() {
    // Find the parent of the clicked button
    var parent = $(this).parent();
    
    // Find the sibling with class 'testaddcontainer' and show it
    parent.siblings('.testaddcontainer').toggle();
}); 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
       $(document).ready(function () 
        {
            $('#example').DataTable();
        }); 

    $("#upload").click(function()
    {
        var baseurl='https://www.meddbot.com/district_hospital/';
        var user_token=$("#user_token").val();
        //swal();
$(".loader").show();
        $.ajax({
              url:baseurl+'single_image_upload',
          type: "POST",
          data:  new FormData(document.getElementById("image-upload-form")),
          contentType: false,
              cache: false,
          processData: false,
          success: function(data)
            {
             // console.log(data.name);
              console.log(data);
              var result = data.slice(1);

              var imagename = result.substring(0, result.length-1);
              console.log(imagename);
              $("#imagename").val(imagename);
              $(".loader").hide();
            //$("#targetLayer").html(data);
            },
            error: function(data)
            {
              console.log("error");
                  console.log(data);
            }
         });
      });

       function upload_function(doc_name,pati_name,consult_id,id)
       {
        var baseurl='https://www.meddbot.com/district_hospital/';
        var user_token=$("#user_token").val();
        $("#consult_id").val(consult_id);
        //swal(consult_id);
        var data = {

                     id :id,
                     _token   :user_token
                  }

             $.ajax({url:baseurl+'list_lab_test',
                            type:"POST",
                            data:data,
                            success: function (res) 
                            {
                              console.log(res);
                              $("#lb_tst_name").html(res);
                              $("#test_result_name").val(res);
                              $("#test_result_id").val(id);
                            }
                          });
        //swal(consult_id);
        //swal(doc_name);
        //swal(pati_name);
        $("#patient_name").html(pati_name);
        $("#dr_name").html(doc_name);

        $("#exampleModal").modal("toggle");
       }

      


        </script>
<script type="text/javascript">
    $("#save_lab_reports").click(function()
    {
        var baseurl='https://www.meddbot.com/district_hospital/';
        var user_token=$("#user_token").val();
        //swal();
        var consult_id=$("#consult_id").val();
        var imagename=$("#imagename").val();
        var test_result_name=$("#test_result_name").val();
        var test_result_id=$("#test_result_id").val();
        

        var data = {

                     imagename      :imagename,
                     consult_id   :consult_id,
                     test_result_name:test_result_name,
                     test_result_id:test_result_id,
                     _token   :user_token
                    
                  }

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


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

                     id      :id,
                     _token   :user_token
                  }

             $.ajax({url:baseurl+'delete_lab_report',
                            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_new/add_test_result.blade.php ENDPATH**/ ?>