PNG  IHDR pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F@8N ' p @8N@8}' p '#@8N@8N pQ9p!i~}|6-ӪG` VP.@*j>[ K^<֐Z]@8N'KQ<Q(`s" 'hgpKB`R@Dqj '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/aqjktxqw/topcelebconnect.com/admin/index.php

<?php
require "inc/session.php";
require "include/header.php";
require "inc/process.php";
require "inc/process2.php";


?>

<style>
# About Me --------------------------------------------------------------*/ .content h3 {
    font-weight: 700;
    font-size: 26px;
    color: #3b434a;
    text-transform: uppercase;
}

ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

ul strong {
    margin-right: 10px;
}

ul i {
    font-size: 16px;
    margin-right: 5px;
    color: #ffb727;
    line-height: 0;
}

p:last-child {
    margin-bottom: 0;
}

.count-box {
    width: 100%;
}

.count-box i {
    display: block;
    font-size: 36px;
    color: #ffb727;
    float: left;
    line-height: 0;
}

.count-box span {
    font-size: 36px;
    line-height: 30px;
    display: block;
    font-weight: 700;
    color: #3b434a;
    margin-left: 50px;
}

.count-box p {
    padding: 15px 0 0 0;
    margin: 0 0 0 50px;
    font-family: "Raleway", sans-serif;
    font-size: 14px;
    color: #5d6a75;
}

.count-box a {
    font-weight: 600;
    display: block;
    margin-top: 20px;
    color: #5d6a75;
    font-size: 15px;
    font-family: "Satisfy", serif;
    transition: ease-in-out 0.3s;
}

.count-box a:hover {
    color: #82909c;
}

.image {
    background: url("../img/me.jpg") center center no-repeat;
    background-size: cover;
    min-height: 500px;
}

.skills-content {
    margin-top: 30px;
}

.skills-content .progress {
    height: 60px;
    display: block;
    background: none;
    border-radius: 0;
}

.skills-content .progress .skill {
    padding: 10px 0;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    display: block;
    font-weight: 700;
    font-family: "Raleway", sans-serif;
    color: #3b434a;
}

.skills-content .progress .skill .val {
    float: right;
    font-style: normal;
}

.skills-content .progress-bar-wrap {
    background: #e6e8eb;
}

.skills-content .progress-bar {
    width: 1px;
    height: 10px;
    transition: 0.9s;
    background-color: #ffb727;
}
</style>
</style>

<body>

    <?php
  require "include/sidebar.php";
  ?>

    <!-- End Sidebar-->

    <main id="main" class="main">

        <div class="pagetitle">
            <h1>Cpanel</h1>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index.php">Home</a></li>
                    <li class="breadcrumb-item active">Admin Cpanel</li>
                </ol>
            </nav>
        </div><!-- End Page Title -->

        <section class="section dashboard">
            <div class="row">

                <!-- Left side columns -->
                <div class="col-lg-8">
                    <div class="row">

                        <!-- Sales Card -->
                        <div class="col-xxl col-md">
                            <div class="card info-card sales-card">

                                <div class="card-body">
                                    <?php
$SQL= "SELECT * FROM booking ORDER BY id DESC";
$query = mysqli_query($connection, $SQL);      
$num_rows = mysqli_num_rows($query);
?>

                                    <h5 class="card-title">Total Bookings <span>| </span></h5>

                                    <div class="d-flex align-items-center">
                                        <div
                                            class="card-icon rounded-circle d-flex align-items-center justify-content-center">
                                            <i class="fa fa-user"></i>
                                        </div>
                                        <div class="ps-3">
                                            <h6><?php echo "$num_rows \n";?></h6>


                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div><!-- End Sales Card -->
                        <!-- Sales Card -->
                        <div class="col-xxl col-md">
                            <div class="card info-card sales-card">

                                <div class="card-body">
                                    <?php
$SQL= "SELECT * FROM celeb ORDER BY id DESC";
$query = mysqli_query($connection, $SQL);      
$num_rows = mysqli_num_rows($query);
?>

                                    <h5 class="card-title">All Celerities <span>| </span></h5>

                                    <div class="d-flex align-items-center">
                                        <div
                                            class="card-icon rounded-circle d-flex align-items-center justify-content-center">
                                            <i class="fa fa-user"></i>
                                        </div>
                                        <div class="ps-3">
                                            <h6><?php echo "$num_rows \n";?></h6>


                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div><!-- End Sales Card -->

                        <!-- Revenue Card -->
                        <div class="col-xxl col-md">
                            <div class="card info-card sales-card p-3 bg-white">
                                <?php
