<?php include("../Header/Session.php"); ?>
<?php include("../Header/Connection.php"); ?>

<!DOCTYPE html>
<html lang="en">
<?php include ("../Header/head.php"); ?>
<body class="skin-default fixed-layout">

<!-- Main wrapper - style you can find in pages.scss -->
<div id="main-wrapper">    
<?php include ("../Header/header.php"); ?>
<?php include ("../Header/left_menu.php"); ?>
<?php include ("../Header/right_sidebar.php"); ?>
        
<!-- Page wrapper  -->
<div class="page-wrapper">
<!-- Container fluid  -->
<div class="container-fluid">
<!-- Bread crumb and right sidebar toggle -->
<!--?php include ("../Header/breadcumb.php"); ?-->
<br><br>
<!-- End Bread crumb and right sidebar toggle -->
<!-- Start Page Content -->
<!-- ============================================================== -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="card-title">Rank Settings</h4>
<h6 class="card-subtitle">Export data to Copy, CSV, Excel, PDF & Print</h6>
<div class="table-responsive m-t-40">
    <form method="post" action="../Controller/Database_sql.php" enctype="multipart/form-data">
    <table id="example23"
        class="display nowrap table table-hover table-striped table-bordered"
        cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Rank Level</th>
                <th>Rank Name</th>
                <!--th>Rank Product Discount (%)</th-->
                <th>Rank Comission (%)</th>
                <th>Action</th>
            </tr>
        </thead>                                      
        <tbody>
            <?php
            $id = $_GET['id']; 

            $q = "SELECT *
            FROM user_level
            Where id='$id'";
            $result = $mysqli-> query($q);
            if ($result -> num_rows > 0)
            {
	            while($record = $result -> fetch_assoc())
	            {    
					$id = $record['id'];
                    $level_number = $record['level_number'];
                    $level_name = $record['level_name'];
                    $level_percent_product_discount = $record['level_percent_product_discount']; 
                    $level_percent_commission = $record['level_percent_commission'];
            ?>
            <tr>
                <td><input type="text" class="form-control" name="level_number" value="<?php echo $level_number; ?>" required></td>
                <td><input type="text" class="form-control" name="level_name" value="<?php echo $level_name; ?>" required></td>
                <!--td><input type="number" class="form-control" name="level_percent_product_discount" value="<?php echo $level_percent_product_discount; ?>" required></td-->
                <td><input type="number" class="form-control" name="level_percent_commission" value="<?php echo $level_percent_commission; ?>" required></td>
                <td>
                    <input type="hidden" name="id" value="<?php echo $id; ?>">
                    <button name="Update_Rank_Setting" class="btn btn-success"><i class="fa fa-check"></i> Update</button>
                </td>
            </tr>
            <?php 
                }
            }
            ?>
        </tbody>
    </table>
    </form>
</div>
</div>
</div>                      
</div>
</div>
<!-- ============================================================== -->
<!-- End PAge Content -->

</div>
<!-- End Container fluid  -->
</div>
<!-- End Page wrapper  -->

<!-- Footer Start-->
<?php include ("../Footer/footer.php"); ?>
<!-- Footer End-->

</div>
<!-- End Wrapper -->
<!-- All Jquery -->
    

<!-- All Jquery Start-->
<?php include ("../Header/all_jquery.php"); ?>
<!-- All Jquery End-->

</body>

</html>