Added contact name to vendors

This commit is contained in:
root 2019-06-13 17:37:08 -04:00
parent 0686406e07
commit 4330254891
9 changed files with 35 additions and 12 deletions

View File

@ -112,6 +112,16 @@
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab">
<div class="form-group">
<label>Contact Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="contact_name" placeholder="Vendor contact name">
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">

View File

@ -29,6 +29,7 @@
$vendor_city = $row['vendor_city'];
$vendor_state = $row['vendor_state'];
$vendor_zip = $row['vendor_zip'];
$vendor_contact_name = $row['vendor_contact_name'];
$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);

View File

@ -112,6 +112,16 @@
<div class="tab-pane fade" id="pills-contact<?php echo $vendor_id; ?>" role="tabpanel" aria-labelledby="pills-contact-tab<?php echo $vendor_id; ?>">
<div class="form-group">
<label>Contact Name</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="contact_name" value="<?php echo $vendor_contact_name; ?>" placeholder="Vendor contact name">
</div>
</div>
<div class="form-group">
<label>Phone</label>
<div class="input-group">

View File

@ -42,7 +42,7 @@ if(isset($_GET['pdf_invoice'], $_GET['url_key'])){
if(mysqli_num_rows($sql) == 1){
//Mark downloaded in history
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'Invoice downloaded', invoice_id = $invoice_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'Invoice downloaded', history_created_at = NOW(), invoice_id = $invoice_id");
$sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC");
@ -122,7 +122,7 @@ if(isset($_GET['pdf_invoice'], $_GET['url_key'])){
<!--mpdf
<htmlpageheader name="myheader">
<table width="100%"><tr>
<td width="15%"><img width="75" height="75" src=" '.$config_invoice_logo.' "></img></td>
<td width="15%"><img width="75" height="75" src=" /'.$config_invoice_logo.' "></img></td>
<td width="50%"><span style="font-weight: bold; font-size: 14pt;"> '.$config_company_name.' </span><br />' .$config_company_address.' <br /> '.$config_company_city.' '.$config_company_state.' '.$config_company_zip.'<br /> '.$config_company_phone.' </td>
<td width="35%" style="text-align: right;">Invoice No.<br /><span style="font-weight: bold; font-size: 12pt;"> INV-'.$invoice_number.' </span></td>
</tr></table>
@ -315,7 +315,7 @@ if(isset($_GET['pdf_quote'], $_GET['url_key'])){
<!--mpdf
<htmlpageheader name="myheader">
<table width="100%"><tr>
<td width="15%"><img width="75" height="75" src=" '.$config_invoice_logo.' "></img></td>
<td width="15%"><img width="75" height="75" src=" /'.$config_invoice_logo.' "></img></td>
<td width="50%"><span style="font-weight: bold; font-size: 14pt;"> '.$config_company_name.' </span><br />' .$config_company_address.' <br /> '.$config_company_city.' '.$config_company_state.' '.$config_company_zip.'<br /> '.$config_company_phone.' </td>
<td width="35%" style="text-align: right;">Quote No.<br /><span style="font-weight: bold; font-size: 12pt;"> QUO-'.$quote_number.' </span></td>
</tr></table>
@ -407,7 +407,7 @@ if(isset($_GET['approve_quote'], $_GET['url_key'])){
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Approved' WHERE quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Approved', history_description = 'Client approved Quote!', quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Approved', history_description = 'Client approved Quote!', history_created_at = NOW(), quote_id = $quote_id");
$_SESSION['alert_message'] = "Quote approved";
@ -432,7 +432,7 @@ if(isset($_GET['reject_quote'], $_GET['url_key'])){
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Rejected' WHERE quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Rejected', history_description = 'Client rejected Quote!', quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Rejected', history_description = 'Client rejected Quote!', history_created_at = NOW(), quote_id = $quote_id");
$_SESSION['alert_message'] = "Quote rejected";

View File

@ -42,7 +42,7 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
if(mysqli_num_rows($sql) == 1){
//Mark viewed in history
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'Invoice viewed', invoice_id = $invoice_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'Invoice viewed', history_created_at = NOW(), invoice_id = $invoice_id");
$sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC");

View File

@ -41,7 +41,7 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
if(mysqli_num_rows($sql) == 1){
//Mark viewed in history
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$quote_status', history_description = 'Quote viewed', quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$quote_status', history_description = 'Quote viewed', history_created_at = NOW(), quote_id = $quote_id");
//Set Badge color based off of quote status
if($quote_status == "Sent"){

View File

@ -377,7 +377,7 @@ if(isset($_GET['delete_ticket'])){
if(isset($_POST['add_vendor'])){
$client_id = intval($_POST['client_id']);
$client_id = intval($_POST['client_id']); //Used if this vendor is under a contact otherwise its 0 for under company
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
$account_number = strip_tags(mysqli_real_escape_string($mysqli,$_POST['account_number']));
@ -385,12 +385,13 @@ if(isset($_POST['add_vendor'])){
$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']));
$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);
$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_phone = '$phone', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_created_at = NOW(), client_id = $client_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_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_created_at = NOW(), client_id = $client_id");
$vendor_id = mysqli_insert_id($mysqli);
@ -410,12 +411,13 @@ if(isset($_POST['edit_vendor'])){
$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']));
$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);
$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_phone = '$phone', vendor_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_updated_at = NOW() WHERE vendor_id = $vendor_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_email = '$email', vendor_website = '$website', vendor_account_number = '$account_number', vendor_updated_at = NOW() WHERE vendor_id = $vendor_id");
$_SESSION['alert_message'] = "Vendor modified";

View File

@ -44,7 +44,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
</div>
<select class="form-control" name="config_company_state">
<select class="form-control selectpicker show-tick" data-live-search="true" name="config_company_state">
<option value="">Select a state...</option>
<?php foreach($states_array as $state_abbr => $state_name) { ?>
<option <?php if($config_company_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>

View File

@ -31,6 +31,7 @@
$vendor_city = $row['vendor_city'];
$vendor_state = $row['vendor_state'];
$vendor_zip = $row['vendor_zip'];
$vendor_contact_name = $row['vendor_contact_name'];
$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);
@ -38,7 +39,6 @@
$vendor_email = $row['vendor_email'];
$vendor_website = $row['vendor_website'];
?>
<tr>
<td><?php echo $vendor_name; ?></td>