<?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;
}
.status_badge{
  font-size: 18px !important;
  padding: 6px !important;
  margin-bottom: 15px;
}

</style>


<?php $this->view("includes/Inc_navigation");?>
<div class="m-grid__item m-grid__item--fluid m-wrapper">

  <!-- 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">
                Vehicle Profile
              </div>
              <div class="m-card-profile__pic">
                <div class="m-card-profile__pic-wrapper" style="overflow: hidden;">
                  <!-- <img src="<?php echo $this->config->item('Template_template_file_url'); ?>template/assets/app/media/img/users/user.png" alt=""/> -->


                  <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
                  viewBox="0 0 512.043 512.043" style="width: 100%;" xml:space="preserve">
                  <path style="fill:#FF7058;" d="M436.437,164.8H330.709v191.627h173.227v-86.251l-20.203-69.824
                  C477.643,179.296,458.357,164.8,436.437,164.8"/>
                  <path style="fill:#84DBFF;" d="M478.645,269.291l-18.005-62.24c-3.104-10.699-13.056-18.187-24.203-18.187h-81.664v80.427H478.645z"
                  />
                  <polygon style="fill:#CDD6E0;" points="478.667,269.259 354.731,269.259 354.731,188.832 "/>
                  <path style="fill:#F2F2F2;" d="M478.645,269.291l-18.005-62.24c-3.104-10.699-13.056-18.187-24.203-18.187h-81.664L478.645,269.291z
                  "/>
                  <path style="fill:#FFD15C;" d="M32,68.597h266.709c17.664,0,32,14.325,32,32v255.819H0V100.597C0,82.923,14.325,68.597,32,68.597"/>
                  <polygon style="fill:#F2F2F2;" points="216.747,68.651 216.747,153.205 204.373,140.832 191.403,153.803 178.443,140.832
                  165.483,153.803 152.501,140.832 139.371,153.803 126.421,140.832 113.899,153.355 113.899,68.651 "/>
                  <path style="fill:#334A5E;" d="M512.043,356.405v36.16h-512v-36.16h53.44c12.48-22.4,36.48-37.547,64-37.547
                  c27.413,0,51.413,15.147,64,37.547h171.947c12.48-22.4,36.363-37.547,63.883-37.547c27.52,0,51.413,15.147,64,37.547H512.043z"/>
                  <path style="fill:#40596B;" d="M468.416,392.341c0,28.224-22.88,51.104-51.104,51.104s-51.083-22.88-51.083-51.104
                  s22.869-51.104,51.083-51.104C445.547,341.237,468.416,364.117,468.416,392.341"/>
                  <path style="fill:#ACB3BA;" d="M437.856,392.341c0,11.339-9.195,20.523-20.523,20.523c-11.339,0-20.544-9.184-20.544-20.523
                  c0-11.339,9.195-20.523,20.544-20.523C428.661,371.808,437.856,381.003,437.856,392.341"/>
                  <path style="fill:#40596B;" d="M168.544,392.341c0,28.224-22.891,51.104-51.104,51.104c-28.224,0-51.104-22.88-51.104-51.104
                  s22.88-51.104,51.104-51.104C145.653,341.237,168.544,364.117,168.544,392.341"/>
                  <path style="fill:#ACB3BA;" d="M137.963,392.341c0,11.339-9.184,20.523-20.523,20.523s-20.533-9.184-20.533-20.523
                  c0-11.339,9.195-20.523,20.533-20.523S137.963,381.003,137.963,392.341"/>
                </svg>


              </div>
            </div>
            <div class="m-card-profile__details">
              <span class="m-card-profile__name">
                <?php echo $vehicle_data->consignee_name ?>
                <br>
                <?php echo " [ ".$vehicle_data->vehicle_name." : ".$vehicle_data->vehicle_no." ]"?>
              </span>
              <br/>
              <?php if($vehicle_data->vehicle_type=='own'){?>
                <span class="status_badge m-badge m-badge-lg m-badge--primary m-badge--wide">Owned Vehicle</span>
              <?php }else{
                ?>
                <span class="status_badge m-badge m-badge-lg m-badge--warning m-badge--wide">Rented/Hired Vehicle</span>
              <?php } ?>
            </div>
            <div class="m-card-profile__details">
              <span class="m-card-profile__name">
                <?php if($this->config->item('app_module_vehicle_management')==1 && $vehicle_data->vehicle_type=='own'){?>
                  <a style="margin-left: 5px;margin-right: 5px" href="<?php echo base_url()?>vehicles/edit/<?php echo $vehicle_data->id?>"  class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                    <span>
                      <i class="la la-edit"></i>
                      <span>
                        Edit Vehicle Details
                      </span>
                    </span>
                  </a>
                <?php } ?>
              </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_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">
                      Vehicle Info
                    </span>
                  </span>
                </span>
              </a>
            </li>
            <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
              <li class="m-nav__item profile_nav" id="nav_documents" data-nav="documents" data-table-name='vehicle_documents_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-file-upload"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Documents & Pictures
                      </span>
                    </span>
                  </span>
                </a>
              </li>
            <?php } ?>
            <li class="m-nav__item profile_nav" id="nav_wage_slips" data-nav="wage_slips" data-table-name='vehicle_work_slip_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">
                      Work Slips
                    </span>
                  </span>
                </span>
              </a>
            </li>

            <li class="m-nav__item profile_nav" id="nav_wage_slip_payments" data-nav="wage_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-rupee-sign"></i>
                <span class="m-nav__link-title">
                  <span class="m-nav__link-wrap">
                    <span class="m-nav__link-text">
                      Work Slip Payments
                    </span>
                  </span>
                </span>
              </a>
            </li>
            <li class="m-nav__item profile_nav" id="nav_op_balance_payments" data-nav="op_balance_payments" data-table-name='vehicle_op_balance_transaction_view_table'>
              <a href="javascript:;" class="m-nav__link">
                <i class="m-nav__link-icon fa fa-rupee-sign"></i>
                <span class="m-nav__link-title">
                  <span class="m-nav__link-wrap">
                    <span class="m-nav__link-text">
                      OP Balance Payments
                    </span>
                  </span>
                </span>
              </a>
            </li>
            <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
              <li class="m-nav__item profile_nav" id="nav_renewal_payments" data-nav="renewal_payments" data-table-name='vehicle_renewal_transaction_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-rupee-sign"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Renewal Payments
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_vehicle_expenses" data-nav="vehicle_expenses" data-table-name='vehicle_expenses_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-th-list"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Vehicle Expenses
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_vehicle_allocations" data-nav="vehicle_allocations" data-table-name='vehicle_allocations_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-th-list"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Vehicle Allocations
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_vehicle_consumptions" data-nav="vehicle_consumptions" data-table-name='vehicle_material_consumption_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-th-list"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Material Consumptions
                      </span>
                    </span>
                  </span>
                </a>
              </li>
            <?php } ?>

          </ul>

        </div>
      </div>
    </div>
    <div class="col-xl-9 col-lg-8">
      <div id="div_info" 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">
              <div class="col-md-12 col-lg-12 col-xl-3">
                <!--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 Work Slip Count
                        </h3>
                      </div>
                      <div class="col m--align-right">
                        <span class="m-widget1__number m--font-success">
                          <label class="work_slips_count_info"></label>
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
                <!--begin:: Widgets/Stats2-3 -->
              </div>
              <div class="col-md-12 col-lg-12 col-xl-3">
                <!--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 Work Slips Payable
                        </h3>
                      </div>
                      <div class="col m--align-right">
                        <span class="m-widget1__number m--font-success">
                          <label class="work_slips_payable_info"></label>
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
                <!--begin:: Widgets/Stats2-3 -->
              </div>
              <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 Work Slips Paid
                        </h3>
                      </div>
                      <div class="col m--align-right">
                        <span class="m-widget1__number m--font-brand">
                          <label class="total_work_slip_paid_info"></label>
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
                <!--end:: Widgets/Stats2-1 -->
              </div>
              <div class="col-md-12 col-lg-12 col-xl-3">
                <!--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">
                          Opening Balance Payable
                        </h3>
                      </div>
                      <div class="col m--align-right">
                        <span class="m-widget1__number m--font-success">
                          <label class="op_balance_payable_info"></label>
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
                <!--begin:: Widgets/Stats2-3 -->
              </div>
              <div class="col-md-12 col-lg-12 col-xl-3">
                <!--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">
                          Opening Balance Paid
                        </h3>
                      </div>
                      <div class="col m--align-right">
                        <span class="m-widget1__number m--font-success">
                          <label class="op_balance_paid_info"></label>
                        </span>
                      </div>
                    </div>
                  </div>
                </div>
                <!--begin:: Widgets/Stats2-3 -->
              </div>
              <div class="col-md-12 col-lg-12 col-xl-3">
                <!--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 Balance
                        </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>
        <?php if($this->config->item('app_module_vehicle_management')==1){ ?>
          <div class="m-portlet m-portlet--mobile m-portlet--warning 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">
                    Upcoming/Due Payments
                  </h3>
                </div>
              </div>
            </div>
            <div class="m-portlet__body" style="padding: 1rem 2.2rem;">
              <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="vehicle_pending_renewal_view_table">
                <thead>
                  <tr>
                    <th>#</th>
                    <th>Vehicle</th>
                    <th>Renewal Type</th>
                    <th>Date</th>
                    <th>Status</th>
                    <th>Action</th>
                    <th>vehicle_id</th>
                    <th>type</th>
                  </tr>
                </thead>
                <tbody>

                </tbody>
              </table>
            </div>
          </div>
        <?php } ?>
        <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">
                  Vehicle 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">
                <?php if($this->config->item('app_module_vehicle_management')==0 || $vehicle_data->vehicle_type=='rent' ){ ?>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Vehicle No
                    </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-hashtag "></i>
                          </span>
                        </div>
                        <input disabled type="text" name="name" class="form-control m-input m-input--solid" value="<?php echo $vehicle_data->vehicle_no ?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Vehicle Name
                    </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-truck"></i>
                          </span>
                        </div>
                        <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->vehicle_name ?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Vehicle Type
                    </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-clone"></i>
                          </span>
                        </div>
                        <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo ucfirst( $vehicle_data->vehicle_type) ?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Consignee Name
                    </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-user"></i>
                          </span>
                        </div>
                        <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->consignee_name?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Basic Charge
                    </label>
                    <div class="col-xl-4 col-lg-4">
                      <div class="input-group m-input-group--air date">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-rupee-sign"></i>
                          </span>
                        </div>
                        <input  disabled type="text"  class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->basic_charge?>">
                        <div class="input-group-append">
                          <span class="input-group-text">
                            /<?= ucfirst($vehicle_data->work_duration_type) ?>
                          </span>
                        </div>
                      </div>
                    </div>
                  </div>
                <?php }else{ ?>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Vehicle No
                        </label>
                        <div class="input-group m-input-group--air">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-hashtag "></i>
                            </span>
                          </div>
                          <input disabled type="text" name="name" class="form-control m-input m-input--solid" value="<?php echo $vehicle_data->vehicle_no ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Manufacturer
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-truck"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->manufacturer ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Category
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-truck"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->vehicle_category ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Model
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-truck"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->model ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Engine No
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-truck"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->engine_no ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Chasis No
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-truck"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->chasis_no ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label >
                          Vehicle Type
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-clone"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo ucfirst( $vehicle_data->vehicle_type_cat) ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label >
                          Dealer
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-clone"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo ucfirst( $vehicle_data->dealer) ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Consignee Name
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-user"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->consignee_name?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Basic Charge
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-rupee-sign"></i>
                            </span>
                          </div>
                          <input  disabled type="text"  class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->basic_charge?>">
                          <div class="input-group-append">
                            <span class="input-group-text">
                              /<?= ucfirst($vehicle_data->work_duration_type) ?>
                            </span>
                          </div>
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Loading Capacity (CFT)
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-edit"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->loading_capacity_cft?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Loading Capacity (TON)
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-edit"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->loading_capacity_ton?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Delivery Date
                        </label>
                        <div class="input-group m-input-group--air date">
                          <div class="input-group-prepend">
                            <span class="input-group-text">
                              <i class="fa fa-edit"></i>
                            </span>
                          </div>
                          <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php if($vehicle_data->date_of_delivery!='0000-00-00'){ echo date('d-m-Y',strtotime($vehicle_data->date_of_delivery));} ?>">
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Vehicle Status
                        </label>
                        <?php
                        if($vehicle_data->vehicle_status==1){
                          $vehicle_status = '<span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Active</span>';
                        }else{
                          $vehicle_status = '<span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> On Repair</span>';
                        }
                        ?>
                        <br/>
                        <?php echo $vehicle_status?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                  </div>
                  <?php
                  if($vehicle_data->emi_status==2){
                    $emi_status = '<span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Finished</span>';
                  }elseif($vehicle_data->emi_status==1){
                    $emi_status = '<span style="margin-top: 5px" class="status_badge m-badge m-badge--info m-badge--wide"><i class="fa fa-check-circle"></i> Ongoing</span>';
                  }else{
                    $emi_status = '<span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> NO EMI</span>';
                  }
                  ?>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          EMI Status
                        </label>
                        <br/>
                        <?php echo $emi_status?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->emi_status!=0){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Financier
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->loan_provider_name ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Total Amount
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->total_amount?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            EMI Amount
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->emi_amount?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Loan No
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->loan_no?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Installments
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->installments?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            EMI Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->emi_date?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            EMI Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php if($vehicle_data->next_emi_renewal_date!='0000-00-00'){ echo date('d-m-Y',strtotime($vehicle_data->next_emi_renewal_date)); }?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Bank A/C
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->acc_head_name?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Purchase Month
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php if($vehicle_data->purchase_month!='0000-00-00'){ echo date('M Y',strtotime($vehicle_data->purchase_month));} ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Closing Month
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php if($vehicle_data->closing_month!='0000-00-00'){ echo date('M Y',strtotime($vehicle_data->closing_month));} ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            No of Installments Left
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->installments_left?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Payable Amount on Vehicle Creation
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo $vehicle_data->current_payable_amount?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Insurance
                        </label>
                        <br/>
                        <?php if($vehicle_data->insurance_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->insurance_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->insurance_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Tax
                        </label>
                        <br/>
                        <?php if($vehicle_data->tax_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->tax_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->tax_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Break
                        </label>
                        <br/>
                        <?php if($vehicle_data->break_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->break_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->break_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Permit
                        </label>
                        <br/>
                        <?php if($vehicle_data->permit_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->permit_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->permit_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Fitness
                        </label>
                        <br/>
                        <?php if($vehicle_data->fitness_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->fitness_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->fitness_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Pollution
                        </label>
                        <br/>
                        <?php if($vehicle_data->pollution_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->pollution_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->pollution_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          GPS
                        </label>
                        <br/>
                        <?php if($vehicle_data->gps_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->gps_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->gps_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Speed Governor
                        </label>
                        <br/>
                        <?php if($vehicle_data->speed_governor_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->speed_governor_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->speed_governor_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="form-group m-form__group">
                        <label>
                          Welfare
                        </label>
                        <br/>
                        <?php if($vehicle_data->welfare_renewal_date!='0000-00-00'){?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--success m-badge--wide"><i class="fa fa-check-circle"></i> Yes</span>
                        <?php }else{ ?>
                          <span style="margin-top: 5px" class="status_badge m-badge m-badge--danger m-badge--wide"><i class="fa fa-times-circle"></i> No</span>
                        <?php } ?>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <?php if($vehicle_data->welfare_renewal_date!='0000-00-00'){?>
                      <div class="col-lg-6">
                        <div class="form-group m-form__group">
                          <label>
                            Next Renewal Date
                          </label>
                          <div class="input-group m-input-group--air date">
                            <div class="input-group-prepend">
                              <span class="input-group-text">
                                <i class="fa fa-edit"></i>
                              </span>
                            </div>
                            <input  disabled type="text" class="form-control m-input m-input--solid"  value="<?php echo date('d-m-Y',strtotime($vehicle_data->welfare_renewal_date)); ?>">
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    <?php } ?>
                  </div>
                <?php } ?>
              </div>
            </form>
          </div>
        </div>

      </div>
      <div id="div_documents" 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">
                  Documents & Pictures
                </h3>
              </div>
            </div>
            <div class="m-portlet__head-tools">
              <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
                <a href="#" data-toggle="modal" data-target="#vehicle_document_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Add Document/Photo
                    </span>
                  </span>
                </a>
              <?php } ?>
            </div>
          </div>
          <div class="m-portlet__body">
            <!--begin: Datatable -->
            <?php $this->view("modules/include_tables/table_vehicle_documents");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
      <div id="div_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">
                  Wage Slips
                </h3>
              </div>
            </div>
            <div class="m-portlet__head-tools">
              <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
                <a href="#" data-toggle="modal" data-target="#vehicle_work_slip_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Add Work Slip
                    </span>
                  </span>
                </a>
              <?php } ?>
            </div>
          </div>
          <div class="m-portlet__body">
            <!--begin: Datatable -->
            <?php $this->view("modules/include_tables/table_vehicle_work_slips");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>

      <div id="div_wage_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">
                  Wage Slip Payments
                </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");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
      <div id="div_op_balance_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">
                  OP Balance Payments
                </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_op_balance_transaction");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
      <div id="div_renewal_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">
                  Renewal Payments
                </h3>
              </div>
            </div>
            <div class="m-portlet__head-tools">
              <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
                <a href="#" data-toggle="modal" data-target="#vehicle_renewal_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Add Payment
                    </span>
                  </span>
                </a>
              <?php } ?>
            </div>
          </div>
          <div class="m-portlet__body">
            <!--begin: Datatable -->
            <?php $this->view("modules/include_tables/table_vehicle_renewal_transaction");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
      <div id="div_vehicle_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">
                  Vehicle Expenses
                </h3>
              </div>
            </div>
            <div class="m-portlet__head-tools">
              <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
                <a href="#" data-toggle="modal" data-target="#vehicle_expense_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Add New Expense
                    </span>
                  </span>
                </a>
              <?php } ?>
            </div>
          </div>
          <div class="m-portlet__body">
            <!--begin: Datatable -->
            <?php $this->view("modules/include_tables/table_vehicle_expenses");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
      <div id="div_vehicle_allocations" 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 Allocations
                </h3>
              </div>
            </div>
            <div class="m-portlet__head-tools">

            </div>
          </div>
          <div class="m-portlet__body">
            <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-4">
                      <div class="form-group m-form__group" >
                        <label> Date:</label>
                        <input  id="table_filter_date_vehicle_allocation"  type="text" class="form-control  m-input  m-input--air m-input--pill"  >
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!--begin: Datatable -->
            <?php $this->view("modules/include_tables/table_vehicle_allocations");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
      <div id="div_vehicle_consumptions" 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 Material Consumptions
                </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_material_consumptions");?>
            <!--end: Datatable -->
          </div>
        </div>
      </div>
    </div>

  </div>
</div>
</div>

<?php $this->view("modules/include_modals/modal_bills");?>

<?php $this->view("modules/include_modals/modal_transaction_delete");?>

</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>

<?php if($this->config->item('app_module_vehicle_management')==1){ ?>
  $("#m_aside_left_minimize_toggle").addClass("m-brand__toggler--active");
  $("#body").addClass("m-brand--minimize m-aside-left--minimize");
  <?php } ?>
  $('#vehicle_renewal_add_modal').on('shown.bs.modal', function() {
    $('#vehicle_renewal_add_modal').appendTo(document.body);
  });
  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('info');
  $('body').on('click', '.profile_nav', function() {
    var nav = $(this).attr('data-nav');
    active(nav);
  })
</script>
<script>

$("#vehicle_menu").addClass('m-menu__item--active m-menu__item--open');
$("#vehicle_menu_1").addClass('m-menu__item--active');

select_summary();
function select_summary(){
  var id = "<?php echo $vehicle_data->id?>";
  $.post("<?php echo base_url().'vehicles/select_summary/count' ?>",{
    id:id
  },function(data){
    var obj= $.parseJSON(data);
    $(".work_slips_payable_info").html(obj.work_slips_payable);
    $(".work_slips_count_info").html(obj.work_slips_count);
    $(".total_work_slip_paid_info").html(obj.total_work_slip_paid);
    $(".op_balance_payable_info").html(obj.op_balance_payable);
    $(".op_balance_paid_info").html(obj.op_balance_paid);
    $(".total_balance_info").html(obj.total_balance);

  })
}
</script>
<!-- Bill Scripts -->
<?php $this->view("modules/include_scripts/bill_scripts");?>

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

<?php $this->view("modules/include_scripts/vehicle_work_scripts");?>

<?php $this->view("modules/include_scripts/vehicle_renewal_scripts");?>

<?php $this->view("modules/include_scripts/vehicle_expense_scripts");?>

<?php $this->view("modules/include_scripts/vehicle_allocation_scripts");?>

<?php $this->view("modules/include_scripts/vehicle_documents_scripts");?>

<?php $this->view("modules/include_scripts/vehicle_material_consumption_view_scripts");?>

<script>
var id = "<?php echo $vehicle_data->id?>";

$("#expense_vehicle_add").val("<?php echo $vehicle_data->id?>").trigger('change');
$("#renewal_vehicle_add").val("<?php echo $vehicle_data->id?>").trigger('change');
$("#vehicle_add").val("<?php echo $vehicle_data->id?>").trigger('change');

jQuery(document).ready(function() {
  $('.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();
      });
    }
  });
  $(".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[obj.flashdata_type](obj.flashdata_msg, obj.flashdata_title);
          $("#"+modal_id).modal('toggle');
          $("."+form_id+"_fields").val('');
          $("."+form_id+"_select").val('').trigger("change");
          select_summary();
          vehicle_work_slip_view_table.ajax.reload();
          vehicle_work_slip_transaction_view_table.ajax.reload();
          vehicle_op_balance_transaction_view_table.ajax.reload();
          vehicle_expenses_view_table.ajax.reload();
          vehicle_renewal_transaction_view_table.ajax.reload();
          vehicle_pending_renewal_view_table.ajax.reload();
          vehicle_documents_view_table.ajax.reload();
          vehicle_allocations_view_table.ajax.reload();
          $("#expense_vehicle_add").val("<?php echo $vehicle_data->id?>").trigger('change');
          $("#renewal_vehicle_add").val("<?php echo $vehicle_data->id?>").trigger('change');
          $("#vehicle_add").val("<?php echo $vehicle_data->id?>").trigger('change');
        } else {
          a.removeClass("m-loader m-loader--right m-loader--light").attr("disabled", !1);
          toastr[obj.flashdata_type](obj.flashdata_msg, obj.flashdata_title);
        }
        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");
      }
    })
  )
});
$($.fn.dataTable.tables(true)).DataTable()
.columns.adjust()
.responsive.recalc();

});
</script>
