<script>
var work_id = "<?php echo $work_data->work_id?>";
</script>
<?php if($this->session->userdata('user_role')!='boq_manager' && $this->session->userdata('user_role')!='purchase_manager' && $this->session->userdata('user_role')!='operation_manager'){ ?>
  <?php $this->view("modules/include_scripts/invoices_scripts");?>
  <?php $this->view("modules/include_scripts/invoices_proforma_scripts");?>
  <?php $this->view("modules/include_scripts/invoices_payments_scripts");?>
  <!-- Client Payment Scripts -->
  <?php $this->view("modules/include_scripts/client_payments_scripts");?>
  <!-- Security Deposit Scripts -->
  <?php $this->view("modules/include_scripts/security_deposit_scripts");?>
<?php } ?>

<?php if($this->session->userdata('user_role')!='accounts_manager' && $this->session->userdata('user_role')!='boq_manager'){ ?>
  <!-- Purchase Request Scripts -->
  <?php $this->view("modules/include_scripts/purchase_request_view_scripts");?>
<?php } ?>
<?php if($this->session->userdata('user_role')!='boq_manager'){ ?>
  <!-- Purchase Order Scripts -->
  <?php $this->view("modules/include_scripts/purchase_order_view_scripts");?>

  <!-- Purchase Order Payments Scripts -->
  <?php $this->view("modules/include_scripts/purchase_order_payments_view_scripts");?>
<?php } ?>
<!-- Purchase Bill Scripts -->
<?php $this->view("modules/include_scripts/purchase_bill_view_scripts");?>
<?php if($this->session->userdata('user_role')!='boq_manager'){ ?>
  <!-- Purchase Bill Payments Scripts -->
  <?php $this->view("modules/include_scripts/purchase_bill_payments_view_scripts");?>
<?php } ?>
<!-- Purchased Material Scripts -->
<?php $this->view("modules/include_scripts/materials_purchased_view_scripts");?>
<?php if($this->session->userdata('user_role')!='boq_manager' && $this->session->userdata('user_role')!='purchase_manager'){ ?>
  <!-- Subcontract Scripts -->
  <?php $this->view("modules/include_scripts/subcontracts_view_scripts");?>

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

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

  <!-- Labour Wage Scripts -->
  <?php $this->view("modules/include_scripts/labour_wage_scripts");?>
  <!-- Salary Slip Scripts -->
  <?php if($this->session->userdata('user_role')!='boq_manager' && $this->session->userdata('user_role')!='purchase_manager' && $this->session->userdata('user_role')!='operation_manager'){ ?>
  <?php $this->view("modules/include_scripts/salary_slips_scripts");?>
  <?php $this->view("modules/include_scripts/employee_payments_scripts");?>
<?php } ?>
  <script>
  <?php if($page_name=='work_profile'){?>
  var assigned_labour_view_table = $('#assigned_labour_view_table').DataTable({
    "ajax":{
      url :"<?php echo base_url().'labours/select_labour' ?>", // json datasource
      type: "post", // type of method  , by default would be get
      data: function(d){
        <?php if($page_name=='work_profile_master' || $page_name=='work_summary_master'){?>
          d.work_ids = "<?php echo implode(',',$sub_project_ids)?>";
          <?php }else{ ?>
        d.work_id = "<?php echo $work_data->work_id?>";
        <?php } ?>
      }
    },
    "bProcessing": true,
    "deferRender": true,
    "bDeferRender": true,
    "scrollX" : true,
    buttons: [
      { extend: 'print', className: 'btn dark btn-outline', title: 'List of Assigned Labours - #<?php echo $work_data->work_id." ".$work_data->work_name?>' },
      { extend: 'csv', className: 'btn purple btn-outline ' },
      { extend: 'colvis', className: 'btn dark btn-outline', text: 'Columns'}
    ],
    dom:"<'row'<'col-sm-6 text-left'B><'col-sm-6 text-right'f>>\n\t\t\t<'row'<'col-sm-12'tr>>\n\t\t\t<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7 dataTables_pager'lp>>", // horizobtal scrollable datatable
    "lengthMenu": [
      [25, 50, 100, -1],
      [25, 50, 100, "All"] // change per page values here
    ],
    "columnDefs": [
      {
        "targets": [ 1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],
        className: "hidden"
      }
    ],
    'order': false
  });
  <?php } ?>
  </script>
<?php } ?>

<?php if($this->session->userdata('user_role')!='boq_manager'){ ?>
  <!-- Stock Register Scripts -->
  <?php $this->view("modules/include_scripts/stock_register_view_scripts");?>

  <!-- Stock Transfer Scripts -->
  <?php $this->view("modules/include_scripts/stock_consumption_view_scripts");?>
<?php } ?>
<?php if($this->session->userdata('user_role')!='purchase_manager'){ ?>
  <!-- Project Tasks Scripts -->
  <?php $this->view("modules/include_scripts/project_tasks_scripts");?>

  <!-- BOQ Scripts -->
  <?php $this->view("modules/include_scripts/boq_scripts");?>
  <!-- Boq-Purchase Report -->
  <?php $this->view("modules/include_scripts/boq_purchase_report_script");?>
<?php } ?>

<!-- Documents Scripts -->
<?php $this->view("modules/include_scripts/documents_scripts");?>
<?php if($this->session->userdata('user_role')!='purchase_manager'){ ?>
<!-- Daily Tasks Scripts -->
<?php $this->view("modules/include_scripts/daily_task_scripts");?>

<!-- Daily Notes Scripts -->
<?php $this->view("modules/include_scripts/daily_notes_scripts");?>
<?php } ?>

<?php if($this->session->userdata('user_role')!='boq_manager' && $this->session->userdata('user_role')!='purchase_manager'){ ?>
  <!-- EMD -->
  <?php $this->view("modules/include_scripts/emd_scripts");?>
  <!-- Vehicle Work SLip -->
  <?php $this->view("modules/include_scripts/vehicle_work_scripts");?>

  <!-- Tools Script -->
  <?php $this->view("modules/include_scripts/tool_consumption_payment_script");?>
  <?php $this->view("modules/include_scripts/tool_rent_script");?>
  <?php $this->view("modules/include_scripts/tool_transfer_script");?>


<?php } ?>
<!-- Custom Requirements Script -->
<?php $this->view("modules/include_scripts/project_custom_requirements_scripts");?>
<?php if ($this->config->item('Subcontract_material_issue') == 1) { ?>
<!-- Subcontract Material Issue -->
<?php $this->view("modules/include_scripts/material_issue_view_scripts");?>
<?php } ?>
<?php if ($this->config->item('Project_beneficiary_accounts') == 1) { ?>
<!-- Project Beneficiary -->
<?php $this->view("modules/include_scripts/project_beneficiarys_scripts"); ?>
<?php } ?>
<?php if($this->session->userdata('user_role')!='boq_manager' && $this->session->userdata('user_role')!='purchase_manager' && $this->session->userdata('user_role')!='operation_manager'){ ?>
<?php $this->view("modules/include_scripts/creditors_list_scripts");?>
<?php $this->view("modules/include_scripts/balance_sheet_scripts");?>
<?php } ?>
