<?php $this->view("includes/Inc_pagehead");?>
<!-- Page Styles Goes Here-->
<style>
.m-input{
  border: 1px solid #ebedf2 !important;
  background-color: #f4f5f833 !important;
}
#payment_view_table .dataTables_scrollHeadInner {
  width:100% !important;
  padding: 0 !important;
}
</style>

<?php $this->view("includes/Inc_navigation");?>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
  <!-- BEGIN: Subheader -->
  <div class="m-subheader ">
    <div class="d-flex align-items-center">
      <div class="mr-auto">
        <h3 class="m-subheader__title m-subheader__title--separator">
          User Profile
        </h3>
      </div>
    </div>
  </div>
  <!-- END: Subheader -->
  <div class="m-content">
    <div class="row">
      <div class="col-xl-3 col-lg-4">
        <div class="m-portlet m-portlet--full-height  ">
          <div class="m-portlet__body" style="padding-top: 0px">
            <div class="m-card-profile">
              <div class="m-card-profile__title m--hide">
                User Profile
              </div>
              <div class="m-card-profile__pic">
                <div class="m-card-profile__pic-wrapper">
                  <img src="<?php echo $this->config->item('Template_template_file_url'); ?>template/assets/app/media/img/users/user.png" alt=""/>
                </div>
              </div>
              <div class="m-card-profile__details">
                <span class="m-card-profile__name">
                  #<?php echo $user_data->user_id?> - <?php echo $user_data->user_alias?>
                </span>

              </div>
              <div class="m-card-profile__details">
                <span class="m-card-profile__name">
                  <span class="m-badge m-badge--success m-badge--wide"><?php echo $user_data->role_title ?></span>
                </span>
              </div>
              <br/>
            </div>
            <ul class="m-nav m-nav--hover-bg m-portlet-fit--sides">
              <li class="m-nav__separator m-nav__separator--fit" style="margin-top: 0px"></li>
              <li class="m-nav__section m--hide">
                <span class="m-nav__section-text">
                  Section
                </span>
              </li>
              <li class="m-nav__item profile_nav" id="nav_overview" data-nav="overview" data-table-name='assigned_works_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-industry"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Overview
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_info" data-nav="info" data-table-name=''>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-info-circle"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        User Info
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <?php if($this->config->item('app_module_user_payments')==1){?>
                <li class="m-nav__item profile_nav" id="nav_user_payments" data-nav="user_payments" data-table-name='user_payment_receipts_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon la la-money"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          User Payments
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
              <?php } ?>
              <li class="m-nav__item profile_nav" id="nav_client_payments" data-nav="client_payments" data-table-name='client_payments_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon la la-money"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Client Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>

              <li class="m-nav__item profile_nav" id="nav_other_income" data-nav="other_income" data-table-name='income_receipts_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-wallet"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Other Income
                      </span>
                    </span>
                  </span>
                </a>
              </li>

              <?php if($this->config->item('app_module_purchase_order')==1){?>
                <li class="m-nav__item profile_nav" id="nav_purchase_orders" data-nav="purchase_orders" data-table-name='purchase_order_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon fa fa-shopping-cart"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Purchase Orders
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
                <li class="m-nav__item profile_nav" id="nav_purchase_order_payments" data-nav="purchase_order_payments" data-table-name='purchase_order_transaction_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon fa fa-money-bill-alt"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Purchase Order Payments
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
              <?php } ?>
              <li class="m-nav__item profile_nav" id="nav_purchases" data-nav="purchases" data-table-name='purchase_bills_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-shopping-cart"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Purchase Bills
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_purchase_materials" data-nav="purchase_materials" data-table-name='materials_purchased_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-shopping-cart"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Purchased Materials
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_purchase_payments" data-nav="purchase_payments" data-table-name='purchase_bill_transaction_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-money-bill-alt"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Purchase Bill Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_labour_wage_slips" data-nav="labour_wage_slips" data-table-name='labour_wage_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-users"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Labour Wage Slips
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_labour_wages" data-nav="labour_wages" data-table-name='labour_wage_transaction_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-users"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Labour Wage Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <?php if($this->config->item('app_module_vehicle')==1){?>
                <li class="m-nav__item profile_nav" id="nav_vehicle_work_slips" data-nav="vehicle_work_slips" data-table-name='vehicle_work_slip_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon fa fa-truck"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Vehicle Work Slips
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
                <li class="m-nav__item profile_nav" id="nav_vehicle_work_slip_payments" data-nav="vehicle_work_slip_payments" data-table-name='vehicle_work_slip_transaction_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon fa fa-truck"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Vehicle Work Slip Payments
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
              <?php } ?>
              <?php if($this->config->item('app_module_hr')==1){?>
                <li class="m-nav__item profile_nav" id="nav_salary_slips" data-nav="vehicle_work_slips" data-table-name='salary_slip_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon la la-money"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Salary Slips
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
                <li class="m-nav__item profile_nav" id="nav_salary_slip_payments" data-nav="salary_slip_payments" data-table-name='salary_slip_transaction_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon la la-money"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Salary Slip Payments
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
              <?php } ?>
              <?php if($this->config->item('app_module_tools_management')==1){?>
                <li class="m-nav__item profile_nav" id="nav_tool_payments" data-nav="tool_payments" data-table-name='tool_payment_transanctions_view_table'>
                  <a href="javascript:;" class="m-nav__link">
                    <i class="m-nav__link-icon la la-money"></i>
                    <span class="m-nav__link-title">
                      <span class="m-nav__link-wrap">
                        <span class="m-nav__link-text">
                          Tool Payments
                        </span>
                      </span>
                    </span>
                  </a>
                </li>
              <?php } ?>
              <li class="m-nav__item profile_nav" id="nav_supplier_advance_payments" data-nav="supplier_advance_payments" data-table-name='supplier_advance_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon la la-money"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Supplier Advance Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_supplier_advance_return_payments" data-nav="supplier_advance_return_payments" data-table-name='supplier_advance_return_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon la la-money"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Supplier Advance Returned Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_expenses" data-nav="expenses" data-table-name='expense_bills_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-clipboard-list"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Expense Bill Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <!-- <li class="m-nav__item profile_nav" id="nav_sub_contracts" data-nav="sub_contracts" data-table-name='subcontracts_view_table'>
              <a href="javascript:;" class="m-nav__link">
              <i class="m-nav__link-icon fa fa-sitemap"></i>
              <span class="m-nav__link-title">
              <span class="m-nav__link-wrap">
              <span class="m-nav__link-text">
              Subcontracts
            </span>
          </span>
        </span>
      </a>
    </li> -->
    <li class="m-nav__item profile_nav" id="nav_sub_contract_payments" data-nav="sub_contract_payments" data-table-name='subcontract_payments_view_table'>
      <a href="javascript:;" class="m-nav__link">
        <i class="m-nav__link-icon fa fa-money-bill-alt"></i>
        <span class="m-nav__link-title">
          <span class="m-nav__link-wrap">
            <span class="m-nav__link-text">
              Subcontract Payments
            </span>
          </span>
        </span>
      </a>
    </li>
    <?php if($this->config->item('app_module_travel_allowance')==1){?>
      <li class="m-nav__item profile_nav" id="nav_travel_allowance" data-nav="travel_allowance" data-table-name='ta_view_table'>
        <a href="javascript:;" class="m-nav__link">
          <i class="m-nav__link-icon fa fa-car"></i>
          <span class="m-nav__link-title">
            <span class="m-nav__link-wrap">
              <span class="m-nav__link-text">
                Travel Allowance
              </span>
            </span>
          </span>
        </a>
      </li>
    <?php } ?>
    <?php if($this->config->item('app_module_work_hour_report')==1){?>
      <li class="m-nav__item profile_nav" id="nav_work_hour_report" data-nav="work_hour_report" data-table-name=''>
        <a href="javascript:;" class="m-nav__link">
          <i class="m-nav__link-icon fa fa-chart-bar"></i>
          <span class="m-nav__link-title">
            <span class="m-nav__link-wrap">
              <span class="m-nav__link-text">
                Work Hour Report
              </span>
            </span>
          </span>
        </a>
      </li>
    <?php } ?>
    <!-- <li class="m-nav__item profile_nav" id="nav_daily_reports" data-nav="daily_reports" data-table-name='8'>
    <a href="javascript:;" class="m-nav__link">
    <i class="m-nav__link-icon fa fa-chart-line"></i>
    <span class="m-nav__link-title">
    <span class="m-nav__link-wrap">
    <span class="m-nav__link-text">
    Daily Work Reports
  </span>
</span>
</span>
</a>
</li> -->
</ul>

</div>
</div>
</div>
<div class="col-xl-9 col-lg-8">
  <div class="m-portlet  m-portlet--rounded m-portlet--bordered">
    <div class="m-portlet__body" style="padding: 1rem 2.2rem;">
      <div class="m-form m-form--label-align-right m--margin-bottom-10">
        <div class="row ">
          <div class="col-xl-12 order-2 order-xl-1">
            <div class="form-group m-form__group row" style="padding-bottom: 0px">
              <div class="col-md-7">
                <div class="row ">
                  <div class="col-md-6">
                    <div class="form-group m-form__group">
                      <label for="user_name">
                        Start Date
                      </label>
                      <div class="input-group m-input-group--air m-input-group--pill  date">
                        <input data-date-format="dd-mm-yyyy" id="table_filter_start_date"  type="text"  class="form-control  m-input table_filter" placeholder="Start Date" >
                      </div>
                    </div>
                  </div>
                  <div class="col-md-6">
                    <div class="form-group m-form__group">
                      <label for="user_name">
                        End Date
                      </label>
                      <div class="input-group m-input-group--air m-input-group--pill  date">
                        <input  data-date-format="dd-mm-yyyy" id="table_filter_end_date"  type="text"  class="form-control  m-input table_filter" placeholder="End Date" >
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-md-5">
                <button id="btn_table_filter" style="margin-top: 25px;margin-right: 5px"  class="btn btn-success m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-search"></i>
                    <span>
                      Apply Filter
                    </span>
                  </span>
                </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div id="div_overview" class="profile_nav_div">
    <div class="m-portlet">
      <div class="m-portlet__body m-portlet__body--no-padding">
        <div class="row m-row--no-padding m-row--col-separator-xl">
          <?php if($this->config->item('app_module_user_payments')==1){?>
            <div class="col-md-12 col-lg-12 col-xl-3">
              <!--begin:: Widgets/Stats2-1 -->
              <div class="m-widget1">
                <div class="m-widget1__item">
                  <div class="row m-row--no-padding align-items-center">
                    <div class="col">
                      <h3 class="m-widget1__title">
                        Total Received Payments to User
                      </h3>
                    </div>
                    <div class="col m--align-right">
                      <span class="m-widget1__number m--font-brand">
                        <label class="total_payments_received_info"></label>
                      </span>
                    </div>
                  </div>
                </div>
              </div>
              <!--end:: Widgets/Stats2-1 -->
            </div>
          <?php } ?>
          <div class="col-md-12 col-lg-12 col-xl-3">
            <!--begin:: Widgets/Stats2-2 -->
            <div class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Spent By User
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-accent">
                      <label class="total_expense_info"></label>
                    </span>
                  </div>
                </div>
              </div>
            </div>
            <!--begin:: Widgets/Stats2-2 -->
          </div>

            <div class="col-md-12 col-lg-12 col-xl-2">
              <!--begin:: Widgets/Stats2-3 -->
              <div class="m-widget1">
                <div class="m-widget1__item">
                  <div class="row m-row--no-padding align-items-center">
                    <div class="col">
                      <h3 class="m-widget1__title">
                        Total Returned
                      </h3>
                    </div>
                    <div class="col m--align-right">
                      <span class="m-widget1__number m--font-success">
                        <label class="total_returned_info"></label>
                      </span>
                    </div>
                  </div>
                </div>
              </div>
              <!--begin:: Widgets/Stats2-3 -->
            </div>
            <div class="col-md-12 col-lg-12 col-xl-2">
              <!--begin:: Widgets/Stats2-3 -->
              <div class="m-widget1">
                <div class="m-widget1__item">
                  <div class="row m-row--no-padding align-items-center">
                    <div class="col">
                      <h3 class="m-widget1__title">
                        OP Balance
                      </h3>
                    </div>
                    <div class="col m--align-right">
                      <span class="m-widget1__number m--font-success">
                        <label class="total_opbalance_info"></label>
                      </span>
                    </div>
                  </div>
                </div>
              </div>
              <!--begin:: Widgets/Stats2-3 -->
            </div>
            <div class="col-md-12 col-lg-12 col-xl-2">
              <!--begin:: Widgets/Stats2-3 -->
              <div class="m-widget1">
                <div class="m-widget1__item">
                  <div class="row m-row--no-padding align-items-center">
                    <div class="col">
                      <h3 class="m-widget1__title">
                        Balance in Hand
                      </h3>
                    </div>
                    <div class="col m--align-right">
                      <span class="m-widget1__number m--font-success">
                        <label class="total_balance_info"></label>
                      </span>
                    </div>
                  </div>
                </div>
              </div>
              <!--begin:: Widgets/Stats2-3 -->
            </div>

        </div>
      </div>
    </div>
    <div class="m-portlet">
      <div class="m-portlet__body m-portlet__body--no-padding">
        <div class="row m-row--no-padding m-row--col-separator-xl">
          <div  class="col-md-3 col-lg-3 col-xl-2">
            <!--begin:: Widgets/Stats2-3 -->
            <!--                            Display Only for Project Mangement-->
            <div id="poject_management_commission_amount" class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Labour Wage Payments
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-success">
                      <label class="total_labour_payments_info"></label>
                    </span>
                  </div>
                </div>
              </div>

            </div>
            <!--begin:: Widgets/Stats2-3 -->
          </div>
          <div  class="col-md-3 col-lg-3 col-xl-2">
            <!--begin:: Widgets/Stats2-3 -->
            <!--                            Display Only for Project Mangement-->
            <div id="poject_management_commission_amount" class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Purchase Payments
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-success">
                      <label class="total_purchase_payment_info"></label>
                    </span>
                  </div>
                </div>
              </div>

            </div>
            <!--begin:: Widgets/Stats2-3 -->
          </div>
          <div  class="col-md-3 col-lg-3 col-xl-2">
            <!--begin:: Widgets/Stats2-3 -->
            <!--                            Display Only for Project Mangement-->
            <div id="poject_management_commission_amount" class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Subcontract Payments
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-success">
                      <label class="total_subcontract_payments_info"></label>
                    </span>
                  </div>
                </div>
              </div>

            </div>
            <!--begin:: Widgets/Stats2-3 -->
          </div>
          <div  class="col-md-3 col-lg-3 col-xl-2">
            <!--begin:: Widgets/Stats2-3 -->
            <!--                            Display Only for Project Mangement-->
            <div id="poject_management_commission_amount" class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Other Expense
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-success">
                      <label class="total_other_expense_info"></label>
                    </span>
                  </div>
                </div>
              </div>

            </div>
            <!--begin:: Widgets/Stats2-3 -->
          </div>
          <div class="col-md-12 col-lg-12 col-xl-2">
            <!--begin:: Widgets/Stats2-3 -->
            <div class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Transferred In
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-success">
                      <label class="total_transferred_in_info"></label>
                    </span>
                  </div>
                </div>
              </div>
            </div>
            <!--begin:: Widgets/Stats2-3 -->
          </div>
          <div class="col-md-12 col-lg-12 col-xl-2">
            <!--begin:: Widgets/Stats2-3 -->
            <div class="m-widget1">
              <div class="m-widget1__item">
                <div class="row m-row--no-padding align-items-center">
                  <div class="col">
                    <h3 class="m-widget1__title">
                      Total Transferred Out
                    </h3>
                  </div>
                  <div class="col m--align-right">
                    <span class="m-widget1__number m--font-success">
                      <label class="total_transferred_out_info"></label>
                    </span>
                  </div>
                </div>
              </div>
            </div>
            <!--begin:: Widgets/Stats2-3 -->
          </div>
        </div>
      </div>
    </div>
    <div class="m-portlet  m-portlet--rounded m-portlet--bordered">
      <div class="m-portlet__body">
        <h3 class="m-portlet__head-text" style="text-align: center">
          Payment Summary
        </h3>
        <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="all_payments">
          <thead>
            <tr class="">
              <th>Types Of Transactions</th>
              <th>Amount</th>
            </tr>
          </thead>
          <tbody>
            <?php if($this->config->item('app_module_purchase_order')==1){?>
              <tr>
                <td>Purchase Order Payments (Advances)</td>
                <strong><td class="total_purchase_order_payment_info"></td></strong>
              </tr>
            <?php } ?>
            <tr>
              <td>Purchase Bill Payments</td>
              <strong><td class="total_purchase_payment_info"></td></strong>
            </tr>
            <tr>
              <td>Supplier Advance Payments</td>
              <strong><td class="total_supplier_advance_info"></td></strong>
            </tr>
            <tr>
              <td>Supplier OP Balance Payments</td>
              <strong><td class="total_supplier_opbalance_info"></td></strong>
            </tr>
            <tr>
              <td>Subcontract Payments</td>
              <strong><td class="total_subcontract_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Labour Wage Payments</td>
              <strong><td class="total_labour_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Expense Bill Payments</td>
              <strong><td class="total_other_expense_info"></td></strong>
            </tr>
            <tr>
              <td>Vehicle Payments</td>
              <strong><td class="total_vehicle_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Salary Slip Payments</td>
              <strong><td class="total_salary_slip_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Employee Payments</td>
              <strong><td class="total_employee_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Tool Payments</td>
              <strong><td class="total_tool_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Loan Payments</td>
              <strong><td class="total_loan_payments_info"></td></strong>
            </tr>
            <tr>
              <td>Client Payment Received</td>
              <strong><td class="total_client_payment_info"></td></strong>
            </tr>
            <tr>
              <td>Other Income Receipts</td>
              <strong><td class="total_other_income_info"></td></strong>
            </tr>
            <tr>
              <td>User Payment (Petty Cash) Received (From Admin/Manager)</td>
              <strong><td class="total_user_payments_received_info"></td></strong>
            </tr>
            <tr>
              <td></td>
              <td></td>
            </tr>
            <tr>
              <td>Total Spent By User</td>
              <strong><td class="total_expense_info"></td></strong>
            </tr>
            <tr>
              <td>Total Transferred In From Other A/C</td>
              <strong><td class="total_transferred_in_info"></td></strong>
            </tr>
            <tr>
              <td>Total Transferred Out to Other A/C</td>
              <strong><td class="total_transferred_out_info"></td></strong>
            </tr>
            <tr>
              <td>Total Petty Cash Released to Other Users A/C</td>
              <strong><td class="total_user_payments_released_info"></td></strong>
            </tr>
            <?php if($user_data->role_name!='general_manager' || ($user_data->role_name=='general_manager' && $this->CI->config->item('User_general_manager_tr_user_accounts_only')==1)){ ?>
              <?php if($this->config->item('app_module_user_payments')==1){?>
                <tr>
                  <td>OP Balance</td>
                  <strong><td class="total_opbalance_info"></td></strong>
                </tr>
                <tr>
                  <td>Total Received Payments to User</td>
                  <strong><td class="total_payments_received_info"></td></strong>
                </tr>
                <tr>
                  <td>Total Payment Returned by User</td>
                  <strong><td class="total_returned_info"></td></strong>
                </tr>
                <tr>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td>Total Balance in Hand</td>
                  <strong><td class="total_balance_info"></td></strong>
                </tr>
              <?php } ?>
            <?php } ?>
            <tr>
              <td>Total Travel Allowance</td>
              <strong><td class="total_travel_allowance_info"></td></strong>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Assigned Works
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="assigned_works_view_table">
          <thead>
            <tr class="">
              <th>Work ID</th>
              <th>Work ID</th>
              <th>Work Name</th>
              <th>Role</th>
              <th>Client Name</th>
              <th>Client Contacts</th>
              <th>Location</th>
              <th>Work Type</th>
              <th>Total Budget Amount</th>
              <th>Work Status</th>
              <th>Created By</th>
              <th>Created Date</th>
              <th>Last Updated By</th>
              <th>Last Updated Date</th>
              <th>Profile</th>
              <th>Actions</th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_info" class="profile_nav_div">
    <div class="m-portlet">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              User Info
            </h3>
          </div>
        </div>
      </div>
      <div class="m-portlet__body">
        <form autocomplete="off" class="m-form m-form--fit m-form--label-align-right">
          <div class="m-portlet__body">
            <div class="form-group m-form__group row">
              <div class="col-9 ml-auto">
                <h4 class="m-form__section">
                  1. User Details
                </h4>
              </div>
            </div>
            <div class="form-group m-form__group row">
              <label class="col-xl-3 col-lg-3 col-form-label">
                User Name
              </label>
              <div class="col-xl-7 col-lg-7">
                <div class="input-group m-input-group--air">
                  <div class="input-group-prepend">
                    <span class="input-group-text">
                      <i class="fa fa-briefcase "></i>
                    </span>
                  </div>
                  <input disabled type="text" name="name" class="form-control m-input m-input--solid" value="<?php echo $user_data->user_alias?>">
                </div>
              </div>
            </div>
            <div class="form-group m-form__group row">
              <label class="col-xl-3 col-lg-3 col-form-label">
                Email
              </label>
              <div class="col-xl-7 col-lg-7">
                <div class="input-group m-input-group--air date">
                  <div class="input-group-prepend">
                    <span class="input-group-text">
                      <i class="fa fa-envelope"></i>
                    </span>
                  </div>
                  <input  disabled type="text"  class="form-control m-input m-input--solid"  value="<?php echo $user_data->username?>">
                </div>
              </div>
            </div>
            <div class="form-group m-form__group row">
              <label class="col-xl-3 col-lg-3 col-form-label">
                Phone
              </label>
              <div class="col-xl-7 col-lg-7">
                <div class="input-group m-input-group--air date">
                  <div class="input-group-prepend">
                    <span class="input-group-text">
                      <i class="fa fa-phone"></i>
                    </span>
                  </div>
                  <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $user_data->phone_no?>">
                </div>
              </div>
            </div>
            <div class="form-group m-form__group row">
              <label class="col-xl-3 col-lg-3 col-form-label">
                User Role
              </label>
              <div class="col-xl-7 col-lg-7">
                <span class="m-badge m-badge-lg m-badge--success m-badge--wide"><?php echo $user_data->role_title ?></span>
              </div>
            </div>
            <div class="form-group m-form__group row">
              <label class="col-xl-3 col-lg-3 col-form-label">
                Account Status
              </label>
              <div class="col-xl-7 col-lg-7">
                <?php if($user_data->acc_status==1){?>
                  <span class="m-badge m-badge--primary m-badge--wide">Active</span>
                <?php }else{ ?>
                  <span class="m-badge m-badge--danger m-badge--wide">DeActive</span>
                <?php } ?>
              </div>
            </div>

          </div>

        </form>
      </div>
    </div>
  </div>
  <div id="div_user_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Payment Releases to The User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_user_payment_receipts");?>
        <!--end: Datatable -->
      </div>
    </div>
    <div class="m-portlet m-portlet--mobile m-portlet--focus m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Payment Returned By The User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_user_payment_returns");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_client_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Client Payments Received By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_client_payments");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>

  <div id="div_other_income" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Other Income Received By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_income_receipts");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>

  <div id="div_purchase_orders" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Purchase Orders Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_purchase_order");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_purchase_order_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Purchase Order Payments Created by User (Orders Those Haven't Purchase Bill Created)
            </h3>
          </div>
        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_purchase_order_payments");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_purchases" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Purchase Bills Created by User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <?php $this->view("modules/include_tables/table_purchase_bills");?>
      </div>
    </div>
  </div>
  <div id="div_purchase_materials" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Material Purchased By User
            </h3>
          </div>
        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_materials_purchased");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_purchase_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Purchase Bill Payments by User
            </h3>
          </div>
        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_purchase_bill_payments");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_labour_wage_slips" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Labour Wage Slips Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_labour_wage_slips");?>
      </div>
    </div>
  </div>
  <div id="div_labour_wages" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Labour Wage Payments By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_labour_wage_transaction");?>
      </div>
    </div>
  </div>

  <div id="div_vehicle_work_slips" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Vehicle Work Slips Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_vehicle_work_slips");?>
      </div>
    </div>
  </div>

  <div id="div_vehicle_work_slip_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Vehicle Work Slip Payments Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_vehicle_work_slip_transaction");?>
      </div>
    </div>
  </div>

  <div id="div_salary_slips" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Salary Slips Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_salary_slips");?>
      </div>
    </div>
  </div>

  <div id="div_salary_slip_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Salary Slip Payments Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_salary_slip_transaction");?>
      </div>
    </div>
  </div>

  <div id="div_tool_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Tool Payments Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_tool_payments_transactions");?>
      </div>
    </div>
  </div>

  <div id="div_supplier_advance_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Advance Payments Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_supplier_advance_payments");?>
      </div>
    </div>
  </div>

  <div id="div_supplier_advance_return_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Advance return Payments Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_supplier_advance_return_payments");?>
      </div>
    </div>
  </div>

  <div id="div_expenses" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Other Expense Payments By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_expense_bill_payments");?>
      </div>
    </div>
  </div>
  <div id="div_sub_contracts" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Subcontracts Created By User
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_subcontracts");?>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_sub_contract_payments" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Subcontract Payments By User
            </h3>
          </div>
        </div>
      </div>
      <div class="m-portlet__body">
        <?php $this->view("modules/include_tables/table_subcontract_payments");?>
      </div>
    </div>
  </div>
  <div id="div_work_hour_report" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Work Hour Report
            </h3>
          </div>
        </div>
      </div>
      <div class="m-portlet__body">
        <div class="m-form m-form--label-align-right m--margin-bottom-10">
          <div class="row align-items-center">
            <div class="col-xl-12 order-2 order-xl-1">
              <div class="form-group m-form__group row ">
                <div class="col-md-3">
                  <div class="m-form__group ">
                    <label>
                      Joined Date:
                    </label>
                    <input readonly value="<?php if($user_data->joined_date!='0000-00-00'){ echo date('d-m-Y',strtotime($user_data->joined_date));} ?>"   type="text" class="form-control m-input m-input--air m-input--pill"  >
                  </div>
                </div>
                <?php
                if($user_data->joined_date!='0000-00-00'){
                  $current_month_day = date('Y-m-').date('d',strtotime($user_data->joined_date));
                  $start_date = date('d-m-Y', strtotime('-1 month', strtotime($current_month_day)));
                  $end_date = date('d-m-Y', strtotime('-1 day', strtotime($current_month_day)));
                }else{
                  $start_date = "01-".date('m-Y');
                  $end_date = date('t-m-Y');
                }
                ?>
                <div class="col-md-3">
                  <div class="m-form__group ">
                    <label>
                      Start Date:
                    </label>
                    <input data-date-format="dd-mm-yyyy" value="<?php echo $start_date?>"  id="table_filter_work_hour_start_date"   type="text" class="form-control m-input m-input--air m-input--pill table_filter_work_hour"  >
                  </div>
                </div>
                <div class="col-md-3">
                  <div class="m-form__group ">
                    <label>
                      End Date:
                    </label>
                    <input data-date-format="dd-mm-yyyy" value="<?php echo $end_date?>"  id="table_filter_work_hour_end_date"   type="text" class="form-control m-input m-input--air m-input--pill table_filter_work_hour"  >
                  </div>
                </div>
                <div class="col-md-3">
                  <a href="javascript:;" style="margin-top: 25px" id="btn_print_work_hour_report" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                    <span>
                      <i class="la la-print"></i>
                      <span>
                        Print Report
                      </span>
                    </span>
                  </a>
                </div>
              </div>
            </div>
          </div>
        </div>
        <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="work_hour_report_view_table">

        </table>
      </div>
    </div>
  </div>
  <div id="div_travel_allowance" class="profile_nav_div">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Travel Allowances
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_travel_allowance");?>
      </div>
    </div>

  </div>
