Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.83 KB | None | 0 0
  1. @extends('layouts.master')
  2. @section('title','گزارش هدایات')
  3. @section('content')
  4. @component('components.portlet')
  5. @slot('icon')
  6. icon-magnifier
  7. @endslot
  8. @slot('body')
  9. <form id="search_form" action="" method="post" class="form-inline">
  10. {{ csrf_field() }}
  11. <div class="form-body">
  12. <div class="row">
  13. <div class="col-md-12">
  14. <div class="form-group">
  15. <label class="radio-inline">
  16. <input type="radio" name="date_type" class="toggle_dates" id="date" > تاریخ
  17. </label>
  18. <label class="radio-inline">
  19. <input type="radio" name="date_type" class="toggle_dates" id="two_dates" checked > بین دو تاریخ
  20. </label>
  21. </div>
  22. <div class="form-group single_date_picker">
  23. <input type="text" id="single_date" name="single_date" value="" placeholder="تاریخ" class="form-control persian_date ">
  24. </div>
  25. <div class="form-group between_dates_picker">
  26. <input type="text" id="from_date" name="from_date" value="" placeholder="از تاریخ" class="form-control persian_date ">
  27. </div>
  28. <div class="form-group between_dates_picker">
  29. <input type="text" id="to_date" name="to_date" value="" placeholder="الی تاریخ" class="form-control persian_date ">
  30. </div>
  31. <div class="form-group">
  32. <select class="form-control select2" name="status" id="">
  33. {{--
  34. <option value="">نوع سند</option>
  35. --}}
  36. <option value="">حالت</option>
  37. <option value="0">اجراء‌ نا شده</option>
  38. <option value="1">درحال اجراء‌</option>
  39. <option value="2">اجراء شده</option>
  40. </select>
  41. </div>
  42. <div class="form-group">
  43. <select class="form-control select2" name="type" id="">
  44. {{--
  45. <option value="">نوع سند</option>
  46. --}}
  47. <option value="">چگونگی</option>
  48.  
  49. <option value="0">کتبی</option>
  50. <option value="1">شفاهی</option>
  51. </select>
  52. </div>
  53. <div class="form-group">
  54. <select class="form-control select2" name="sector" id="sector">
  55. <option value="">سکتورها</option>
  56. @foreach ($sectors as $sector)
  57. <option value="{{$sector->id}}">{{$sector->name_dr}}</option>
  58. @endforeach
  59. </select>
  60. </div>
  61. <div class="form-group">
  62. <select class="form-control select2" name="recipient" id="recipient">
  63. <option value=" ">اداره /وزارت</option>
  64. @foreach ($recipients as $recipient)
  65. <option value="{{$recipient->id}}">{{$recipient->name_dr}}</option>
  66. @endforeach
  67. </select>
  68. </div>
  69. <div class="form-group">
  70. <select class="form-control select2" name="user" id="">
  71. @if(auth()->user()->hasRole('admin'))
  72. <option value="" >یوزر</option>
  73. @endif
  74. @foreach ($users as $user)
  75. <option value="{{$user->id}}" {{!auth()->user()->hasRole('admin') ? 'selected' :''}}>{{$user->name_dr}}</option>
  76. @endforeach
  77. </select>
  78. </div>
  79. <div class="form-group">
  80. <button id="search_form_submit" class="btn btn-success">
  81. <i class="icon-magnifier" style="font-size:1.3em !important;"></i>
  82. </button>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </form>
  88. </div>
  89. <!-- END FORM-->
  90. <div class="row">
  91. <div class="col-md-12">
  92. <div class="data" style="margin-bottom:10px;">
  93. </div>
  94. </div>
  95. </div>
  96. @endslot
  97. @endcomponent
  98. {{-- </div>
  99. </div>
  100. </div>
  101. </div> --}}
  102. @endsection
  103. @push('custom-js')
  104. <script type="text/javascript">
  105. $(function() {
  106.  
  107. $('.toggle_dates').click(function() {
  108. console.log($(this));
  109. $("#search_form input[type=text]").val("");
  110. if(this.id == 'date') {
  111. $('.form-group.between_dates_picker').hide();
  112. $('.form-group.single_date_picker').css('display','inline-block');
  113.  
  114.  
  115. }
  116. else {
  117. $('.form-group.between_dates_picker').css('display','inline-block');
  118. $('.form-group.single_date_picker').hide();
  119.  
  120. }
  121. });
  122. })
  123.  
  124. </script>
  125. <script type="text/javascript">
  126. $(document).ready(function() {
  127. $('#search_form_submit').click(function(){
  128. var dataString = $('#search_form').serialize();
  129. $.ajax({
  130. type:'POST',
  131. url:'{!!URL::route("get_order_reports")!!}',
  132. data: dataString,
  133. beforeSend: function(){
  134. $('.data').html('<span"><img style="display:block;margin:auto; width:auto;height:70px;" src="{{asset('public/images/report-loader.gif')}}" /></span>');
  135. },
  136. success:function(response){
  137.  
  138. $('.data').html(response);
  139. Metronic.init(); // init metronic core components
  140. $('.datatable').DataTable( {
  141. order: [],
  142. columnDefs: [ { orderable: false, targets: [6] } ],
  143. language: {
  144. "sEmptyTable": "هیچ موردی وجود ندارد",
  145. "sInfo": "نمایش _START_ تا _END_ از _TOTAL_ رکورد",
  146. "sInfoEmpty": "نمایش 0 تا 0 از 0 رکورد",
  147. "sInfoFiltered": "(فیلتر شده از _MAX_ رکورد)",
  148. "sInfoPostFix": "",
  149. "sInfoThousands": ",",
  150. "sLengthMenu": "نمایش _MENU_ رکورد",
  151. "sLoadingRecords": "در حال بارگزاری...",
  152. "sProcessing": "در حال پردازش...",
  153. "sSearch": "جستجو:",
  154. "sZeroRecords": "رکوردی با این مشخصات پیدا نشد",
  155. "oPaginate": {
  156. "sFirst": "ابتدا",
  157. "sLast": "انتها",
  158. "sNext": "بعدی",
  159. "sPrevious": "قبلی"
  160. },
  161. "oAria": {
  162. "sSortAscending": ": فعال سازی نمایش به صورت صعودی",
  163. "sSortDescending": ": فعال سازی نمایش به صورت نزولی"
  164. }
  165. }
  166. } );
  167. }
  168. })
  169.  
  170. return false;
  171. });
  172. });
  173.  
  174.  
  175. </script>
  176. @endpush
  177. @push('custom-css')
  178. <style>
  179. .form-group.single_date_picker {
  180. display: none;
  181. }
  182. div.dataTables_wrapper div.dataTables_length label {
  183. margin-top:32px;
  184. }
  185. div.dataTables_wrapper div.dataTables_filter input {
  186. margin-right: 0px;
  187. }
  188. .search{
  189. padding: 20px;
  190. margin-right: 185px;
  191. }
  192. </style>
  193. @endpush
  194. @push('custom-js')
  195. <script>
  196. // sector drop down get related recipients
  197. $(document).ready(function() {
  198. $("#sector").change(function() {
  199. var id = $(this).val();
  200. $.ajax({
  201. type: "GET",
  202. url: "{{url('related_recipients')}}/"+id,
  203. success: function(data) {
  204. $("#recipient").html(data);
  205.  
  206. }
  207. });
  208.  
  209. });
  210.  
  211. });
  212.  
  213.  
  214. $("#recipient").change(function () {
  215. var id = this.value;
  216.  
  217. if(id==' '){
  218.  
  219. $('#sector').removeAttr('disabled', 'disabled');
  220.  
  221. }else{
  222.  
  223. $('#sector').attr('disabled', 'disabled');
  224. }
  225. });
  226.  
  227. </script>
  228. @endpush
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement