File "fetch_details.php"

Full Path: /home/leadltht/fastlinkinternet.com/wp-comment-form/reports/fetch_details.php
File size: 2 KB
MIME-type: text/x-php
Charset: utf-8

<?php
require_once('D:/xampp/htdocs/prazey-hocms/config.php');
if (isset($_GET['server']) && !empty($_GET['server'])) {
    $server = $_GET['server'];

    $query = "SELECT firstname, lastname, contact, installation_date, installation_fee, plan_name, plan_price, server, status FROM member_list WHERE server = '$server'";
    $result = $conn->query($query);
    $num_rows = $result->num_rows;

    echo "<h5 class='mt-4'>Number of rows under $server: $num_rows</h5>";
    if ($num_rows > 0) {
        echo "<table class='table table-bordered mt-3'>
                <thead>
                    <tr>
                        <th>Client Name</th>
                        <th>Contact</th>
                        <th>Installation Date</th>
                        <th>Installation Fee</th>
                        <th>Plan Name</th>
                        <th>Plan Price</th>
                        <th>Server</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>";
        while ($row = $result->fetch_assoc()) {
            $client_name = $row['firstname'] . " " . $row['lastname'];
            $contact = $row['contact'];
            $installation_date = $row['installation_date'];
            $installation_fee = $row['installation_fee'];
            $plan_name = $row['plan_name'];
            $plan_price = $row['plan_price'];
            $server = $row['server'];
            $status = $row['status'] == 1 ? 'Active' : 'Inactive';

            echo "<tr>
                    <td>$client_name</td>
                    <td>$contact</td>
                    <td>$installation_date</td>
                    <td>$installation_fee</td>
                    <td>$plan_name</td>
                    <td>$plan_price</td>
                    <td>$server</td>
                    <td>$status</td>
                </tr>";
        }
        echo "</tbody></table>";
    } else {
        echo "<p>No records found for $server.</p>";
    }
}
?>