Server IP : 162.214.80.37 / Your IP : 216.73.216.83 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/imyrqtmy/public_html/destinytrafficsolutions/vendor/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); $se = $_SESSION["id"]; if (!isset($_SESSION['id'])) { header("Location: login.php"); } include("inc/config.php");; ?> <!DOCTYPE html> <html lang="en"> <?php require "inc/head.php"; ?> <body> <!-- header--> <?php require "inc/header.php"; ?> <!-- End Main-content Top bar--> <!-- main-content--> <div class="wrapper"> <?php require "inc/sidebar.php"; ?> <div id="content"> <?php if (isset($_SESSION['status']) && $_SESSION['status'] != '') { ?> <div class="alert alert-warning alert-dismissible fade show" role="alert"> <strong>Hey!</strong> <?php echo $_SESSION['status']; ?> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> <?php unset($_SESSION['status']); } ?> <div class="row"> <div class="col-12 col-sm-12"> <div class="row mb-5"> <?php $id = $_GET['id']; // Get the ID from the URL // Ensure the ID is sanitized to prevent SQL injection $id = mysqli_real_escape_string($conn, $id); // Fetch all tasks associated with the given project ID $query = " SELECT t.*, p.project_name, e.photo FROM tasks t LEFT JOIN projects p ON t.project_name = p.id -- Match project ID in tasks with ID in projects LEFT JOIN employees e ON t.emp_name = CONCAT(e.femp_name, ' ', e.lemp_name) -- Match employee names WHERE t.project_name = '$id'"; // Filter tasks by project ID $query_run = mysqli_query($conn, $query); if (mysqli_num_rows($query_run) > 0) { foreach ($query_run as $row) { ?> <div class="col-12 col-sm-6 col-xl-4 mb-4"> <h5 style="text-align:center;"><?php echo $row['project_name']; ?></h5> <div class="card redial-border-light redial-shadow"> <span style="text-align: center; color: red; font-weight: bold; margin-top: 10px;"><?php echo $row['status']; ?></span> <div class="media d-block d-sm-flex text-center text-sm-left" style="padding: 25px; margin-top: -23px;"> <!-- Display Employee's Image --> <a href="#"> <img src="<?php echo "employee/" . $row['photo']; ?>" alt="Employee Image" class="img-fluid d-sm-flex mr-sm-3 mb-3 mb-sm-0 rounded-circle" width="40" /> </a> <div class="media-body"> <a href="#"><h4><?php echo $row['emp_name']; ?></h4></a> <ul class="list-unstyled redial-font-weight-600" style="margin-left: -45px;"> <li><i class="icofont icofont-briefcase-pin pr-2"></i><?php echo $row['task_name']; ?></li> <li><i class="icofont icofont-briefcase-pin pr-2"></i><b>Hour Rate:</b> <?php echo $row['erh']; ?></li> <li><i class="icofont icofont-briefcase-pin pr-2"></i><b>Start Date:</b> <?php echo $row['start_datetime']; ?></li> </ul> <?php if ($row['status'] === 'Complete') { ?> <a href="update-task.php?id=<?php echo $row['id']; ?>" class="btn btn-primary btn-xs mb-2"> <i class="icofont icofont-edit pr-1"></i>Edit Task </a> <?php } else { ?> <a href="update-task.php?id=<?php echo $row['id']; ?>" class="btn btn-danger1 btn-xs mb-2"> <i class="icofont icofont-verification-check pr-1"></i>End Task </a> <?php } ?> <!-- <a href="update-task.php?id=<?php echo $row['id']; ?>" class="btn btn-danger1 btn-xs mb-2"> <i class="icofont icofont-verification-check pr-1"></i>End Task </a> --> </div> </div> </div> </div> <?php } } else { echo "<div class='col-12'><p>No tasks found for this project.</p></div>"; } ?> </div> </div> </div> </div> </div> <!-- End main-content--> <!-- Top To Bottom--> <a href="#" class="scrollup text-center redial-bg-primary redial-rounded-circle-50"> <h4 class="text-white mb-0"><i class="icofont icofont-long-arrow-up"></i></h4> </a> <!-- End Top To Bottom--> <!-- jQuery --> <script src="dist/js/plugins.min.js"></script> <script src="dist/js/common.js"></script> </body> </html>