Viewing File: /home/quiczmwg/lightspringdigitals.com/admin/manage-commission.php

<?php
include 'head.php';
include 'header.php';





?>

<body class="skin-default fixed-layout">
    <div id="main-wrapper">
        <?php
        include 'sidebar.php';
        if (isset($message)) {
            foreach ($message as $message) {
                echo '<div class="message"><span>' . $message . '</span> <i class="fas fa-times" onclick="this. parentElement.style.display = `none`;"></i> </div>';
            };
        };
        ?>

        <div class="page-wrapper">
            <div class="container-fluid">
                <?php include 'nav.php'; ?>
                <div class="container">


                    <div class="container">
                        <div class="text-right my-3">
                            <a href="assign-commission.php" class="btn btn-primary">
                                <i class="bi bi-plus"></i> Assign Commission
                            </a>
                        </div>

                    </div>

                    <!-- The Modal -->
                    <div class="modal fade" id="myModal">
                        <div class="modal-dialog">
                            <div class="modal-content">

                                <!-- Modal Header -->
                                <div class="modal-header">
                                    <h4 class="modal-title">Manage Category</h4>
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                </div>

                                <!-- Modal body -->
                                <div class="modal-body">
                                    <form action="manage-category-process.php" method="post" class="add-product-form" enctype="multipart/form-data">

                                        <div class="form-group">
                                            <input type="text" name="category" placeholder="Enter category name" class="form-control my-2  " required>

                                        </div>

                                        <div class="form-group">
                                            <input type="file" name="category_image" accept="image/png, image/jpeg, image/jpg" class="form-control my-2  " required>

                                        </div>

                                </div>

                                <!-- Modal footer -->
                                <div class="modal-footer">
                                    <!-- <button type="submit" name="btnSave"  class="btn btn-success bg-warn">Submit</button> -->
                                    <button type="submit" name="add_category" class="btn btn-success bg-warn">Submit</button>
                                    <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                                </div>
                                </form>
                            </div>
                        </div>
                    </div>






                    <section>
                        <div class="d-flex justify-content-end align-items-center">
                            <div class="container-fluid">
                                <div class="card mt-4">
                                    <div class="card-body">
                                        <h5 class="mb-3">Assigned Commissions</h5>
                                        <div class="table-responsive">
                                            <table class="table table-striped">
                                                <thead class="table-dark">
                                                    <tr>
                                                        <th>#</th>
                                                        <th>User</th>
                                                        <th>Amount ($)</th>
                                                        <th>Assigned On</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php
                                                    $result = mysqli_query($conn, "SELECT c.*, u.full_name FROM commission c JOIN user_login u ON c.user_id = u.userid ORDER BY c.created_at DESC");
                                                    $num = 1;
                                                    while ($row = mysqli_fetch_assoc($result)) {
                                                        echo '<tr>
                    <td>' . $num++ . '</td>
                    <td>' . htmlspecialchars($row['full_name']) . '</td>
                    <td>$' . number_format($row['amount'], 2) . '</td>
                    <td>' . date("M j, Y • g:i A", strtotime($row['created_at'])) . '</td>
                  </tr>';
                                                    }
                                                    ?>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>


        </section>
    </div>
    </div>
    </div>
    <?php
    include 'footer.php';
    ?>
Back to Directory File Manager
<