:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/kreative_crm/quatation/**
:: Editing File: tax_list.php
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); include_once("session.php"); include("header.php"); include("db.php"); ?> <link href="assets/vendor/datatable/jquery.dataTables.min.css" rel="stylesheet" type="text/css"> <main> <div class="container-fluid"> <div class="row m-1"> <div class="col-9"> <h4 class="main-title">Tax List</h4> <ul class="app-line-breadcrumbs mb-3"> <li> <a class="f-s-14 f-w-500" href="dashboard.php"> <span> <i class="ph-duotone ph-bank f-s-16"></i> Home </span> </a> </li> <li class="active"> <a class="f-s-14 f-w-500" href="#">Tax List</a> </li> </ul> </div> <div class="col-3"> <a href="add_tax.php" class="btn btn-primary" style="float: right;">Add Tax</a> </div> </div> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body p-0"> <div class="app-datatable-default overflow-auto"> <table class="display app-data-table default-data-table" id="example2"> <thead> <tr> <th>Tax ID</th> <th>Tax Name</th> <th>Tax %</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php // SQL query updated to select from 'taxes' $sql = "SELECT id, tax_name, tax_percentage, status FROM taxes ORDER BY id DESC"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { echo "<tr>"; echo "<td>".$row['id']."</td>"; // Displaying ID echo "<td>".$row['tax_name']."</td>"; // Displaying Tax Name echo "<td>".$row['tax_percentage']." %</td>"; // Displaying Tax Percentage echo "<td>".ucfirst($row['status'])."</td>"; // Displaying Status from DB echo "<td> <a href='edit_tax.php?id=".$row['id']."' class='btn btn-light-success icon-btn b-r-4'> <i class='ti ti-edit text-success'></i> </a> <a href='delete_tax.php?id=".$row['id']."' class='btn btn-light-danger icon-btn b-r-4 delete-btn' onclick=\"return confirm('Are you sure to delete this tax?');\"> <i class='ti ti-trash'></i> </a> </td>"; echo "</tr>"; } } else { echo "<tr><td colspan='5' class='text-center'>No taxes found</td></tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </main> <?php include("footer.php"); ?> <script src="assets/vendor/datatable/jquery-3.5.1.js"></script> <script src="assets/vendor/datatable/jquery.dataTables.min.js"></script> <script src="assets/js/data_table.js"></script> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.1/css/buttons.dataTables.min.css"> <script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script> <script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script> <script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.print.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>