<?php 
if(!isset($_SESSION)) { 
  session_start(); 
  include('../includes/dbcon.php');
}
if(empty($_SESSION['hrm_id'])):
header('Location:../index.php');
endif;




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


<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>SalesHub | Supplier Management </title>
  <!-- plugins:css -->
  <?php include('../includes/commonheader.php');?>

</head>
<body>
 <?php include('../includes/header.php');?>
 <?php include('../includes/leftsidebar.php');?>
           <!-- partial -->
 <div class="main-panel">        
        <div class="content-wrapper">      
             
         <div class="col-12 grid-margin">
              <div class="card">
                <div class="card-body">
<div class="table-responsive">
                    <table id="order-listing" class="table">
                       <thead>
  <tr class="bg-primary text-white">
   
    <th width="8%">#</th>
    <th width="10%">Supplier Name</th>
    <th width="10%">Address</th>
    <th width="10%">Telephone</th>
    <th width="10%">Email</th> 
    <th width="10%">City</th> 
    <th width="10%">Note</th>      
    <th width="25%">Actions</th>   

   
    </tr>
  </thead>
<tbody>
<?php
$rcount=0;

//echo$tt;

$sql="SELECT * from supplier_master"  ;

$query=mysqli_query($con,$sql)or die(mysqli_error()); 

              while($row=mysqli_fetch_array($query)){   $rcount=$rcount+1;
                $sup_name=$row['sup_name']; 
                $address=$row['address']; 
                $telephone=$row['telephone']; 
                $email=$row['email'];
                $city=$row['city'];
                $notes=$row['notes'];
                $sup_id=$row['sup_id']; 
               
              ?>   

               <tr>       
            <td> <?php echo $rcount;   ?></td>
            <td> <?php echo $sup_name;   ?></td>
             <td> <?php echo $address;   ?></td>
            <td> <?php echo $telephone;   ?></td>
            <td><?php echo $email; ?></td>
           <td> <?php echo $city;   ?></td>
            <td><?php echo $notes; ?></td>
           


<td>
              <form method="post" action="#" enctype="multipart/form-data">
                  
                  <input type="hidden" class="form-control pull-right" id="tid" name="tid"  value=" <?php echo $sup_id; ?>">   
                   <input type="hidden" name="fname" id="fname" class="form-control todo-list-input" placeholder="Add To-do" value="<?php echo basename($_SERVER['PHP_SELF']);  ?>">
                    <input type="hidden" class="form-control" id="s1_remarks" name="s1_remarks" placeholder="Remarks">

                      

                       <button type="button" class="btn btn-outline-info btn-rounded btn-icon"  data-toggle="modal" data-target="#addvoucher_edit<?php echo $row['sup_id'];?>">
                          <i class="fa fa-edit"></i>
                        </button>

                      
              </form>
              </td> 

<!----------------------End of modal------------------------->

                    
            

         
             </tr>
                
                    <?php }  ?>
                    </tbody>
                    </table>
                  </div>
 </div> </div> </div>

        </div>  <!----- <div class="content-wrapper">------>
  </div>

 </div><!-----End of main panel--~~~~~~~~~~~~~~~~~~~~~~~--------------->
 </div><!-----Dont Delete this DIV--~~~~~~~~~~~~~~~~~~~~~~~--------------->
  <!-- container-scroller -->
<?php include('../includes/footer.php');?>
<?php include('../includes/commonjs.php');?>
 
</body>


</html>

<script>
    $( document ).ready(function() {
         // alert("Please Select Order Type");

    });



</script>

 <!-- End custom js for this page-->
  <script>
  $(function () {
    //Initialize Select2 Elements
    $('.select2').select2()

    //Initialize Select2 Elements
    $('.select2bs4').select2({
      theme: 'bootstrap4'
    })
  })

</script>



