Added Phone Extensions to vendors, clients, and contacts, updated DB to relect new fields, some other minor cleanups

This commit is contained in:
johnny@pittpc.com 2020-01-20 17:05:39 -05:00
parent f84e3c4b6b
commit 382a4b2842
49 changed files with 112 additions and 58 deletions

View File

@ -114,16 +114,23 @@
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
<label>Phone</label>
<div class="form-row">
<div class="col-8">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
</div>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension">
</div>
</div>
<div class="form-group">
<label>Mobile</label>
<div class="input-group">

View File

@ -30,13 +30,20 @@
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
<label>Phone</label>
<div class="form-row">
<div class="col-8">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
</div>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'">
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension">
</div>
</div>

View File

@ -122,13 +122,20 @@
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
<label>Phone</label>
<div class="form-row">
<div class="col-8">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'">
</div>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone number" data-inputmask="'mask': '999-999-9999'">
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension">
</div>
</div>

View File

@ -73,7 +73,6 @@ $total_pages = ceil($total_found_rows / 10);
<tr>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_type&o=<?php echo $disp; ?>">Type</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_ip&o=<?php echo $disp; ?>">IP</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_make&o=<?php echo $disp; ?>">Make</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_model&o=<?php echo $disp; ?>">Model</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_serial&o=<?php echo $disp; ?>">Serial</a></th>
@ -183,7 +182,6 @@ $total_pages = ceil($total_found_rows / 10);
?>
</td>
<td><?php echo $asset_ip; ?></td>
<td><?php echo $asset_make; ?></td>
<td><?php echo $asset_model; ?></td>
<td><?php echo $asset_serial; ?></td>

View File

@ -87,6 +87,7 @@ $total_pages = ceil($total_found_rows / 10);
if(strlen($contact_phone)>2){
$contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4);
}
$contact_extension = $row['contact_extension'];
$contact_mobile = $row['contact_mobile'];
if(strlen($contact_mobile)>2){
$contact_mobile = substr($row['contact_mobile'],0,3)."-".substr($row['contact_mobile'],3,3)."-".substr($row['contact_mobile'],6,4);
@ -122,7 +123,7 @@ $total_pages = ceil($total_found_rows / 10);
<?php
if(!empty($contact_phone)){
?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?> <?php if(!empty($contact_extension)){ echo "x$contact_extension"; } ?>
<br>
<?php
}

View File

@ -48,8 +48,8 @@ if(!empty($_GET['dtf'])){
$dtf = $_GET['dtf'];
$dtt = $_GET['dtt'];
}else{
$dtf = "1000-01-01";
$dtt = "9999-01-01";
$dtf = "0000-00-00";
$dtt = "9999-00-00";
}
//Rebuild URL
@ -125,6 +125,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
if(strlen($client_phone)>2){
$client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4);
}
$client_extension = $row['client_extension'];
$client_mobile = $row['client_mobile'];
if(strlen($client_mobile)>2){
$client_mobile = substr($row['client_mobile'],0,3)."-".substr($row['client_mobile'],3,3)."-".substr($row['client_mobile'],6,4);
@ -172,7 +173,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
<?php
if(!empty($client_phone)){
?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $client_phone; ?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $client_phone; ?> <?php if(!empty($client_extension)){ echo "x$client_extension"; } ?>
<br>
<?php
}

View File

@ -73,7 +73,7 @@ $total_pages = ceil($total_found_rows / 10);
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_title&o=<?php echo $disp; ?>">Title</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_email&o=<?php echo $disp; ?>">Email</a></th>
<th>Phone</th>
<th class="text-center">Action</th>
<th class="text-center">Actionl</th>
</tr>
</thead>
<tbody>
@ -87,6 +87,7 @@ $total_pages = ceil($total_found_rows / 10);
if(strlen($contact_phone)>2){
$contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4);
}
$contact_extension = $row['contact_extension '];
$contact_mobile = $row['contact_mobile'];
if(strlen($contact_mobile)>2){
$contact_mobile = substr($row['contact_mobile'],0,3)."-".substr($row['contact_mobile'],3,3)."-".substr($row['contact_mobile'],6,4);
@ -96,6 +97,7 @@ $total_pages = ceil($total_found_rows / 10);
$contact_initials = initials($contact_name);
$client_id = $row['client_id'];
$client_name = $row['client_name'];
?>
<tr>
@ -124,7 +126,7 @@ $total_pages = ceil($total_found_rows / 10);
<?php
if(!empty($contact_phone)){
?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?> <?php echo $contact_extension; ?>
<br>
<?php
}

11
db.sql
View File

@ -1,8 +1,8 @@
-- MariaDB dump 10.17 Distrib 10.4.10-MariaDB, for debian-linux-gnu (x86_64)
-- MariaDB dump 10.17 Distrib 10.4.11-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: admin_crm
-- Host: localhost Database: admin_crm
-- ------------------------------------------------------
-- Server version 10.4.10-MariaDB-1:10.4.10+maria~bionic
-- Server version 10.4.11-MariaDB-1:10.4.11+maria~bionic
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@ -137,6 +137,7 @@ CREATE TABLE `clients` (
`client_zip` varchar(200) DEFAULT NULL,
`client_contact` varchar(200) DEFAULT NULL,
`client_phone` varchar(200) DEFAULT NULL,
`client_extension` varchar(200) DEFAULT NULL,
`client_mobile` varchar(200) DEFAULT NULL,
`client_email` varchar(200) DEFAULT NULL,
`client_website` varchar(200) DEFAULT NULL,
@ -178,6 +179,7 @@ CREATE TABLE `contacts` (
`contact_title` varchar(200) DEFAULT NULL,
`contact_email` varchar(200) DEFAULT NULL,
`contact_phone` varchar(200) DEFAULT NULL,
`contact_extension` varchar(200) DEFAULT NULL,
`contact_mobile` varchar(200) DEFAULT 'NULL',
`contact_primary` tinyint(1) DEFAULT NULL,
`contact_recieve_invoices` tinyint(1) DEFAULT NULL,
@ -797,6 +799,7 @@ CREATE TABLE `vendors` (
`vendor_zip` varchar(200) DEFAULT NULL,
`vendor_contact_name` varchar(200) DEFAULT NULL,
`vendor_phone` varchar(200) DEFAULT NULL,
`vendor_extension` varchar(200) DEFAULT NULL,
`vendor_email` varchar(200) DEFAULT NULL,
`vendor_website` varchar(200) DEFAULT NULL,
`vendor_account_number` varchar(200) DEFAULT NULL,
@ -817,4 +820,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-01-04 19:47:01
-- Dump completed on 2020-01-20 17:04:20

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
dist/img/avatar.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

BIN
dist/img/avatar04.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
dist/img/avatar2.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

BIN
dist/img/avatar3.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

BIN
dist/img/avatar5.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

BIN
dist/img/boxed-bg.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

BIN
dist/img/boxed-bg.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

BIN
dist/img/icons.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
dist/img/noone.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
dist/img/photo1.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 KiB

BIN
dist/img/photo2.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 KiB

BIN
dist/img/photo3.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 KiB

BIN
dist/img/photo4.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

BIN
dist/img/prod-1.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

BIN
dist/img/prod-2.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

BIN
dist/img/prod-3.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

BIN
dist/img/prod-4.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

BIN
dist/img/prod-5.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -115,13 +115,20 @@
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
<label>Phone</label>
<div class="form-row">
<div class="col-8">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $client_phone; ?>">
</div>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" value="<?php echo $client_phone; ?>" data-inputmask="'mask': '999-999-9999'">
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $client_extension; ?>">
</div>
</div>

View File

@ -41,14 +41,21 @@
<input type="text" class="form-control" name="title" placeholder="Title" value="<?php echo $contact_title; ?>" required>
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-phone"></i></span>
<label>Phone</label>
<div class="form-row">
<div class="col-8">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_phone; ?>">
</div>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" value="<?php echo $contact_phone; ?>">
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $contact_extension; ?>">
</div>
</div>

View File

@ -122,13 +122,20 @@
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
<label>Phone</label>
<div class="form-row">
<div class="col-8">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone Number" value="<?php echo $vendor_phone; ?>" data-inputmask="'mask': '999-999-9999'">
</div>
</div>
<input type="text" class="form-control" name="phone" placeholder="Phone number" value="<?php echo $vendor_phone; ?>" data-inputmask="'mask': '999-999-9999'">
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $vendor_extension; ?>">
</div>
</div>

View File

@ -239,7 +239,7 @@ if(isset($_GET['invoice_id'])){
<td><input type="text" class="form-control" name="name" placeholder="Product"></td>
<td><textarea class="form-control" rows="1" name="description" placeholder="Description"></textarea></td>
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: center;" name="qty" placeholder="Quantity"></td>
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
<td><input type="number" step="0.01" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
<td>
<select dir="rtl" class="form-control" name="tax">
<option <?php if($item_tax == '0.00'){ echo "selected"; } ?> value="0.00">None</option>

View File

@ -480,6 +480,7 @@ if(isset($_POST['add_client'])){
$contact = strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact']));
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
$phone = preg_replace("/[^0-9]/", '',$phone);
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
$mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile']));
$mobile = preg_replace("/[^0-9]/", '',$mobile);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
@ -487,7 +488,7 @@ if(isset($_POST['add_client'])){
$net_terms = intval($_POST['net_terms']);
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_created_at = NOW(), company_id = $session_company_id");
mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_created_at = NOW(), company_id = $session_company_id");
$client_id = mysqli_insert_id($mysqli);
@ -515,6 +516,7 @@ if(isset($_POST['edit_client'])){
$contact = strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact']));
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
$phone = preg_replace("/[^0-9]/", '',$phone);
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
$mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile']));
$mobile = preg_replace("/[^0-9]/", '',$mobile);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
@ -522,7 +524,7 @@ if(isset($_POST['edit_client'])){
$net_terms = intval($_POST['net_terms']);
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_updated_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_updated_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Client', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), client_id = $client_id, company_id = $session_company_id, user_id = $session_user_id");
@ -801,10 +803,11 @@ if(isset($_POST['add_vendor'])){
$contact_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_name']));
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
$phone = preg_replace("/[^0-9]/", '',$phone);
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
mysqli_query($mysqli,"INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
mysqli_query($mysqli,"INSERT INTO vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
$vendor_id = mysqli_insert_id($mysqli);
@ -830,10 +833,11 @@ if(isset($_POST['edit_vendor'])){
$contact_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_name']));
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
$phone = preg_replace("/[^0-9]/", '',$phone);
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
mysqli_query($mysqli,"UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_updated_at = NOW() WHERE vendor_id = $vendor_id AND company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE vendors SET vendor_name = '$name', vendor_description = '$description', vendor_address = '$address', vendor_city = '$city', vendor_state = '$state', vendor_zip = '$zip', vendor_contact_name = '$contact_name', vendor_phone = '$phone', vendor_extension = '$extension', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_updated_at = NOW() WHERE vendor_id = $vendor_id AND company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Vendor', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
@ -2763,6 +2767,7 @@ if(isset($_POST['add_contact'])){
$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);
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
$mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile']));
$mobile = preg_replace("/[^0-9]/", '',$mobile);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
@ -2778,7 +2783,7 @@ if(isset($_POST['add_contact'])){
move_uploaded_file($_FILES['file']['tmp_name'], $path);
}
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_created_at = NOW(), client_id = $client_id, company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
@ -2797,6 +2802,7 @@ if(isset($_POST['edit_contact'])){
$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);
$extension = strip_tags(mysqli_real_escape_string($mysqli,$_POST['extension']));
$mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile']));
$mobile = preg_replace("/[^0-9]/", '',$mobile);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
@ -2814,7 +2820,7 @@ if(isset($_POST['edit_contact'])){
move_uploaded_file($_FILES['file']['tmp_name'], $path);
}
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_updated_at = NOW() WHERE contact_id = $contact_id AND company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_updated_at = NOW() WHERE contact_id = $contact_id AND company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");

View File

@ -97,6 +97,7 @@
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_extension = $row['vendor_extension'];
$vendor_email = $row['vendor_email'];
$vendor_website = $row['vendor_website'];
?>
@ -126,7 +127,7 @@
<?php
if(!empty($vendor_phone)){
?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?> <?php if(!empty($vendor_extension)){ echo "x$vendor_extension"; } ?>
<br>
<?php
}