mirror of
https://github.com/itflow-org/itflow
synced 2026-05-22 18:58:19 +00:00
API: Add some missing end points
This commit is contained in:
43
api/v1/vendors/vendor_model.php
vendored
Normal file
43
api/v1/vendors/vendor_model.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
// Variable assignment from POST (or: blank/from DB is updating)
|
||||
|
||||
if (isset($_POST['vendor_name'])) {
|
||||
$name = sanitizeInput($_POST['vendor_name']);
|
||||
} elseif ($vendor_row) {
|
||||
$name = mysqli_real_escape_string($mysqli, $vendor_row['vendor_name']);
|
||||
} else {
|
||||
$name = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_description'])) {
|
||||
$description = sanitizeInput($_POST['vendor_description']);
|
||||
} elseif ($vendor_row) {
|
||||
$description = mysqli_real_escape_string($mysqli, $vendor_row['vendor_description']);
|
||||
} else {
|
||||
$description = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_website'])) {
|
||||
$website = preg_replace("(^https?://)", "", sanitizeInput($_POST['vendor_website']));
|
||||
} elseif ($vendor_row) {
|
||||
$website = mysqli_real_escape_string($mysqli, $vendor_row['vendor_website']);
|
||||
} else {
|
||||
$website = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_phone'])) {
|
||||
$phone = sanitizeInput($_POST['vendor_phone']);
|
||||
} elseif ($vendor_row) {
|
||||
$phone = mysqli_real_escape_string($mysqli, $vendor_row['vendor_phone']);
|
||||
} else {
|
||||
$phone = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['vendor_notes'])) {
|
||||
$notes = sanitizeInput($_POST['vendor_notes']);
|
||||
} elseif ($vendor_row) {
|
||||
$notes = mysqli_real_escape_string($mysqli, $vendor_row['vendor_notes']);
|
||||
} else {
|
||||
$notes = '';
|
||||
}
|
||||
Reference in New Issue
Block a user