<div id="page-wrapper">
    <div class="header">
        <h1 class="page-header">

        </h1>
        <ol class="breadcrumb">
            <li><a href="#">Member</a></li>
            <li class="active">DCB</li>
        </ol>
    </div>

    <div id="page-inner">
        <style>
            @media print {
                body * {
                    visibility: hidden;
                }

                .print-container,
                .print-container * {
                    visibility: visible;
                }
            }
        </style>
        <div class="row print-container">

            <div class="col-md-12">
                <!-- Advanced Tables -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        DCB Details
                    </div>
                    <div class="panel-body">
                        <table id="table_ids11" class="table table-striped table-bordered" style="width:100%">
                            <thead>
                                <tr>
                                    <th class="text-center">S No.</th>
                                    <th class="text-center">M.No</th>
                                    <th class="text-center">Member Name</th>
                                    <th class="text-center">CB</th>
                                    <th class="text-center">April</th>
                                    <th class="text-center">May</th>

                                    <th class="text-center">June</th>

                                    <th class="text-center">July</th>

                                    <th class="text-center">Augest</th>

                                    <th class="text-center">September</th>

                                    <th class="text-center">October</th>

                                    <th class="text-center">November</th>

                                    <th class="text-center">December</th>

                                    <th class="text-center">January</th>

                                    <th class="text-center">Febraury</th>

                                    <th class="text-center">March</th>

                                    <th class="text-center">Total</th>

                                    <th class="text-center">Total + CB</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $sno = 1; ?>
                                <?php foreach ($value as $val => $data) : ?>


                                    <tr>
                                        <td class="text-center">
                                            <?= $sno; ?>
                                        </td>
                                        <td class="text-center">
                                            <?= $data[0]['me_no']; ?>
                                        </td>
                                        <td class="text-center">
                                            <?= $data[0]['mem_name']; ?>
                                        </td>

                                        <td class="text-center">
                                            <?= $data[0]['cb']; ?>
                                            <?php $tcb += $data[0]['cb']; ?>
                                        </td>
                                        <?php print_r($data[0]); ?>
                                            <?php if ($data[0]['payment_month'] == "February"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>
                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "May"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "June"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "July"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "August"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "September"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>  <?php if ($data[0]['payment_month'] == "October"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>  <?php if ($data[0]['payment_month'] == "November"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "December"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                             <?php if ($data[0]['payment_month'] == "January"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "February "  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <?php if ($data[0]['payment_month'] == "March"  && $data['amt'] > 0) { ?>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                            <?php } else { ?>
                                                <td class="text-center">
                                                    0
                                                </td>

                                            <?php } ?>
                                            <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>
                                                <td class="text-center">
                                                    <?= $data['amt']; ?>
                                                    <?php $apr = $data['amt']; ?>
                                                    <?php $tapr += $apr; ?>
                                                </td>



                                        <?php $sno++; ?>
                                    <?php endforeach; ?>
                                    <tr>
                                        <td class="text-center" colspan="3">
                                            Total
                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tcb + $tcb1; ?></b>
                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tapr + $tapr1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tmay + $tmay1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tjun + $tjun1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tjul + $tjul1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $taug + $taug1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tsept + $tsept1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $toct + $toct1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tnov + $tnov1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tdec + $tdec1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tjan + $tjan1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tfeb + $tfeb1; ?></b>

                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tmar + $tmar1; ?></b>

                                        </td>

                                        <td class="text-center">
                                            <b> <?= $totv1 + $totv; ?></b>
                                        </td>
                                        <td class="text-center">
                                            <b> <?= $tot1 + $tot; ?></b>
                                        </td>

                                    </tr>
                            </tbody>

                        </table>

                    </div>
                    <!-- /. PAGE INNER  -->
                </div>
            </div>
        </div>
        <style>
            th {
                padding: 5px;
                text-align: center;
            }
        </style>