<div class="container">
    <header>
        <div class="row">
            <div class="col-12">
                <div class="t-corp pull-left">
                    <div class="t-corp-logo">
                        <img src="http://salihin.noip.me/spserp/assets/images/logo/salihin-logo.png" alt="company logo">
                    </div>
                    <div class="t-corp-name"><b>SPS</b> | HR SYSTEM</div>
                </div>
                <div class="report-title pull-right">
                    
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
                <table class="company">
                    <tbody><tr>
                        <td class="divider">
                            <span class="line">&nbsp;</span>
                        </td>
                        <td class="details">
                            <span><b>SALIHIN (AF 1426)</b></span>
                            <span>555, Jalan Samudra Utara 1, Taman Samudra, Batu Caves,</span>
                            <span>68100, Batu Caves, Selangor</span>
                            <span>Phone: 03-6185 9970 &nbsp;&nbsp; Fax: 03-6185 9970</span>
                            <span>Website: salihin.com.my</span>
                        </td>
                        <td class="divider">
                            <span class="line">&nbsp;</span>
                        </td>
                    </tr>
                </tbody></table>
            </div>
        </div>

        <div class="row">
            <div class="col-12 text-left">
                <strong>Name : </strong> <?php echo (!empty($claims_user['name']))?$claims_user['name']:''; ?> <br>
                <strong>Employement ID : </strong> <?php echo (!empty($claims_user['staff_id']))?$claims_user['staff_id']:''; ?> <br>
                <strong>Position :  </strong> <?php echo (!empty($claims_user['position_name']))?$claims_user['position_name']:''; ?> <br>
                <strong>Department : </strong> <?php echo (!empty($claims_user['department_name']))?$claims_user['department_name']:''; ?> (<?php echo (!empty($claims_user['branch_name']))?$claims_user['branch_name']:''; ?>) <br>
                <strong>Claim : </strong> <?php echo date('F Y',strtotime('01-'.$month.'-'.$year)); ?>
            </div>
        </div>
   

    </header>
