<style type="text/css">


    .panel.panel-default.panel-body{
        margin-top: 20px;
    }


    .label-circle {


    }
    .table-background-odd{
        background-color: #f3e3e0;

    }
    .table-background-even{
        background-color: #f6f0ee  
    }
    .table-background-head{
        background-color: #e8eff4;  
    }




    .spinner{
        margin-top: 8px;
        margin-left: -5px;
        display: none;
    }
    .form_label{
        margin-top: 4px;
    }
    .td_success{
        background-color: green;
    }
    .td_danger{
        background-color: red;
    }
    .td_dots{
        background-color: blue;
    }
    .td_outside{
        background-color: #0099FF;
    }
    .td_remain{
        background-color: #5bc0de;
    }
    .permanent_patient_id{
        cursor: pointer;
    }

    .table-user-information tbody tr td{
        text-align: center;
        color: #269abc;

    }
    .table-user-information{
        margin-top: -12px;

    }


    .table-user-information > tbody > tr {
        border-top: 1px solid rgb(221, 221, 221);
    }

    .table-user-information > tbody > tr:first-child {
        border-top: 0;
    }


    .table-user-information > tbody > tr > td {
        border-top: 0;
    }



    #patient_dose_taken_phase1_table{
        border: 1px solid #857875;
    }
    #patient_dose_taken_phase1_table > thead > tr > th,
    #patient_dose_taken_phase1_table > tbody > tr > th,
    #patient_dose_taken_phase1_table > tfoot > tr > th,
    #patient_dose_taken_phase1_table > thead > tr > td,
    #patient_dose_taken_phase1_table > tbody > tr > td,
    #patient_dose_taken_phase1_table > tfoot > tr > td {
        border: 1px solid #857875;

    }
    #patient_dose_taken_phase1_table{
        width: 100%;

    }

    .field-coordinator-patient-dose .panel{

    }
    .verticalLine {
        border:solid #ecf2f2;
    }
    .text-setting{
        margin-top: 4px;
    }
