File "page-view.php"

Full path: /home/fsibplc/public_html/admin/page-view.php
File size: 5.56 B (5.56 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('../all/config.php');
//session_start();

include('include/header.php');
?>

<div class="container-fluid px-4">
    
       <div class="row mt-4">
        <div class="col-md-12">
        <?php include('message.php'); ?>
         <div class="card">
                <div class="card-header">
                    
                    <h4>View Pages <?php   if( $_SESSION['auth_role'] == 2): ?> <a href="page-add.php" class="btn btn-primary float-end">Add Page</a><?php endif; ?></h4>
                     
                </div>
                <div class="card-body">


                    <div class="table-responsive">
                            <table class="table bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Name</th>
                                            <th>Image</th>
                                            <th>Status</th>
                                            <th>View</th>
                                            <th>Edit</th>
                                            <?php if( $_SESSION['auth_role'] == 2): ?>
                                            <th>Delete</th>
                                             
                                            <?php endif; ?>
                                        </tr>
                                    </thead>
                                    <tbody>
                                            <?php
                            
                                 $page = "SELECT * FROM pages WHERE status !='2'";
                                $page_run = mysqli_query($con, $page);

                                if(mysqli_num_rows($page_run)>0)
                                {

                                    foreach($page_run as $page)
                                    {
                                    ?>   
                                     <?php  if($_SESSION['auth_role'] == 2 || $u['user_name'] == 'International Division' && $page['category'] == 'Foreign Exchange'|| $u['user_name'] == 'Marketing Division' && $page['category'] == 'Deposit Scheme'|| $u['user_name'] == 'Card Division' && $page['category'] == 'FSIB Card'|| $u['user_name'] == 'Share Division' && $page['category'] == 'Share Division Content')   :  ?>
                                        <tr>
                                                <td><?= $page['id'] ?></td>
                                                <td><?= $page['name'] ?></td>
                                                <td>
                                                <img src="../uploads/page/<?= $page['image'] ?>" width="60px" height="60px" />
                                                <img src="../uploads/page/<?= $page['icon'] ?>" width="60px" height="60px" />
                                                </td>
                                                <td>
                                                    <?= $page['status'] == '1' ? 'Hidden':'Visible' ?>
                                                </td>
                                                  <td>
                                                    <a href="../page.php?title=<?= $page['slug'] ?>" class="btn btn-info">View</a>
    
                                                </td>
                                                <td>
                                                    <a href="page-edit.php?id=<?= $page['id'] ?>" class="btn btn-success">Edit</a>
    
                                                </td>
                                                <?php if( $_SESSION['auth_role'] == 2): ?>
                                                <td>
                                                    <form action="code-superadmin.php" method="POST">
                                                        <button type="submit" name="page_detete_btn" value="<?= $page['id'] ?>" class="btn btn-danger" onclick='return checkDelete()'>Delete</button>
                                                    </form>
                                                    
    
                                                </td>
                                                
                                                
                                                <?php endif; ?><!--for delt btn-->
                                        </tr>
                                     <?php endif; ?><!--for id user-->

                                   <?php
                                    }

                                }else{
                                    ?> 
                                            <tr>
                                             <td colspan="7">No Record Found</td>
                                            </tr>

                                    <?php
                                }
                                    ?>


                                    </tbody>
                            </table>


                    </div>




                

                </div>

            </div>

        </div>

    </div>

</div>
<script type="text/javascript">
        function checkDelete(){
            return confirm('Are you sure you want to delete this record?');
        }
</script>
<?php
include('include/footer.php');

include('include/script.php');

?>