[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: all-client.php
<?php include("db/db.php");?> <?php include("includes/functions/functions.php");?> <?php if(!isset($_SESSION['name_Xw211qAAsq4'])){ header('Location: index'); exit(); } else{ $username = $_SESSION['name_Xw211qAAsq4']; if(isset($_POST['del'])){ $ID = mysqli_real_escape_string($new,$_POST['SID']); $DEL = mysqli_query($new,"DELETE FROM expenses WHERE id = '$ID'"); } if(isset($_POST['update'])){ $vendor_id = filter_input(INPUT_POST, 'vendor_id', FILTER_SANITIZE_STRING); $vendor_id = htmlspecialchars($vendor_id, ENT_QUOTES, 'UTF-8'); $exp_id = filter_input(INPUT_POST, 'exp_id', FILTER_SANITIZE_STRING); $exp_id = htmlspecialchars($exp_id, ENT_QUOTES, 'UTF-8'); $item_name = filter_input(INPUT_POST, 'item_name', FILTER_SANITIZE_STRING); $item_name = htmlspecialchars($item_name, ENT_QUOTES, 'UTF-8'); $item_amount = filter_input(INPUT_POST, 'item_amount', FILTER_SANITIZE_STRING); $item_amount = htmlspecialchars($item_amount, ENT_QUOTES, 'UTF-8'); $note = filter_input(INPUT_POST, 'note', FILTER_SANITIZE_STRING); $note = htmlspecialchars($note, ENT_QUOTES, 'UTF-8'); $date = filter_input(INPUT_POST, 'date', FILTER_SANITIZE_STRING); $date = htmlspecialchars($date, ENT_QUOTES, 'UTF-8'); $stmt_update_service = $con->prepare("UPDATE expenses SET vendor_id = ?,item_name = ?,item_amount = ?,note = ?,date = ? WHERE id = ?"); $stmt_update_service->execute(array($vendor_id,$item_name,$item_amount,$note,$date,$exp_id)); } if(isset($_POST['insert'])){ $vendor_id = filter_input(INPUT_POST, 'vendor_id', FILTER_SANITIZE_STRING); $vendor_id = htmlspecialchars($vendor_id, ENT_QUOTES, 'UTF-8'); $item_name = filter_input(INPUT_POST, 'item_name', FILTER_SANITIZE_STRING); $item_name = htmlspecialchars($item_name, ENT_QUOTES, 'UTF-8'); $item_amount = filter_input(INPUT_POST, 'item_amount', FILTER_SANITIZE_STRING); $item_amount = htmlspecialchars($item_amount, ENT_QUOTES, 'UTF-8'); $note = filter_input(INPUT_POST, 'note', FILTER_SANITIZE_STRING); $note = htmlspecialchars($note, ENT_QUOTES, 'UTF-8'); $date = filter_input(INPUT_POST, 'date', FILTER_SANITIZE_STRING); $date = htmlspecialchars($date, ENT_QUOTES, 'UTF-8'); if(!empty($item_amount)){ $stmt = $con->prepare("insert into admin_expenses(vendor_id,item_name,item_amount,note,date) values(?,?,?,?,?) "); $stmt->execute(array($vendor_id,$item_name,$item_amount,$note,$date)); } } ?> <div id="layout-wrapper"> <div class="header-border"></div> <header id="page-topbar"> <?php include("includes/template/header.php");?> </header> <!-- Plugins css --> <link href="plugins/datatables/dataTables.bootstrap4.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/responsive.bootstrap4.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/buttons.bootstrap4.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/select.bootstrap4.css" rel="stylesheet" type="text/css" /> <title><?php echo $shopname?> || <?php echo $pageTitle1;?></title> <script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js'></script> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css'/> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/theme.min.css" rel="stylesheet" type="text/css" /> <div class="vertical-menu"> <?php include("includes/template/sidebar.php");?> </div> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <!-- start page title --> <div class="row"> <div class="col-12"> <h4 class="mb-0 font-size-18">All Clients </h4> <div class="page-title-box d-flex align-items-center justify-content-between"> </div> </div> </div> <!-- end page title --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <button type="button" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-target=".bd-example-modal-lg">Add client</button> <br /><br /> <div class="table-responsive"> <table id="basic-datatable" class="table table-hover table-striped table-bordered"> <thead> <tr> <th>ID</th> <th>Client name</th> <th>Outlet name </th> <th>Phone number</th> <th>Date</th> <th>Action</th> </tr> </thead> <tbody> <?php $cont = 1; $stmt = $con->prepare("SELECT * FROM admin_expenses e, admin_vendors v where e.vendor_id = v.vendor_id ORDER BY e.id DESC"); $stmt->execute(); $rows_services = $stmt->fetchAll(); ?> <tr> <?php foreach($rows_services as $service){ ?> <td><?php echo $cont++;?></td> <td><?php echo $service['vendor_name'];?></td> <td><?php echo $service['item_name'];?></td> <td><?php echo number_format($service['item_amount'],2);?></td> <td><?php echo date("F,d, Y",strtotime($service['date'])) ?></td> <td> <?php $edit_data = "edit_".$service["id"];?> <?php $delete_data = "delete_".$service["id"];?> <li class="list-inline-item" data-toggle="tooltip" title="Edit"> <a href="#" data-toggle="modal" data-target="#<?php echo $edit_data; ?>" data-placement="top"><i class="fa fa-edit"></i></a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Delete"> <a href="#" data-toggle="modal" data-target="#<?php echo $delete_data; ?>" data-placement="top"><i class="fa fa-trash-alt" style="color:red"></i></a> </li> <div class="modal fade" id="<?php echo $delete_data; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $delete_data; ?>" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Delete Expenses</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form method="POST"> Are you sure you want to delete this Expenses? </div> <input type="hidden" name="SID" value="<?php echo $service['id']; ?>"> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="submit" name="del" class="btn btn-success">Delete</button> </form> </div> </div> </div> </div> <div class="modal fade bd-example-modal-lg12" id="<?php echo $edit_data; ?>" tabindex="-1" role="dialog" aria-labelledby="<?php echo $edit_data; ?>" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title h4" id="myLargeModalLabel">Edit Expenses</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div id="response"></div> </div> <div class="modal-body"> <form method="post"> <div class="row"> <div class="form-group col-md-6"> <label>Vendor name</label> <?php $stmt = $con->prepare("SELECT * FROM vendors WHERE business_name = ?"); $stmt->execute(array("$shopname")); $rows_categories = $stmt->fetchAll(); ?> <select class="custom-select" name="vendor_id" value="<?php echo $service['vendor_name'] ;?>"> <option value="">Select Vendor </option> <?php foreach($rows_categories as $category) { if($category['vendor_id'] == $category['vendor_id']) { echo "<option value = '".$category['vendor_id']."' selected>"; echo $category['vendor_name']; echo "</option>"; } else { echo "<option value = '".$category['vendor_id']."'>"; echo $category['vendor_name']; echo "</option>"; } } ?> </select> </div> <div class="form-group col-md-6"> <label>Item name</label> <input type="text" name="item_name" value="<?php echo $service['item_name'] ;?>" class="form-control" style="height:40px"> </div> <div class="form-group col-md-6"> <label>Amount</label> <input type="number" name="item_amount" value="<?php echo $service['item_amount'] ;?>" class="form-control" style="height:40px"> </div> <div class="form-group col-md-6"> <label>Date</label> <input type="date" name="date" required value="<?php echo $service['date'] ;?>" class="form-control" style="height:40px"> </div> <input type="hidden" name="exp_id" value="<?php echo $service['id'] ;?>"> <div class="form-group col-md-12"> <label>Note</label> <textarea cols="5" name="note" class="form-control"><?php echo $service['note'] ;?></textarea> </div> <div class="form-group col-md-4"> <button type="submit" name="update" class="btn btn-success form-control">Send</button> </div> </div> </form> </div> </div> </div> </div> </li> </ul> </td> </tr> <?php };?> </tbody> </table> </div> </div> <!-- end card --> </div><!-- end col--> </div> <!-- end row--> </div> <!-- container-fluid --> </div> <!-- End Page-content --> <?php include("includes/template/footer.php");?> </div> <!-- end main content--> </div> <!-- Overlay--> <div class="menu-overlay"></div> <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title h4" id="myLargeModalLabel">Add New Expenses</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div id="response"></div> </div> <div class="modal-body"> <form method="post" accept-charset="utf-8" > <div class="row"> <div class="form-group col-md-6"> <label>Vendor name</label> <?php $stmt = $con->prepare("SELECT * FROM admin_vendors ORDER BY vendor_id DESC"); $stmt->execute(); $rows_categories = $stmt->fetchAll(); ?> <select class="custom-select" name="vendor_id"> <option value="">Select Vendor </option> <?php foreach($rows_categories as $category) { if($category['vendor_id'] == $service['vendor_id']) { echo "<option value = '".$category['vendor_id']."' selected>"; echo $category['vendor_name']; echo "</option>"; } else { echo "<option value = '".$category['vendor_id']."'>"; echo $category['vendor_name']; echo "</option>"; } } ?> </select> </div> <div class="form-group col-md-6"> <label>Item name</label> <input type="text" name="item_name" class="form-control" style="height:40px"> </div> <div class="form-group col-md-6"> <label>Amount</label> <input type="text" name="item_amount" class="form-control" style="height:40px"> </div> <div class="form-group col-md-6"> <label>Date</label> <input type="date" name="date" class="form-control" style="height:40px"> </div> <div class="form-group col-md-12"> <label>Note</label> <textarea cols="5" name="note" class="form-control"></textarea> </div> <div class="form-group col-md-4"> <button type="submit" name="insert" class="btn btn-success form-control">Send</button> </div> </div> </form> </div> </div> </div> </div> <!-- third party js --> <script src="plugins/datatables/jquery.dataTables.min.js"></script> <script src="plugins/datatables/dataTables.bootstrap4.js"></script> <script src="plugins/datatables/dataTables.responsive.min.js"></script> <script src="plugins/datatables/responsive.bootstrap4.min.js"></script> <script src="plugins/datatables/dataTables.buttons.min.js"></script> <script src="plugins/datatables/buttons.bootstrap4.min.js"></script> <script src="plugins/datatables/buttons.html5.min.js"></script> <script src="plugins/datatables/buttons.flash.min.js"></script> <script src="plugins/datatables/buttons.print.min.js"></script> <script src="plugins/datatables/dataTables.keyTable.min.js"></script> <script src="plugins/datatables/dataTables.select.min.js"></script> <!-- third party js ends --> <!-- Datatables init --> <script src="assets/pages/datatables-demo.js"></script> <!-- App js --> <script src="assets/js/theme.js"></script> </body> </html> <?php }?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 60.06 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002