<?php  
//include 'import.php';


  
?>



<!DOCTYPE html>
<html lang="en">

    
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Convert excel to JSON Object</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.16.2/xlsx.full.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    
 <script type="text/javascript">
     
     $(document).ready(function(){
  $("#btn_import_file").click(function(){
    

        
     let idd=  document.getElementById("jsondata").innerHTML  ;


    
    
    $.ajax({
        url: 'import.php',
        type: 'POST',
        data: {id:idd},
        success: function(data) {
           // alert(data);
            document.getElementById("get_data").innerHTML=data;
            
            console.log(data); // Inspect this in your console
        }
    });






    
 });
});



      
      
</script>


</head>



<body>
    
    
    
    
  

  
    <div class="conatiner mt-5" >
        <div class="row">
            <div class="col-md-3"></div>
            <div class="col-md-3">
                <input class="form-control" type="file" id="input" accept=".xls,.xlsx"  >
            </div>
            <div class="col-md-2">
                <button class="btn btn-primary" id="button">Convert</button>
            </div>
            
              <div>
                  <button class="btn btn-primary" id="btn_import_file" name="btn_import_file" >Import Data</button>
                <pre id="get_data"> Data </pre>
              
        
    </div>
            
            
<div class="col-md-12">
    <pre id="jsondata"></pre>
</div>
        </div>
    </div>
    
<script src="excel.js"></script>





</body>






</html>