| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/add_subtask.php.tar |
home/emeraadmin/public_html/pages/emeraadmin/add_subtask.php 0000644 00000002236 15167742231 0020311 0 ustar 00 <?php
// Check if the request method is POST
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
require_once '../../Classes/Subtask.php';
require_once '../../Service/SubtaskService.php';
require_once '../../Service/TaskService.php';
// Retrieve and sanitize input data
$task_id = $_POST['task_id'];
$service_id = $_POST['service_name'];
$subtask_date = $_POST['subtask_date'];
$subtask_time = isset($_POST['subtask_time']) ? $_POST['subtask_time'] : null;
$now = new DateTime();
$created_at = $now->format('Y-m-d H:i:s');
$updated_at = $now->format('Y-m-d H:i:s');
// Create a new Subtask object
$subtask = new Subtask('', $task_id, $service_id, $subtask_date, $subtask_time,$created_at,$updated_at,0,"",0,"","","");
// Instantiate SubtaskService
$subtaskService = new SubtaskService(); // Replace with your SubtaskService class instantiation
// Attempt to add the subtask
if ($subtaskService->addSubtask($subtask)) {
echo "Subtask added successfully!";
} else {
echo "Failed to add subtask.";
}
} else {
echo "Invalid request method.";
}
?>
home/emeraadmin/public_html/pages/taskprovider/add_subtask.php 0000644 00000002236 15167742250 0020725 0 ustar 00 <?php
// Check if the request method is POST
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
require_once '../../Classes/Subtask.php';
require_once '../../Service/SubtaskService.php';
require_once '../../Service/TaskService.php';
// Retrieve and sanitize input data
$task_id = $_POST['task_id'];
$service_id = $_POST['service_name'];
$subtask_date = $_POST['subtask_date'];
$subtask_time = isset($_POST['subtask_time']) ? $_POST['subtask_time'] : null;
$now = new DateTime();
$created_at = $now->format('Y-m-d H:i:s');
$updated_at = $now->format('Y-m-d H:i:s');
// Create a new Subtask object
$subtask = new Subtask('', $task_id, $service_id, $subtask_date, $subtask_time,$created_at,$updated_at,0,"",0,"","","");
// Instantiate SubtaskService
$subtaskService = new SubtaskService(); // Replace with your SubtaskService class instantiation
// Attempt to add the subtask
if ($subtaskService->addSubtask($subtask)) {
echo "Subtask added successfully!";
} else {
echo "Failed to add subtask.";
}
} else {
echo "Invalid request method.";
}
?>