Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET['get']) && !empty($_GET['get']) )
- {
- include 'intodb/edit_category.php';
- }
- if (check_method('get') && isset($_GET['delete']) )
- {
- require 'intodb/delete_category.php';
- }
- if (check_method('get') && isset($_GET['get']) )
- {
- require 'intodb/get_category.php';
- }
- ?>
- <!-- start: cat body -->
- <div class="columns is-mobile is-centered is-vcentered">
- <div class="column is-half">
- <div class="section has-background-white-ter box ">
- <div class="has-text-centered column " >
- <h4 class="title is-4">Ctegories</h4>
- </div>
- <div class="column " >
- <?php if (check_method('get') && isset($_GET['get'])) {?>
- <form action="" method="post">
- <?php } else {?>
- <form action="intodb/add_category.php" method="post">
- <?php } ?>
- <label class="label" for="admin_add_category_bar">Add Category</label>
- <div class="field is-grouped">
- <p class="control is-expanded">
- <?php if (check_method('get') && isset($_GET['get'])) {?>
- <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; ?>">
- <?php
- ?>
- <?php } else {?>
- <input id="admin_add_category_bar" name="admin_add_category_bar" class="input" type="text" placeholder="Add Your Category Here">
- <?php } ?>
- </p>
- <p class="control">
- <input type="submit" name="admin_add_category_submit" class="button is-info my_fucking_hover_right_arrow" value="Add Category">
- </p>
- </div>
- </form>
- <div class="">
- <!-- start: body for all posts inside admin -->
- <table class="table is-bordered">
- <thead>
- <tr>
- <th><p>Category Name</p></th>
- <th><p>Edit</p></th>
- <th><p>Delete</p></th>
- </tr>
- </thead>
- <?php
- global $connection;
- $sql = "SELECT * FROM categories ;";
- $result = mysqli_query($connection, $sql);
- if (!$result) {
- echo mysqli_error($connection);
- }
- while($row = mysqli_fetch_assoc($result))
- {
- ?>
- <tbody>
- <tr>
- <td><p><?php echo $row['category_name']?></p></td>
- <td>
- <a href="admin_category.php?get=<?php echo $row['category_id']; ?>" class="button is-info my_fucking_hover_right_arrow" >Edit</a>
- </td>
- <td>
- <a href="admin_category.php?delete=<?php echo $row['category_id']; ?>" class="button is-danger my_fucking_hover_right_arrow" >Delete</a>
- </td>
- </tr>
- </tbody>
- <?php }?>
- </table>
- <!-- end: body for all posts inside admin -->
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- end: cat body -->
Add Comment
Please, Sign In to add comment