report.blade.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @extends('layouts.master')
  2. @section('content')
  3. <link rel="stylesheet" href="{{ URL::asset('assets/css/jquery.datetimepicker.css') }}">
  4. <script type="text/javascript" src="{{ URL::asset('assets/js/jquery.datetimepicker.full.min.js') }}"></script>
  5. <!-- Main content -->
  6. <section class="content">
  7. <!-- Main row -->
  8. <div class="row">
  9. <div class="col-md-12">
  10. <section class="panel tasks-widget">
  11. <header class="panel-heading" style="height:40px;">
  12. <div class="pull-left">
  13. {{$title}}
  14. </div>
  15. </header>
  16. <?php
  17. $users=array(
  18. 'Reza',
  19. 'Mamun',
  20. 'Golam Sayed',
  21. 'Akib',
  22. 'Masum',
  23. 'Helal',
  24. 'Zeba',
  25. 'Shabuj',
  26. 'Hasib',
  27. 'Tipu',
  28. 'Niloy',
  29. 'Nishat',
  30. 'Jamil',
  31. 'Shamim'
  32. );
  33. ?>
  34. <div class="row">
  35. <div class="col-md-12">
  36. <div class="col-md-2" style="margin-top:2%">
  37. <select class="form-control" id="user">
  38. <option value="0"> Select User</option>
  39. @foreach($users as $i=>$user)
  40. <option value="{{$i+1}}">{{ $user }}</option>
  41. @endforeach
  42. </select>
  43. </div>
  44. <div class="col-md-4" style="margin-top:2%">
  45. <input name="date1" type="text" class="form-control" id="date1" placeholder="Select Start Date" required="">
  46. </div>
  47. <div class="col-md-4" style="margin-top:2%">
  48. <input name="date2" type="text" class="form-control" id="date2" placeholder="Select End Date" required="">
  49. </div>
  50. <div class="col-md-2" style="margin-top:2%">
  51. <span class="btn btn-sm btn-success pull-right" id="srch"><i class="fa fa-search"></i> Search</span>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="table-responsive project-list" id="content_container">
  56. </div>
  57. <div class="panel-body">
  58. <div class=" add-task-row">
  59. </div>
  60. <div class="table-foot">
  61. </div>
  62. </div>
  63. </section>
  64. </div>
  65. </div>
  66. </section>
  67. <!-- row end -->
  68. <!-- /.content -->
  69. @endsection
  70. @section('script')
  71. <script type="text/javascript">
  72. $(document).ready(function(){
  73. $( "#date1" ).datetimepicker({});
  74. $( "#date2" ).datetimepicker({});
  75. $('#srch').on('click',function(){
  76. var user = $('#user').val();
  77. var start_date = $( "#date1" ).val();
  78. var end_date = $( "#date2" ).val();
  79. if(user !=0 && start_date !='' && end_date !='')
  80. {
  81. $.ajax({
  82. url: "{{url('admin/report_content')}}",
  83. type: 'POST',
  84. data: {user: user,start_date: start_date,end_date: end_date},
  85. })
  86. .done(function(data) {
  87. console.log(data);
  88. $("#content_container").html(data);
  89. });
  90. }
  91. else
  92. {
  93. if(user ==0 && start_date !='' && end_date !='')
  94. {
  95. alert("Please Select An User");
  96. }
  97. else if(start_date =='' && user !=0 && end_date !='')
  98. {
  99. alert("Please Select Start Date");
  100. }
  101. else if(end_date =='' && user !=0 && start_date !='')
  102. {
  103. alert("Please Select End Date");
  104. }
  105. else if(user ==0 && start_date =='' && end_date =='')
  106. {
  107. alert("Please Select Start Date,End Date and User");
  108. }
  109. }
  110. })
  111. });
  112. </script>
  113. @endsection