| Path : /var/www/html/mini-moneyexchange/resources/views/user/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : //var/www/html/mini-moneyexchange/resources/views/user/userList.blade.php |
@extends('layouts.main')
@section('content')
<div class="page-wrapper">
<div class="page-breadcrumb">
<div class="row">
<div class="col-12 d-flex no-block align-items-center">
<h4 class="page-title">{{__('message.user')}}</h4>
<div class="ms-auto text-end">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="{{route('users.create')}}" class="btn btn-primary btn-sm">
<i class="fa fa-plus"></i>
{{{__('message.add new')}}}
</a>
</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
<div class="container-fluid" style="padding-top: 0px;">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table
id="zero_config"
class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>{{__('message.name')}}</th>
<th>{{__('message.phone')}}</th>
<th>{{__('message.role')}}</th>
@foreach($currencies as $currency)
<th>
{{$currency->name}}
<img src="{{asset($currency->flage)}}" style="height:20px;">
<img src="{{asset($currency->sample_money)}}" style="height:20px;">
</th>
@endforeach
<th>{{__('message.allow to change exchange rate')}}</th>
<th>{{__('message.status')}}</th>
<th>{{__('message.created date')}}</th>
<th>{{__('message.action')}}</th>
</tr>
</thead>
<tbody>
<?php
$c = [];
?>
@foreach($users as $index => $user)
<tr class="@if(!$user->is_active) disabled-row @endif">
<td>{{$index+1}}</td>
<td>{{$user->name}}</td>
<td>{{$user->phone}}</td>
<td>{{$user->role->name}}</td>
@foreach($currencies as $currency)
<td class="credit">
<?php
$bankAccount = $currency->getCashAmount($user->id);
$amount = $bankAccount->credit??0;
$c[$currency->currency_code]= ($c[$currency->currency_code]??0)+$amount;
?>
{{number_format($amount,2)}} {{$currency->currency_code}}
<br/>
<button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#modal{{$user->id}}_{{$currency->id}}" data-transaction='deposit'>
<i class="fa fa-plus"></i>
{{__('message.deposit')}}
</button>
<button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#modal{{$user->id}}_{{$currency->id}}" data-transaction='withdraw'>
<i class="fa fa-arrow-circle-down"></i>
{{__('message.withdraw')}}
</button>
</td>
<div class="modal fade" id="modal{{$user->id}}_{{$currency->id}}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="background-color:#081C30; color:white;">
<h1 class="modal-title fs-5" id="exampleModalLabel">{{__('message.deposit')}}/{{__('message.withdraw')}}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@if($bankAccount)
<form method="POST" action="{{route('bank-accounts.deposit-withdraw.store',$bankAccount)}}" class="mt-5" enctype="multipart/form-data">
{{ csrf_field() }}
<section class="col-sm-12">
<div class="mb-3 mt-3">
<label>{{__('message.amount')}} ({{$bankAccount->currency->name}})</label>
<input type="number" class="form-control" placeholder="{{__('message.amount')}}" name="amount" required step="0.01">
<input type="hidden" name="type" value="xxx">
</div>
<div class="mb-3">
<label>{{__('message.bank account transaction type')}}</label>
<select name="bank_account_transaction_type_id" id="pet-select" class="form-control" required="">
<option value="">{{__('message.bank account transaction type')}}</option>
@foreach($bankAccountTransactionTypes as $index=>$bankAccountTransactionType)
<option value="{{$bankAccountTransactionType->id}}">
{{$bankAccountTransactionType->name}}
</option>
@endforeach
</select>
</div>
<div class="mb-3 mt-3">
<label>{{__('message.note')}}</label>
<input type="text" class="form-control" placeholder="{{__('message.note')}}" name="note">
</div>
<div class="text-center">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary btn-sm">
<i class="fa fa-save"></i>
{{__('message.save')}}
</button>
</div>
</section>
</form>
@else
Please input bank account for this user
@endif
</div>
</div>
</div>
</div>
@endforeach
<td>
<input class="form-check-input" type="checkbox" @if($user->allow_to_change_exchange_rate||$user->role->name=='admin') checked @endif>
</td>
<td title="{{$user->is_active?'Yes':'No'}}">
<input class="form-check-input" type="checkbox" @if($user->is_active) checked @endif>
</td>
<td title="{{$user->created_at}}" class="credit">
{{ $user->created_at->format('d/m/Y H:i') }}
</td>
<td>
<a href="{{route('transactions')}}?user_id={{$user->id}}" class="btn btn-primary btn-sm"><i class="fa fa-eye"></i>{{__('message.report')}}</a>
<a href="{{route('users.edit',$user)}}" class="btn btn-primary btn-sm"><i class="fa fa-eye"></i></a>
<form method="POST" action="{{route('users.destroy', $user)}}" style="display:inline">
<input name="_method" type="hidden" value="DELETE">
{{ csrf_field() }}
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('{{ __('message.do you want to delete') }}?')">
<i class="fas fa-trash" style="color: #FFF;"></i>
</button>
</form>
</td>
</tr>
@endforeach
<thead>
<tr style="">
<th colspan="4" style="text-align:right;"> {{ __('message.total') }}</th>
@foreach($currencies as $currency)
<th>{{number_format($c[$currency->currency_code],2)}} {{$currency->currency_code}}</th>
@endforeach
<th colspan="4">
{{ __('message.date') }}: {{date("Y/m/d h:i:sa")}}
</th>
</tr>
</thead>
</tbody>
</table>
<div class="rows">
{{ $users->appends($_GET)->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
<script type="text/javascript">
$('.modal').on('show.bs.modal', function(e) {
//get data-id attribute of the clicked element
var t = $(e.relatedTarget).data('transaction');
//populate the textbox
$(e.currentTarget).find('input[name="type"]').val(t);
});
</script>
@endsection
@section('meta')
<title>{{__('message.user')}}</title>
@endsection