File "site_view.php"

Full path: /home/fsibplc/public_html/admin/site_view.php
File size: 3.58 B (3.58 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php



include('config/dbcon.php');

include('authentication.php');

//include('middleware/superadminAuth.php');

//session_start();



include('include/header.php');

?>



<div class="container-fluid px-4">

    <h4 class="mt-4">Site Information</h4>

    <ol class="breadcrumb mb-4">

        <li class="breadcrumb-item active">Admin Dashboard</li>

        <li class="breadcrumb-item">Site Informationers</li>

    </ol>

    

    <div class="row">

        <div class="col-md-12">

        <?php include('message.php'); ?>

            <div class="card">

                <div class="card-header">

                    <h4>Site Information
                    <?php if ($_SESSION['auth_role'] == 2) : ?>
                        <a href="siteinfo-add.php" class="btn btn-primary float-end">Add Info Field</a>
                    <?php endif; ?>
                    </h4>

                    

                </div>

                <div class="card-body">

                    <table class="table table-bordered">

                        <thead>

                            <tr>

                                <th>ID</th>

                                <th>Field Name</th>

                                <th>Value</th>

                                <th>Edit</th>

                                <?php if ($_SESSION['auth_role'] == 2) : ?>

                                <th>Delete</th>

                                <?php endif; ?>

                            </tr>

                        </thead>

                        <tbody>

                            <?php

        $query= "SELECT * FROM site_details";

        $query_run = mysqli_query($con, $query);

        if(mysqli_num_rows($query_run) >0 ){

            foreach($query_run as $row)

            {

                ?>

                            <tr>

                                <td><?= $row['id']; ?></td>

                                <td><?= $row['field_name']; ?></td>
 
                                <td>
                                <?php if ($row['field_name']=='Logo'){ ?>      
                                <img src="../uploads/<?= $row['value']; ?>" width="100px">        
                                <?php }else{ ?>
                                <?= $row['value'] ?>
                                <?php } ?>   

                                </td>
                                    
                              

                                

                                <td><a href="edit-siteinfo.php?id=<?= $row['id']; ?>" class="btn btn-success">Edit</a></td>
                                <?php if ($_SESSION['auth_role'] == 2) : ?>

                                 <td>

                                <form action="code.php" method="POST">

                                    <button type="submit" name="siteinfo_delete" value="<?= $row['id']; ?>" class="btn btn-danger">Delete</button></td>

                                </form>   

                                <?php endif; ?>
                                

                                





                            </tr>



                            <?php

            }





        }else{

        ?>

                            <tr>

                                <td colspan="6">No Record Found </td>



                            </tr>



                            <?php }            ?>







                        </tbody>

                    </table>

                </div>

            </div>



        </div>









    </div>

</div>



<?php

include('include/footer.php');



include('include/script.php');



?>