Mini Shell

Direktori : /home/haworld/public_html/admin/
Upload File :
Current File : /home/haworld/public_html/admin/testimonial-all.php

<!DOCTYPE html>
<html lang="en">


<head>
    <?php include('include/head_admin.php');
    $page_id = '16';

    if (isset($_GET['type']) && $_GET['type'] != '') {
        $type = get_safe_value($con, $_GET['type']);
        if ($type == 'status') {
            $operation = get_safe_value($con, $_GET['operation']);
            $id = get_safe_value($con, $_GET['id']);
            if ($operation == 'active') {
                $status = '1';
            } else {
                $status = '0';
            }
            $update_status_sql = "update testimonial set status='$status' where id='$id'";
            mysqli_query($con, $update_status_sql);
        }

        if ($type == 'delete') {
            $id = get_safe_value($con, $_GET['id']);
           

                $delete_sql = "DELETE FROM testimonial WHERE `id`='$id'";
                mysqli_query($con, $delete_sql);
                header('Location: testimonial-all.php');
          
        }
    }

    $sql = "select * from testimonial ";
    $res = mysqli_query($con, $sql);
    ?>
</head>

<body>
    <!--== MAIN CONTRAINER ==-->
    <?php include('include/header_admin.php'); ?>

    <!--== BODY CONTNAINER ==-->
    <div class="container-fluid sb2">
        <div class="row">

            <?php include('include/sidebar_admin.php'); ?>

            <div class="sb2-2">
                <div class="sb2-2-2">
                    <ul>
                        <li><a href="index.php"><i class="fa fa-home" aria-hidden="true"></i> Home</a>
                        </li>
                        <li class="active-bre"><a href="testimonial-all.php"> Testimonial</a>
                        </li>
                    </ul>
                </div>
                <div class="sb2-2-1">
                    <h2>All Testimonial</h2>
                    <!-- <p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p> -->
                    <table class="table">
                        <thead>
                            <tr>
                                <th>#</th>
                                <!-- <th>Image</th> -->
                                <th>Name</th>
                                <th>Edit</th>
                                <th>Delete</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $i = 1;
                            while ($row = mysqli_fetch_assoc($res)) { ?>
                                <tr>
                                    <td><?php echo $i++ ?></td>
                                    <!-- <td><?php
                                        echo "<a target='_blank' href='" . "../media/testimonial/" . $row['image'] . "'><img width='100px' src='" . "../media/testimonial/" . $row['image'] . "'/></a>";
                                        ?></td> -->
                                     <td><?php echo $row['name'] ?></td>
                                    <td><a href="testimonial-add.php?id=<?php echo $row['id']; ?>" class="sb2-2-1-edit"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a>
                                    </td>
                                    <td><a href="?type=delete&id=<?php echo $row['id'] ?>" class="sb2-2-1-edit"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
                                    </td>
                                </tr>
                            <?php } ?>
                          
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <?php include('include/footer_admin.php'); ?>

    <?php include('include/foot_admin.php'); ?>

</body>


</html>