Current File : /home/itiffy/public_html/resources/views/admin/transactions/index.blade.php
@extends('admin.layouts.master')

@section('content')

@if ($transactions->count())
    <div class="portlet box green">
        <div class="portlet-title">
            <div class="caption">{{ trans('quickadmin::templates.templates-view_index-list') }}</div>
        </div>
        <div class="portlet-body">
            <table class="table table-striped table-hover table-responsive datatable1" id="datatable1">
                <thead>
                    <tr>
                        <th>Transaction Id</th>
                        <th>Order Number</th>
                        <th>Price</th>
                        <th>Name</th>
                        <th>Address</th>
                        {{-- <th>City</th>
                        <th>State</th>
                        <th>Zip Code</th>
                        <th>Country</th> --}}
                        <th>Email</th>
                        <th>Phone Number</th>
                        <th>Hires For</th>
                        <th>Duration</th>
                        {{-- <th>Gateway</th> --}}
                        <th>Created At</th>
                    </tr>
                </thead>

                <tbody>
                    @foreach ($transactions as $row)
                        <tr>
                            <td>{{ $row->transaction_id }}</td>
                            <td>{{ $row->order_number }}</td>
                            <td>{{ $row->price }} {{ $row->currency_code }} @if($row->payment_type==1){{ '(Half Payment)'}}@endif</td>
                            <td>{{ $row->name }}</td>
                            <td>Address : {{ $row->address }}
                                City : {{ $row->city }}
                                State : {{ $row->state }}
                                Country : {{ $cuntry_array[$row->country] }}
                                Zip Code : {{ $row->zip_code }}
                            </td>
                            <td>{{ $row->email }}</td>
                            <td>{{ $row->phone_number }}</td>
                            <td>{{ $row->hires_for }}</td>
                            <td>@if($row->hires_hour_or_month==0){{ 'Fixed Budget' }}@else {{ $row->how_many_hour_or_month }} @if($row->hires_hour_or_month==1){{ 'hour(s)' }}@elseif($row->hires_hour_or_month==2){{ 'month(s)' }}@else{{ 'year(s)' }}@endif @endif</td>
                            {{-- <td>@if($row->gateway==2){{ 'paypal' }}@elseif($row->gateway==1){{ '2checkout paypal' }}@else{{ '2checkout' }}@endif</td> --}}
                            <td>{{ $row->created_at }}</td>
                            
                        </tr>
                    @endforeach
                </tbody>
            </table>
            {{-- <div class="row">
                <div class="col-xs-12">
                    <button class="btn btn-danger" id="delete">
                        {{ trans('quickadmin::templates.templates-view_index-delete_checked') }}
                    </button>
                </div>
            </div> --}}
            {!! Form::open(['route' => config('quickadmin.route').'.contactformdb.massDelete', 'method' => 'post', 'id' => 'massDelete']) !!}
                <input type="hidden" id="send" name="toDelete">
            {!! Form::close() !!}
        </div>
	</div>
@else
    {{ trans('quickadmin::templates.templates-view_index-no_entries_found') }}
@endif

@endsection

@section('javascript')
    <script>
        $(document).ready(function () {
            $('#delete').click(function () {
                if (window.confirm('{{ trans('quickadmin::templates.templates-view_index-are_you_sure') }}')) {
                    var send = $('#send');
                    var mass = $('.mass').is(":checked");
                    if (mass == true) {
                        send.val('mass');
                    } else {
                        var toDelete = [];
                        $('.single').each(function () {
                            if ($(this).is(":checked")) {
                                toDelete.push($(this).data('id'));
                            }
                        });
                        send.val(JSON.stringify(toDelete));
                    }
                    $('#massDelete').submit();
                }
            });
            $('#datatable1').dataTable({
                 "order": [[ 9, "desc" ]],
                 });
        });
    </script>
@stop