</style>
<div class="panel"> 
    <?php $this->load->view('mira_anm_work_button') ?>


    <div class="panel-body" style="margin: 0">
        <table class="table tatable-bordered table-hover tableborder" id="patient_dose_taken_phase1_table" style="margin: 0">
            <thead>         
                <tr class="table-background-head">
                    <th class="text-center fix" rowspan="2">#</th> 
                    <th class="text-center fix" rowspan="2">H.&nbsp;No.</th> 
                    <th class="text-center" rowspan="2">Women&nbsp;Name</th>
                    <th class="text-center" rowspan="2">LPM&nbsp;Date&nbsp;&nbsp;</th> 
                    <th class="text-center" rowspan="2">ANC1&nbsp;Status</th>
                    <th class="text-center" rowspan="2">ANC1&nbsp;Status</th>
                    <th class="text-center" rowspan="2">ANC1&nbsp;Status</th>
                    <th class="text-center" rowspan="2">ANC1&nbsp;Status</th>

                </tr>



            </thead>
            <tbody>
                <?php
                if (isset($anm_work_detail_anc) and $anm_work_detail_anc) {
                    for ($i = 0; $i < count($anm_work_detail_anc); $i++) {
                        ?>
                        <tr>
                            <td class="text-center"><?= ($i + 1) ?></td>
                            <td class="text-center"><?= $anm_work_detail_anc[$i]['house_number'] ?></td>
                            <td class="text-center"><?= str_replace(' ', '&nbsp;', $anm_work_detail_anc[$i]['name']) ?></td>
                            <td class="text-center"><?= date('d-m-Y', strtotime($anm_work_detail_anc[$i]['pregnant_date'])) ?></td>
                            <?php if ($anm_work_detail_anc[$i]['anc_status']['anc1'] == 1) { ?>
                                <td class="text-center"><span class="label label-success"><i class="fa fa-check"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc1'] == 2) { ?>
                                <td class="text-center"><span class="label label-warning"><i class="fa fa-clock-o"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc1'] == 3) { ?>
                                <td class="text-center"><span class="label label-info"><i class="fa fa-arrow-circle-down"></i></span></td>
                            <?php } else { ?>
                                <td class="text-center"><span class="label label-danger"><i class="fa fa-times"></i></span></td>
                            <?php }
                            ?>
                            <?php if ($anm_work_detail_anc[$i]['anc_status']['anc2'] == 1) { ?>
                                <td class="text-center"><span class="label label-success"><i class="fa fa-check"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc2'] == 2) { ?>
                                <td class="text-center"><span class="label label-warning"><i class="fa fa-clock-o"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc2'] == 3) { ?>
                                <td class="text-center"><span class="label label-info"><i class="fa fa-arrow-circle-down"></i></span></td>
                            <?php } else { ?>
                                <td class="text-center"><span class="label label-danger"><i class="fa fa-times"></i></span></td>
                            <?php }
                            ?>
                            <?php if ($anm_work_detail_anc[$i]['anc_status']['anc3'] == 1) { ?>
                                <td class="text-center"><span class="label label-success"><i class="fa fa-check"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc3'] == 2) { ?>
                                <td class="text-center"><span class="label label-warning"><i class="fa fa-clock-o"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc3'] == 3) { ?>
                                <td class="text-center"><span class="label label-info"><i class="fa fa-arrow-circle-down"></i></span></td>
                            <?php } else { ?>
                                <td class="text-center"><span class="label label-danger"><i class="fa fa-times"></i></span></td>
                            <?php }
                            ?>

                            <?php if ($anm_work_detail_anc[$i]['anc_status']['anc4'] == 1) { ?>
                                <td class="text-center"><span class="label label-success"><i class="fa fa-check"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc4'] == 2) { ?>
                                <td class="text-center"><span class="label label-warning"><i class="fa fa-clock-o"></i></span></td>
                            <?php } elseif ($anm_work_detail_anc[$i]['anc_status']['anc4'] == 3) { ?>
                                <td class="text-center"><span class="label label-info"><i class="fa fa-arrow-circle-down"></i></span></td>
                            <?php } else { ?>
                                <td class="text-center"><span class="label label-danger"><i class="fa fa-times"></i></span></td>
                            <?php }
                            ?>
                        </tr>
                            <?php
                        }
                    }
                    ?>


            </tbody>
        </table>
        <div class="panel-footer" style="margin: 0">
            <div class="row">
                <div class="col-lg-12">
                    <ul class="pagination pagination-large">
<?php
if (isset($totalPage) and $totalPage and $totalPage > 1) {
    for ($i = 0; $i < $totalPage; $i++) {
        if ($i == 0) {
            if ($activePage == 1) {
                ?>
                                        <li class="disabled"><span>«</span></li>
                                    <?php } else { ?>
                                        <li class="page" value="<?= ($activePage - 1) ?>"><a href="<?= base_url('anm-work-detail-anc/' . ($activePage - 1) . '/' . $region_detail[0]['region_code']) ?>"><span>«</span></a></li>
                                        <?php
                                    }
                                }


                                if (($i + 1) == $activePage) {
                                    ?>

                                    <li class="active page"><span><?= ($i + 1) ?></span></li>  
                                <?php } else { ?>
                                    <li class="page"><a href="<?= base_url('anm-work-detail-anc/' . ($i + 1) . '/' . $region_detail[0]['region_code']) ?>"><span><?= ($i + 1) ?></span></a></li>
            <?php
        }


        if (($i + 1) == $totalPage) {
            if ($totalPage == $activePage) {
                ?>
                                        <li class="disabled page"><span>Next</span></li>
                                    <?php } else { ?>
                                        <li class="page"><a href="<?= base_url('anm-work-detail-anc/' . ($activePage + 1) . '/' . $region_detail[0]['region_code']) ?>"><span>Next</span></a></li>
                                        <?php
                                    }
                                }
                            }
                        }
                        ?>
                    </ul>
                </div>

            </div>

        </div>
    </div>
</div>