<?php if(!empty($dentals)) foreach ($dentals as $key => $dental): ?>
    <div class="row py-1">
        <div class="col">
            <h4>Dental and Optical</h4>
            <?php echo date('d-F-Y',strtotime($dental->date)) ?>                                            
        </div>
    </div>

    <div class="row py-1">
        <div class="col">
            <b>Submission : </b> <?php echo date('F Y',strtotime('01-'.$dental->month.'-'.$dental->year)); ?>
        </div>
    </div>
    <div class="row">
        <div class="col-12 col-md-10">

            <div class="row">
                <div class="col-12 col-md-6">
                    <div class="row">
                        <div class="col-md-4"><b>Status (HOD) </b></div>
                        <div class="col">
                            <!-- HOD -->
                            <?php if($dental->is_hod_approved == 0): ?>
                                <span class="badge badge-secondary">Draft</span>
                            <?php endif ?>

                            <?php if($dental->is_hod_approved == 1): ?>
                                <span class="badge badge-success">Approved</span>
                            <?php endif ?>

                            <?php if ($dental->is_hod_approved == 2): ?>
                                <span class="badge badge-danger">Rejected</span>
                            <?php endif ?>

                            <!-- -->
                        </div>
                    </div>
                </div>
                <div class="col-12 col-md-6">
                    <div class="row">
                        <div class="col-md-4"><b>Status (Admin)</b></div>
                        <div class="col">
                            <!-- admin -->
                            <?php if ($dental->is_approve == 0): ?>
                                <span class="badge badge-secondary">Draft</span>
                            <?php endif ?>

                            <?php if ($dental->is_approve == 1): ?>
                                <span class="badge badge-success">Approved</span>
                            <?php endif ?>

                            <?php if ($dental->is_approve == 2): ?>
                                <span class="badge badge-danger">Rejected</span>
                            <?php endif ?>
                            <!-- -->
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-2">
                    <b>Invoice Chit </b>
                </div>
                <div class="col"><?php echo $dental->invoice_chit; ?></div>
            </div>

            <div class="row">
                <div class="col-lg-2">
                    <b>Hospital / clinic</b> 
                </div>
                <div class="col"><?php echo $dental->clinic_name; ?></div>
            </div>

            <div class="row">
                <div class="col-lg-2">
                    <b>Attachment(s)</b>
                </div>
                <div class="col">
                    <ol>
                    <?php if(!empty($dental->attachments)) foreach ($dental->attachments as $key => $attach): ?>
                        <li>
                            <a href="<?php echo base_url('/hr/claim/openAttachment/'.$attach->unique_id.'/DENTAL'); ?>" target="_blank"><?php echo $attach->attachment_name; ?></a>
                            <br/>
                            <small><?php echo $attach->description; ?></small>    
                        </li>
                    <?php endforeach ?>
                    </ol>
                </div>
            </div>
            
            <div class="row">
                <div class="col-lg-2">
                    <b>Remarks</b>
                </div>
                <div class="col" style="min-height:100px;">


                    <?php if($dental->is_hod_approved == 2): ?>
                        <?php if(!empty($dental->hod_remarks)): ?>
                            <b>[HOD] : </b> <?php echo $dental->hod_remarks; ?>
                        <?php endif; ?>
                    <?php endif; ?>

                    <?php if($dental->is_approve == 2): ?>
                        <?php if(!empty($dental->admin_remarks)): ?>
                            <b>[ADMIN] : </b> <?php echo $dental->admin_remarks; ?>
                        <?php endif; ?>
                    <?php endif; ?>



                </div>
            </div>
        </div>
        <div class="col-12 col-md-2">

            <div class="row py-1 border-bottom">
                <div class="col">
                    <b>Claimed (RM)</b>
                    <h1><?php echo number_format($dental->amount_claim,2); ?></h1>
                </div>
            </div>

            <div class="row py-1">
                <div class="col">
                    <b>Approved (RM)</b>
                    <h1><?php echo number_format($dental->amount_approved,2); ?></h1>
                </div>
            </div>
        </div>
    </div>
    <hr>
<?php endforeach ?>