mirror of https://github.com/itflow-org/itflow
Updated Vendors added description and account number removed address phone email
This commit is contained in:
parent
65557db9a9
commit
3f34bac863
|
|
@ -29,8 +29,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Note</label>
|
||||
<textarea rows="4" class="form-control" name="note"></textarea>
|
||||
<label>Account Number</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="account_number" placeholder="Account number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-user"></i> New vendor</h5>
|
||||
<h5 class="modal-title"><i class="fa fa-building"></i> New vendor</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
@ -14,32 +14,12 @@
|
|||
<input type="text" class="form-control" name="name" required autofocus="autofocus">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Phone</label>
|
||||
<input type="text" class="form-control" name="phone" data-inputmask="'mask': '999-999-9999'">
|
||||
<label>Description</label>
|
||||
<input type="text" class="form-control" name="description" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Email</label>
|
||||
<input type="email" class="form-control" name="email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Website</label>
|
||||
<input type="text" class="form-control" name="website">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
<input type="text" class="form-control" name="address">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>City</label>
|
||||
<input type="text" class="form-control" name="city">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>State</label>
|
||||
<input type="text" class="form-control" name="state">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Zip</label>
|
||||
<input type="text" class="form-control" name="zip">
|
||||
<label>Account Number</label>
|
||||
<input type="text" class="form-control" name="account_number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<tr>
|
||||
<th>Vendor</th>
|
||||
<th>Description</th>
|
||||
<th>Account Number</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -16,11 +17,13 @@
|
|||
$client_vendor_id = $row['client_vendor_id'];
|
||||
$client_vendor_name = $row['client_vendor_name'];
|
||||
$client_vendor_description = $row['client_vendor_description'];
|
||||
$client_vendor_account_number = $row['client_vendor_account_number'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "$client_vendor_name"; ?></td>
|
||||
<td><?php echo "$client_vendor_description"; ?></td>
|
||||
<td><?php echo $client_vendor_name; ?></td>
|
||||
<td><?php echo $client_vendor_description; ?></td>
|
||||
<td><?php echo $client_vendor_account_number; ?></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">
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@
|
|||
<input type="text" class="form-control" name="description" placeholder="Description of the Vendor" value="<?php echo $client_vendor_description; ?>"required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Account Number</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="account_number" placeholder="Account number" value="<?php echo $client_vendor_account_number; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -8,43 +8,24 @@
|
|||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Name</label>
|
||||
<input type="text" class="form-control" name="name" value="<?php echo "$vendor_name"; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Phone</label>
|
||||
<input type="text" class="form-control" name="phone" data-inputmask="'mask': '999-999-9999'" value="<?php echo "$vendor_phone"; ?>" required>
|
||||
<label>Description</label>
|
||||
<input type="text" class="form-control" name="description" value="<?php echo $vendor_description; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Email</label>
|
||||
<input type="email" class="form-control" name="email" value="<?php echo "$vendor_email"; ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Website</label>
|
||||
<input type="text" class="form-control" name="website" value="<?php echo "$vendor_website"; ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
<input type="text" class="form-control" name="address" value="<?php echo "$vendor_address"; ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>City</label>
|
||||
<input type="text" class="form-control" name="city" value="<?php echo "$vendor_city"; ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>State</label>
|
||||
<input type="text" class="form-control" name="state" value="<?php echo "$vendor_state"; ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Zip</label>
|
||||
<input type="text" class="form-control" name="zip" value="<?php echo "$vendor_zip"; ?>">
|
||||
<label>Account Number</label>
|
||||
<input type="text" class="form-control" name="account_number" value="<?php echo $vendor_account_number; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="_vendor" class="btn btn-primary">Save</button>
|
||||
<button type="submit" name="edit_vendor" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
32
post.php
32
post.php
|
|
@ -96,16 +96,10 @@ if(isset($_GET['delete_client'])){
|
|||
if(isset($_POST['add_vendor'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['address']));
|
||||
$city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['city']));
|
||||
$state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['state']));
|
||||
$zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip']));
|
||||
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
||||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
|
||||
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
||||
$account_number = strip_tags(mysqli_real_escape_string($mysqli,$_POST['account_number']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO vendors SET vendor_name = '$name', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_phone = '$phone', vendor_email = '$email', vendor_website = '$website', vendor_created_at = UNIX_TIMESTAMP()");
|
||||
mysqli_query($mysqli,"INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_account_number = '$account_number', vendor_created_at = UNIX_TIMESTAMP()");
|
||||
|
||||
$_SESSION['alert_message'] = "Vendor added";
|
||||
|
||||
|
|
@ -117,16 +111,10 @@ if(isset($_POST['edit_vendor'])){
|
|||
|
||||
$vendor_id = intval($_POST['vendor_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['address']));
|
||||
$city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['city']));
|
||||
$state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['state']));
|
||||
$zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip']));
|
||||
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
||||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
|
||||
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
||||
$account_number = strip_tags(mysqli_real_escape_string($mysqli,$_POST['account_number']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE vendors SET vendor_name = '$name', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_phone = '$phone', vendor_email = '$email', vendor_website = '$website', vendor_updated_at = UNIX_TIMESTAMP() WHERE vendor_id = $vendor_id");
|
||||
mysqli_query($mysqli,"UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_account_number = '$account_number', vendor_updated_at = UNIX_TIMESTAMP() WHERE vendor_id = $vendor_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Vendor modified";
|
||||
|
||||
|
|
@ -631,9 +619,9 @@ if(isset($_POST['add_client_vendor'])){
|
|||
$client_id = intval($_POST['client_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
$account_number = strip_tags(mysqli_real_escape_string($mysqli,$_POST['account_number']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO client_vendors SET client_vendor_name = '$name', client_vendor_description = '$description', client_vendor_note = '$note', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO client_vendors SET client_vendor_name = '$name', client_vendor_description = '$description', client_vendor_account_number = '$account_number', client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Vendor added";
|
||||
|
||||
|
|
@ -646,9 +634,9 @@ if(isset($_POST['edit_client_vendor'])){
|
|||
$client_vendor_id = intval($_POST['client_vendor_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
$account_number = strip_tags(mysqli_real_escape_string($mysqli,$_POST['account_number']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE client_vendors SET client_vendor_name = '$name', client_vendor_description = '$description', client_vendor_note = '$note' WHERE client_vendor_id = $client_vendor_id");
|
||||
mysqli_query($mysqli,"UPDATE client_vendors SET client_vendor_name = '$name', client_vendor_description = '$description', client_vendor_account_number = '$account_number' WHERE client_vendor_id = $client_vendor_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Vendor updated";
|
||||
|
||||
|
|
|
|||
24
vendors.php
24
vendors.php
|
|
@ -13,10 +13,9 @@
|
|||
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Website</th>
|
||||
<th>Vendor</th>
|
||||
<th>Description</th>
|
||||
<th>Account Number</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -26,26 +25,21 @@
|
|||
while($row = mysqli_fetch_array($sql)){
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = $row['vendor_name'];
|
||||
$vendor_email = $row['vendor_email'];
|
||||
$vendor_phone = $row['vendor_phone'];
|
||||
if(strlen($vendor_phone)>2){
|
||||
$vendor_phone = substr($row['vendor_phone'],0,3)."-".substr($row['vendor_phone'],3,3)."-".substr($row['vendor_phone'],6,4);
|
||||
}
|
||||
$vendor_website = $row['vendor_website'];
|
||||
$vendor_description = $row['vendor_description'];
|
||||
$vendor_account_number = $row['vendor_account_number'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "$vendor_name"; ?></td>
|
||||
<td><?php echo "$vendor_email"; ?></td>
|
||||
<td><?php echo "$vendor_phone"; ?></td>
|
||||
<td><?php echo "$vendor_website"; ?></td>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td><?php echo $vendor_description; ?></td>
|
||||
<td><?php echo $vendor_account_number; ?></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="#editvendorModal<?php echo $vendor_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue