<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="project_custom_requirements_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>Branch</th>
      <th>Requirement ID</th>
      <th>Project</th>
      <th>Requirement Title</th>
      <th>Requirement Date</th>
      <th>Type</th>
      <th>Taxable Amt</th>
      <th><?php echo $this->config->item('Tax_tax_name')?> %</th>
      <th>Est Amount</th>
      <th>Description</th>
      <th>Status</th>
      <th>Creation</th>
      <th>Action</th>
      <th>Work ID</th>
      <th>Status</th>
      <th>Tax</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>
<div class="modal fade" tabindex="-1" id="project_custom_requirement_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 800px">
    <div class="modal-content" >
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Add Custom Requirements From Client
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-modal-id="project_custom_requirement_add_modal" id="form_project_custom_requirements_add" method="post" action="<?php echo base_url().'work/create_custom_requirement'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_project_custom_requirements_add_msg">
              <div class="m-alert__icon">
                <i class="la la-warning"></i>
              </div>
              <div class="m-alert__text">
                Oh snap! Change a few things up and try submitting again.
              </div>
              <div class="m-alert__close">
                <button type="button" class="close" data-close="alert" aria-label="Close"></button>
              </div>
            </div>
          </div>
          <?php if($page_name=='work_profile'){?>
            <input type="hidden" name="work" value="<?php echo $work_data->work_id?>" />
          <?php }else{ ?>
            <div class="row">
              <div class="col-lg-12">
                <div class="form-group m-form__group">
                  <label for="user_name">
                    Project Name
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select required style="width: 100%" class="form-control m-select2 form_project_custom_requirements_add_select" id="custom_requiremnt_work_add"  name="work" data-placeholder="Select Work">
                      <option selected disabled>Select Project</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>
            </div>
          </div>
        <?php } ?>
        <div class="row">
          <div class="col-lg-12">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Title
              </label>
              <div class="input-group m-input-group--air m-input-group--pill date">
                <input required type="text" name="title" class="form-control m-input form_project_custom_requirements_add_fields" placeholder="Requirement Title" >
              </div>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-6">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Date
              </label>
              <div class="input-group m-input-group--air m-input-group--pill date">
                <input required data-date-format="dd-mm-yyyy" id="custom_requirement_date_add" type="text" name="date" class="form-control m-input form_project_custom_requirements_add_fields" placeholder="Date" >
              </div>
            </div>
            <span class="m-form__help"></span>
          </div>
          <div class="col-lg-6">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Type
              </label>
              <div class="m-select2 m-select2--air m-select2--pill">
                <select required style="width: 100%" class="form-control m-select2 form_project_custom_requirements_add_select" id="custom_requiremnt_type_add"  name="requirement_type" data-placeholder="Select Type">
                  <option selected disabled>Select Requirement Type</option>
                  <option value="Complaint">Complaint</option>
                  <option value="Addition">Addition</option>
              </select>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-4">
          <div class="form-group m-form__group">
            <label for="user_name">
              Taxable Amount
            </label>
            <div class="input-group m-input-group--air m-input-group--pill">
              <input required  id="custom_requirement_taxable_amount_add" type="text" name="taxable_amount" class="form-control m-input form_project_custom_requirements_add_fields" placeholder="Taxable Amount" >
            </div>
          </div>
          <span class="m-form__help"></span>
        </div>
        <div class="col-lg-4">
          <div class="form-group m-form__group">
            <label for="user_name">
              <?php echo $this->config->item('Tax_tax_name')?> %
            </label>
            <div class="m-select2 m-select2--air m-select2--pill ">
              <select required id="custom_requirement_tax_percent_add" name="tax_percent" style="width: 100%" class="form-control m-input form_project_custom_requirements_add_select" aria-describedby="basic-addon1" data-placeholder="Select Tax Percentage">
                <?php
                $tax_percent = $this->config->item('Tax_tax_percent');
                foreach($tax_percent as $row):
                  $selected_tax='';
                  if($row->tax_percentage==0){
                    $selected_tax='selected';
                  }
                  ?>
                  <option <?php echo $selected_tax?> data-tax-percent="<?php echo $row->tax_percentage?>" value="<?php echo $row->tax_id?>"><?php echo $row->tax_name?></option>
                  <?php
                endforeach;
                ?>
              </select>
            </div>
          </div>
        </div>
        <div class="col-lg-4">
          <div class="form-group m-form__group">
            <label for="user_name">
              Estimated Amount
            </label>
            <div class="input-group m-input-group--air m-input-group--pill">
              <input readonly required  id="custom_requirement_amount_add" type="text" name="amount" class="form-control m-input form_project_custom_requirements_add_fields" placeholder="Estimated Amount" >
            </div>
          </div>
          <span class="m-form__help"></span>
        </div>
        </div>
        <div class="row">
          <div class="col-lg-12">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Description
              </label>
              <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                <textarea required name="description"  class="form-control m-input form_project_custom_requirements_add_fields"  aria-describedby="basic-addon1" rows="7"></textarea>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <div class="col-lg-12">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Status
              </label>
              <div class="m-radio-inline" style="padding-top: 10px;">
                <label class="m-radio m-radio--solid m-radio--state-warning">
                  <input required checked type="radio" class="form_fields_radio"  name="requirement_status" value="0"> Pending
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-info">
                  <input type="radio" class="form_fields_radio" name="requirement_status"  value="3"> In Progress
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-success">
                  <input type="radio" class="form_fields_radio" name="requirement_status"  value="1"> Completed
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-danger">
                  <input type="radio" class="form_fields_radio" name="requirement_status"  value="2"> Rejected
                  <span></span>
                </label>
              </div>
            </div>
          </div>
        </div>
        <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">
          Close
        </button>
        <button type="submit" class="btn btn-primary form_submit_btn">
          Submit
        </button>
      </div>
    </form>
  </div>
