<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$this->load->helper('url');
$this->load->helper('form');
$this->load->database();
?>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Incomplete Job Cards</title>
        <style type="text/css">  
            #table_customer_details{
                border: solid 1px silver;
                border-collapse: collapse;
                margin-top: 20px;
                text-align: center;
            }
            #table_customer_details th{ 
                border: #000 solid 3px;
            }
        </style>
    </head>
    <body>
    <center>
        <table cellpadding="5" border="1" id="table_customer_details">
            <thead>
                <tr id="table_customer_details">
                    <th>Customer</th>
                    <th>Date</th>
                    <th>Total</th>
                    <th>View Details</th>
                    <th>Completed</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $all_inc_jobcards = $this->db->query("SELECT customer.customer_name as cusname,date,job_card_total,idjob_card from job_card join customer on job_card.customer_customer_id = customer.customer_id where complete_status='0'");
                foreach ($all_inc_jobcards->result() as $cpr) {
                    ?>
                    <tr>
                        <td><?php echo $cpr->cusname; ?></td>
                        <td><?php echo $cpr->date; ?></td>
                        <td><?php echo $cpr->job_card_total; ?></td>
                        <td><a href="<?php echo base_url(); ?>index.php/Ui_controller/view_jobcards_details?id_jc=<?php echo $cpr->idjob_card; ?>"><input type="submit" value="View Job Card Details" /></a></td>
                        <td><a href="<?php echo base_url(); ?>index.php/JobCard_Controller/completeJobCard?id_jc=<?php echo $cpr->idjob_card; ?>"><input type="submit" value="Complete" /></a></td>
                    </tr>
                    <?php
                }
                ?>
            </tbody>
        </table>

    </center>
</body>
</html>
