V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
home
/
aerosoft
/
public_html
/
InventorySystem
/
Viewing: stores.php
<?php $page_title = 'Manage Stores'; require_once('includes/load.php'); // Checkin What level user has permission to view this page page_require_level(1); $all_stores = find_all('stores'); ?> <?php if(isset($_POST['add_store'])){ $req_fields = array('store-name','store-address','store-license'); validate_fields($req_field); $store_name = remove_junk($db->escape($_POST['store-name'])); $store_address = remove_junk($db->escape($_POST['store-address'])); $store_license = remove_junk($db->escape($_POST['store-license'])); if(empty($errors)){ $sql = "INSERT INTO stores (store_name, store_address, store_license_number)"; $sql .= " VALUES ('{$store_name}', '{$store_address}', '{$store_license}')"; if($db->query($sql)){ $session->msg("s", "Successfully Added New Store"); redirect('stores.php',false); } else { $session->msg("d", "Sorry Failed to insert."); redirect('stores.php',false); } } else { $session->msg("d", $errors); redirect('stores.php',false); } } ?> <?php include_once('layouts/header.php'); ?> <div class="row"> <div class="col-md-12"> <?php echo display_msg($msg); ?> </div> </div> <div class="row"> <div class="col-md-5"> <div class="panel panel-default"> <div class="panel-heading"> <strong> <span class="glyphicon glyphicon-th"></span> <span>Add New Store</span> </strong> </div> <div class="panel-body"> <form method="post" action="stores.php"> <div class="form-group"> <input type="text" class="form-control" name="store-name" placeholder="Store Name" required> </div> <div class="form-group"> <textarea class="form-control" name="store-address" placeholder="Store Address" required></textarea> </div> <div class="form-group"> <input type="text" class="form-control" name="store-license" placeholder="License Number" required> </div> <button type="submit" name="add_store" class="btn btn-primary">Add Store</button> </form> </div> </div> </div> <div class="col-md-7"> <div class="panel panel-default"> <div class="panel-heading"> <strong> <span class="glyphicon glyphicon-th"></span> <span>All Stores</span> </strong> </div> <div class="panel-body"> <table class="table table-bordered table-striped table-hover"> <thead> <tr> <th class="text-center" style="width: 50px;">#</th> <th>Store Name</th> <th>License Number</th> <th>Address</th> <th class="text-center" style="width: 100px;">Actions</th> </tr> </thead> <tbody> <?php foreach ($all_stores as $store):?> <tr> <td class="text-center"><?php echo count_id();?></td> <td><?php echo remove_junk(ucfirst($store['store_name'])); ?></td> <td><?php echo remove_junk($store['store_license_number']); ?></td> <td><?php echo remove_junk($store['store_address']); ?></td> <td class="text-center"> <div class="btn-group"> <a href="edit_store.php?id=<?php echo (int)$store['id'];?>" class="btn btn-xs btn-warning" data-toggle="tooltip" title="Edit"> <span class="glyphicon glyphicon-edit"></span> </a> <a href="delete_store.php?id=<?php echo (int)$store['id'];?>" class="btn btn-xs btn-danger" data-toggle="tooltip" title="Remove"> <span class="glyphicon glyphicon-trash"></span> </a> </div> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> </div> </div> <?php include_once('layouts/footer.php'); ?>
Coded With 💗 by
HanzOFC