Added user CRUD functionality added template for reports added delete vendor

This commit is contained in:
root 2019-03-22 03:01:32 -04:00
parent 62f86df80e
commit 4171d9ac5d
11 changed files with 578 additions and 84 deletions

49
add_user_modal.php Normal file
View File

@ -0,0 +1,49 @@
<div class="modal fade" id="addUserModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-user-plus"></i> New User</h5>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<div class="modal-body">
<div class="form-group">
<label>Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Full Name" required>
</div>
</div>
<div class="form-group">
<label>Email</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
</div>
<input type="email" class="form-control" name="email" placeholder="Email Address" required>
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
</div>
<input type="password" class="form-control" name="password" placeholder="Enter a Password" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_user" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>

51
edit_user_modal.php Normal file
View File

@ -0,0 +1,51 @@
<div class="modal fade" id="editUserModal<?php echo $user_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-user-edit"></i> Edit User</h5>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="user_id" value="<?php echo $user_id; ?>">
<input type="hidden" name="current_password_hash" value="<?php echo $password; ?>">
<div class="modal-body">
<div class="form-group">
<label>Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $name; ?>" required>
</div>
</div>
<div class="form-group">
<label>Email</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
</div>
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $email; ?>" required>
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
</div>
<input type="password" class="form-control" name="password" placeholder="Enter a password" value="<?php echo $password; ?>" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="edit_user" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -34,11 +34,11 @@
?>
<tr>
<td><?php echo "$mileage_date"; ?></td>
<td><?php echo "$mileage_purpose"; ?></td>
<td><?php echo "$mileage_starting_location"; ?></td>
<td><?php echo "$mileage_destination"; ?></td>
<td><?php echo "$mileage_miles"; ?></td>
<td><?php echo $mileage_date; ?></td>
<td><?php echo $mileage_purpose; ?></td>
<td><?php echo $mileage_starting_location; ?></td>
<td><?php echo $mileage_destination; ?></td>
<td><?php echo $mileage_miles; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

112
post.php
View File

