Guest User

admin_get_category_bod.php

a guest
May 4th, 2019
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.07 KB | None | 0 0
  1.   <?php
  2.  
  3.   if (isset($_GET['get']) && !empty($_GET['get']) )
  4.   {
  5.       include 'intodb/edit_category.php';
  6.   }
  7.  
  8.  
  9.   if (check_method('get') && isset($_GET['delete']) )
  10.                             {
  11.                                 require 'intodb/delete_category.php';
  12.                             }
  13.  
  14.  
  15.    if (check_method('get') && isset($_GET['get']) )
  16.   {
  17.       require 'intodb/get_category.php';
  18.   }
  19.  
  20.  
  21.                             ?>
  22.  
  23. <!--            start: cat body          -->
  24.  
  25. <div     class="columns is-mobile is-centered is-vcentered">
  26.     <div class="column is-half">
  27.         <div   class="section has-background-white-ter box ">
  28.  
  29.  
  30.             <div class="has-text-centered column    " >
  31.                 <h4 class="title is-4">Ctegories</h4>
  32.             </div>
  33.  
  34.             <div class="column " >
  35.  
  36.  
  37.                 <?php if (check_method('get') && isset($_GET['get'])) {?>
  38.                 <form action="" method="post">
  39.                 <?php } else {?>
  40.                     <form action="intodb/add_category.php" method="post">
  41.                         <?php } ?>
  42.  
  43.                     <label class="label" for="admin_add_category_bar">Add Category</label>
  44.                 <div class="field is-grouped">
  45.  
  46.                     <p class="control is-expanded">
  47.  
  48.                         <?php if (check_method('get') && isset($_GET['get'])) {?>
  49.  
  50.                             <input id="admin_add_category_bar" name="admin_add_category_bar_edit" class="input" type="text" placeholder="Add Your Category Here" value="<?php echo $cat_name; ?>">
  51.  
  52.                             <?php
  53.  
  54.  
  55.                             ?>
  56.                         <?php } else {?>
  57.                             <input id="admin_add_category_bar" name="admin_add_category_bar" class="input" type="text" placeholder="Add Your Category Here">
  58.  
  59.                         <?php } ?>
  60.                         </p>
  61.                         <p class="control">
  62.                             <input type="submit" name="admin_add_category_submit" class="button is-info my_fucking_hover_right_arrow" value="Add Category">
  63.                         </p>    
  64.                     </div>
  65.                 </form>
  66.  
  67.  
  68.                 <div class="">
  69.  
  70.                     <!--            start: body for all posts inside admin          -->
  71.  
  72.  
  73.                     <table class="table is-bordered">
  74.                         <thead>
  75.                         <tr>
  76.                             <th><p>Category Name</p></th>
  77.                             <th><p>Edit</p></th>
  78.                             <th><p>Delete</p></th>
  79.                         </tr>
  80.                         </thead>
  81.  
  82.                         <?php
  83.  
  84.                         global $connection;
  85.                         $sql = "SELECT * FROM categories ;";
  86.  
  87.                         $result = mysqli_query($connection, $sql);
  88.                         if (!$result) {
  89.                             echo mysqli_error($connection);
  90.                         }
  91.                         while($row = mysqli_fetch_assoc($result))
  92.                         {
  93.                         ?>
  94.                         <tbody>
  95.                         <tr>
  96.                             <td><p><?php echo $row['category_name']?></p></td>
  97.                             <td>
  98.                                 <a href="admin_category.php?get=<?php echo $row['category_id']; ?>" class="button is-info my_fucking_hover_right_arrow" >Edit</a>
  99.  
  100.                             </td>
  101.  
  102.                             <td>
  103.                                 <a href="admin_category.php?delete=<?php echo $row['category_id']; ?>" class="button is-danger my_fucking_hover_right_arrow" >Delete</a>
  104.  
  105.                             </td>
  106.                         </tr>
  107.  
  108.  
  109.                         </tbody>
  110.                         <?php }?>
  111.                     </table>
  112.  
  113.                     <!--           end: body for all posts inside admin             -->
  114.  
  115.  
  116.  
  117.  
  118.                 </div>
  119.  
  120.                 </div>
  121.             </div>
  122.  
  123.  
  124.         </div>
  125.  
  126.     </div>
  127. </div>
  128.  
  129.  
  130. <!--           end: cat body             -->
Add Comment
Please, Sign In to add comment