<div class="row">
    <div class="col table-responsive">
        <table class="table table-striped table-bordered p-0 m-0 w-100" width="100%">
            <thead class="thead-dark">
                <tr>
                    <th class="text-center" style="width:10%;">#</th>
                    <th class="text-center" style="width:90%;" >Description</th>
                </tr>
            </thead>
            
            <tbody>

                <?php $counter = 0; ?>

                <!-- outpatient claim list farouq -->
                <?php if($outpatients) foreach ($outpatients as $key => $outpatient): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td style="vertical-align:middle;">

                            <div class="row py-1">
                                <div class="col text-right">
                                    <?php if(empty($screen_mode)): ?>
                                        <button class="btn btn-danger btn-sm" data-rqtarget="removeOutpatient" data-id="<?php echo ($outpatient->id)?$outpatient->id:0?>" onclick="deleteClaim(this)" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>>
                                            <i class="fa fa-trash-alt"></i>
                                        </button>
                                    <?php endif ?>

                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approve Claim" data-claim-id="<?php echo $outpatient->id; ?>" data-mode="1" onclick="hodApproval(this)">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                        </button>

                                        <!-- button rejecet -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $outpatient->id; ?>"
                                            data-claim-id="<?php echo $outpatient->id; ?>" 
                                            data-mode="1" 
                                            data-toggle="modal" data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button rejecet -->
                                    <?php endif; ?>

                                    <?php if ($screen_mode == 'admin'): ?>
                                        <button class="btn btn-success btn-sm text-white" onclick="approveClaim(this)" data-price="<?php echo number_format($outpatient->amount_claim,2); ?>" data-rqtarget="approveOutpatient" data-id="<?php echo ($outpatient->id)?$outpatient->id:0; ?>" data-status="<?php echo $outpatient->is_approve; ?>" data-allocation="status" data-balanced="balanced" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approve Claim">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                        </button>
                                    <?php endif ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($outpatient->date)); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    
                                    <?php if ($outpatient->is_approve == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($outpatient->is_approve == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($outpatient->is_approve == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-sm btn-block text-white" type="button" disabled>
                                                    Rejected
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                <b>Status (HOD)</b>
                                </div>
                                <div class="col btn-group">
                                    
                                    <?php if ($outpatient->is_hod_approved == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($outpatient->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($outpatient->is_hod_approved == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-sm btn-block text-white" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col text-primary"><?php echo (empty($outpatient->is_medical))? 'Outpatient':'Medical Screening'; ?></div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Invoice Chit </b>
                                </div>
                                <div class="col"><?php echo $outpatient->invoice_chit; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Hospital / clinic</b> 
                                </div>
                                <div class="col"><?php echo ($outpatient->clinic_name)?$outpatient->clinic_name:''; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Patient Name </b>
                                </div>
                                <div class="col">
                                    <?php if ($outpatient->patient_name): ?>
                                        <?php echo $outpatient->patient_name; ?>
                                    <?php else: ?>
                                        N/A
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Relation </b>
                                </div>
                                <div class="col">
                                    <?php if ($outpatient->relation == 0): ?>
                                        Unrecognize    
                                    <?php endif ?>

                                    <?php if ($outpatient->relation == 1): ?>
                                        Self
                                    <?php endif ?>

                                    <?php if ($outpatient->relation == 2): ?>
                                        Child
                                    <?php endif ?>

                                    <?php if ($outpatient->relation == 3): ?>
                                        Spouse
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Treatment</b> 
                                </div>
                                <div class="col"><?php echo $outpatient->treatment; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachment(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                    <?php foreach ($outpatient->attachments as $key => $attach): ?>
                                        <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$attach->unique_id.'/OUTPATIENT'); ?>" target="_blank">
                                            <?php echo $attach->attachment_name;  ?>
                                        </a></li>
                                    <?php endforeach ?>
                                    </ol>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div style="min-height:100px;">

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

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


                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($outpatient->amount_claim,2); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Approved (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($outpatient->amount_approved,2); ?>
                                </div>
                            </div>
                        </td>

                    </tr>
                <?php endforeach ?>
                
                <!-- hospitalization claim list -->
                <?php if($hospitalizations) foreach ($hospitalizations as $key => $hospitalize): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        
                        <td>
                            <div class="row">
                                <div class="col text-right">
                                <?php if($screen_mode == 'hod'): ?>
                                    <button class="btn btn-success btn-sm" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approved Claim" data-claim-id="<?php echo $hospitalize->id; ?>" data-mode="2" onclick="hodApproval(this)">
                                        <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                    </button>
                                    
                                    <!-- button rejecet -->
                                    <button class="btn btn-danger btn-sm" 
                                        data-trigger="hover" 
                                        data-tooltip="tooltip" 
                                        title="" 
                                        data-original-title="Disaprove Claim" 
                                        data-id="<?php echo $hospitalize->id; ?>"
                                        data-claim-id="<?php echo $hospitalize->claim_id; ?>" 
                                        data-mode="2" 
                                        data-toggle="modal" data-target="#rejectModal"
                                        onclick="hodReject(this)"
                                        >
                                        <i class="fas fa-thumbs-down"></i>
                                    </button>
                                    <!-- button rejecet -->
                                <?php else: ?>
                                    <?php if($screen_mode == 'admin'):?>
                                        <button class="btn btn-success btn-sm text-white" onclick="approveClaim(this)"  data-price="<?php echo number_format($hospitalize->amount_claim,2); ?>" data-rqtarget="approveHospitalization" data-id="<?php echo ($hospitalize->id)?$hospitalize->id:0; ?>" data-status="<?php echo $hospitalize->is_approve; ?>" data-allocation="status" data-balanced="balanced" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approve Claim">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>                                                            
                                        </button>
                                    <?php endif ?>
                                    <?php if(empty($screen_mode)): ?>
                                    <button class="btn btn-danger btn-sm" data-rqtarget="removeHospitalization" data-id="<?php echo ($hospitalize->id)?$hospitalize->id:0?>" onclick="deleteClaim(this)" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>>
                                        <i class="fa fa-trash-alt"></i>
                                    </button>
                                    <?php endif ?>
                                <?php endif ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($hospitalize->date)); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Status (Admin)</b></div>
                                <div class="col">
                                    <?php if ($hospitalize->is_approve == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($hospitalize->is_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($hospitalize->is_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if($hospitalize->is_hod_approved == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>
                                    
                                    <?php if ($hospitalize->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($hospitalize->is_hod_approved == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-sm btn-block text-white" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col text-primary">Hospitalization</div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Invoice Chit </b>
                                </div>
                                <div class="col"><?php echo $hospitalize->invoice_chit; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Hospital / clinic</b> 
                                </div>
                                <div class="col"><?php echo ($hospitalize->clinic_name)?$hospitalize->clinic_name:''; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Patient Name </b>
                                </div>
                                <div class="col"><?php echo $hospitalize->patient_name; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Relation </b>
                                </div>
                                <div class="col"><?php echo $hospitalize->relations; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Treatment</b> 
                                </div>
                                <div class="col"><?php echo $hospitalize->treatment; ?></div>
                            </div>


                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Payment Method</b>
                                </div>
                                <div class="col">
                                    <?php if($hospitalize->payment_method == 0): ?>
                                        Cash
                                    <?php else:?>
                                        Premium Insurance
                                    <?php endif; ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachment(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                    <?php if($hospitalize->attachments) foreach ($hospitalize->attachments as $key => $attachment): ?>
                                        <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$attachment->unique_id.'/HOSPITALIZATION'); ?>" target="_blank"><?php echo $attachment->attachment_name; ?></a></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($hospitalize->is_hod_approved == 2): ?>
                                        <?php if(!empty($hospitalize->hod_remarks)): ?>
                                            <b>[HOD] : </b> <?php echo $hospitalize->hod_remarks; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>

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

                                </div>
                            </div>
                            

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($hospitalize->amount_claim,2); ?>
                                </div>
                            </div>


                            <div class="row py-1" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Approved (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($hospitalize->amount_approved,2); ?>
                                </div>
                            </div>
                        </td>

                    </tr>
                <?php endforeach ?>
                
                <!-- dentals claim list -->
                <?php if($dentals) foreach ($dentals as $key => $dental): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>

                        <td>
                            
                        <div class="row py-1">
                            <div class="col text-right">
                                <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approved Claim" data-claim-id="<?php echo $dental->id; ?>" data-mode="3" onclick="hodApproval(this)">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                        </button>
                                    <!-- button rejecet -->
                                    <button class="btn btn-danger btn-sm" 
                                        data-trigger="hover" 
                                        data-tooltip="tooltip" 
                                        title="" 
                                        data-original-title="Disaprove Claim" 
                                        data-id="<?php echo $dental->id; ?>"
                                        data-claim-id="<?php echo $dental->claim_id; ?>" 
                                        data-mode="3" 
                                        data-toggle="modal" data-target="#rejectModal"
                                        onclick="hodReject(this)"
                                        >
                                        <i class="fas fa-thumbs-down"></i>
                                    </button>
                                    <!-- button rejecet -->
                                <?php else: ?>
                                    <?php if($screen_mode == 'admin'):?>
                                        <button class="btn btn-success btn-sm text-white" onclick="approveClaim(this)" data-price="<?php echo number_format($dental->amount_claim,2); ?>" data-rqtarget="approveDentals" data-id="<?php echo ($dental->id)?$dental->id:0; ?>" data-status="<?php echo $dental->is_approve; ?>" data-allocation="status" data-balanced="balanced" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approve Claim">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>                                                           
                                        </button>
                                    <?php endif ?>
                                    <?php if(empty($screen_mode)): ?>
                                    <button class="btn btn-danger btn-sm" data-rqtarget="removeDental" data-id="<?php echo ($dental->id)?$dental->id:0?>" onclick="deleteClaim(this)" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>>
                                        <i class="fa fa-trash-alt"></i>
                                    </button> 
                                    <?php endif ?>                                                  
                                <?php endif ?>
                            </div>
                        </div>
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($dental->date)) ?>                                            
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Status (Admin)</b></div>
                                <div class="col">
                                    <!-- admin -->
                                    <?php if ($dental->is_approve == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($dental->is_approve == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($dental->is_approve == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>
                                    <!-- -->
                                </div>
                            </div>
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Status (HOD) </b></div>
                                <div class="col">
                                    <!-- HOD -->
                                    <?php if($dental->is_hod_approved == 0): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if($dental->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($dental->is_hod_approved == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-sm btn-block text-white" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <!-- -->
                                </div>
                            </div>
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col text-primary">Dental and Optical</div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Invoice Chit </b>
                                </div>
                                <div class="col"><?php echo $dental->invoice_chit; ?></div>
                            </div>

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

                            <div class="row py-1 border-bottom">
                                <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></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 class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Claim</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($dental->amount_claim,2); ?>
                                </div>
                            </div>

                            <div class="row py-1" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Approved</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($dental->amount_approved,2); ?>
                                </div>
                            </div>
                        </td>
                    </tr>
                <?php endforeach ?>

                <!-- travel claim list -->
                <?php if($travels) foreach ($travels as $key => $travel): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td>

                            <div class="row py-1">
                                <div class="col text-right">
                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" title="" 
                                            data-original-title="Approved Claim" 
                                            data-claim-id="<?php echo $travel->id; ?>" 
                                            data-mode="6" 
                                            onclick="hodApproval(this)"
                                            >
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                        </button>
                                        <!-- button reject -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $travel->id; ?>"
                                            data-claim-id="<?php echo $travel->claim_id; ?>" 
                                            data-mode="6" 
                                            data-toggle="modal" data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button reject -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button 
                                                class="btn btn-success btn-sm text-white" 
                                                onclick="approveClaim(this)" 
                                                data-price="<?php echo number_format($travel->amount_claim,2); ?>" 
                                                data-mileage="<?php echo number_format($travel->mileage_amount,2); ?>"
                                                data-rqtarget="approveTravels" 
                                                data-id="<?php echo ($travel->id)?$travel->id:0; ?>" 
                                                data-status="<?php echo $travel->status; ?>" 
                                                data-allocation="status" 
                                                data-balanced="balanced" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                                <!-- <i class="fas fa-check"></i> -->
                                            </button>
                                        <?php endif ?>
                                        <?php if(empty($screen_mode)): ?>
                                        <button class="btn btn-danger btn-sm" data-rqtarget="removeTravel" data-id="<?php echo ($travel->id)?$travel->id:0?>" onclick="deleteClaim(this)" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>>
                                            <i class="fa fa-trash-alt"></i>
                                        </button>
                                        <?php endif ?>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($travel->travelling_date)); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">

                                    <?php if ($travel->status == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($travel->status == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($travel->status == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">

                                    <?php if ($travel->is_hod_approved == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($travel->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($travel->is_hod_approved == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col text-primary">Mileage</div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Task</b></div>
                                <div class="col" style="min-height:100px;"><?php echo $travel->task; ?></div>
                            </div>

                            <?php if($travel->details) foreach ($travel->details as $key => $detail): ?>
                                <div class="row">
                                    <div class="col-lg-2">
                                        <i class="<?php echo $detail['claim_type_icon']; ?>"></i> <?php echo $detail['claim_type']; ?>
                                    </div>
                                    <div class="col">RM<?php echo number_format($detail['amount'],2); ?></div>
                                </div>
                                <?php if($key == sizeof($travel->details)-1)
                                {
                                    echo '<div class="row py-1 border-bottom"></div>';
                                }
                                ?>
                            <?php endforeach ?>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-12">
                                    <b>Routes</b>
                                </div>
                                <!-- <ol class="col-12" style="width:100%;"> -->
                                    
                                        <?php if($travel->routes) foreach($travel->routes as $key => $route): ?>
                                        <!-- <li> -->
                                            <!-- <div class="row"> -->
                                            <div class="col-lg-4">
                                                <?php echo $key+1; ?>.
                                                <i class="fas fa-map-marker-alt text-danger"></i>
                                                <a href="https://www.google.com/maps/search/?api=1&parameters=<?php echo $route->from; ?>" target="_blank">
                                                    [<?php echo substr($route->from,0,25); ?>
                                                    <span class="dot" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="<?php echo $route->from; ?>" ><i class="fas fa-ellipsis-h"></i></span>]
                                                </a>
                                            </div>
                                            <div class="col">
                                                <i class="fas fa-arrow-right text-success"></i>
                                            </div>
                                            <div class="col-lg-4">                                                            
                                                <i class="fas fa-map-marker-alt text-danger"></i>
                                                <a href="https://www.google.com/maps/search/?api=1&parameters=<?php echo $route->to;?>" target="_blank">
                                                    [<?php echo substr($route->to,0,25); ?> 
                                                    <span class="dot" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="<?php echo $route->to; ?>"><i class="fas fa-ellipsis-h"></i></span>]
                                                </a>
                                            </div>
                                            <div class="col">
                                                (<?php echo number_format($route->distance,2); ?> <b>KM</b>)
                                            </div>
                                            <!-- </div> -->
                                        <!-- </li> -->
                                        <?php endforeach?>
                                <!-- </ol> -->
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Attachment(s)</b></div>
                                <?php if($travel->attachments) foreach($travel->attachments as $key => $attachment): ?>

                                    <div class="col">
                                        <ol>
                                            <li><a href="<?php echo base_url('/hr/claim/openAttachment/'.$attachment->unique_id.'/MILEAGE'); ?>" target="_blank"><?php echo $attachment->attachment_name; ?></a></li>
                                        </ol>
                                    </div>
                                <?php endforeach ?>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

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

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2"><b>Mileage (RM)</b></div>
                                <div class="col">
                                <?php 
                                    echo number_format($travel->mileage_amount,2); 
                                ?>
                                </div>
                            </div>

                            <!-- 
                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2"><b>Travelling (RM)</b></div>
                                <div class="col">
                                <?php 
                                    //echo number_format($travel->amount_claim,2); 
                                ?>
                                </div>
                            </div> 
                            -->

                            <div class="row py-1" style="background-color:bisque;">
                                <div class="col-lg-2"><b>Approved (RM)</b></div>
                                <div class="col"><?php echo number_format($travel->amount_approve,2); ?></div>
                            </div>
                        </td>
                    </tr>
                <?php endforeach ?>
                
                <!-- accomodation -->
                <?php if($accomodation) foreach($accomodation as $key => $value): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td> 
                            
                            <div class="row py-1 border-bottom">
                                <div class="col text-right">

                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" title="" 
                                            data-original-title="Approved Claim" 
                                            data-claim-id="<?php echo $value->id; ?>" 
                                            data-mode="9" 
                                            onclick="hodApproval(this)"
                                            >
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                        </button>
                                        <!-- button reject -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $value->id;?>"
                                            data-claim-id="<?php echo $value->claim_id; ?>" 
                                            data-mode="9" 
                                            data-toggle="modal" 
                                            data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button reject -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button 
                                                class="btn btn-success btn-sm text-white" 
                                                onclick="approveClaim(this)" 
                                                data-price="" 
                                                data-mileage=""
                                                data-rqtarget="approveTravels" 
                                                data-id="" 
                                                data-status="" 
                                                data-allocation="status" 
                                                data-balanced="balanced" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                            </button>
                                        <?php endif; ?>

                                        <?php if(empty($screen_mode)):?>
                                            <button class="btn btn-danger btn-sm" 
                                                data-rqtarget="" 
                                                data-id="" 
                                                onclick="deleteClaim(this)" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>
                                            >
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                        <?php endif; ?>
                                    <?php endif; ?>

                                </div>
                            </div>
                
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date From</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date_from)); ?>
                                </div>
                                <div class="col-lg-2">
                                    <b> Date To</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date_to)); ?>
                                </div>
                            </div>
                            
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_admin_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    
                                    <?php if ($value->is_hod_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Type</b>
                                </div>
                                <div class="col text-primary">
                                    Accomodation
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Travel Type</b>
                                </div>
                                <div class="col">
                                    <?php if($value->type == 0): ?> 
                                        Local Travel
                                    <?php else:?>
                                        International Travel
                                    <?php endif;?>
                                </div>
                            </div>
                                
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachment(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if(!empty($value->attachment_name)): ?>
                                            <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$value->unique_id.'/ACCOMODATION'); ?>" target="_blank"><?php echo $value->attachment_name; ?></a></li>
                                        <?php endif; ?>
                                    </ol>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Staff Movement(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if(!empty($value->staff_movements)) foreach($value->staff_movements as $mov_key => $movement): ?>
                                            <li><a href="#" target="_blank"><?php echo $movement->date.' - '.$movement->type.' : '.$movement->destination; ?></a></li>
                                        <?php endforeach; ?>
                                    </ol>
                                </div>
                            </div>
                            
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

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

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b> Amount Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount,2); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b> Amount Approve (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount_approved,2); ?>
                                </div>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; ?>
                
                <!-- subsistence -->
                <?php if($subsistence) foreach($subsistence as $key => $value): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td>

                            <div class="row py-1 border-bottom">
                                <div class="col text-right">
                                   
                                <?php if($screen_mode == 'hod'): ?>
                                    <button class="btn btn-success btn-sm" 
                                        data-trigger="hover" 
                                        data-tooltip="tooltip" title="" 
                                        data-original-title="Approved Claim" 
                                        data-claim-id="<?php echo $value->id; ?>" 
                                        data-mode="10" 
                                        onclick="hodApproval(this)"
                                        >
                                        <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                    </button>
                                    <!-- button reject -->
                                    <button class="btn btn-danger btn-sm" 
                                        data-trigger="hover" 
                                        data-tooltip="tooltip" 
                                        title="" 
                                        data-original-title="Disaprove Claim" 
                                        data-id="<?php echo $value->id; ?>"
                                        data-claim-id="<?php echo $value->claim_id; ?>" 
                                        data-mode="10" 
                                        data-toggle="modal" 
                                        data-target="#rejectModal"
                                        onclick="hodReject(this)"
                                        >
                                        <i class="fas fa-thumbs-down"></i>
                                    </button>
                                    <!-- button reject -->
                                <?php else: ?>
                                    <?php if($screen_mode == 'admin'): ?>
                                        <button 
                                            class="btn btn-success btn-sm text-white" 
                                            onclick="approveClaim(this)" 
                                            data-price="" 
                                            data-mileage=""
                                            data-rqtarget="approveTravels" 
                                            data-id="" 
                                            data-status="" 
                                            data-allocation="status" 
                                            data-balanced="balanced" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Approve Claim">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                        </button>
                                    <?php endif; ?>

                                    <?php if(empty($screen_mode)):?>
                                        <button class="btn btn-danger btn-sm" 
                                            data-rqtarget="" 
                                            data-id="" 
                                            onclick="deleteClaim(this)" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>
                                        >
                                            <i class="fa fa-trash-alt"></i>
                                        </button>
                                    <?php endif; ?>
                                <?php endif; ?>

                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date From</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date_from)); ?>
                                </div>
                                <div class="col-lg-2">
                                    <b>Date To</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date_to)); ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_admin_approved == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approved == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approved == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_hod_approved == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approved == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Type</b>
                                </div>
                                <div class="col text-primary">
                                    Subsistence Allowance (<?php echo strtolower($value->allowance); ?>)
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Staff Movement(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if($value->staff_movements) foreach($value->staff_movements as $move_key => $movement): ?>
                                            <li><a href="" target="_blank"><?php echo $movement->date.' - '.$movement->type.' : '.$movement->destination; ?></a></li>
                                        <?php endforeach;?>
                                    </ol>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

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

                            <div class="row" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount,2);?>
                                </div>
                            </div>

                            <div class="row" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Approve (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount_approved,2);?>
                                </div>
                            </div>
                        </td>            
                    </tr>
                <?php endforeach; ?>

                <!-- transportation -->
                <?php if($transportation) foreach($transportation as $key => $value): ?>
                    <tr>
                         <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                         <td>

                            <div class="row py-1 border-bottom">
                                <div class="col text-right">
                                    
                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" title="" 
                                            data-original-title="Approved Claim" 
                                            data-claim-id="<?php echo $value->id; ?>" 
                                            data-mode="11" 
                                            onclick="hodApproval(this)"
                                            >
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                        </button>
                                        <!-- button reject -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $value->id; ?>"
                                            data-claim-id="<?php echo $value->claim_id; ?>" 
                                            data-mode="11" 
                                            data-toggle="modal" 
                                            data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button reject -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button 
                                                class="btn btn-success btn-sm text-white" 
                                                onclick="approveClaim(this)" 
                                                data-price="" 
                                                data-mileage=""
                                                data-rqtarget="approveTravels" 
                                                data-id="" 
                                                data-status="" 
                                                data-allocation="status" 
                                                data-balanced="balanced" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                            </button>
                                        <?php endif; ?>

                                        <?php if(empty($screen_mode)):?>
                                            <button class="btn btn-danger btn-sm" 
                                                data-rqtarget="" 
                                                data-id="" 
                                                onclick="deleteClaim(this)" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>
                                            >
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                        <?php endif; ?>
                                    <?php endif; ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date)); ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_admin_approved == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approved == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approved == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_hod_approved == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approved == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Type</b>
                                </div>
                                <div class="col text-primary">
                                    Transportation
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Transportation</b>
                                </div>
                                <div class="col">
                                    <?php echo $value->transportation_type; ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Description</b>
                                </div>
                                <div class="col">
                                    <?php echo $value->description; ?>
                                </div>
                            </div>

                            

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachment(s)</b> 
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if($value->attachments) foreach($value->attachments as $attachment_key => $attachment): ?>
                                            <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$attachment->unique_id.'/TRANSPORTATION'); ?>" target="_blank"><?php echo $attachment->attachment_name; ?></a></li>
                                        <?php endforeach; ?>
                                    </ol>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Staff movements </b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if($value->staff_movements) foreach($value->staff_movements as $move_key => $movement): ?>
                                            <li><a href="" target="_blank"><?php echo $movement->date.' - '.$movement->type.' : '.$movement->destination; ?></a></li>
                                        <?php endforeach; ?>
                                    </ol>
                                </div>
                            </div>
                            
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

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

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                   <b>Amount Claim(RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount,2); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Approved(RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount_approved,2); ?>
                                </div>
                            </div>
                         </td>
                    </tr>
                <?php endforeach; ?>

                <!-- parking -->
                <?php if($parking) foreach($parking as $key => $value): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td>
                            <div class="row py-1 border-bottom">
                                <div class="col text-right">
                                    
                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" title="" 
                                            data-original-title="Approved Claim" 
                                            data-claim-id="<?php echo $value->id; ?>" 
                                            data-mode="12" 
                                            onclick="hodApproval(this)"
                                            >
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                        </button>
                                        <!-- button reject -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $value->id; ?>"
                                            data-claim-id="<?php echo $value->claim_id; ?>" 
                                            data-mode="12" 
                                            data-toggle="modal" 
                                            data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button reject -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button 
                                                class="btn btn-success btn-sm text-white" 
                                                onclick="approveClaim(this)" 
                                                data-price="" 
                                                data-mileage=""
                                                data-rqtarget="approveTravels" 
                                                data-id="" 
                                                data-status="" 
                                                data-allocation="status" 
                                                data-balanced="balanced" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                            </button>
                                        <?php endif; ?>

                                        <?php if(empty($screen_mode)):?>
                                            <button class="btn btn-danger btn-sm" 
                                                data-rqtarget="" 
                                                data-id="" 
                                                onclick="deleteClaim(this)" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>
                                            >
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                    
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b> 
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date)); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_admin_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_hod_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Type</b>
                                </div>
                                <div class="col text-primary">
                                    Parking
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachments</b>
                                </div>
                                <div class="col">
                                    <ol>
                                    <?php if($value->attachment) foreach($value->attachment as $attach_key => $attachment): ?>
                                        <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$attachment->unique_id.'/PARKING'); ?>" target="_blank"><?php echo $attachment->attachment_name; ?></a></li>
                                    <?php endforeach;?>
                                    </ol>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Staff movements</b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if($value->staff_movement) foreach($value->staff_movement as $move_key => $movement): ?>
                                            <li><a href="" target="_blnak"><?php echo $movement->date.' - '.$movement->type.' : '.$movement->destination;?></a></li>
                                        <?php endforeach; ?>
                                    </ol>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

                                    <?php if($value->is_admin_approve == 2): ?>
                                        <?php if(!empty($value->admin_remarks)): ?>
                                            <b>[ADMIN] : </b> <?php echo $value->admin_remarks; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount,2); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Approved (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount_approved,2); ?>
                                </div>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; ?>
                
                <!-- toll -->
                <?php if($toll) foreach($toll as $key => $value):?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td>
                            


                            <div class="row py-1 border-bottom">
                                <div class="col text-right">
                                    
                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" title="" 
                                            data-original-title="Approved Claim" 
                                            data-claim-id="<?php echo $value->id; ?>" 
                                            data-mode="13" 
                                            onclick="hodApproval(this)"
                                            >
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                        </button>
                                        <!-- button reject -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $value->id; ?>"
                                            data-claim-id="<?php echo $value->claim_id; ?>" 
                                            data-mode="13" 
                                            data-toggle="modal" 
                                            data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button reject -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button 
                                                class="btn btn-success btn-sm text-white" 
                                                onclick="approveClaim(this)" 
                                                data-price="" 
                                                data-mileage=""
                                                data-rqtarget="approveTravels" 
                                                data-id="" 
                                                data-status="" 
                                                data-allocation="status" 
                                                data-balanced="balanced" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                            </button>
                                        <?php endif; ?>

                                        <?php if(empty($screen_mode)):?>
                                            <button class="btn btn-danger btn-sm" 
                                                data-rqtarget="" 
                                                data-id="" 
                                                onclick="deleteClaim(this)" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>
                                            >
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </div>
                            </div>




                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b> 
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date)); ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_admin_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_hod_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col text-primary">
                                    Toll
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachment(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if($value->attachments) foreach($value->attachments as $attach_key => $attachment): ?>
                                            <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$attachment->unique_id.'/TOLL'); ?>" target="_blank"><?php echo $attachment->attachment_name; ?></a></li>
                                        <?php endforeach;?>
                                    </ol>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Staff movement(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                        <?php if($value->staff_movements) foreach($value->staff_movements as $move_key => $movement): ?>
                                            <li><a href="" target="_blnak"><?php echo $movement->date.' - '.$movement->type.' : '.$movement->destination;?></a></li>
                                        <?php endforeach; ?>
                                    </ol>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

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

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount,2); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Amount Approved (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($value->amount_approved,2); ?>
                                </div>
                            </div>

                        </td>
                    </tr>
                <?php endforeach; ?>
                
                <!-- trainers -->
                <?php if($trainers) foreach($trainers as $key => $value): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col text-right">
                                    
                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" title="" 
                                            data-original-title="Approved Claim" 
                                            data-claim-id="<?php echo $value->id; ?>" 
                                            data-mode="14" 
                                            onclick="hodApproval(this)"
                                            >
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>    
                                        </button>
                                        <!-- button reject -->
                                        <button class="btn btn-danger btn-sm" 
                                            data-trigger="hover" 
                                            data-tooltip="tooltip" 
                                            title="" 
                                            data-original-title="Disaprove Claim" 
                                            data-id="<?php echo $value->id; ?>"
                                            data-claim-id="<?php echo $value->claim_id; ?>" 
                                            data-mode="14" 
                                            data-toggle="modal" 
                                            data-target="#rejectModal"
                                            onclick="hodReject(this)"
                                            >
                                            <i class="fas fa-thumbs-down"></i>
                                        </button>
                                        <!-- button reject -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button 
                                                class="btn btn-success btn-sm text-white" 
                                                onclick="approveClaim(this)" 
                                                data-price="" 
                                                data-mileage=""
                                                data-rqtarget="approveTravels" 
                                                data-id="" 
                                                data-status="" 
                                                data-allocation="status" 
                                                data-balanced="balanced" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                            </button>
                                        <?php endif; ?>

                                        <?php if(empty($screen_mode)):?>
                                            <button class="btn btn-danger btn-sm" 
                                                data-rqtarget="" 
                                                data-id="" 
                                                onclick="deleteClaim(this)" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>
                                            >
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($value->date)); ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_admin_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_admin_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if ($value->is_hod_approve == 0): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                Draft
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 1): ?>
                                        <div class="input-group w-100">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-success btn-block btn-sm" type="button" disabled>
                                                Approved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($value->is_hod_approve == 2): ?>
                                        <div class="input-group">
                                        <div class="input-group-prepend w-100">
                                            <button class="btn btn-danger btn-block btn-sm text-white" type="button" disabled>
                                                Disaproved
                                            </button>
                                        </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Type</b>
                                </div>
                                <div class="col text-primary">
                                    Trainer / Facilitator
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Title</b></div>
                                <div class="col">
                                    <?php echo $value->title; ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Start At : </b></div>
                                <div class="col"><?php echo date('h:i a',strtotime($value->start_at)); ?></div>
                                <div class="cl-lg-2"><b>End At : </b></div>
                                <div class="col"><?php echo date('h:i a',strtotime($value->end_at)); ?></div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col">
                                    <?php if(!empty($value->type) && $value->type == 1): ?>
                                        External Training
                                    <?php else: ?>
                                        Inhouse Training
                                    <?php endif; ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Remarks</b></div>
                                <div class="col" style="min-height:100px;">
                                    <?php if($value->is_hod_approve == 2): ?>
                                        <?php if(!empty($value->hod_remarks)): ?>
                                            <b>[HOD] : </b> <?php echo $value->hod_remarks; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>

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

                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Attachments</b></div>
                                <div class="col">
                                    <ol>
                                        <?php foreach($value->attachments as $att_key => $att_val): ?>
                                            <li>
                                                <a href="<?php echo base_url('hr/claim/openAttachment/'.$att_val->unique_id.'/TRAINER'); ?>" target="_blanl"><?php echo $att_val->attachment_name;?></a><br>
                                                <small><?php echo $att_val->description; ?></small>
                                            </li>
                                        <?php endforeach; ?>
                                    </ol>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2"><b>Claim (RM)</b></div>
                                <div class="col">
                                    <?php echo number_format($value->amount,2); ?>
                                </div>
                            </div>

                            <div class="row py-1 border-bottom" style="background-color:bisque">
                                <div class="col-lg-2"><b>Amount Approve (RM)</b></div>
                                <div class="col">
                                    <?php echo number_format($value->amount_approved,2); ?>
                                </div>
                            </div>

                        </td>
                    </tr>
                <?php endforeach; ?>

                <!-- others claim list -->                     
                <?php if($others) foreach ($others as $key => $other): ?>
                    <tr>
                        <td style="vertical-align:middle;"><?php echo ++$counter; ?></td>
                        <td>
                            <div class="row">
                                <div class="col text-right">
                                    <?php if($screen_mode == 'hod'): ?>
                                        <button class="btn btn-success btn-sm" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approved Claim" data-claim-id="<?php echo $other->id; ?>" data-mode="8" onclick="hodApproval(this)">
                                            <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                        </button>
                                        
                                            <!-- button rejecet -->
                                            <button class="btn btn-danger btn-sm" 
                                                data-trigger="hover" 
                                                data-tooltip="tooltip" 
                                                title="" 
                                                data-original-title="Disaprove Claim" 
                                                data-id="<?php echo $other->id; ?>"
                                                data-claim-id="<?php echo $other->claim_id; ?>" 
                                                data-mode="8" 
                                                data-toggle="modal" data-target="#rejectModal"
                                                onclick="hodReject(this)"
                                                >
                                                <i class="fas fa-thumbs-down"></i>
                                            </button>
                                            <!-- button rejecet -->
                                    <?php else: ?>
                                        <?php if($screen_mode == 'admin'): ?>
                                            <button class="btn btn-success btn-sm text-white" onclick="approveClaim(this)" data-price="<?php echo number_format($other->amount_claim,2); ?>" data-rqtarget="approveOthers" data-id="<?php echo ($other->id)?$other->id:0; ?>" data-status="<?php echo $other->is_approve; ?>" data-allocation="status" data-balanced="balanced" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Approve Claim">
                                                <i class="fas fa-thumbs-up" style="transform: scaleX(-1);"></i>
                                                
                                            </button>
                                        <?php endif ?>
                                        <?php if(empty($screen_mode)): ?>
                                        <button class="btn btn-danger btn-sm" data-rqtarget="removeOther" data-id="<?php echo ($other->id)?$other->id:0; ?>" onclick="deleteClaim(this)" data-trigger="hover" data-tooltip="tooltip" title="" data-original-title="Remove Claim" <?php echo ($disabled || !empty($claims->is_submit))?'disabled':''; ?>>
                                            <i class="fa fa-trash-alt"></i>
                                        </button>
                                        <?php endif ?>
                                    <?php endif ?>
                                </div>
                            </div>


                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Date</b>
                                </div>
                                <div class="col">
                                    <?php echo date('d-F-Y',strtotime($other->date)); ?>                                                
                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (Admin)</b>
                                </div>
                                <div class="col">
                                    <?php if ($other->is_approve == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($other->is_approve == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-block btn-success btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($other->is_approve == 2): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-block btn-danger btn-sm text-white" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </div>
                            
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Status (HOD)</b>
                                </div>
                                <div class="col">
                                    <?php if ($other->is_hod_approved == 0): ?>
                                        <div class="input-group">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-default btn-block btn-sm bg-dark text-white" type="button" disabled>
                                                    Draft
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>

                                    <?php if ($other->is_hod_approved == 1): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-block btn-success btn-sm" type="button" disabled>
                                                    Approved
                                                </button>
                                            </div>
                                        </div>
                                    <?php endif ?>
                                    
                                    <?php if($other->is_hod_approved == 2): ?>
                                        <div class="input-group w-100">
                                            <div class="input-group-prepend w-100">
                                                <button class="btn btn-danger btn-block btn-sm" type="button" disabled>
                                                    Disaproved
                                                </button>
                                            </div>
                                        </div>    
                                    <?php endif ?>

                                </div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2"><b>Type</b></div>
                                <div class="col text-primary">
                                    Others
                                    <br>
                                    <?php echo strtolower(str_replace('_',' ',$other->type)); ?>
                                </div>
                            </div>

                            <!-- 
                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Client</b>
                                </div>
                                <div class="col">

                                </div>
                            </div> 
                            -->

                            <div class="row border-bottom">
                                <div class="col-lg-2">
                                    <b>Description</b>
                                </div>
                                <div class="col" style="min-height:100px;"><?php echo $other->description; ?></div>
                            </div>

                            <div class="row py-1 border-bottom">
                                <div class="col-lg-2">
                                    <b>Attachment(s)</b>
                                </div>
                                <div class="col">
                                    <ol>
                                    <?php if($other->attachments) foreach ($other->attachments as $key => $attach): ?>
                                        <li><a href="<?php echo base_url('hr/claim/openAttachment/'.$attach->unique_id.'/OTHERS'); ?>" target="_blank"><?php echo $attach->attachment_name; ?></a></li>
                                    <?php endforeach ?>
                                    </ol>
                                </div>
                            </div>

                            <div class="row border-bottom">
                                <div class="col-lg-2">
                                    <b>Remarks</b>
                                </div>
                                <div class="col" style="min-height:100px;">

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

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


                                </div>
                            </div>
            
                            <div class="row border-bottom" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Claim (RM)</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($other->amount_claim,2); ?>
                                </div>
                            </div>
                            <div class="row" style="background-color:bisque;">
                                <div class="col-lg-2">
                                    <b>Approved</b>
                                </div>
                                <div class="col">
                                    <?php echo number_format($other->amount_approved,2); ?>
                                </div>
                            </div>
                        </td>

                    </tr>
                <?php endforeach ?>
                

            </tbody>
            
        </table>
    </div>
</div>