@ -6,6 +6,41 @@ include("check_login.php");
$todays_date = date('Y-m-d');
if(isset($_POST['add_user'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$password = md5(mysqli_real_escape_string($mysqli,$_POST['password']));
mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password'");
$_SESSION['alert_message'] = "User added";
header("Location: users.php");
}
if(isset($_POST['edit_user'])){
$user_id = intval($_POST['user_id']);
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$current_password_hash = mysqli_real_escape_string($mysqli,$_POST['current_password_hash']);
$password = mysqli_real_escape_string($mysqli,$_POST['password']);
if($current_password_hash == $password){
$password = $current_password_hash;
}else{
$password = md5($password);
}
mysqli_query($mysqli,"UPDATE users SET name = '$name', email = '$email', password = '$password' WHERE user_id = $user_id");
$_SESSION['alert_message'] = "User updated";
header("Location: users.php");
}
if(isset($_POST['add_client'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
@ -714,83 +749,6 @@ if(isset($_GET['delete_client_note'])){
}
if(isset($_POST['add_user'])){
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$password = mysqli_real_escape_string($mysqli,$_POST['password']);
$first_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['first_name']));
$last_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['last_name']));
$title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title']));
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
$phone = preg_replace("/[^0-9]/", '',$phone);
$location = intval($_POST['location']);
$user_access = intval($_POST['user_access']);
$hash_password = md5($password);
mysqli_query($mysqli,"INSERT INTO users SET email = '$email', password = '$hash_password', first_name = '$first_name', last_name = '$last_name', title = '$title', phone = '$phone', current_location_id = $location, user_created = UNIX_TIMESTAMP(), user_access = $user_access");
$user_id = mysqli_insert_id($mysqli);
$check = getimagesize($_FILES["avatar"]["tmp_name"]);
if($check !== false) {
$avatar_path = "uploads/user_avatars/";
$avatar_path = $avatar_path . $user_id . '_' . time() . '_' . basename( $_FILES['avatar']['name']);
move_uploaded_file($_FILES['avatar']['tmp_name'], $avatar_path);
}else{
$avatar_path = "img/default_user_avatar.png";
}
mysqli_query($mysqli,"UPDATE users SET avatar = '$avatar_path' WHERE user_id = $user_id");
$event_description = "User $first_name $last_name $email created.";
mysqli_query($mysqli,"INSERT INTO events SET event_type = 'Add User', event_description = '$event_description', event_created_at = UNIX_TIMESTAMP(), user_id = $session_user_id");
$_SESSION['alert_message'] = "User Added";
header("Location: admin.php?tab=users");
}
if(isset($_POST['edit_user'])){
$user_id = intval($_POST['user_id']);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$current_password_hash = mysqli_real_escape_string($mysqli,$_POST['current_password_hash']);
$new_password = mysqli_real_escape_string($mysqli,$_POST['new_password']);
if($current_password_hash == $new_password){
$hash_password = $current_password_hash;
}else{
$hash_password = md5($new_password);
}
$first_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['first_name']));
$last_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['last_name']));
$title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title']));
$phone = mysqli_real_escape_string($mysqli,$_POST['phone']);
$phone = preg_replace("/[^0-9]/", '',$phone);
$user_access = intval($_POST['user_access']);
$location = intval($_POST['location']);
$avatar_path = $_POST['current_avatar_path'];
$check = getimagesize($_FILES["avatar"]["tmp_name"]);
if($check !== false) {
if($avatar_path != "img/default_user_avatar.png"){
unlink($avatar_path);
}
$avatar_path = "uploads/user_avatars/";
$avatar_path = $avatar_path . $user_id . '_' . time() . '_' . basename( $_FILES['avatar']['name']);
move_uploaded_file($_FILES['avatar']['tmp_name'], "$avatar_path");
}
mysqli_query($mysqli,"UPDATE users SET email = '$email', password = '$hash_password', first_name = '$first_name', last_name = '$last_name', title = '$title', phone = '$phone', avatar = '$avatar_path', user_modified = UNIX_TIMESTAMP(), current_location_id = $location, user_access = $user_access WHERE user_id = $user_id");
$event_description = "User $first_name $last_name $email modified.";
mysqli_query($mysqli,"INSERT INTO events SET event_type = 'Edit User', event_description = '$event_description', event_created_at = UNIX_TIMESTAMP(), user_id = $session_user_id");
$_SESSION['alert_message'] = "User Updated.";
header("Location: admin.php?tab=users");
}
if(isset($_POST['change_password'])){
$current_url = $_POST['current_url'];
$new_password = mysqli_real_escape_string($mysqli,$_POST['new_password']);

View File

@ -0,0 +1,92 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category type = 'Expense' ORDER BY vendor_id DESC"); ?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-coins"></i> Expense Summary</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#print"><i class="fas fa-print"></i> Print</button>
<select class="form-control mt-5">
<option>2019</option>
<option>2018</option>
<option>2017</option>
</select>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Category</th>
<th class="text-right">January</th>
<th class="text-right">February</th>
<th class="text-right">March</th>
<th class="text-right">April</th>
<th class="text-right">May</th>
<th class="text-right">June</th>
<th class="text-right">July</th>
<th class="text-right">August</th>
<th class="text-right">September</th>
<th class="text-right">October</th>
<th class="text-right">November</th>
<th class="text-right">December</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>Expense Category Type</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<td>Expense Category Type 2</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th>Total</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php include("footer.php");

92
report_income_summary.php Normal file
View File

@ -0,0 +1,92 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category type = 'Expense' ORDER BY vendor_id DESC"); ?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-coins"></i> Income Summary</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#print"><i class="fas fa-print"></i> Print</button>
<select class="form-control mt-5">
<option>2019</option>
<option>2018</option>
<option>2017</option>
</select>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Category</th>
<th class="text-right">January</th>
<th class="text-right">February</th>
<th class="text-right">March</th>
<th class="text-right">April</th>
<th class="text-right">May</th>
<th class="text-right">June</th>
<th class="text-right">July</th>
<th class="text-right">August</th>
<th class="text-right">September</th>
<th class="text-right">October</th>
<th class="text-right">November</th>
<th class="text-right">December</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>Income Category Type</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<td>Income Category Type 2</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th>Total</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php include("footer.php");

View File

@ -0,0 +1,92 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category type = 'Expense' ORDER BY vendor_id DESC"); ?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-coins"></i> Expense Summary</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#print"><i class="fas fa-print"></i> Print</button>
<select class="form-control mt-5">
<option>2019</option>
<option>2018</option>
<option>2017</option>
</select>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Category</th>
<th class="text-right">January</th>
<th class="text-right">February</th>
<th class="text-right">March</th>
<th class="text-right">April</th>
<th class="text-right">May</th>
<th class="text-right">June</th>
<th class="text-right">July</th>
<th class="text-right">August</th>
<th class="text-right">September</th>
<th class="text-right">October</th>
<th class="text-right">November</th>
<th class="text-right">December</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>Category Type</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<td>Category Type 2</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th>Total</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php include("footer.php");

100
report_profit_loss.php Normal file
View File

@ -0,0 +1,100 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category type = 'Expense' ORDER BY vendor_id DESC"); ?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-coins"></i> Profit & Loss</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#print"><i class="fas fa-print"></i> Print</button>
<select class="form-control mt-5">
<option>2019</option>
<option>2018</option>
<option>2017</option>
</select>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th></th>
<th class="text-right">Jan-Mar</th>
<th class="text-right">Apr-Jun</th>
<th class="text-right">Jul-Sep</th>
<th class="text-right">Oct-Dec</th>
<th class="text-right">Total</th>
</tr>
<tr>
<th><br><br>Income</th>
<th colspan="5"></th>
</tr>
</thead>
<tbody>
<tr>
<td>Income Category Type</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<td>Income Category Type 2</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th>Gross Profit</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
</tr>
<tr>
<th><br><br>Expenses</th>
<th colspan="5"></th>
</tr>
<tr>
<td>Expense Category Type</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<td>Expense Category Type 2</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th>Total Expenses<br><br><br></th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
</tr>
<tr>
<th>Net Profit</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
<th class="text-right">$0.00</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php include("footer.php");

View File

@ -59,7 +59,7 @@
<span>Reports</span>
</a>
<div class="dropdown-menu" aria-labelledby="pagesDropdown">
<a class="dropdown-item" href="report_expense_income_summary.php">Income Summary</a>
<a class="dropdown-item" href="report_income_summary.php">Income Summary</a>
<a class="dropdown-item" href="report_expense_summary.php">Expense Summary</a>
<a class="dropdown-item" href="report_income_vs_expense.php">Income vs Expense</a>
<a class="dropdown-item" href="report_profit_loss.php">Profit & Loss</a>

60
users.php Normal file
View File

@ -0,0 +1,60 @@
<?php include("header.php"); ?>
<?php $sql = mysqli_query($mysqli,"SELECT * FROM users ORDER BY user_id DESC"); ?>
<div class="card mb-3">
<div class="card-header">
<h6 class="float-left mt-1"><i class="fa fa-users"></i> Users</h6>
<button type="button" class="btn btn-primary btn-sm mr-auto float-right" data-toggle="modal" data-target="#addUserModal"><i class="fas fa-plus"></i> Add New</button>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th class="text-center">Actions</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($sql)){
$user_id = $row['user_id'];
$name = $row['name'];
$email = $row['email'];
$password = $row['password'];
?>
<tr>
<td><?php echo $name; ?></a></td>
<td><a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editUserModal<?php echo $user_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_user=<?php echo $user_id; ?>">Delete</a>
</div>
</div>
</td>
</tr>
<?php
include("edit_user_modal.php");
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php include("add_user_modal.php"); ?>
<?php include("footer.php");

View File

@ -46,7 +46,7 @@
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editvendorModal<?php echo $vendor_id; ?>">Edit</a>
<a class="dropdown-item" href="#">Delete</a>
<a class="dropdown-item" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
</div>
</div>
</td>