<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="security_deposits_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>Branch</th>
      <th>ID</th>
      <th>Receipt Id</th>
      <th>Date</th>
      <th>Project</th>
      <th>Client</th>
      <th>Security Deposit</th>
      <th>Retention Money</th>
      <th>LD</th>
      <th>Income Tax</th>
      <th>GST TDS</th>
      <th>Creation</th>
      <th>Action</th>
      <th>Project ID</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>

<div class="modal fade" tabindex="-1" id="security_deposit_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 Security Deposit
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" id="form_security_deposit_add" data-modal-id="security_deposit_add_modal" method="post" action="<?php echo base_url().'accounts/create_security_deposit'?>" 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_security_deposit_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>
          <div class="row">
            <div class="col-lg-6">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Project Name
                </label>
                <?php if($page_name=='security_deposits'){?>
                  <div class="m-select2 m-select2--air m-select2--pill" >
                    <select required style="width: 100%" class="form-control m-select2 form_security_deposit_add_select" id="security_deposit_work_add"  name="work_id" data-placeholder="Select Work">
                      <option selected disabled>Select Work</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>
              <?php }elseif($page_name=='work_profile' || $page_name=='projects_profile'){ ?>
                <div class="m-input-icon m-input-icon--right">
                  <input value="<?php echo $work_data->work_name?>" type="text"  readonly class="form-control m-input m-input--pill m-input--air"  aria-describedby="basic-addon1">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                </div>
              <?php } ?>
              <span class="m-form__help"></span>
            </div>
            </div>
            <div class="col-lg-6">
            <div class="form-group m-form__group" >
              <label for="user_name">
                Client Name
              </label>
              <div class="m-input-icon m-input-icon--right">
                <?php if($page_name=='security_deposits'){?>
                  <input type="text" name="client_name" readonly class="form-control form_security_deposit_add_fields m-input m-input--pill m-input--air" id="security_deposit_client_name_add" aria-describedby="basic-addon1">
                <?php }elseif($page_name=='work_profile' || $page_name=='projects_profile'){ ?>
                  <input value="<?php echo $work_data->client_name?>" type="text" name="client_name" readonly class="form-control m-input m-input--pill m-input--air" id="security_deposit_client_name_add" aria-describedby="basic-addon1">
                <?php } ?>
                <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-user"></i></span></span>
              </div>
              <span class="m-form__help"></span>
            </div>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-4">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Date
                </label>
                <div class="input-group m-input-group--air m-input-group--pill date">
                  <div class="input-group-prepend">
                    <span class="input-group-text">
                      <i class="la la-calendar"></i>
                    </span>
                  </div>
                  <input  data-date-format="dd-mm-yyyy" id="security_deposit_date_add" required type="text" name="deposit_date" class="form-control form_security_deposit_add_fields m-input " placeholder=" Date" >
                </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">
                  Security Deposit
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="security_deposit"  class="form-control form_security_deposit_add_fields m-input" placeholder="Security Deposit" aria-describedby="basic-addon1">
                </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">
                  Retention Money
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="retention_money"  class="form-control form_security_deposit_add_fields m-input" placeholder="Retention Money" aria-describedby="basic-addon1">
                </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">
                  LD
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="ld_amount"  class="form-control form_security_deposit_add_fields m-input" placeholder="LD" aria-describedby="basic-addon1">
                </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">
                  Income Tax
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="income_tax"  class="form-control form_security_deposit_add_fields m-input" placeholder="Income Tax" aria-describedby="basic-addon1">
                </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">
                  GST TDS
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="gst_tds"  class="form-control form_security_deposit_add_fields m-input" placeholder="GST TDS" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <?php if($page_name=='work_profile' || $page_name=='projects_profile'){ ?>
            <input type="hidden"  name="work_id" value="<?php echo $work_data->work_id?>">
            <input type="hidden"  name="client_id" value="<?php echo $work_data->client_id?>">
            <?php } ?>
            <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">
            Close
          </button>
          <button type="submit" class="btn form_submit_btn btn-primary">
            Submit
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
<div class="modal fade" tabindex="-1" id="security_deposit_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 Security Deposit
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" id="form_security_deposit_edit" data-modal-id="security_deposit_edit_modal" method="post" action="<?php echo base_url().'accounts/update_security_deposit'?>" 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_security_deposit_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>
          <div class="row">
            <div class="col-lg-6">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Project Name
                </label>
                <?php if($page_name=='security_deposits'){?>
                  <div class="m-select2 m-select2--air m-select2--pill" >
                    <select required style="width: 100%" class="form-control m-select2 form_security_deposit_edit_select" id="security_deposit_work_edit"  name="work_id" data-placeholder="Select Work">
                      <option selected disabled>Select Work</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>
              <?php }elseif($page_name=='work_profile' || $page_name=='projects_profile'){ ?>
                <div class="m-input-icon m-input-icon--right">
                  <input value="<?php echo $work_data->work_name?>" type="text"  readonly class="form-control m-input m-input--pill m-input--air"  aria-describedby="basic-addon1">
                  <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                </div>
              <?php } ?>
              <span class="m-form__help"></span>
            </div>
            </div>
            <div class="col-lg-6">
            <div class="form-group m-form__group" >
              <label for="user_name">
                Client Name
              </label>
              <div class="m-input-icon m-input-icon--right">
                <?php if($page_name=='security_deposits'){?>
                  <input type="text" name="client_name" readonly class="form-control form_security_deposit_edit_fields m-input m-input--pill m-input--air" id="security_deposit_client_name_edit" aria-describedby="basic-addon1">
                <?php }elseif($page_name=='work_profile' || $page_name=='projects_profile'){ ?>
                  <input value="<?php echo $work_data->client_name?>" type="text" name="client_name" readonly class="form-control m-input m-input--pill m-input--air" id="security_deposit_client_name_edit" aria-describedby="basic-addon1">
                <?php } ?>
                <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-user"></i></span></span>
              </div>
              <span class="m-form__help"></span>
            </div>
            </div>
          </div>
          <div class="row">
            <div class="col-lg-4">
              <div class="form-group m-form__group">
                <label for="user_name">
                  Date
                </label>
                <div class="input-group m-input-group--air m-input-group--pill date">
                  <div class="input-group-prepend">
                    <span class="input-group-text">
                      <i class="la la-calendar"></i>
                    </span>
                  </div>
                  <input  data-date-format="dd-mm-yyyy" id="security_deposit_date_edit" required type="text" name="deposit_date" class="form-control form_security_deposit_edit_fields m-input " placeholder=" Date" >
                </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">
                  Security Deposit
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="security_deposit" id="security_deposit_edit" class="form-control form_security_deposit_edit_fields m-input" placeholder="Security Deposit" aria-describedby="basic-addon1">
                </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">
                  Retention Money
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="retention_money" id="retention_money_edit"  class="form-control form_security_deposit_edit_fields m-input" placeholder="Retention Money" aria-describedby="basic-addon1">
                </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">
                  LD
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="ld_amount" id="ld_amount_edit"  class="form-control form_security_deposit_edit_fields m-input" placeholder="LD" aria-describedby="basic-addon1">
                </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">
                  Income Tax
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="income_tax" id="income_tax_edit"  class="form-control form_security_deposit_edit_fields m-input" placeholder="Income Tax" aria-describedby="basic-addon1">
                </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">
                  GST TDS
                </label>
                <div class="input-group m-input-group m-input-group--pill m-input-group--air">
                  <input  type="text" name="gst_tds" id="gst_tds_edit"  class="form-control form_security_deposit_edit_fields m-input" placeholder="GST TDS" aria-describedby="basic-addon1">
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <?php if($page_name=='work_profile' || $page_name=='projects_profile'){ ?>
            <input type="hidden"  name="work_id" value="<?php echo $work_data->work_id?>">
            <input type="hidden"  name="client_id" value="<?php echo $work_data->client_id?>">
            <?php } ?>
            <input type="hidden"  name="deposit_id" id="deposit_id_edit">
            <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">
            Close
          </button>
          <button type="submit" class="btn form_submit_btn btn-primary">
            Submit
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
<div class="modal fade" tabindex="-1" id="security_deposit_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" id="form_security_deposit_delete" data-modal-id="security_deposit_delete_modal"  method="post" action="<?php echo base_url().'accounts/delete_security_deposit'?>" 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="deposit_id" id="deposit_id_delete">
          <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
        </div>
      </div>
    </form>
  </div>
</div>