</div>
</div>
</div>
</div>
</div>
<!-- end:: Body -->
<!-- begin::Footer -->
<?php $this->view("includes/Inc_footer");?>
<!-- end::Footer -->
</div>
<!-- end:: Page -->
<?php $this->view("includes/Inc_sidebar");?>
<?php $this->view("includes/Inc_scripts");?>

<!--begin::Page Snippets -->
<script src="<?php echo $this->config->item('Template_template_file_url'); ?>template/assets/app/js/dashboard.js" type="text/javascript"></script>
<!--end::Page Snippets -->

<script>
function hide_all(){
  $(".profile_nav").removeClass('m-nav__item--active');
  $(".profile_nav_div").hide();
}
function active(menu_name){
  hide_all();
  $("#nav_"+menu_name).addClass('m-nav__item--active');
  $("#div_"+menu_name).show();
  $("#div_"+menu_name).fadeIn("slow");
  $('html, body').animate({
    scrollTop: eval($("#div_"+menu_name).offset().top - 150)
  }, 500);
}
//  Hide All Div and In Active All Menu
hide_all();
//  Active First Menu and Its div
active('overview');
$('body').on('click', '.profile_nav', function() {
  var nav = $(this).attr('data-nav');
  active(nav);
})
</script>
<script>

$("#m_aside_left_minimize_toggle").addClass("m-brand__toggler--active");
$("#body").addClass("m-brand--minimize m-aside-left--minimize");
$("#user_menu").addClass('m-menu__item--active');
$("#table_filter_start_date,#table_filter_end_date").datepicker( {
  todayHighlight:!0, orientation:"bottom left", templates: {
    leftArrow: '<i class="la la-angle-left"></i>', rightArrow: '<i class="la la-angle-right"></i>'
  }
})

