mirror of https://github.com/itflow-org/itflow
Clients API - Add - abbreviation support
This commit is contained in:
parent
6295a5c878
commit
46c2c8616e
|
|
@ -66,6 +66,14 @@ if (isset($_POST['client_tax_id_number'])) {
|
|||
$tax_id_number = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['client_abbreviation'])) {
|
||||
$abbreviation = substr(sanitizeInput($_POST['client_abbreviation']), 0, 6);
|
||||
} elseif ($client_row) {
|
||||
$abbreviation = $client_row['client_abbreviation'];
|
||||
} else {
|
||||
$abbreviation = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['client_is_lead'])) {
|
||||
$lead = intval($_POST['client_is_lead']);
|
||||
} elseif ($client_row) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ $insert_id = false;
|
|||
if (!empty($name) && $client_id == 0) {
|
||||
|
||||
// Insert client
|
||||
$insert_sql = mysqli_query($mysqli, "INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = $lead, client_notes = '$notes', client_accessed_at = NOW()");
|
||||
$insert_sql = mysqli_query($mysqli, "INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_abbreviation = '$abbreviation', client_lead = $lead, client_notes = '$notes', client_accessed_at = NOW()");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue