<?php
session_start(); 
$u_uname = '';
if (isset($_COOKIE['auth_token'])) {
    $u_uname = $_COOKIE['auth_token'];
} else {
    header("location:login.php");
    exit; 
}
?>

<?php include 'include/header.php'; ?>
<?php include 'include/aside.php'; ?>
<?php include 'include/connection.php'; ?>

<!--start page wrapper -->
<div class="page-wrapper">
    <div class="page-content">
        <h6 class="mb-0 text-uppercase">Server Plan</h6>
        <hr/>

        <div class="card">
            <div class="card-body">
                <div class="table-responsive">
                    <table id="example2" class="table table-striped table-bordered">
                        <thead>
                            <tr>
                                <th>SR. No</th>
                                <th>Package Name</th>
                                <th>Server Details</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $sql = "SELECT * FROM  webhosting";
                            $result = $link->query($sql);
                            $sr = 1; // Initialize serial number
                            
                            if ($result->num_rows > 0) {
                                // Output data of each row
                                while($row = $result->fetch_assoc()) {
                                    ?>
                                    
                                    <tr>
                                    <td><?php echo  $row['id'] ?></td>
                                    <td><?php echo$row['package_name'] ?></td>
                                    <!--<td><?php $row['full_name'] ?></td>-->
                                    
                                    <!--<td><?php echo $row['email_id'] ?></td>-->
                                    <!--<td><?php echo $row['mobile_no'] ?></td>-->
                                    <!--<td><?php echo  $row['gender'] ?></td>-->
                                    <!--<td><?php echo$row['company_name'] ?></td>-->
                                    <!--<td><?php echo $row['company_address'] ?></td>-->
                                    <!--<td><?php echo $row['blocking_status'] ?></td>-->
                                    <!--<td><?php echo $row['wallet_balance'] ?></td>-->
                                    <!--<td><?php echo $row['password'] ?></td>-->
                                    <!-- <td><?php echo $row['date_of_joining'] ?></td>-->
                                    <td><button class="btn btn-success"><a style="color:white" href="package_history.php?package_id=<?php echo $row['package_id'] ?>">View</a></button></td>
                                  
                                    </tr>
                                    <?php
                                    $sr++; 
                                }
                            } else {
                                echo "<tr><td colspan='8'>No data available</td></tr>";
                            }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<!--end page wrapper -->

<?php include 'include/footer.php'; ?>
