File "company_registration.php"

Full Path: /home/ccipcixf/public_html/hirepro/admin/company_registration.php
File size: 5.71 KB
MIME-type: text/x-php
Charset: utf-8

<?php
session_start();
if (isset($_SESSION['admin_role']) && $_SESSION['admin_role'] !== "Admin") {
    header("location:index.php");
    exit(); // Add an exit to stop further execution after redirection
}
include "menu.php";
$title = "Admin Panel";

?>

<?php if (isset($_SESSION["admin_role"]) == "Admin") : ?>

    <!DOCTYPE html>
    <html lang="en" class="light-style layout-menu-fixed" dir="ltr" data-theme="theme-default" data-assets-path="../assets/" data-template="vertical-menu-template-free">

    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
        <title><?php echo $title ?></title>

        <link rel="stylesheet" href="//cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css">

        <!-- This page plugin CSS -->
        <!-- <link href="assets/extra-libs/datatables.net-bs4/css/dataTables.bootstrap4.css" rel="stylesheet"> -->
        <meta name="description" content="" />
    </head>

    <body>
        <!-- Content wrapper -->
        <div class="content-wrapper">
            <!-- Content -->

            <div class="container-xxl flex-grow-1 container-p-y ">

                <!-- <a href="EMS_form.php"><button class=" btn btn-primary  float-end mt-3 mb-2" style="background: linear-gradient(#0052D4, #2B32B2 );">Add New Form</button></a> -->

                <h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light"><?php echo $title . " " . "Users" ?></h4>

                <!-- Basic Bootstrap Table -->


                <!-- Striped Rows -->
                <div class="card p-3">
                    <div class="table-responsive">
                        <?php

                        include "config.php";

                        $query = "SELECT * FROM `companies_register`";

                        $result = mysqli_query($conn, $query);

                        if (mysqli_num_rows($result) > 0) {

                            // echo "<pre>";
                            // print_r($result);



                        ?>
                            <table id="my_Table" class="table table-striped table-bordered no-wrap" style="width:100%">

                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>User Name</th>
                                        <th>Email</th>
                                        <th>Contact</th>
                                        <th>Company</th>
                                        <th>Designation</th>
                                        <th>Company Logo</th>
                                        <th>Action</th>
                                        <!-- <th>Message</th> -->

                                    </tr>
                                </thead>
                                <tbody class="table-border-bottom-0">
                                    <?php

                                    while ($row = mysqli_fetch_assoc($result)) {

                                    ?>
                                        <tr>
                                            <td class='id'><?php echo $row["id"] ?></td>
                                            <td><?php echo $row["Name"] ?></td>
                                            <td><?php echo $row["Email"] ?></td>
                                            <td><?php echo $row["Contact"] ?></td>
                                            <td><?php echo $row["Company_name"] ?></td>
                                            <td class="text-center"><?php echo $row["Designation"] ?></td>
                                            <td class="text-center">
                                                <!-- Displaying the company_logo with rounded styling -->
                                                <?php
                                                $logoPath = $row["company_logo"];
                                                echo "<img src='../$logoPath' alt='Company Logo'class='rounded-circle' width='50'
                                                height='50'>";
                                                ?>
                                            </td>
                                            <!-- <td class="text-start"><?php echo $row["text_message"] ?></td> -->

                                            <!-- <td class='view'><a href='users_view.php?id=<?php echo $row["id"] ?>'><i class="bx bx-show me-1" style="color: #0350d2;"></i></a></td> -->
                                            <td class='delete'><a href='company_delete.php?id=<?php echo $row["id"] ?>'><i class="bx bx-trash me-1" style="color: #0350d2;"></i></a></td>
                                        </tr>
                                    <?php } ?>



                                </tbody>
                            </table>
                    </div>
                </div>
            <?php } ?>
            <!--/ Striped Rows -->
            <hr class="my-5" />
            </div>
            <!-- / Content -->
            <!--This page plugins -->
            <script src="https://code.jquery.com/jquery-3.7.0.js">
            </script>
            <!-- <script src="https://cdn.datatables.net/1.13.7/js/dataTables.bootstrap5.min.js"></script> -->
            <script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>
            <script>
                $(document).ready(function() {
                    $('#my_Table').DataTable();
                });
            </script>
    </body>

    </html>
<?php endif; ?>