revenue_report.blade.php 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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">Revenue 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="client" id="client" class="form-control">
  20. <option value="">Select Client</option>
  21. @if($companies)
  22. @foreach($companies as $row)
  23. <option value="{{ $row->id }}">{{ $row->name}}</option>
  24. @endforeach
  25. @endif
  26. </select>
  27. </div>
  28. <div class="form-group">
  29. <select name="acc_head" id="acc_head" style='width:200px;' class="form-control">
  30. <option value="">Select Revenue Head</option>
  31. @if($credit_heads)
  32. @foreach($credit_heads as $row)
  33. <option value="{{ $row->id }}">{{ $row->name }}</option>
  34. @endforeach
  35. @endif
  36. </select>
  37. </div>
  38. <div class="form-group">
  39. <button type="button" id="btn_search" class="btn btn-default">
  40. <i class="fa fa-search"></i> Search</button>
  41. </div>
  42. <div class="form-group">
  43. <button type="button" id="btnClear" class="btn btn-default"><i class="fa fa-times"></i> Clear</button>
  44. </div>
  45. </div>
  46. <br><br>
  47. <div id="reportContent">
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. @stop
  55. @section('script')
  56. <script type="text/javascript">
  57. $(document).ready(function() {
  58. $( ".date" ).datepicker({
  59. changeMonth: true,
  60. changeYear: true,
  61. dateFormat:"yy-mm-dd"
  62. });
  63. /**
  64. * generate expense report
  65. */
  66. $('#btn_search').click(function(){
  67. var from_date=$('#from_date').val();
  68. var to_date=$('#to_date').val();
  69. var client=$('#client').val();
  70. var acc_head=$('#acc_head').val();
  71. var token='{{ csrf_token() }}';
  72. $.ajax({
  73. url: '{{ url('account/report/revenue') }}',
  74. type: 'POST',
  75. data: {from_date: from_date,to_date:to_date,client:client,acc_head:acc_head,_token:token}
  76. })
  77. .done(function(res) {
  78. $('#reportContent').html(res);
  79. });
  80. });
  81. $('#btnClear').click(function(){
  82. $('#from_date').val('');
  83. $('#to_date').val('');
  84. $('#acc_head').val('');
  85. });
  86. });
  87. </script>
  88. @stop