</div>
<div class="container">
    <?php $counter = 0; ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/outpatient'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/hospitalization'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/dental_optical'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/panel_claim'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/mileage'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/petrol'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/accomodation'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/transportation'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/subsistence_allowance'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/meal_allowance'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/parking'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/toll'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/trainer'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/entertainment'); ?>
    <?php //$this->load->view('hr/report/claim/claimdetail/others'); ?>

    <?php
        //outpatient 
        $total_outpatient_claim = 0;$total_outpatient_hod_approved = 0;$total_outpatient_admin_approved = 0;
        //hospitalization
        $total_hospitalization_claim = 0;$total_hospitalization_hod_approved = 0;$total_hospitalization_admin_approved = 0;
        //dental / optical
        $total_dental_optical_claim = 0;$total_dental_optical_hod_approved = 0;$total_dental_optical_admin_approved = 0;
        //panel clinic 
        $total_panel = 0 ;
        //mileage
        $total_mileage_claim = 0;$total_mileage_hod_approved = 0;$total_mileage_admin_approved = 0;$total_mileage_em_approved = 0;
        //petrol 
        $total_petrol_claim = 0;$total_petrol_hod_approved = 0;$total_petrol_admin_approved = 0;$total_petrol_em_approved = 0;
        //accomodation
        $total_accomodation_claim = 0;$total_accomodation_hod_approved = 0;$total_accomodation_admin_approved = 0;$total_accomodation_em_approved = 0;
        //transportation
        $total_transportation_claim = 0;$total_transportation_hod_approved = 0;$total_transportation_admin_approved = 0;$total_transportation_em_approved = 0;
        //subsistence allowance
        $total_subsistence_claim = 0;$total_subsistence_hod_approved = 0;$total_subsistence_admin_approved = 0;$total_subsistence_em_approved = 0;
        //meals allowance 
        $total_meals_claim = 0;$total_meals_hod_approved = 0;$total_meals_admin_approved = 0;$total_meals_em_approved = 0;
        //parking 
        $total_parking_claim = 0;$total_parking_hod_approved = 0;$total_parking_admin_approved = 0;$total_parking_em_approved = 0;
        //toll
        $total_toll_claim = 0;$total_toll_hod_approved = 0;$total_toll_admin_approved = 0;$total_toll_em_approved = 0;
        //trainer 
        $total_trainer_claim = 0;$total_trainer_hod_approved = 0;$total_trainer_admin_approved = 0;$total_trainer_em_approved = 0;
        //entertainement 
        $total_entertainment_claim =0;$total_entertainment_hod_approved = 0;$total_entertainement_admin_approved = 0;$total_entertainement_em_approved = 0;
        // changes made by Ariff 29/03/2021
        //membership claim
        $total_membership_claim = 0;$total_membership_hod_approved = 0;$total_membership_admin_approved = 0;
        //other claim
        $total_other_claim = 0;$total_other_hod_approved = 0;$total_other_admin_approved = 0;$total_other_em_approved = 0;

        //dressing
        $total_dressing_claim = 0;$total_dressing_hod_approved = 0;$total_dressing_admin_approved = 0;
        //gadget
        $total_gadget_claim = 0;$total_gadget_hod_approved = 0;$total_gadget_admin_approved = 0;
    ?>

    <!-- start : outpatient -->
        <?php if(!empty($outpatients)): ?>
            <br>
            <div class="row">

                <div class="col-4">
                    <b class="text-uppercase"><u>outpatient</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                <?php foreach($outpatients as $key => $outpatient): ?>
                <div class="col-4">
                    &emsp;<?php echo $outpatient->invoice_chit; ?> <?php echo (!empty($outpatient->is_medical))?'MEDICAL SCREENING ':''; ?><?php echo date('d-F-Y',strtotime($outpatient->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        echo number_format($outpatient->amount_claim,2); 
                        $total_outpatient_claim += $outpatient->amount_claim;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right">
                    <?php 
                        // echo ($outpatient->is_hod_approved == 1)?number_format($outpatient->amount_claim):'0.00'; 
                        if($outpatient->is_hod_approved == 1)
                        {
                            echo number_format($outpatient->amount_claim,2);
                            $total_outpatient_hod_approved += $outpatient->amount_claim;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php 
                        if($outpatient->is_approve == 1)
                        {
                            echo number_format($outpatient->amount_approved,2); 
                            $total_outpatient_admin_approved += $outpatient->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>
                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_outpatient_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_outpatient_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_outpatient_admin_approved,2); ?>
                </div>

            </div>
        <?php endif; ?>
    <!-- end : outpatient -->

    <!-- start: hospitalization -->
        <?php if(!empty($hospitalizations)): ?>
            <br>
            <div class="row">
                    
                    <div class="col-4">
                        <b class="text-uppercase"><u>hospitalization</u></b>
                    </div>
                    <div class="col-2">
                        <b class="text-uppercase">claims</b>
                    </div>
                    <div class="col-2">
                        <b class="text-uppercase">em approved</b>
                    </div>
                    <div class="col-2">
                        <b class="text-uppercase">hod approved</b>
                    </div>
                    <div class="col-2">
                        <b class="text-uppercase">admin approved</b>
                    </div>
                    
                    <?php foreach($hospitalizations as $key => $hospitalize): ?>
                    <div class="col-4">
                        &emsp;<?php echo $hospitalize->invoice_chit; ?><?php echo date('d-F-Y',strtotime($hospitalize->date)); ?>
                    </div> 
                    <div class="col-2 text-right">
                        <?php 
                            echo number_format($hospitalize->amount_claim,2); 
                            $total_hospitalization_claim += $hospitalize->amount_claim;
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php echo '0.00'; ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($hospitalize->is_hod_approved == 1)
                            {
                                echo number_format($hospitalize->amount_claim,2); 
                                $total_hospitalization_hod_approved += $hospitalize->amount_claim;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($hospitalize->is_approve == 1){
                                echo number_format($hospitalize->amount_approved,2); 
                                $total_hospitalization_admin_approved += $hospitalize->amount_approved;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <?php endforeach; ?>
                
                    <div class="col-4 text-uppercase">
                        <b>sub total</b>
                    </div>
                    <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                        <?php echo number_format($total_hospitalization_claim,2); ?>
                    </div>
                    <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                        <?php echo '0.00'; ?>
                    </div>
                    <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                        <?php echo number_format($total_hospitalization_hod_approved,2); ?>
                    </div>
                    <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                        <?php echo number_format($total_hospitalization_admin_approved,2); ?>
                    </div>
            </div>
        <?php endif; ?>   
    <!-- end: hospitalization -->

    <!-- start: dental and optical -->
        <?php if(!empty($dentals)): ?>
            <br>
            <div class="row">      
                <div class="col-4">
                    <b class="text-uppercase"><u>Dental and optical</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($dentals as $key => $dental): ?>
                <div class="col-4">
                    &emsp;<?php echo $dental->invoice_chit; ?> <?php echo date('d-F-Y',strtotime($dental->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        echo number_format($dental->amount_claim,2); 
                        $total_dental_optical_claim += $dental->amount_claim;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($dental->is_hod_approved == 1)
                        {
                            echo number_format($dental->amount_claim,2);
                            $total_dental_optical_hod_approved += $dental->amount_claim;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($dental->is_approve == 1){
                            echo number_format($dental->amount_approved,2); 
                            $total_dental_optical_admin_approved += $dental->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_dental_optical_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_dental_optical_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_dental_optical_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: dental and optical -->

    <!-- start: panel claims  -->
        <?php if(!empty($panel_first_month)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Panel clinic</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($panel_first_month as $key => $panel): //debug($panel); ?>
                    <div class="col-4">
                        &emsp;<?php echo $panel->invoice_chit; ?> <?php echo date('F-Y',strtotime('01-'.$panel->invoice_month.'-'.$panel->invoice_year)); ?>  
                        <?php if($panel->claim_type_id == 1){ 
                            echo "[Medical - Outpatient]";
                        } else if ($panel->claim_type_id == 2){ 
                            echo "[Medical - Hospitalization]";
                        } else if ($panel->claim_type_id == 4){ 
                            echo "[Medical - Dental / Optical]";
                        } ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php $total_panel += $panel->amount; ?>
                        <?php echo number_format($panel->amount,2); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php echo '0.00'; ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php echo number_format($panel->amount,2); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php echo number_format($panel->amount,2); ?>
                    </div>
                <?php endforeach; ?>



                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_panel,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_panel,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_panel,2); ?>
                </div>

            </div>
        <?php endif; ?>
    <!-- end: panel claims -->

    <!-- start: mileage  --> 
        <?php if(!empty($travels)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Mileage</u></b>
                </div>     
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($travels as $key => $travel): ?>
                    <div class="col-4">
                        Job ID [<?php if($travel->job_id > 0){ echo $travel->job_id; }else{ echo ' - '; } ?>] :
                        <?php
                            $distance = 0;
                            foreach($travel->routes as $index => $route):
                                $distance += $route->distance;
                            endforeach;
                        ?>
                        &emsp;<?php echo $distance.' KM - '; ?><?php echo date('d-F-Y',strtotime($travel->travelling_date)); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php 
                        echo number_format($travel->mileage_amount,2); 
                        $total_mileage_claim += $travel->mileage_amount;
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($travel->is_em_approved == 1){
                                echo number_format($travel->mileage_amount,2); 
                                $total_mileage_em_approved += $travel->mileage_amount;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($travel->is_hod_approved == 1){
                                echo number_format($travel->mileage_amount,2); 
                                $total_mileage_hod_approved += $travel->mileage_amount;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($travel->status == 1){
                                echo number_format($travel->amount_approve,2);
                                $total_mileage_admin_approved += $travel->amount_approve;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                <?php endforeach; ?>
                
                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_mileage_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_mileage_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_mileage_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_mileage_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: mileage -->
    
    <!-- start: petrol  -->
        <?php if(!empty($petrols)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Petrol</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($petrols as $key => $petrol): ?>
                <div class="col-4">
                    Job ID [<?php if($petrol->job_id > 0){ echo $petrol->job_id; }else{ echo ' - '; } ?>] :
                    &emsp;<?php echo date('d-F-Y',strtotime($petrol->date_from)).' to '.date('d-F-Y',strtotime($petrol->date_to)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php 
                        echo number_format($petrol->amount,2); 
                        $total_petrol_claim += $petrol->amount;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($petrol->is_em_approved == 1){
                            echo number_format($petrol->amount,2);
                            $total_petrol_em_approved += $petrol->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($petrol->is_hod_approve == 1){
                            echo number_format($petrol->amount,2);
                            $total_petrol_hod_approved += $petrol->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($petrol->is_admin_approve == 1){
                            echo number_format($petrol->amount_approved,2);
                            $total_petrol_admin_approved += $petrol->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_petrol_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_petrol_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_petrol_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_petrol_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?> 
    <!-- end: petrol -->
    
    <!-- start: Accomodation  -->
        <?php if(!empty($accomodation)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Accomodation</u></b>
                </div>
                
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($accomodation as $key => $value): ?>
                    <div class="col-4">
                        Job ID [<?php if($value->job_id > 0){ echo $value->job_id; }else{ echo ' - '; } ?>] :
                        &emsp;<?php echo date('d-F-Y',strtotime($value->date_from)).' to '.date('d-F-Y',strtotime($value->date_to)); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php 
                            echo number_format($value->amount,2); 
                            $total_accomodation_claim += $value->amount;
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_em_approved == 1)
                            {
                                echo number_format($value->amount,2);
                                $total_accomodation_em_approved += $value->amount;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_hod_approve == 1)
                            {
                                echo number_format($value->amount,2);
                                $total_accomodation_hod_approved += $value->amount;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_admin_approve == 1){
                                echo number_format($value->amount_approved,2);
                                $total_accomodation_admin_approved += $value->amount_approved;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                <?php endforeach; ?>

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_accomodation_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_accomodation_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_accomodation_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_accomodation_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: Accomodation -->

    <!-- start: Transportation  -->
        <?php if(!empty($transportation)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Transportation</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($transportation as $key => $value): ?>
                    <div class="col-4">
                        Job ID [<?php if($value->job_id > 0){ echo $value->job_id; }else{ echo ' - '; } ?>] :
                        &emsp;<?php echo strtoupper($value->transportation_type); ?><?php echo date('d-F-Y',strtotime($value->date)); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            echo number_format($value->amount,2);
                            $total_transportation_claim += $value->amount; 
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_em_approved == 1){
                                echo number_format($value->amount,2);
                                $total_transportation_em_approved += $value->amount; 
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_hod_approved == 1){
                                echo number_format($value->amount,2);
                                $total_transportation_hod_approved += $value->amount; 
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_admin_approved == 1){
                                echo number_format($value->amount_approved,2);
                                $total_transportation_admin_approved += $value->amount_approved;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                <?php endforeach; ?>
                
                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_transportation_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_transportation_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_transportation_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_transportation_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: Transportation -->
    
    <!-- start: subsistence allowance  -->
        <?php if(!empty($subsistence)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Subsistence Allowance</u></b>
                </div>
                
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($subsistence as $key => $value): ?>
                    <div class="col-4">
                        Job ID [<?php if($value->job_id > 0){ echo $value->job_id; }else{ echo ' - '; } ?>] :
                        &emsp;<?php echo $value->allowance; ?> - <?php echo date('d-F-Y',strtotime($value->date_from)).' to '.date('d-F-Y',strtotime($value->date_to)); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            echo number_format($value->amount,2);
                            $total_subsistence_claim += $value->amount;
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_em_approved == 1){
                                echo number_format($value->amount,2); 
                                $total_subsistence_em_approved += $value->amount;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_hod_approved == 1){
                                echo number_format($value->amount,2); 
                                $total_subsistence_hod_approved += $value->amount;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($value->is_admin_approved == 1){
                                echo number_format($value->amount_approved,2); 
                                $total_subsistence_admin_approved += $value->amount_approved;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                <?php endforeach;?>
            

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_subsistence_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_subsistence_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_subsistence_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_subsistence_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?> 
    <!-- end: subsistence allowance -->
    
    <!-- start: Meals Allowance  -->
        <?php if(!empty($meals)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Meals Allowance</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($meals as $key => $meal): ?>
                    <div class="col-4">
                        Job ID [<?php if($meal->job_id > 0){ echo $meal->job_id; }else{ echo ' - '; } ?>] :
                        &emsp;<?php echo date('d-F-Y',strtotime($meal->date)); ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            echo number_format($meal->amount_claim,2);
                            $total_meals_claim += $meal->amount_claim;
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($meal->is_em_approved == 1){
                                echo number_format($meal->amount_claim,2);
                                $total_meals_em_approved += $meal->amount_claim;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($meal->is_hod_approved == 1){
                                echo number_format($meal->amount_claim,2);
                                $total_meals_hod_approved += $meal->amount_claim;
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                    <div class="col-2 text-right">
                        <?php
                            if($meal->is_approve == 1){
                                echo number_format($meal->amount_approved,2);
                                $total_meals_admin_approved += $meal->amount_approved; 
                            }else{
                                echo '0.00';
                            }
                        ?>
                    </div>
                <?php endforeach; ?>
        
                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_meals_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_meals_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_meals_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_meals_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: Meals Allowance -->
    
    <!-- start: Parking  -->
        <?php if(!empty($parking)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Parking</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($parking as $key => $value): ?>
                <div class="col-4">
                    Job ID [<?php if($value->job_id > 0){ echo $value->job_id; }else{ echo ' - '; } ?>] :
                    &emsp;<?php echo date('d-F-Y',strtotime($value->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php 
                        echo number_format($value->amount,2); 
                        $total_parking_claim += $value->amount;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($value->is_em_approved == 1){
                            echo number_format($value->amount,2); 
                            $total_parking_em_approved += $value->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($value->is_hod_approve == 1){
                            echo number_format($value->amount,2); 
                            $total_parking_hod_approved += $value->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($value->is_admin_approve == 1){
                            echo number_format($value->amount_approved,2); 
                            $total_parking_admin_approved += $value->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>
                
                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_parking_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_parking_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_parking_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_parking_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: Parking -->
    
    <!-- start: Toll  -->
        <?php if(!empty($toll)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Toll</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($toll as $key => $value): ?>
                <div class="col-4">
                    Job ID [<?php if($value->job_id > 0){ echo $value->job_id; }else{ echo ' - '; } ?>] :
                    &emsp;<?php echo date('d-F-Y',strtotime($value->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php 
                        echo number_format($value->amount,2); 
                        $total_toll_claim += $value->amount;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($value->is_em_approved == 1){
                            echo number_format($value->amount,2); 
                            $total_toll_em_approved += $value->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($value->is_hod_approve == 1){
                            echo number_format($value->amount,2); 
                            $total_toll_hod_approved += $value->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($value->is_admin_approve == 1){
                            echo number_format($value->amount_approved,2); 
                            $total_toll_admin_approved += $value->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>
                

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_toll_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_toll_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_toll_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_toll_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: Toll -->

    <!-- start: dressing -->
        <?php if(!empty($dressing)): ?>
            <br>
            <div class="row">      
                <div class="col-4">
                    <b class="text-uppercase"><u>Special Allowance - Dressing</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($dressing as $key => $dressing): ?>
                <div class="col-4">
                    &emsp;<?php echo $dressing->invoice_chit; ?> <?php echo date('d-F-Y',strtotime($dressing->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        echo number_format($dressing->amount_claim,2); 
                        $total_dressing_claim += $dressing->amount_claim;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($dressing->is_hod_approved == 1)
                        {
                            echo number_format($dressing->amount_claim,2);
                            $total_dressing_hod_approved += $dressing->amount_claim;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($dressing->is_approve == 1){
                            echo number_format($dressing->amount_approved,2); 
                            $total_dressing_admin_approved += $dressing->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_dressing_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_dressing_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_dressing_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: dressing -->

    <!-- start: gadget -->
        <?php if(!empty($gadget)): ?>
            <br>
            <div class="row">      
                <div class="col-4">
                    <b class="text-uppercase"><u>Special Allowance - Gadget</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($gadget as $key => $gadget): ?>
                <div class="col-4">
                    &emsp;<?php echo $gadget->invoice_chit; ?> <?php echo date('d-F-Y',strtotime($gadget->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        echo number_format($gadget->amount_claim,2); 
                        $total_gadget_claim += $gadget->amount_claim;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($gadget->is_hod_approved == 1)
                        {
                            echo number_format($gadget->amount_claim,2);
                            $total_gadget_hod_approved += $gadget->amount_claim;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($gadget->is_approve == 1){
                            echo number_format($gadget->amount_approved,2); 
                            $total_gadget_admin_approved += $gadget->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_gadget_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo '0.00'; ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_gadget_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_gadget_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: dressing -->
    
    <!-- start: Trainers  -->
        <?php if(!empty($trainers)): ?>
            <br>
            <div class="row">
                <div class="col-4">
                    <b class="text-uppercase"><u>Trainers</u></b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($trainers as $key => $trainer): ?>
                <div class="col-4">
                    Job ID [<?php if($trainer->job_id > 0){ echo $trainer->job_id; }else{ echo ' - '; } ?>] :
                    &emsp;<?php echo date('d-F-Y',strtotime($trainer->date)); ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        echo number_format($trainer->amount,2); 
                        $total_trainer_claim += $trainer->amount;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($trainer->is_em_approved == 1){
                            echo number_format($trainer->amount,2); 
                            $total_trainer_em_approved += $trainer->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($trainer->is_hod_approve == 1){
                            echo number_format($trainer->amount,2); 
                            $total_trainer_hod_approved += $trainer->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($trainer->is_admin_approve == 1){
                            echo number_format($trainer->amount_approved,2); 
                            $total_trainer_admin_approved += $trainer->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                <?php echo number_format($total_trainer_claim,2); ?> 
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_trainer_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_trainer_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_trainer_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: Trainers -->

    <!-- start: entertainment  -->
        <?php if(!empty($entertainments)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Entertainment</u></b>
                </div>
                
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                
                <?php foreach($entertainments as $key => $entertainment): ?>
                <div class="col-4">
                    Job ID [<?php if($entertainment->job_id > 0){ echo $entertainment->job_id; }else{ echo ' - '; } ?>] :
                    &emsp; <?php echo $entertainment->description; ?>
                </div>
                <div class="col-2 text-right">
                    <?php 
                        echo number_format($entertainment->amount,2); 
                        $total_entertainment_claim += $entertainment->amount;
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($entertainment->is_em_approved == 1){
                            echo number_format($entertainment->amount,2); 
                            $total_entertainement_em_approved += $entertainment->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($entertainment->is_hod_approve == 1){
                            echo number_format($entertainment->amount,2); 
                            $total_entertainment_hod_approved += $entertainment->amount;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <div class="col-2 text-right">
                    <?php
                        if($entertainment->is_approve == 1){
                            echo number_format($entertainment->amount_approved,2); 
                            $total_entertainement_admin_approved += $entertainment->amount_approved;
                        }else{
                            echo '0.00';
                        }
                    ?>
                </div>
                <?php endforeach; ?>
            

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_entertainment_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_entertainement_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_entertainment_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_entertainement_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: entertainment -->
    
    <!-- changes made by Ariff 29/03/2021 start: membership  -->
        <?php if(!empty($others)): ?>
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>Membership</u></b>
                </div>
                
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                <?php foreach($others as $key => $other): ?>
                    <?php if($other->type == 'MEMBERSHIP'): ?>
                        <div class="col-4">
                            Job ID [<?php if($other->job_id > 0){ echo $other->job_id; }else{ echo ' - '; } ?>] :
                            &emsp;<?php echo $other->description; ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php 
                            echo number_format($other->amount_claim,2); 
                            $total_membership_claim +=$other->amount_claim;
                            ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php
                                if($other->is_em_approved == 1){
                                    echo number_format($other->amount_claim,2); 
                                    $total_membership_em_approved += $other->amount_claim;
                                }else{
                                    echo '0.00';
                                }
                            ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php
                                if($other->is_hod_approved == 1){
                                    echo number_format($other->amount_claim,2); 
                                    $total_membership_hod_approved += $other->amount_claim;
                                }else{
                                    echo '0.00';
                                }
                            ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php
                            if($other->is_approve == 1){
                                echo number_format($other->amount_approved,2); 
                                $total_membership_admin_approved += $other->amount_approved;
                            }else{
                                echo '0.00';
                            }
                            ?>
                        </div>
                    <?php endif; ?>
                <?php endforeach; ?>
                

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_admin_approved,2); ?>
                </div>
            </div>
    <!-- end: membership  -->

    <!-- start other  -->
            <br>
            <div class="row">
                    
                <div class="col-4">
                    <b class="text-uppercase"><u>others</u></b>
                </div>
                
                <div class="col-2">
                    <b class="text-uppercase">claims</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">em approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">hod approved</b>
                </div>
                <div class="col-2">
                    <b class="text-uppercase">admin approved</b>
                </div>
                <?php foreach($others as $key => $other): ?>
                    <?php if($other->type != 'MEMBERSHIP'): ?>
                        <div class="col-4">
                            Job ID [<?php if($other->job_id > 0){ echo $other->job_id; }else{ echo ' - '; } ?>] :
                            &emsp;<?php echo strtoupper(str_replace('_',' ',$other->type)); ?> - <?php echo date('d-F-Y',strtotime($other->date)); ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php 
                            echo number_format($other->amount_claim,2); 
                            $total_other_claim +=$other->amount_claim;
                            ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php
                                if($other->is_em_approved == 1){
                                    echo number_format($other->amount_claim,2); 
                                    $total_other_em_approved += $other->amount_claim;
                                }else{
                                    echo '0.00';
                                }
                            ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php
                                if($other->is_hod_approved == 1){
                                    echo number_format($other->amount_claim,2); 
                                    $total_other_hod_approved += $other->amount_claim;
                                }else{
                                    echo '0.00';
                                }
                            ?>
                        </div>
                        <div class="col-2 text-right">
                            <?php
                            if($other->is_approve == 1){
                                echo number_format($other->amount_approved,2); 
                                $total_other_admin_approved += $other->amount_approved;
                            }else{
                                echo '0.00';
                            }
                            ?>
                        </div>
                    <?php endif; ?>
                <?php endforeach; ?>
                

                <div class="col-4 text-uppercase">
                    <b>sub total</b>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_claim,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_em_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_hod_approved,2); ?>
                </div>
                <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                    <?php echo number_format($total_other_admin_approved,2); ?>
                </div>
            </div>
        <?php endif; ?>
    <!-- end: other -->

    <!-- start: total  -->
        <br>
        <div class="row">
            <div class="col-4 text-uppercase">
                <b>total</b>
            </div>
            <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                <strong>
                    <?php
                        $total_claim = $total_outpatient_claim
                                        + $total_hospitalization_claim
                                        + $total_dental_optical_claim
                                        + $total_panel
                                        + $total_mileage_claim
                                        + $total_petrol_claim
                                        + $total_accomodation_claim
                                        + $total_transportation_claim
                                        + $total_subsistence_claim
                                        + $total_meals_claim
                                        + $total_parking_claim
                                        + $total_toll_claim
                                        + $total_trainer_claim
                                        + $total_entertainment_claim
                                        + $total_membership_claim
                                        + $total_other_claim
                                        + $total_dressing_claim
                                        + $total_gadget_claim;
                        echo number_format($total_claim,2);
                    ?>
                </strong>
            </div>
            <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                <strong>
                    <?php
                        $total_em_approve = $total_mileage_em_approved
                                            + $total_petrol_em_approved
                                            + $total_accomodation_em_approved
                                            + $total_transportation_em_approved
                                            + $total_subsistence_em_approved
                                            + $total_meals_em_approved
                                            + $total_parking_em_approved
                                            + $total_toll_em_approved
                                            + $total_trainer_em_approved
                                            + $total_entertainement_em_approved
                                            + $total_other_em_approved;
                        echo number_format($total_em_approve,2); 
                    ?>
                </strong>
            </div>
            <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                <strong>
                    <?php
                        $total_hod_approve = $total_outpatient_hod_approved
                                            + $total_hospitalization_hod_approved
                                            + $total_dental_optical_hod_approved
                                            + $total_panel
                                            + $total_mileage_hod_approved
                                            + $total_petrol_hod_approved
                                            + $total_accomodation_hod_approved
                                            + $total_transportation_hod_approved
                                            + $total_subsistence_hod_approved
                                            + $total_meals_hod_approved
                                            + $total_parking_hod_approved
                                            + $total_toll_hod_approved
                                            + $total_trainer_hod_approved
                                            + $total_entertainment_hod_approved
                                            + $total_membership_hod_approved
                                            + $total_other_hod_approved
                                            + $total_dressing_hod_approved
                                            + $total_gadget_hod_approved;
                        echo number_format($total_hod_approve,2); 
                    ?>
                </strong>
            </div>
            <div class="col-2 text-right" style="border-top:1px solid;border-bottom:double;">
                <strong>
                    <?php
                        $total_admin_approve = $total_outpatient_admin_approved
                                                + $total_hospitalization_admin_approved
                                                + $total_dental_optical_admin_approved
                                                + $total_panel
                                                + $total_mileage_admin_approved
                                                + $total_petrol_admin_approved
                                                + $total_accomodation_admin_approved
                                                + $total_transportation_admin_approved
                                                + $total_subsistence_admin_approved
                                                + $total_meals_admin_approved
                                                + $total_parking_admin_approved
                                                + $total_toll_admin_approved
                                                + $total_trainer_admin_approved
                                                + $total_entertainement_admin_approved
                                                + $total_membership_admin_approved
                                                + $total_other_admin_approved
                                                + $total_dressing_admin_approved
                                                + $total_gadget_admin_approved;
                        echo number_format($total_admin_approve,2);
                    ?>
                </strong>
            </div>
        </div> 
    <!-- end: total -->
</div>