<?php

include 'load.php';

?>

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

<head>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Your Comission Rates | Recharge and Billing System | ORMS | Dashbaord</title>
	
	<?php
	require_once 'headercss.php';
	?>

</head>

<body>

        <!--**********************************
        Main wrapper start
    ***********************************-->
    <div id="main-wrapper">
	
<?php
require_once 'header.php';
?>

        <!--**********************************
            Sidebar start
        ***********************************-->
        <div class="deznav">
            <div class="deznav-scroll">
<?php

require_once 'sidebarmenu.php';

?>
            </div>
        </div>
        <!--**********************************
            Sidebar end
        ***********************************-->
		
        <!--**********************************
            Content body start
        ***********************************-->
        <div class="content-body">
            <!-- row -->
            <div class="container-fluid">
				<div class="row">
				<div class="col-xl-12 col-xxl-12 col-sm-12">
				<div class="alert alert-danger bg-danger text-white" role="alert">
				<strong>Alert!</strong> ඔබගේ ගිනුම තහවුරු කිරීම අසම්පුර්නයි.<a href="identity_verify.php" class="btn btn-success float-right" style="padding: 0px 3px;">සම්පුර්න කරන්න</a>
				</div>
				</div>
				</div>    
                <div class="row page-titles mx-0">
                    <div class="col-sm-6 p-md-0">
                        <div class="welcome-text">
                            <h4>Your Comission Rates</h4>
                        </div>
                    </div>
                    <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="index.php">Home</a></li>
                            <li class="breadcrumb-item active"><a href="javascript:void(0);">Your Comission Rates</a></li>
                        </ol>
                    </div>
                </div>
				
				<div class="row">
<div class="col-lg-12">
<div class="row tab-content">
<div id="list-view" class="tab-pane fade active show col-lg-12">
    <div class="card">
        <div class="card-body">
           <div class="card-body pl-4 pr-4 pb-4">
          <div class="form-group form-row">
			  <?php $lqury1=mysqli_query($conn,"SELECT * FROM pkgs WHERE pkgcount='".$sellerpackage."'");
					$lresalt1=mysqli_fetch_array($lqury1); ?>
            <h2 class="col-md-12" style="text-align:center;">Package Name: <?php echo $lresalt1['name'];?></h2>
          </div>
          <hr>
          <h4 class="text-center mb-3">Providers List</h4>
		  <hr>

          <div class="form-row">
		 
		  <div class="table-responsive">
		   <?php
			
$count = 0;
$list_qury=mysqli_query($conn,"SELECT * FROM ormscategory ORDER BY cid ASC");

while($list_resalt=mysqli_fetch_array($list_qury)){

// $count++;

?>
		  <h4 class="text-center mb-3">------------<?php echo $list_resalt['catename']; ?>------------</h4>
                <table id="example1" class="table table-bordered">
                    <thead>
                        <tr>
                            <th>COVERAGE</th> 
							<th>TYPE</th>
                            <th>RATE</th>
                        </tr>
                    </thead>
                    <tbody>
<?php

// $count2=0;
$list_qury2=mysqli_query($conn,"SELECT * FROM ormsservices where category='".$list_resalt['cid']."' ORDER BY sid ASC");
while($list_resalt2=mysqli_fetch_array($list_qury2)){
$count++;

$lqury=mysqli_query($conn,"SELECT * FROM pkgs WHERE pkgcount='".$sellerpackage."' and sid='$count'");
$lresalt=mysqli_fetch_array($lqury);
	
?>

                        <tr>
							<td><p><strong><?php echo $list_resalt2['sname']; ?></strong></p></td>
                            <td><p><strong>
							<?php

							$id = $list_resalt2['provider'];

							$query = $DB_con->prepare('SELECT pname FROM ormsproviders WHERE pid='.$id);

							$query->execute();

							$result = $query->fetch();

							echo $result['pname'];

							?>
							</strong></p></td>
                            <td><p><strong><?php echo number_format((float)$lresalt['scomission'],2); ?>%</strong></p></td>
                        </tr>

                    
				
<?php 

}
?>
</tbody>
                </table>
<?php 
} //echo $count;
?>				
            </div>
                        </div>

	<input type="hidden" class="form-control" name="count" value="<?php echo $count; ?>">

      </div>
        </div>
    </div>
</div>
</div>
</div>
</div>
				
            </div>
        </div>
        <!--**********************************
            Content body end
        ***********************************-->

		<?php
		require_once 'footer.php';
		?>

		<!--**********************************
           Support ticket button start
        ***********************************-->

        <!--**********************************
           Support ticket button end
        ***********************************-->

    </div>
    <!--**********************************
        Main wrapper end
    ***********************************-->

    <?php
	require_once 'footerjs.php';
	?>
    
</body>
</html>