Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layouts.master')
- @section('title','گزارش هدایات')
- @section('content')
- @component('components.portlet')
- @slot('icon')
- icon-magnifier
- @endslot
- @slot('body')
- <form id="search_form" action="" method="post" class="form-inline">
- {{ csrf_field() }}
- <div class="form-body">
- <div class="row">
- <div class="col-md-12">
- <div class="form-group">
- <label class="radio-inline">
- <input type="radio" name="date_type" class="toggle_dates" id="date" > تاریخ
- </label>
- <label class="radio-inline">
- <input type="radio" name="date_type" class="toggle_dates" id="two_dates" checked > بین دو تاریخ
- </label>
- </div>
- <div class="form-group single_date_picker">
- <input type="text" id="single_date" name="single_date" value="" placeholder="تاریخ" class="form-control persian_date ">
- </div>
- <div class="form-group between_dates_picker">
- <input type="text" id="from_date" name="from_date" value="" placeholder="از تاریخ" class="form-control persian_date ">
- </div>
- <div class="form-group between_dates_picker">
- <input type="text" id="to_date" name="to_date" value="" placeholder="الی تاریخ" class="form-control persian_date ">
- </div>
- <div class="form-group">
- <select class="form-control select2" name="status" id="">
- {{--
- <option value="">نوع سند</option>
- --}}
- <option value="">حالت</option>
- <option value="0">اجراء نا شده</option>
- <option value="1">درحال اجراء</option>
- <option value="2">اجراء شده</option>
- </select>
- </div>
- <div class="form-group">
- <select class="form-control select2" name="type" id="">
- {{--
- <option value="">نوع سند</option>
- --}}
- <option value="">چگونگی</option>
- <option value="0">کتبی</option>
- <option value="1">شفاهی</option>
- </select>
- </div>
- <div class="form-group">
- <select class="form-control select2" name="sector" id="sector">
- <option value="">سکتورها</option>
- @foreach ($sectors as $sector)
- <option value="{{$sector->id}}">{{$sector->name_dr}}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <select class="form-control select2" name="recipient" id="recipient">
- <option value=" ">اداره /وزارت</option>
- @foreach ($recipients as $recipient)
- <option value="{{$recipient->id}}">{{$recipient->name_dr}}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <select class="form-control select2" name="user" id="">
- @if(auth()->user()->hasRole('admin'))
- <option value="" >یوزر</option>
- @endif
- @foreach ($users as $user)
- <option value="{{$user->id}}" {{!auth()->user()->hasRole('admin') ? 'selected' :''}}>{{$user->name_dr}}</option>
- @endforeach
- </select>
- </div>
- <div class="form-group">
- <button id="search_form_submit" class="btn btn-success">
- <i class="icon-magnifier" style="font-size:1.3em !important;"></i>
- </button>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <!-- END FORM-->
- <div class="row">
- <div class="col-md-12">
- <div class="data" style="margin-bottom:10px;">
- </div>
- </div>
- </div>
- @endslot
- @endcomponent
- {{-- </div>
- </div>
- </div>
- </div> --}}
- @endsection
- @push('custom-js')
- <script type="text/javascript">
- $(function() {
- $('.toggle_dates').click(function() {
- console.log($(this));
- $("#search_form input[type=text]").val("");
- if(this.id == 'date') {
- $('.form-group.between_dates_picker').hide();
- $('.form-group.single_date_picker').css('display','inline-block');
- }
- else {
- $('.form-group.between_dates_picker').css('display','inline-block');
- $('.form-group.single_date_picker').hide();
- }
- });
- })
- </script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('#search_form_submit').click(function(){
- var dataString = $('#search_form').serialize();
- $.ajax({
- type:'POST',
- url:'{!!URL::route("get_order_reports")!!}',
- data: dataString,
- beforeSend: function(){
- $('.data').html('<span"><img style="display:block;margin:auto; width:auto;height:70px;" src="{{asset('public/images/report-loader.gif')}}" /></span>');
- },
- success:function(response){
- $('.data').html(response);
- Metronic.init(); // init metronic core components
- $('.datatable').DataTable( {
- order: [],
- columnDefs: [ { orderable: false, targets: [6] } ],
- language: {
- "sEmptyTable": "هیچ موردی وجود ندارد",
- "sInfo": "نمایش _START_ تا _END_ از _TOTAL_ رکورد",
- "sInfoEmpty": "نمایش 0 تا 0 از 0 رکورد",
- "sInfoFiltered": "(فیلتر شده از _MAX_ رکورد)",
- "sInfoPostFix": "",
- "sInfoThousands": ",",
- "sLengthMenu": "نمایش _MENU_ رکورد",
- "sLoadingRecords": "در حال بارگزاری...",
- "sProcessing": "در حال پردازش...",
- "sSearch": "جستجو:",
- "sZeroRecords": "رکوردی با این مشخصات پیدا نشد",
- "oPaginate": {
- "sFirst": "ابتدا",
- "sLast": "انتها",
- "sNext": "بعدی",
- "sPrevious": "قبلی"
- },
- "oAria": {
- "sSortAscending": ": فعال سازی نمایش به صورت صعودی",
- "sSortDescending": ": فعال سازی نمایش به صورت نزولی"
- }
- }
- } );
- }
- })
- return false;
- });
- });
- </script>
- @endpush
- @push('custom-css')
- <style>
- .form-group.single_date_picker {
- display: none;
- }
- div.dataTables_wrapper div.dataTables_length label {
- margin-top:32px;
- }
- div.dataTables_wrapper div.dataTables_filter input {
- margin-right: 0px;
- }
- .search{
- padding: 20px;
- margin-right: 185px;
- }
- </style>
- @endpush
- @push('custom-js')
- <script>
- // sector drop down get related recipients
- $(document).ready(function() {
- $("#sector").change(function() {
- var id = $(this).val();
- $.ajax({
- type: "GET",
- url: "{{url('related_recipients')}}/"+id,
- success: function(data) {
- $("#recipient").html(data);
- }
- });
- });
- });
- $("#recipient").change(function () {
- var id = this.value;
- if(id==' '){
- $('#sector').removeAttr('disabled', 'disabled');
- }else{
- $('#sector').attr('disabled', 'disabled');
- }
- });
- </script>
- @endpush
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement