| Current Path : /home/emeraadmin/www/4d695/ |
| Current File : /home/emeraadmin/www/4d695/reports_acceptedtasksbyusers.php.tar |
home/emeraadmin/public_html/pages/emeraadmin/reports_acceptedtasksbyusers.php 0000644 00000007457 15167742172 0024054 0 ustar 00 <?php
include('head.php');
require_once '../../Classes/Database.php';
require_once '../../Service/TaskService.php';
require_once '../../Classes/System.php';
// Fetch assigned user ID from session or request
$assignedUserId = $_SESSION['user_id'] ?? ($_GET['user_id'] ?? 1); // Default to 1 if not set
// Create TaskService instance
$taskService = new TaskService();
$System = new System(); // Assuming System class is correctly defined and used
// Fetch accepted tasks by the assigned user
$acceptedTasks = $taskService->getAcceptedTasks();
?>
<div class="main-content">
<div class="container-fluid">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<i class="ik ik-layers bg-blue"></i>
<div class="d-inline">
<h5>Accepted Tasks View</h5>
<span>List of accepted tasks by you</span>
</div>
</div>
</div>
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="../../index.html"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item">
<a href="#">Tasks</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Accepted Tasks View</li>
</ol>
</nav>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="dt-responsive">
<table class="table" id="accepted_tasks_view_table">
<thead>
<tr>
<th>ID</th>
<th>Service Name</th>
<th>Region</th>
<th>Assigned User</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($acceptedTasks as $task) { ?>
<tr>
<td><?= htmlspecialchars($task->id); ?></td>
<td><?= htmlspecialchars($task->service_name); ?></td>
<td><?= htmlspecialchars($task->region); ?></td>
<td><?= htmlspecialchars($task->assigned_user); ?></td>
<td>
<a href="viewtask.php?id=<?= $System->encryptData($task->id); ?>" class="btn btn-primary">View</a>
<!-- Additional actions as needed -->
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php'); ?>
<script>
$(document).ready(function() {
$('#accepted_tasks_view_table').DataTable();
});
</script>