select_summary();
function select_summary(){
  var user_id = "<?php echo $user_data->user_id?>";
  var start_date = $('#table_filter_start_date').val();
  var end_date = $('#table_filter_end_date').val();
  $.post("<?php echo base_url().'user/select_summary' ?>",{
    user_id:user_id,start_date:start_date,end_date:end_date
  },function(data){
    var obj= $.parseJSON(data);
    $(".total_purchase_order_payment_info").html(obj.total_purchase_order_payment);
    $(".total_purchase_payment_info").html(obj.total_purchase_bill_payment);
    $(".total_labour_payments_info").html(obj.total_labour_wage_payments);
    $(".total_other_expense_info").html(obj.total_other_expense);
    $(".total_other_expense_amount").html(obj.total_other_expense_amount);
    $(".total_subcontract_payments_info").html(obj.total_subcontract_payment);
    $(".total_expense_info").html(obj.total_expense_amount);
    $(".total_transferred_in_info").html(obj.total_transferred_in_amount);
    $(".total_transferred_out_info").html(obj.total_transferred_out_amount);
    $(".total_payments_received_info").html(obj.total_user_payments_received);
    $(".total_user_payments_received_info").html(obj.total_user_petty_payments_received);
    $(".total_user_payments_released_info").html(obj.total_user_petty_payments_released);
    $(".total_balance_info").html(obj.total_balance);
    $(".total_returned_info").html(obj.total_user_payments_returned);
    $(".total_opbalance_info").html(obj.total_opbalance);
    $(".total_client_payment_info").html(obj.total_client_payments_received);
    $(".total_other_income_info").html(obj.other_income_received);
    $(".total_supplier_advance_info").html(obj.supplier_advance_payments);
    $(".total_supplier_opbalance_info").html(obj.supplier_opbalance_payments);
    $(".total_vehicle_payments_info").html(obj.vehicle_payments);
    $(".total_employee_payments_info").html(obj.employee_payments);
    $(".total_salary_slip_payments_info").html(obj.salary_payments);
    $(".total_loan_payments_info").html(obj.loan_payments);
    $(".total_tool_payments_info").html(obj.tool_payments);
    $(".total_travel_allowance_info").html(obj.travel_allowance);
  })
}

