<script>

$('body').on('click', '#daily_report_edit_btn', function() {
  var no = $(this).closest('tr').children('td');
  $('#description_update').val(no.eq(5).text());
  $('#report_date_update').datepicker("setDate", no.eq(4).text());
  $('#report_id').val(no.eq(1).text());

})
$('body').on('click', '#daily_report_view_btn', function() {
  var no = $(this).closest('tr').children('td');
  $('#description_view').val(no.eq(5).text());
  $('#report_date_view').datepicker("setDate", no.eq(4).text());

})
$('body').on('click', '#daily_report_delete_btn', function() {
  var no = $(this).closest('tr').children('td');
  $('#delete_report_id').val(no.eq(1).text());

})
$("#work,#work_1,#work_update,#work_view").select2({
  placeholder: "Select  Work",
  templateResult: format_project_dropdown
})
$("#report_date,#report_date_update,#report_date_view").datepicker( {
  todayHighlight:!0, orientation:"bottom left", templates: {
    leftArrow: '<i class="la la-angle-left"></i>', rightArrow: '<i class="la la-angle-right"></i>'
  },
  endDate: '+0d',
  <?php if($this->session->userdata('user_role')!='admin' && $this->config->item('User_calendar_date_restriction_enabled')==1){ ?>
  startDate: '<?php echo $this->config->item('User_calendar_date_restriction_start_days');?>d'
  <?php } ?>
})
</script>
