<div id="div_project_stages" 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">
            Project Stages
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile' && ($this->session->userdata('user_role')=='admin' || $this->session->userdata('user_role')=='general_manager')){?>
          <a href="#project_stages_add_modal" data-toggle="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 Stage
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_project_stages");?>
    </div>
  </div>
</div>
<div id="div_invoices" 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 Invoices
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile' && $this->config->item('User_client_payment_creation_admin_only')==0 || ($this->config->item('User_client_payment_creation_admin_only')==1 && ($this->session->userdata('user_role')=='admin' || $this->session->userdata('user_role')=='madmin'))){?>
          <a href="<?= base_url()?>invoices/add/project_invoice/<?= $work_data->work_id ?>" 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 Invoice
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_invoices");?>
    </div>
  </div>
</div>

<div id="div_invoices_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 Invoice Payments
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile' && $this->config->item('User_client_payment_creation_admin_only')==0 || ($this->config->item('User_client_payment_creation_admin_only')==1 && ($this->session->userdata('user_role')=='admin' || $this->session->userdata('user_role')=='madmin'))){?>
          <a href="#" data-toggle="modal" data-target="#client_payment_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>
                Receive New Payment
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_invoice_payments");?>
    </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">
            All Client Payments Received
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($this->config->item('User_client_payment_creation_admin_only')==0 || ($this->config->item('User_client_payment_creation_admin_only')==1 && ($this->session->userdata('user_role')=='admin' || $this->session->userdata('user_role')=='madmin'))){?>
          <a href="#" data-toggle="modal" data-target="#client_payment_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>
                Receive New Payment
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_client_payments");?>
    </div>
  </div>
</div>
<?php if($page_name=='work_profile'){ ?>
  <div id="div_boq" 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">
              BOQ
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">
          <!-- boq/boq_list $work_data->work_id -->
          <button class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill" data-toggle="modal" data-target="#boq_add_modal">
            <span>
              <i class="la la-plus"></i>
              <span>
                Add New BOQ
              </span>
            </span>
          </button>

          <?php if($this->config->item('boq_purchase_integration')==1){ ?>
            <a class="btn btn-primary m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill ml-3" href="<?= base_url()?>reports/boq_purchase/<?= $work_data->work_id?>">
              <span>
                <i class="far fa-file-alt"></i>
                <span>
                  BOQ Purchase report
                </span>
              </span>
            </a>
          <?php } ?>

        </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="boq_view_table">
          <thead>
            <tr class="">
              <th>SL No</th>
              <th>ID</th>
              <th>BOQ Name</th>
              <th>Total Amount</th>
              <th>Status</th>
              <th>Date</th>
              <th>Actions</th>
              <th>Status</th>

            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
      </div>
    </div>
  </div>
  <div id="div_schedule" 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" m-portlet="true" id="m_portlet_tools_3">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              Project Scheduling
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">
          <a href="#project_schedule_import_modal" data-toggle="modal" class="btn btn-warning m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
            <span>
              <i class="la la-copy"></i>
              <span>
                Import Project Schedule
              </span>
            </span>
          </a>
          <a  id="" href="#project_task_add_modal" data-toggle="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 Task
              </span>
            </span>
          </a>
          <ul class="m-portlet__nav">
            <li class="m-portlet__nav-item">
              <a href="#" m-portlet-tool="fullscreen" class="m-portlet__nav-link m-portlet__nav-link--icon" aria-describedby="tooltip_2xjxu2u0ux"><i class="la la-expand"></i></a>
              <div class="m-tooltip m-tooltip--portlet tooltip bs-tooltip-top" role="tooltip" id="tooltip_2xjxu2u0ux" aria-hidden="true" x-placement="top" style="position: absolute; will-change: transform; visibility: hidden; top: 0px; left: 0px; transform: translate3d(372px, -32px, 0px);">
                <div class="tooltip-arrow arrow" style="left: 48px;"></div>
                <div class="tooltip-inner">Fullscreen</div>
              </div>
            </li>
          </ul>
        </div>
      </div>
      <div class="m-portlet__body">
        <div class="kt-portlet kt-portlet--tabs">
          <div class="kt-portlet__head">
            <div class="kt-portlet__head-toolbar">
              <ul class="nav nav-tabs nav-tabs-line nav-tabs-line-success" role="tablist">
                <li class="nav-item schedule_tabs" data-table-name="project_tasks_view_table">
                  <a class="nav-link" data-toggle="tab" href="#table_view_tabbed" role="tab" aria-selected="true" data-table-name='project_tasks_view_table'>
                    <i class="la la-bars"></i> Table
                  </a>
                </li>
                <li class="nav-item">
                  <a class="nav-link active" onClick="initialise_gantt();" data-toggle="tab" href="#gantt_chart_view_tabbed" role="tab" aria-selected="false">
                    <i class="la la-bar-chart"></i> Gantt Chart
                  </a>
                </li>
              </ul>
            </div>
          </div>
          <div class="kt-portlet__body">
            <div class="tab-content">
              <div class="tab-pane " id="table_view_tabbed" role="tabpanel">
                <!--begin: Datatable -->
                <?php $this->view("modules/include_tables/table_project_tasks");?>
              </div>
              <div class="tab-pane" id="google_chart_view_tabbed" role="tabpanel">
                <div id="chart_div" style="height: auto;width: 100%"></div>
              </div>
              <div class="tab-pane active" style='width:100%; height:100%;'  id="gantt_chart_view_tabbed" role="tabpanel">
                <form class="gantt_control">
                  <input type="button" value="Zoom In" onclick="zoomIn()">
                  <input type="button" value="Zoom Out" onclick="zoomOut()">
                  <button type="button" onclick="toggleMode(this)">Zoom to Fit</button>

                  <input type="radio" id="scale1" class="gantt_radio" name="scale" value="day">
                  <label for="scale1">Day scale</label>

                  <input type="radio" id="scale2" class="gantt_radio" name="scale" value="week">
                  <label for="scale2">Week scale</label>

                  <input type="radio" id="scale3" class="gantt_radio" name="scale" value="month">
                  <label for="scale3">Month scale</label>

                  <input type="radio" id="scale4" class="gantt_radio" name="scale" value="quarter">
                  <label for="scale4">Quarter scale</label>

                  <input type="radio" id="scale5" class="gantt_radio" name="scale" value="year" checked>
                  <label for="scale5">Year scale</label>

                </form>
                <div id="gantt_here" style='width:100%; height:100%;min-height:1200px !important'></div>

              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
<?php } ?>
<div id="div_purchase_requests" 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 Requests
          </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_request");?>
      <!--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
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile'){ ?>
          <a href="<?php echo base_url()?>purchase_order/add/<?php echo $work_data->work_id?>" 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 Purchase Order
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_purchase_order");?>
      <!--end: Datatable -->
    </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">
            Purchase Order Payments (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" style="box-shadow: 0 1px 15px 1px rgba(69, 65, 78, 0.55);background-color: #fff;">
    <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-4">
          <!--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 Purchase Bill Amount
                  </h3>
                </div>
                <div class="col m--align-right">
                  <span class="m-widget1__number m--font-accent">
                    <label class="total_purchases_bill_info"></label>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <!--begin:: Widgets/Stats2-2 -->
        </div>
        <div class="col-md-12 col-lg-12 col-xl-4">
          <!--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 Bill Paid Amount
                  </h3>
                </div>
                <div class="col m--align-right">
                  <span class="m-widget1__number m--font-brand">
                    <label class="total_purchases_bill_payment_info"></label>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <!--end:: Widgets/Stats2-1 -->
        </div>
        <div class="col-md-12 col-lg-12 col-xl-4">
          <!--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 Bill Pending Amount
                  </h3>
                </div>
                <div class="col m--align-right">
                  <span class="m-widget1__number m--font-accent">
                    <label class="total_purchases_bill_pending_info"></label>
                  </span>
                </div>
              </div>
            </div>

          </div>
          <!--begin:: Widgets/Stats2-2 -->
        </div>
      </div>
    </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">
            Purchase Bills
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile'){ ?>
          <a href="<?php echo base_url()?>purchases/add/<?php echo $work_data->work_id?>" 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 Purchase
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">

      <?php $this->view("modules/include_tables/table_purchase_bills");?>

    </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">
            Purchase Bill Payments
          </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_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
          </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_stock_register" 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">
            Stock Register
          </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_stock_register");?>
      <!--end: Datatable -->
    </div>
  </div>
</div>
<?php if($page_name=='work_profile'){ ?>
  <div id="div_transfer_in" 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">
              Stock Transfer In List
            </h3>
          </div>
        </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="stock_transfer_in_view_table">
          <thead>
            <tr class="">
              <th>Sl No</th>
              <th>Transfer ID</th>
              <th>Material Name</th>
              <th>Unit</th>
              <th>Transferred Stock Qty</th>
              <th>Transferred Stock Amt</th>
              <th>Transferred From</th>
              <th>Transferred To</th>
              <th>Transferred By</th>
              <th>Transferred On</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
  <div id="div_transfer_out" 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">
              Stock Transfer Out List
            </h3>
          </div>
        </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="stock_transfer_out_view_table">
          <thead>
            <tr class="">
              <th>Sl No</th>
              <th>Transfer ID</th>
              <th>Material Name</th>
              <th>Unit</th>
              <th>Transferred Stock Qty</th>
              <th>Transferred Stock Amt</th>
              <th>Transferred From</th>
              <th>Transferred To</th>
              <th>Transferred By</th>
              <th>Transferred On</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
        <!--end: Datatable -->
      </div>
    </div>
  </div>
<?php } ?>
<div id="div_consumed" 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">
            Material Consumptions
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <a href="#" data-toggle="modal" data-target="#consumption_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 Stock Consumption
            </span>
          </span>
        </a>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_stock_consumptions");?>
      <?php $this->view("modules/include_modals/modal_stock_consumption");?>
      <!--end: Datatable -->
    </div>
  </div>
</div>
<div id="div_labour_wages" 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-4">
          <!--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 Labours Worked
                  </h3>
                </div>
                <div class="col m--align-right">
                  <span class="m-widget1__number m--font-success">
                    <label class="total_labours_worked_info"></label>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <!--begin:: Widgets/Stats2-3 -->
        </div>
        <div class="col-md-12 col-lg-12 col-xl-4">
          <!--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 Days Worked
                  </h3>
                </div>
                <div class="col m--align-right">
                  <span class="m-widget1__number m--font-success">
                    <label class="total_labours_days_info"></label>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <!--begin:: Widgets/Stats2-3 -->
        </div>
        <div class="col-md-12 col-lg-12 col-xl-4">
          <!--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 Wage
                  </h3>
                </div>
                <div class="col m--align-right">
                  <span class="m-widget1__number m--font-danger">
                    <label class="total_labours_wage_info"></label>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <!--begin:: Widgets/Stats2-3 -->
        </div>
      </div>
    </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">
            List of Labour Daily Wage Slips
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile'){ ?>
          <a href="<?php echo base_url()?>labour_wages/add_group?work_id=<?php echo $work_data->work_id?>" style="margin-right: 10px" class="btn btn-danger m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
            <span>
              <i class="la la-plus"></i>
              <span>
                Add Wage Slip (Group)
              </span>
            </span>
          </a>
          <a href="#" data-toggle="modal" data-target="#labour_wage_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 Wage Slip (Individual)
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_labour_wage_slips");?>
      <!--end: Datatable -->
    </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">
            List of Salary Slips
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile'){ ?>
          <a href="#" data-toggle="modal" data-target="#salary_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 Salary Slip
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_salary_slips");?>
      <!--end: Datatable -->
    </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">
            List of Salary 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_salary_slip_transaction");?>
      <!--end: Datatable -->
    </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 List
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile'){ ?>
          <a href="#" data-toggle="modal" data-target="#expense_bill_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 Bill
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_expense_bills");?>
    </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">
            List of Expense Bill Transactions
          </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");?>
      <!--end: Datatable -->
    </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 Subcontract Works
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($page_name=='work_profile'){ ?>
          <a href="<?php echo base_url().'subcontracts/add?work='.$work_data->work_id?>"  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 Subcontract
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_subcontracts");?>
      <!--end: Datatable -->
    </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">
            Subcontract Payments List
          </h3>
        </div>
      </div>
    </div>
    <div class="m-portlet__body">

      <?php $this->view("modules/include_tables/table_subcontract_payments");?>

    </div>
  </div>

</div>

<div id="div_supervisors" 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">
            Assigned Supervisors for This Work
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($this->session->userdata('user_role')!='supervisor'){?>
          <a href="#user_assign_add_modal" data-toggle="modal" data-target="#user_assign_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>
                Assign New Supervisor
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
      <!-- Add Daily Work Report modal starts from here -->

      <!-- Add Daily Work Report Modal ends here -->
    </div>
    <div class="m-portlet__body">
      <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="user_assign_view_table">
        <thead>
          <tr class="">
            <th>Sl No</th>
            <th style="display:none">Work Sup ID</th>
            <th>Supervisor Name</th>
            <th>Role</th>
            <th>Commission %</th>
            <th>Commission Amount</th>
            <th>Total Paid</th>
            <th>Total Balance</th>
            <th>User Acc ID</th>
            <th>Action</th>
          </tr>
        </thead>
        <tbody>
        </tbody>
      </table>
      <!--end: Datatable -->

    </div>
  </div>
  <?php if($this->config->item('User_project_commission_payment')==1){ ?>
    <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">
              Commission Payment For Assigned Users
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">

        </div>
      </div>
      <div class="m-portlet__body">
        <table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="user_commission_payment_view_table">
          <thead>
            <tr class="">
              <th>Sl No</th>
              <th>TR ID</th>
              <th>Paid Date</th>
              <th>Bill ID</th>
              <th>User Name</th>
              <th>User Role</th>
              <th></th>
              <th></th>
              <th>Bill No</th>
              <th>Consignee</th>
              <th>Paid Amount</th>
              <th>Debit Acc</th>
              <th>Payment Mode</th>
              <th>TR Ref No</th>
              <th>TR Ref Date</th>
              <th>Remarks</th>
              <th>Created By</th>
              <th>Created Date</th>
              <th>Actions</th>
              <th>Debit Acc</th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
      </div>
    </div>
  <?php } ?>
</div>


<div id="div_assigned_labours" 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">
            Assigned Labours for This Work
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($this->session->userdata('user_role')!='supervisor'){?>
          <a href="#labour_assign_add_modal" data-toggle="modal" data-target="#labour_assign_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>
                Assign Labours
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
      <!-- Add Daily Work Report modal starts from here -->

      <!-- Add Daily Work Report Modal ends here -->
    </div>
    <div class="m-portlet__body">
      <?php $this->view("modules/include_tables/table_labour_assign");?>
      <!--end: Datatable -->
    </div>
  </div>
</div>
<div id="div_project_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 List
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <a  href="#document_add_modal" data-toggle="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 Documents
            </span>
          </span>
        </a>
      </div>
    </div>
    <div class="m-portlet__body">

<!--begin: Datatable -->
<?php $this->view("modules/include_tables/table_documents");?>
<!--end: Datatable -->
</div>
</div>
</div>
<div id="div_daily_task" 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">
            Daily Work Tasks
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <?php if($this->session->userdata('user_role')!='supervisor'){?>
          <a href="#daily_task_add_modal" data-toggle="modal" data-target="#daily_task_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 Daily Task
              </span>
            </span>
          </a>
        <?php } ?>
      </div>
    </div>
    <div class="m-portlet__body">
    <?php $this->view("modules/include_tables/table_daily_tasks");?>
  </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">
          Daily Task Activities
        </h3>
      </div>
    </div>
    <div class="m-portlet__head-tools">
    </div>
  </div>
  <div class="m-portlet__body">
  <?php $this->view("modules/include_tables/table_daily_task_activities");?>
</div>
</div>
</div>
<div id="div_daily_notes" 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">
            Daily Work Notes
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
        <a href="#daily_note_add_modal" data-toggle="modal" data-target="#daily_note_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 Daily Note
            </span>
          </span>
        </a>
      </div>
      <!-- Add Daily Report modal starts from here -->

      <!-- Add Daily Report Modal ends here -->
    </div>
    <div class="m-portlet__body">
      <?php $this->view("modules/include_tables/table_daily_notes");?>
    </div>
</div>
