Add logging if creating a referral via create client

This commit is contained in:
johnnyq 2023-11-08 23:35:00 -05:00
parent 0103e05093
commit 408a596efa
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,8 @@ if (isset($_POST['add_client'])) {
$sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'");
if(mysqli_num_rows($sql) == 0) {
mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
// Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Category', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
}
// Create client