expense_report.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. @extends('layouts.master')
  2. @section('content')
  3. <div class="content">
  4. <div class="row">
  5. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  6. <div class="panel panel-default">
  7. <div class="panel-heading">
  8. <h3 class="panel-title">Expense Report</h3>
  9. </div>
  10. <div class="panel-body">
  11. <div class="form-inline">
  12. <div class="form-group">
  13. <input type="text" name="from_date" id="from_date" placeholder="From Date" class="form-control date">
  14. </div>
  15. <div class="form-group">
  16. <input type="text" name="to_date" id="to_date" class="form-control date" placeholder="To Date">
  17. </div>
  18. <div class="form-group">
  19. <select name="acc_head" id="acc_head" class="form-control">
  20. <option value="">Select Expense Head</option>
  21. @if($credit_heads)
  22. @foreach($credit_heads as $row)
  23. <option value="{{ $row->id }}">{{ $row->name }}</option>
  24. @endforeach
  25. @endif
  26. </select>
  27. </div>
  28. <div class="form-group">
  29. <button type="button" id="btn_search" class="btn btn-default">
  30. <i class="fa fa-search"></i> Search</button>
  31. </div>
  32. <div class="form-group">
  33. <button type="button" id="btnClear" class="btn btn-default"><i class="fa fa-times"></i> Clear</button>
  34. </div>
  35. </div>
  36. <br><br>
  37. <div id="reportContent">
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. @stop
  45. @section('script')
  46. <script type="text/javascript">
  47. $(document).ready(function() {
  48. $( ".date" ).datepicker({
  49. changeMonth: true,
  50. changeYear: true,
  51. dateFormat:"yy-mm-dd"
  52. });
  53. /**
  54. * generate expense report
  55. */
  56. $('#btn_search').click(function(){
  57. var from_date=$('#from_date').val();
  58. var to_date=$('#to_date').val();
  59. var acc_head=$('#acc_head').val();
  60. var token='{{ csrf_token() }}';
  61. $.ajax({
  62. url: '{{ url('account/report/expense') }}',
  63. type: 'POST',
  64. data: {from_date: from_date,to_date:to_date,acc_head:acc_head,_token:token}
  65. })
  66. .done(function(res) {
  67. $('#reportContent').html(res);
  68. });
  69. });
  70. $('#btnClear').click(function(){
  71. $('#from_date').val('');
  72. $('#to_date').val('');
  73. $('#acc_head').val('');
  74. });
  75. });
  76. </script>
  77. @stop