</script>
<!-- Client Payment Scripts -->
<?php $this->view("modules/include_scripts/client_payments_scripts");?>

<!-- Income Receipts Scripts -->
<?php $this->view("modules/include_scripts/income_receipts_scripts");?>

<!-- Vehicle Work Slips Scripts -->
<?php $this->view("modules/include_scripts/vehicle_work_scripts");?>

<!-- Salary Slips Scripts -->
<?php $this->view("modules/include_scripts/salary_slips_scripts");?>

<!-- Supplier Advance Payments Scripts -->
<?php $this->view("modules/include_scripts/supplier_advance_payment_view_scripts");?>

<!-- Purchase Order Scripts -->
<?php $this->view("modules/include_scripts/purchase_order_view_scripts");?>

<!-- Purchase Order Payments Scripts -->
<?php $this->view("modules/include_scripts/purchase_order_payments_view_scripts");?>

<!-- Purchase Bill Scripts -->
<?php $this->view("modules/include_scripts/purchase_bill_view_scripts");?>

<!-- Purchase Bill Payments Scripts -->
<?php $this->view("modules/include_scripts/purchase_bill_payments_view_scripts");?>

<!-- Purchased Material Scripts -->
<?php $this->view("modules/include_scripts/materials_purchased_view_scripts");?>

