From c40c204ce1ca3df6ec9c942e99d16476abbe87d3 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 25 Mar 2024 16:45:34 -0400 Subject: [PATCH] Use full name in vars --- post/tasks.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/post/tasks.php b/post/tasks.php index 4346d405..fbab75f2 100644 --- a/post/tasks.php +++ b/post/tasks.php @@ -9,8 +9,8 @@ if (isset($_POST['add_task'])) { validateTechRole(); $ticket_id = intval($_POST['ticket_id']); - $name = sanitizeInput($_POST['name']); - $description = sanitizeInput($_POST['description']); + $task_name = sanitizeInput($_POST['name']); + $task_description = sanitizeInput($_POST['description']); // Get Client ID from tickets using the ticket_id $sql = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_id = $ticket_id"); @@ -18,14 +18,14 @@ if (isset($_POST['add_task'])) { $client_id = intval($row['ticket_client_id']); - mysqli_query($mysqli, "INSERT INTO tasks SET task_name = '$name', task_description = '$description', task_ticket_id = $ticket_id"); + mysqli_query($mysqli, "INSERT INTO tasks SET task_name = '$task_name', task_description = '$task_description', task_ticket_id = $ticket_id"); $task_id = mysqli_insert_id($mysqli); // Logging - mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Task', log_action = 'Create', log_description = '$session_name created task $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $task_id"); + mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Task', log_action = 'Create', log_description = '$session_name created task $task_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $task_id"); - $_SESSION['alert_message'] = "You created Task $name"; + $_SESSION['alert_message'] = "You created Task $task_name"; header("Location: " . $_SERVER["HTTP_REFERER"]); }