Cleaned up empty vars and tags in Vendors listing add edit post

This commit is contained in:
johnny@pittpc.com 2021-02-03 18:31:01 -05:00
parent b7e4cab83a
commit 11f9f82f6d
5 changed files with 60 additions and 37 deletions

View File

@ -1,34 +1,36 @@
<div class="modal" id="addVendorModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-building mr-2"></i>New Vendor</h5>
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-building"></i> New Vendor</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span>&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="client_id" value="<?php if(isset($_GET['client_id'])){ echo $client_id; }else{ echo 0; } ?>">
<div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-address-tab" data-toggle="pill" href="#pills-address">Address</a>
<a class="nav-link" data-toggle="pill" href="#pills-address">Address</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact">Contact</a>
<a class="nav-link" data-toggle="pill" href="#pills-contact">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-notes-tab" data-toggle="pill" href="#pills-notes">Notes</a>
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
</li>
</ul>
<hr>
<div class="tab-content" id="pills-tabContent">
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-details">

View File

@ -215,15 +215,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="post.php?delete_client=<?php echo $client_id; ?>">Delete</a>
</div>
</div>
<?php include("edit_client_modal.php"); ?>
</div>
</td>
</tr>
<?php
include("edit_client_modal.php");
}
?>

View File

@ -1,8 +1,8 @@
<div class="modal" id="editVendorModal<?php echo $vendor_id; ?>" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-building mr-2"></i><?php echo $vendor_name; ?></h5>
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-building"></i> <?php echo $vendor_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
@ -11,7 +11,7 @@
<input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
<div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $vendor_id; ?>">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#pills-details<?php echo $vendor_id; ?>">Details</a>
</li>
@ -28,7 +28,7 @@
<hr>
<div class="tab-content" id="pills-tabContent<?php echo $vendor_id; ?>">
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-details<?php echo $vendor_id; ?>">
@ -64,7 +64,7 @@
</div>
<div class="tab-pane fade" id="pills-address<?php echo $vendor_id; ?>" role="tabpanel" aria-labelledby="pills-address-tab<?php echo $vendor_id; ?>">
<div class="tab-pane fade" id="pills-address<?php echo $vendor_id; ?>">
<div class="form-group">
<label>Address</label>

View File

@ -90,7 +90,7 @@
</div>
<div class="col-sm-8">
<div class="btn-group float-right">
<div class="btn-group">
<a href="?status=%" class="btn <?php if($status == '%'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">All</a>
<a href="?status=Open" class="btn <?php if($status == 'Open'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Open</a>
<a href="?status=In-Progress" class="btn <?php if($status == 'In-Progress'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">In-Progress</a>

View File

@ -39,7 +39,7 @@ if(isset($_GET['o'])){
}
//Date From and Date To Filter
if(isset($_GET['dtf'])){
if(!empty($_GET['dtf'])){
$dtf = $_GET['dtf'];
$dtt = $_GET['dtt'];
}else{
@ -60,28 +60,52 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
?>
<div class="card mb-3">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-2"><i class="fa fa-fw fa-building mr-2"></i>Vendors</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addVendorModal"><i class="fas fa-fw fa-plus"></i></button>
<div class="card card-dark mb-3">
<div class="card-header">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-building"></i> Vendors</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addVendorModal"><i class="fas fa-fw fa-plus"></i> New Vendor</button>
</div>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Invoices">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
<form class="mb-4" autocomplete="off">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Vendors">
<div class="input-group-append">
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<div class="collapse mt-3 <?php if(!empty($_GET['dtf'])){ echo "show"; } ?>" id="advancedFilter">
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>Date From</label>
<input type="date" class="form-control" name="dtf" value="<?php echo $dtf; ?>">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Date To</label>
<input type="date" class="form-control" name="dtt" value="<?php echo $dtt; ?>">
</div>
</div>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
<table class="table table-striped table-hover table-borderless">
<thead class="<?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
<tr>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_name&o=<?php echo $disp; ?>">Vendor</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_description&o=<?php echo $disp; ?>">Description</a></th>
<th>Contact</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_contact&o=<?php echo $disp; ?>">Contact</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
@ -110,9 +134,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
?>
<?php include("edit_vendor_modal.php"); ?>
<tr>
<td>
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?><a>
@ -168,13 +189,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</tr>
<?php
include("edit_vendor_modal.php");
}
?>
</tbody>
</table>
<?php include("pagination.php"); ?>