<!-- Subcontract Scripts -->
<?php $this->view("modules/include_scripts/subcontracts_view_scripts");?>

<!-- Subcontract Payments Scripts -->
<?php $this->view("modules/include_scripts/subcontract_payments_view_scripts");?>

<!-- Expense Scripts -->
<?php $this->view("modules/include_scripts/expense_bill_scripts");?>

<!-- Labour Wage Scripts -->
<?php $this->view("modules/include_scripts/labour_wage_scripts");?>

<!-- User Payment  Scripts -->
<?php $this->view("modules/include_scripts/user_payments_scripts");?>

<!-- Work Hour Report  Scripts -->
<?php $this->view("modules/include_scripts/user_work_hour_report_view_scripts");?>

<!-- Travel Allowance Scripts -->
<?php $this->view("modules/include_scripts/travel_allowance_scripts");?>

<script>
var user_id = "<?php echo $user_data->user_id?>";
var assigned_works_view_table = $('#assigned_works_view_table').DataTable({
  "ajax":{
    url :"<?php echo base_url().'work/select_work/assigned' ?>", // json datasource
    type: "post", // type of method  , by default would be get
    data: function(d){
      d.user_id = user_id;
    }
  },
  "bProcessing": true,
  "deferRender": true,
  "bDeferRender": true,
  "scrollX" : true,
  buttons: [
    { extend: 'print', className: 'btn dark btn-outline',exportOptions: {columns: ':visible'},title: 'Assigned Projects' },
    { extend: 'csv', className: 'btn purple btn-outline ' },
    { extend: 'colvis', className: 'btn dark btn-outline', text: 'Columns'}
  ],
  dom:"<'row'<'col-sm-6 text-left'B><'col-sm-6 text-right'f>>\n\t\t\t<'row'<'col-sm-12'tr>>\n\t\t\t<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7 dataTables_pager'lp>>",
  "lengthMenu": [
    [25, 50, 100, -1],
    [25, 50, 100, "All"] // change per page values here
  ],
  "columnDefs": [
    {
      "targets": [ 0,10,11,12,13,14,15 ],
      className: "hidden"
    }
  ],
  'order': false
});
$('.profile_nav').on('click', function(e){
  var table_name = $(this).attr('data-table-name');
  if(table_name!=''){
    var tables = table_name.split(',');
    $.each(tables, function( index, value ){
      var table_name = value;
      eval(table_name).ajax.reload();
    });
  }
});
$('#btn_table_filter').on('click', function(e){
  select_summary();
  user_payment_receipts_view_table.ajax.reload();
  user_payment_returns_view_table.ajax.reload();
  labour_wage_view_table.ajax.reload();
  labour_wage_transaction_view_table.ajax.reload();
  expense_bill_payments_view_table.ajax.reload();
  subcontract_payments_view_table.ajax.reload();
  subcontracts_view_table.ajax.reload();
  materials_purchased_view_table.ajax.reload();
  purchase_bill_transaction_view_table.ajax.reload();
  purchase_bills_view_table.ajax.reload();
  purchase_order_transaction_view_table.ajax.reload();
  purchase_order_view_table.ajax.reload();
  <?php if($this->config->item('User_project_commission_payment')==1){?>
    // user_commission_payment_view_table.ajax.reload();
    <?php } ?>
  })

  var tool_payment_transanctions_view_table = $('#tool_payment_transanctions_view_table').DataTable({
    "ajax":{
      url :"<?php echo base_url().'accounts/select_account_transactions/tool' ?>", // json datasource
      type: "post", // type of method  , by default would be get
      data: function(d){
        d.user_id = '<?= $user_data->user_id ?>'
      }
    },
    "bProcessing": true,
    "deferRender": true,
    "bDeferRender": true,
    "scrollX" : true,
    buttons: [
      { extend: 'print', className: 'btn dark btn-outline',exportOptions: {columns: ':visible'},title: 'Tool Payments' },
      { extend: 'csv', className: 'btn purple btn-outline ' },
      { extend: 'colvis', className: 'btn dark btn-outline', text: 'Columns'}
    ],
    dom:"<'row'<'col-sm-6 text-left'B><'col-sm-6 text-right'f>>\n\t\t\t<'row'<'col-sm-12'tr>>\n\t\t\t<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7 dataTables_pager'lp>>", // horizobtal scrollable datatable
    "lengthMenu": [
      [25, 50, 100, -1],
      [25, 50, 100, "All"] // change per page values here
    ],
    "columnDefs": [
      {
        "targets": [3,7,8,9,16,19<?php if($this->session->userdata('user_role')=='auditor'){ echo ",18,"; } ?> ],
        className: "hidden"
      }
    ],
    'order': false
  });

  $(".form_submit_btn").click(function (e) {
    e.preventDefault();
    var a = $(this),
    l = $(this).closest("form"),
    action = l.attr('action');
    var form_id = l.attr('id');
    l.validate({
      rules: {

        paid_amount: {
          number: !0,
          required: !0
        }
      }, invalidHandler: function (e, r) {
        var i = $("#" + form_id + "_msg");
        i.removeClass("m--hide").show(), mUtil.scrollTo(i, -200)
      }, submitHandler: function (e) {
      }
    }), l.valid() && (a.addClass("m-loader m-loader--right m-loader--light").attr("disabled", !0),
    l.ajaxSubmit({
      url: action,
      success: function (e, t, r, s) {
        var modal_id = l.attr('data-modal-id');
        var form_type = l.attr('data-form-type');
        $("#" + form_id + "_msg").addClass("m--hide");
        // Block UI
        mApp.blockPage({
          overlayColor: "#000000",
          type: "loader",
          state: "success",
          message: "Please wait..."
        }), setTimeout(function () {
          mApp.unblockPage()
        }, 2e3);
        var obj = $.parseJSON(e);
        if (obj.status == 1) {
          a.removeClass("m-loader m-loader--right m-loader--light").attr("disabled", !1);
          toastr["success"](obj.message, "Success");
          $("#"+modal_id).modal('toggle');
          $("."+form_id+"_fields").val('');
          $("."+form_id+"_select").val('').trigger("change");
          select_summary();

        } else {
          a.removeClass("m-loader m-loader--right m-loader--light").attr("disabled", !1);
          if (obj.status == 2) {
            toastr["warning"](obj.message, "Duplication");
          }else{
            toastr["error"](obj.message, "Error");
          }
        }
        if (obj == null) {
          setTimeout(function () {
            a.removeClass("m-loader m-loader--right m-loader--light").attr("disabled", !1);
            toastr["warning"]("Your Attempt is Timed Out. Please Try Again.", "Timed Out");
          }, 2e4)
        }
      },error: function() {
        a.removeClass("m-loader m-loader--right m-loader--light").attr("disabled", !1);
        toastr["error"]("Sorry. There Has Been Some Error Occurred. Please Try Again.", "Error");
      }
    })
  )
});
jQuery(document).ready(function() {

  $($.fn.dataTable.tables(true)).DataTable()
  .columns.adjust()
  .responsive.recalc();


}

);
</script>