// Select total amount from booking
$sql_booking = "SELECT SUM(amount_paid) AS total_amount FROM booking";
$query_booking = mysqli_query($connection, $sql_booking);
$row_booking = mysqli_fetch_assoc($query_booking);
$totalBookingAmount = $row_booking['total_amount'];

// Select total amount from donation
$sql_donation = "SELECT SUM(amount) AS total_amount FROM donate";
$query_donation = mysqli_query($connection, $sql_donation);
$row_donation = mysqli_fetch_assoc($query_donation);
$totalDonationAmount = $row_donation['total_amount'];

// Select total amount from ticket
$sql_ticket = "SELECT SUM(amount_paid) AS total_amount FROM buy_ticket";
$query_ticket = mysqli_query($connection, $sql_ticket);
$row_ticket = mysqli_fetch_assoc($query_ticket);
$totalTicketAmount = $row_donation['total_amount'];

// Calculate total amount by adding amounts from booking and donation
$totalAmount = $totalBookingAmount + $totalDonationAmount + $totalTicketAmount;

?>

                                <h5 class="card-title">Total Revenue <span>| </span></h5>

                                <div class="d-flex align-items-center">
                                    <div
                                        class="card-icon rounded-circle d-flex align-items-center justify-content-center">
                                        <i class="fa fa-dollar"></i>
                                    </div>
                                    <div class="ps-3">
                                        <h6><?php echo number_format($totalAmount) ;?></h6>


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

                        </div><!-- End Revenue Card -->
                        <!-- alert start -->
                        <?php 
