<?php $this->view("includes/Inc_pagehead"); ?>
<!-- Page Styles Goes Here-->

<?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">
          Manage Beneficiary Accounts
        </h3>
        <ul class="m-subheader__breadcrumbs m-nav m-nav--inline">
          <li class="m-nav__item m-nav__item--home">
            <a href="#" class="m-nav__link m-nav__link--icon">
              <i class="m-nav__link-icon la la-home"></i>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo $this->session->userdata("dashboard_link") ?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Home
              </span>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo base_url() . 'work/beneficiary_accounts' ?>" class="m-nav__link">
              <span class="m-nav__link-text">
                 Beneficiary Accounts
              </span>
            </a>
          </li>


        </ul>
      </div>
      <div>

      </div>
    </div>
  </div>
  <!-- END: Subheader -->
  <div class="m-content">
    <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 Beneficiary Accounts
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">
          <a href="javascript:;" id="btn_print_list" style="margin-left: 5px;margin-right: 5px" class="btn m-btn--gradient-from-danger m-btn--gradient-to-warning  m-btn  m-btn--icon m-btn--air m-btn--pill">
            <span>
              <i class="fa fa-print"></i>
              <span>
                Print List
              </span>
            </span>
          </a>
          <?php if ($this->session->userdata('user_role') != 'auditor') { ?>
            <a href="#" data-toggle="modal" data-target="#beneficiary_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>
                  Create New Account
                </span>
              </span>
            </a>
          <?php } ?>
        </div>
      </div>
      <div class="m-portlet__body">
          <!--begin: Search Form -->
          <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 ">
                  <div class="col-md-4">
                    <?php if ($this->session->userdata('user_role') != 'supervisor') { ?>
                      <div class="form-group m-form__group">
                        <label>
                          Project:
                        </label>
                        <div class="m-select2 m-select2--air m-select2--pill">
                          <select style="width: 100%" class="form-control m-select2 table_filter" id="table_filter_beneficiary_work" name="user" data-placeholder="Select Works">
                            <option value="all">All Works</option>
                            <?php
                            foreach ($work_contracts as $row) : ?>
                              <option data-work-status="<?php echo $row->work_status ?>" value="<?php echo $row->work_id ?>"><?php echo $row->work_name ?></option>
                            <?php
                            endforeach;
                            ?>
                          </select>
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    <?php } ?>
                  </div>
                  <div class="col-lg-3">
                    <div class="form-group m-form__group"  >
                      <label for="user_name">
                        Subcontract
                      </label>
                      <div class="m-select2 m-select2--air m-select2--pill">
                        <select required id="table_filter_beneficiary_subcontract" name="subcontract" style="width: 100%" class="form-control m-input table_filter" aria-describedby="basic-addon1" data-placeholder="Select Subcontract">

                        </select>
                      </div>
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                  <div class="col-lg-3">
                    <div class="form-group m-form__group"  >
                      <label for="user_name">
                        Supervisor
                      </label>
                      <div class="m-select2 m-select2--air m-select2--pill">
                        <select required id="table_filter_beneficiary_supervisor" name="supervisor" style="width: 100%" class="form-control m-input table_filter" aria-describedby="basic-addon1" data-placeholder="Select supervisor">

                        </select>
                      </div>
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                  <div class="col-lg-2">
                    <div class="form-group m-form__group"  >
                      <label for="user_name">
                        Ward No
                      </label>
                      <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                        <input type="text" name="ward_no" id="table_filter_beneficiary_wardno" class="form-control m-input table_filter" placeholder="Ward No" aria-describedby="basic-addon1">
                      </div>
                    </div>
                    </div>
                </div>
              </div>
            </div>
          </div>

        <!--begin: Datatable -->
        <?php $this->view("modules/include_tables/table_project_beneficiary_accounts"); ?>

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

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

<script>
// $("#table_filter_status").selectpicker();
// $("[data-switch=true]").bootstrapSwitch()
</script>

<script>
$("#beneficiary_accounts_menu").addClass('m-menu__item--active');

</script>