</div>
</div>
<div class="modal fade" tabindex="-1" id="project_custom_requirement_edit_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 800px">
    <div class="modal-content" >
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Edit Custom Requirements From Client
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-modal-id="project_custom_requirement_edit_modal" id="form_project_custom_requirements_edit" method="post" action="<?php echo base_url().'work/update_custom_requirement'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_project_custom_requirements_edit_msg">
              <div class="m-alert__icon">
                <i class="la la-warning"></i>
              </div>
              <div class="m-alert__text">
                Oh snap! Change a few things up and try submitting again.
              </div>
              <div class="m-alert__close">
                <button type="button" class="close" data-close="alert" aria-label="Close"></button>
              </div>
            </div>
          </div>
          <?php if($page_name=='work_profile'){?>
            <input type="hidden" name="work" value="<?php echo $work_data->work_id?>" />
          <?php }else{ ?>
            <div class="row">
              <div class="col-lg-12">
                <div class="form-group m-form__group">
                  <label for="user_name">
                    Project Name
                  </label>
                  <div class="m-select2 m-select2--air m-select2--pill">
                    <select required style="width: 100%" class="form-control m-select2 form_project_custom_requirements_edit_select" id="custom_requiremnt_work_edit"  name="work" data-placeholder="Select Work">
                      <option selected disabled>Select Project</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>
            </div>
          </div>
        <?php } ?>
        <div class="row">
          <div class="col-lg-12">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Title
              </label>
              <div class="input-group m-input-group--air m-input-group--pill date">
                <input required type="text" name="title" id="custom_requirement_title_edit" class="form-control m-input form_project_custom_requirements_edit_fields" placeholder="Requirement Title" >
              </div>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-6">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Date
              </label>
              <div class="input-group m-input-group--air m-input-group--pill date">
                <input required data-date-format="dd-mm-yyyy" id="custom_requirement_date_edit" type="text" name="date" class="form-control m-input form_project_custom_requirements_edit_fields" placeholder="Date" >
              </div>
            </div>
            <span class="m-form__help"></span>
          </div>
          <div class="col-lg-6">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Type
              </label>
              <div class="m-select2 m-select2--air m-select2--pill">
                <select required style="width: 100%" class="form-control m-select2 form_project_custom_requirements_edit_select" id="custom_requiremnt_type_edit"  name="requirement_type" data-placeholder="Select Type">
                  <option selected disabled>Select Requirement Type</option>
                  <option value="Complaint">Complaint</option>
                  <option value="Addition">Addition</option>
              </select>
            </div>
            <span class="m-form__help"></span>
          </div>
        </div>
        <div class="col-lg-4">
          <div class="form-group m-form__group">
            <label for="user_name">
              Taxable Amount
            </label>
            <div class="input-group m-input-group--air m-input-group--pill">
              <input required  id="custom_requirement_taxable_amount_edit" type="text" name="taxable_amount" class="form-control m-input form_project_custom_requirements_edit_fields" placeholder="Taxable Amount" >
            </div>
          </div>
          <span class="m-form__help"></span>
        </div>
        <div class="col-lg-4">
          <div class="form-group m-form__group">
            <label for="user_name">
              <?php echo $this->config->item('Tax_tax_name')?> %
            </label>
            <div class="m-select2 m-select2--air m-select2--pill ">
              <select required id="custom_requirement_tax_percent_edit" name="tax_percent" style="width: 100%" class="form-control m-input form_project_custom_requirements_edit_select" aria-describedby="basic-addon1" data-placeholder="Select Tax Percentage">
                <?php
                $tax_percent = $this->config->item('Tax_tax_percent');
                foreach($tax_percent as $row):
                  $selected_tax='';
                  if($row->tax_percentage==0){
                    $selected_tax='selected';
                  }
                  ?>
                  <option <?php echo $selected_tax?> data-tax-percent="<?php echo $row->tax_percentage?>" value="<?php echo $row->tax_id?>"><?php echo $row->tax_name?></option>
                  <?php
                endforeach;
                ?>
              </select>
            </div>
          </div>
        </div>
        <div class="col-lg-4">
          <div class="form-group m-form__group">
            <label for="user_name">
              Estimated Amount
            </label>
            <div class="input-group m-input-group--air m-input-group--pill">
              <input required readonly id="custom_requirement_amount_edit" type="text" name="amount" class="form-control m-input form_project_custom_requirements_edit_fields" placeholder="Estimated Amount" >
            </div>
          </div>
          <span class="m-form__help"></span>
        </div>
        </div>
        <div class="row">
          <div class="col-lg-12">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Description
              </label>
              <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                <textarea required name="description" id="custom_requirement_description_edit"  class="form-control m-input form_project_custom_requirements_edit_fields"  aria-describedby="basic-addon1" rows="7"></textarea>
              </div>
              <span class="m-form__help"></span>
            </div>
          </div>
          <div class="col-lg-12">
            <div class="form-group m-form__group">
              <label for="user_name">
                Requirement Status
              </label>
              <div class="m-radio-inline" style="padding-top: 10px;">
                <label class="m-radio m-radio--solid m-radio--state-warning">
                  <input required checked type="radio" class="form_fields_radio"  name="requirement_status_edit" value="0"> Pending
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-info">
                  <input type="radio" class="form_fields_radio" name="requirement_status_edit"  value="3"> In Progress
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-success">
                  <input type="radio" class="form_fields_radio" name="requirement_status_edit"  value="1"> Completed
                  <span></span>
                </label>
                <label class="m-radio m-radio--solid m-radio--state-danger">
                  <input type="radio" class="form_fields_radio" name="requirement_status_edit"  value="2"> Rejected
                  <span></span>
                </label>
              </div>
            </div>
          </div>
        </div>
        <input type="hidden" name="requirement_id" id="custom_requirement_id_edit"  />
        <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">
          Close
        </button>
        <button type="submit" class="btn btn-primary form_submit_btn">
          Submit
        </button>
      </div>
    </form>
  </div>
</div>
</div>
<div class="modal fade"  tabindex="-1" id="project_custom_requirement_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" method="post" data-modal-id="project_custom_requirement_delete_modal" id="form_project_custom_requirements_delete" action="<?php echo base_url().'work/delete_custom_requirement'?>" class="form-horizontal">
      <div class="modal-content">
        <div class="alert alert-danger" role="alert" style="margin-bottom: 0px">
          <button type="button" class="close" data-dismiss="modal"></button>
          <br/>
          <h4 class="alert-heading">Warning! Please Confirm Your Action</h4>
          <br/>
          <p> Are You Sure to Delete this Data ?. All the Associated Data will Lost. </p>
          <p>
            <button class="btn btn-danger form_submit_btn"  type="submit" name="submit">Confirm & Delete</button>
            <button type="button" class="btn btn-primary modal-dismiss" data-dismiss="modal">Cancel</button>
          </p>
          <input type="hidden" name="requirement_id" id="custom_requirement_id_delete"  />
        </div>
      </div>
    </form>
  </div>
</div>