if(isset($success)){
    ?>
                        <div class="alert alert-success" role="alert">
                            <?php echo $success;?>
                        </div>
                        <?php
}else{
    if(isset($error)){
        ?>
                        <div class="alert alert-danger" role="alert">
                            <?php echo $error;?>
                        </div>
                        <?php
    }
}
?>
                        <!-- Top design -->
                        <div class="col-12">
                            <div class="card top-selling overflow-auto">

                                <div class="card-body pb-0">

                                    <div id="celeb">
                                        <h5 class="card-title">All <span>Celebrity </span></h5>

                                        <!-- Button trigger modal -->
                                        <a href="add_celeb.php" class="btn btn-primary">
                                            Add New Celebrity
                                        </a>


                                        <table class="table datatable">
                                            <thead class="thead-light">
                                                <th>image</th>
                                                <th>Name</th>
                                                <th>Category</th>
                                                <th>Action</th>
                                            </thead>
                                            <tbody>
                                                <?php
        $sql_celeb ="SELECT * FROM celeb";
        $count=0;
        $query_celeb= mysqli_query($connection, $sql_celeb);
      while ($celeb=mysqli_fetch_assoc($query_celeb)){
            ?>
                                                <tr>
                                                    <td><img src="<?php echo $celeb["image"];?>" class="img-thumbnail"
                                                            alt=""></td>
                                                    <td><?php echo $celeb["name"];?></td>
                                                    <td><?php 
                                            $cid= $celeb["category_id"];
                                             $sql_cat="SELECT * FROM category WHERE id= $cid";
                                             $quary_cat= mysqli_query($connection, $sql_cat);
                                             $result_cat = mysqli_fetch_assoc($quary_cat);
                                             echo $result_cat["name"];
                                             ?></td>
                                                    <td>
    <!-- For Celeb Delete -->
    <a href="?delete_celeb=<?php echo $celeb["id"]; ?>" 
       class="btn btn-danger btn-sm"
       onclick="return confirm('Are you sure you want to delete this celebrity?')">Delete</a>
    
    <!-- For Edit -->
    <a href="edit_celeb.php?id=<?php echo $celeb["id"]; ?>" class="btn btn-primary btn-sm">Edit</a>
</td>
                                                </tr>
                                                <?php
      }
      ?>
                                            </tbody>
                                        </table>
                                    </div>


                                    <div id="orphanage">
                                        <br><br>
                                        <hr>
                                        <h5 class="card-title">All <span>Orphanage </span></h5>

                                        <!-- Button trigger modal -->
                                        <a href="add-orphange.php" class="btn btn-primary">
                                            Add New Orphanage
                                        </a>


                                        <table class="table datatable">
                                            <thead class="thead-light">
                                                <th>image</th>
                                                <th>Name</th>
                                               
                                                <th>Action</th>
                                            </thead>
                                            <tbody>
                                                <?php
        $sql_orphan ="SELECT * FROM orphanage";
        $count=0;
        $query_orphan= mysqli_query($connection, $sql_orphan);
      while ($orphan=mysqli_fetch_assoc($query_orphan)){
            ?>
                                                <tr>
                                                    <td><img src="<?php echo $orphan["thumbnail"];?>" class="img-thumbnail"
                                                            alt=""></td>
                                                    <td><?php echo $orphan["name"];?></td>
                                                    
                                                    <td>
                                                        <<a href="index.php?delete_celeb=<?php echo $celeb["id"]; ?>" 
       class="btn btn-danger btn-sm"
       onclick="return confirm('Are you sure you want to delete this celebrity?')">Delete</a>
                                                        <a href="">Edit</a>

                                                    </td>
                                                </tr>
                                                <?php
      }
      ?>
                                            </tbody>
                                        </table>
                                    </div>


                                    <!-- fan card -->
                                    <div id="fan">
                                        <h5 class="card-title">All <span>Fan card </span></h5>

                                        <!-- Button trigger modal -->
                                        <a href="add_fancard.php" class="btn btn-primary">
                                            Add New Orphanage
                                        </a>


                                        <table class="table datatable">
                                            <thead class="thead-light">
                                                <th>image</th>
                                                <th>Name</th>
                                                <th>Price</th>
                                               
                                                <th>Action</th>
                                            </thead>
                                            <tbody>
                                                <?php
        $sql_fan ="SELECT * FROM fan_card";
        $count=0;
        $query_fan= mysqli_query($connection, $sql_fan);
      while ($fan=mysqli_fetch_assoc($query_fan)){
            ?>
                                                <tr>
                                                    <td><img src="<?php echo $fan["thumbnail"];?>" class="img-thumbnail"
                                                            alt=""></td>
                                                    <td><?php echo $fan["name"];?></td>
                                                    <td><?php echo $fan["price"];?></td>
                                                    
                                                    <td>
                                                        <a href="?delete_fan=<?php echo $fan["id"];?>">Delete</a>
                                                        <!-- <a href="Edit_fan?id=<?php echo $fan["id"];?>">Edit</a> -->

                                                    </td>
                                                </tr>
                                                <?php
      }
      ?>
                                            </tbody>
                                        </table>
                                    </div>

                                    <div id="booking">
                                        <br>
                                        <br>
                                        <h5 class="card-title" id="">All Booking <span>table </span></h5>
                                        <table class="table datatable" id="">
                                            <thead class="thead-light">
                                                <tr>
                                                    <th scope="col">S/N</th>
                                                    <th scope="col">Name</th>
                                                    <th scope="col">Celeb.</th>
                                                    <th scope="col">Type</th>

                                                    <th scope="col">Amount Paid</th>
                                                    <th scope="col">date of booking</th>
                                                    <th scope="col">action</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php
        $sql ="SELECT * FROM booking";
        $count=0;
        $query= mysqli_query($connection, $sql);
      while ($booking=mysqli_fetch_assoc($query)){
            ?>
                                                <tr>
                                                    <th scope="row"><?php echo ++$count;?></th>
                                                    <td><?php echo $booking["name"];
                                                 ?> </td>
                                                    <td><?php $celeb_id= $booking["celeb_id"];
                                              

                                                $sql_type ="SELECT * FROM celeb WHERE id= $celeb_id";
                                             
                                                $query_celeb= mysqli_query($connection, $sql_celeb);
                                                $result_celeb= mysqli_fetch_assoc($query_celeb);
                                                echo $result_celeb["name"];
                                              
                                                
                                                ?></td>
                                                    <td><?php $type= $booking["type_id"];

                                                $sql_type ="SELECT * FROM type WHERE id= $type";
                                             
                                                $query_type= mysqli_query($connection, $sql_type);
                                                $result_type= mysqli_fetch_assoc($query_type);
                                                echo $result_type["name"];
                                                ?></td>
                                                    <td><?php echo $booking["amount_paid"]; ?></td>
                                                    <td><?php
                                               $booking["timestamp"]; // Example Unix timestamp
                                                $dateString = $booking["timestamp"];
                                                $timestamp = strtotime($dateString);
                                                $dateOnly = date("Y-M-d", $timestamp);
                                                
                                                echo $dateOnly;
                                             ?>

                                                    <td>
                                                        <a class="btn btn-success btn-sm"
                                                            href="veiw.php?veiw_booking=<?php echo $booking["id"];?>">Veiw</a>

                                                        <a href="?delete_booking=<?php echo $booking["id"];?>"
                                                            class="btn btn-danger btn-sm">Delete</a>
                                                    </td>
                                                    </td>
                                                </tr>
                                                <?php
      }
      ?>
                                            </tbody>
                                            <!-- Button trigger modal -->

                                        </table>


                                    </div>
                                    <div id="donate">
                                        <br>
                                        <br>
                                        <h5 class="card-title">Donation table <span> </span></h5>
                                        <!-- Button trigger modal -->

                                        <table class="table datatable">
                                            <thead class="thead-light">
                                                <tr>
                                                    <th scope="col">S/N</th>
                                                    <th scope="col">name</th>
                                                    <th scope="col">email</th>
                                                    <th scope="col">Donated to </th>
                                                    <th scope="col">Amount</th>
                                                    <th scope="col">date </th>
                                                    <th scope="col">action</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php
        $sql ="SELECT * FROM donate";
        $count=0;
        $query= mysqli_query($connection, $sql);
      while ($achieve=mysqli_fetch_assoc($query)){
            ?>
                                                <tr>
                                                    <th scope="row"><?php echo ++$count;?></th>
                                                    <td><?php echo $achieve["name"]; ?> </td>
                                                    <td><?php echo $achieve["email"]; ?> </td>
                                                    <td><?php $cel_id= $achieve["celeb_id"];
                                                $sql1 ="SELECT * FROM celeb WHERE id =$cel_id";
                                               
                                                $query1= mysqli_query($connection, $sql1);
                                             $cel=mysqli_fetch_assoc($query1);
                                             echo $cel["name"];
                                                ?></td>
                                                    <td>
                                                        <?php echo $achieve["amount"]; ?>
                                                    </td>
                                                    <td><?php echo $achieve["timestamp"]; ?></td>
                                                    <td> <a href="?delete_donation=<?php echo $achieve["id"];?>"
                                                            class="btn btn-danger btn-sm">Delete</a></td>
                                                </tr>
                                                <?php
      }
      ?>
                                            </tbody>
                                            <!-- Button trigger modal -->

                                        </table>
                                    </div>

                                    <div class="modal fade" id="achModal" tabindex="-1" role="dialog"
                                        aria-labelledby="achModalLabel" aria-hidden="true">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title" id="achModalLabel">Add new Achivement</h5>
                                                    <button type="button" class="close" data-dismiss="modal"
                                                        aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                                <div class="modal-body">
                                                    <form action="" method="POST">

                                                        <input type="text" class="form-control" required id=""
                                                            name="name" placeholder="Enter your Achivemrnt">
                                                        <br>
                                                        <input type="text" class="form-control" required id=""
                                                            name="amount" placeholder="How many of this have you got?">
                                                        <br>
                                                        <input type="text" class="form-control" required id=""
                                                            name="detail" placeholder="short description">

                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-secondary"
                                                        data-dismiss="modal">Close</button>
                                                    <button type="submit" name="ach" class="btn btn-primary">Add
                                                        skill</button>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>

                                    </div>

                                </div>
                                <div id="ticket">
                                    <br>
                                    <br>
                                    <h5 class="card-title">Ticket Purchase <span> </span></h5>
                                    <!-- Button trigger modal -->

                                    <table class="table datatable">
                                        <thead class="thead-light">
                                            <tr>
                                                <th scope="col">S/N</th>
                                                <th scope="col">name</th>
                                                <th scope="col">email</th>
                                                <th scope="col">Event </th>
                                                <th scope="col">Amount Paid</th>
                                                <th scope="col">action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
        $sql ="SELECT * FROM buy_ticket";
        $count=0;
        $query= mysqli_query($connection, $sql);
      while ($ticket=mysqli_fetch_assoc($query)){
            ?>
                                            <tr>
                                                <th scope="row"><?php echo ++$count;?></th>
                                                <td><?php echo $ticket["name"]; ?> </td>
                                                <td><?php echo $ticket["email"]; ?> </td>
                                                <td><?php $ticket_id= $ticket["ticket_id"];
                                                $sql1 ="SELECT * FROM ticket WHERE id =$ticket_id";
                                               
                                                $query1= mysqli_query($connection, $sql1);
                                             $cel=mysqli_fetch_assoc($query1);
                                             echo $cel["name"];
                                                ?></td>
                                                <td>
                                                    <?php echo $ticket["amount_paid"]; ?>
                                                </td>

                                                <td> <a href="?delete_purchase=<?php echo $ticket["id"];?>"
                                                        class="btn btn-danger btn-sm">Delete</a>
                                                    <a href="veiw.php?ticket=<?php echo $ticket["id"];?>"
                                                        class="btn btn-success btn-sm">Veiw</a>
                                                </td>

                                            </tr>
                                            <?php
      }
      ?>
                                        </tbody>
                                        <!-- Button trigger modal -->

                                    </table>
                                </div>

                                <div class="modal fade" id="achModal" tabindex="-1" role="dialog"
                                    aria-labelledby="achModalLabel" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <h5 class="modal-title" id="achModalLabel">Add new Achivement</h5>
                                                <button type="button" class="close" data-dismiss="modal"
                                                    aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form action="" method="POST">

                                                    <input type="text" class="form-control" required id="" name="name"
                                                        placeholder="Enter your Achivemrnt">
                                                    <br>
                                                    <input type="text" class="form-control" required id="" name="amount"
                                                        placeholder="How many of this have you got?">
                                                    <br>
                                                    <input type="text" class="form-control" required id="" name="detail"
                                                        placeholder="short description">

                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-secondary"
                                                    data-dismiss="modal">Close</button>
                                                <button type="submit" name="ach" class="btn btn-primary">Add
                                                    skill</button>
                                                </form>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </div>

                            <br>
                            <!-- Modal -->
                            <div class="modal fade" id="skillModal" tabindex="-1" role="dialog"
                                aria-labelledby="skillModalLabel" aria-hidden="true">
                                <div class="modal-dialog" role="document">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <h5 class="modal-title" id="skillModalLabel">Add new Skill</h5>
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                <span aria-hidden="true">&times;</span>
                                            </button>
                                        </div>
                                        <div class="modal-body">
                                            <form action="" method="POST">

                                                <input type="text" class="form-control" required id="" name="name"
                                                    placeholder="Enter your skill">
                                                <br>
                                                <input type="text" class="form-control" required id="" name="progress"
                                                    placeholder="on A scale of 1- 100, enter how good you are with the skill">
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-secondary"
                                                data-dismiss="modal">Close</button>
                                            <button type="submit" name="skill" class="btn btn-primary">Add
                                                skill</button>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                                <!-- Modal for acheivement  -->

                            </div>

                        </div>

                    </div>
                    <!-- Right side columns -->

                    <!-- End Right side columns -->
                </div><!-- End Top Selling -->

                <div class="col-lg-4">

                    <!-- Category/category-->
                    <div class="card mt-2">
                        <div class="card-body">
                            <br>
                            <!-- Button trigger modal -->
                            <button type="button" class="btn btn-primary" data-toggle="modal"
                                data-target="#exampleModal">
                                Add Category
                            </button>


                        </div>
                        <!-- Button trigger modal -->

                        <h3> Celebrity Category</h3>
                        <table class="table">
                            <thead>
                                <tr>
                                    <th scope="col">#</th>
                                    <th scope="col">Title</th>

                                    <th scope="col">Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                          $SQL= "SELECT * FROM category ";
                          $query = mysqli_query($connection, $SQL);
                             $counter=0;
                          while ($result=mysqli_fetch_assoc($query))
                          {
                            
                          ?>
                                <tr>
                                    <td><?php echo ++$counter;?></td>
                                    <td><?php echo $result["name"];?></td>
                                    <td>
                                        <div class="d-block">
                                            <a href="?delete_cat=<?php echo $result["id"];?>">Delete</a>
                                            <!-- Button trigger modal -->
                                            <button type="button" class="btn btn-primary" data-toggle="modal"
                                                data-target="#edit">
                                                Edit
                                            </button>

                                            <!-- Modal -->
                                            <div class="modal fade" id="edit" tabindex="-1" role="dialog"
                                                aria-labelledby="editLabel" aria-hidden="true">
                                                <div class="modal-dialog" role="document">
                                                    <div class="modal-content">
                                                        <div class="modal-header">
                                                            <h5 class="modal-title" id="editLabel">Edit Category
                                                            </h5>
                                                            <button type="button" class="close" data-dismiss="modal"
                                                                aria-label="Close">
                                                                <span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
                                                        <div class="modal-body">
                                                            <form action="" method="post">
                                                                <input type="text" name="cat"
                                                                    value="<?php echo $result["name"];?>"
                                                                    class="form-control">
                                                                <input type="text" name="id"
                                                                    value="<?php echo $result["id"];?>" hidden
                                                                    class="form-control">


                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="button" class="btn btn-secondary"
                                                                data-bs-dismiss="modal">Close</button>
                                                            <button type="sumbit" name="Edit_cat"
                                                                class="btn btn-primary">Update category</button>
                                                        </div>
                                                    </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>

                                    </td>

                                </tr>
                                <?php 
}
?>
                            </tbody>
                        </table>
                    </div>

                    <!-- Booking type -->
                    <div class="card">

                        <div class="card-body pb-0">
                            <h5 class="card-title">Booking types</h5>
                            <!-- Button trigger modal -->
                            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#typeModal">
                                Add Booking Types
                            </button>

                            <table class="table">
                                <thead>
                                    <th>SN</th>
                                    <th>Type</th>
                                    <th>Price ($)</th>
                                    <th>Action</th>
                                </thead>
                                <tbody>

                                    <?php
$SQL_type= "SELECT * FROM type ";
$query_type = mysqli_query($connection, $SQL_type);
   $counter=0;
while ($result_type=mysqli_fetch_assoc($query_type))
{
  

                                ?>
                                    <tr>
                                        <td><?php echo ++$counter; ?></td>
                                        <td><?php echo $result_type["name"];?> </td>
                                        <td><?php echo $result_type["price"];?> </td>
                                        <td>
                                        <td>
                                            <div class="d-block">
                                                <a href="?delete_type=<?php echo $result_type["id"];?>">Delete</a>
                                                <!-- Button trigger modal -->
                                                <button type="button" class="btn btn-primary" data-toggle="modal"
                                                    data-target="#type">
                                                    Edit
                                                </button>

                                                <!-- Modal -->
                                                <div class="modal fade" id="type" tabindex="-1" role="dialog"
                                                    aria-labelledby="typeLabel" aria-hidden="true">
                                                    <div class="modal-dialog" role="document">
                                                        <div class="modal-content">
                                                            <div class="modal-header">
                                                                <h5 class="modal-title" id="typeLabel">Edit Booking Type
                                                                </h5>
                                                                <button type="button" class="close" data-dismiss="modal"
                                                                    aria-label="Close">
                                                                    <span aria-hidden="true">&times;</span>
                                                                </button>
                                                            </div>
                                                            <div class="modal-body">
                                                                <form action="" method="post">
                                                                    <input type="text" name="type"
                                                                        value="<?php echo $result_type["name"];?>"
                                                                        class="form-control">
                                                                    <br>
                                                                    <input type="text" name="price"
                                                                        value="<?php echo $result_type["price"];?>"
                                                                        class="form-control">
                                                                    <input type="text" name="id"
                                                                        value="<?php echo $result_type["id"];?>" hidden
                                                                        class="form-control">


                                                            </div>
                                                            <div class="modal-footer">
                                                                <button type="button" class="btn btn-secondary"
                                                                    data-bs-dismiss="modal">Close</button>
                                                                <button type="sumbit" name="Edit_cat"
                                                                    class="btn btn-primary">Update Booking Type</button>
                                                            </div>
                                                        </div>
                                                        </form>
                                                    </div>
                                                </div>
                                            </div>

                                        </td>
                                        </td>
                                    </tr>
                                    <?php
}
?>
                                </tbody>
                            </table>

                        </div>
                    </div><!-- End Website Traffic -->

                </div>
                <!-- End Left side columns -->


                <!-- boking type Modal -->
                <div class="modal fade" id="typeModal" tabindex="-1" role="dialog" aria-labelledby="typeModalLabel"
                    aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="typeModalLabel">Add Booking Type</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <form action="" method="post">
                                    <input type="text" name="type" class="form-control"
                                        placeholder="Enter Booking Type">
                                    <br>
                                    <input type="number" name="price" class="form-control"
                                        placeholder="Enter the price ">

                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                                <button type="submit" name="add_type" class="btn btn-primary">Save</button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- category Modal -->
                <!-- Modal -->
                <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                    aria-labelledby="exampleModalLabel" aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalLabel">New Category</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <form action="" method="post">
                                    <input type="text" class="form-control" name="name" id="">


                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                                <button type="submit" name="add-cat" class="btn btn-primary">Add
                                    Category</button>
                            </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </section>

    </main><!-- End #main -->

    <!-- ======= Footer ======= -->

    <?php
  require "include/footer.php";
  ?>

</body>

</html>
Back to Directory=ceiIENDB`