Subiendo proyecto completo sin restricciones de git ignore

This commit is contained in:
Jose Sanchez
2023-08-17 11:44:02 -04:00
parent a0d4f5ba3b
commit 20f1c60600
19921 changed files with 2509159 additions and 45 deletions

View File

@@ -0,0 +1,61 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{translate('Affiliate Logs')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead>
<tr>
<th>#</th>
<th data-breakpoints="lg">{{ translate('Referred By')}}</th>
<th>{{ translate('Referral User')}}</th>
<th>{{ translate('Amount')}}</th>
<th data-breakpoints="lg">{{ translate('Order Id')}}</th>
<th data-breakpoints="lg">{{ translate('Referral Type') }}</th>
<th data-breakpoints="lg">{{ translate('Product') }}</th>
<th data-breakpoints="lg">{{ translate('Date') }}</th>
</thead>
<tbody>
@foreach($affiliate_logs as $key => $affiliate_log)
@if ($affiliate_log->user != null)
<tr>
<td>{{ ($key+1) + ($affiliate_logs->currentPage() - 1)*$affiliate_logs->perPage() }}</td>
<td>
{{ optional(\App\Models\User::where('id', $affiliate_log->referred_by_user)->first())->name }}
</td>
<td>
@if($affiliate_log->user_id !== null)
{{ optional($affiliate_log->user)->name }}
@else
{{ translate('Guest').' ('. $affiliate_log->guest_id.')' }}
@endif
</td>
<td>{{ single_price($affiliate_log->amount) }}</td>
<td>
@if($affiliate_log->order_id != null)
{{ optional($affiliate_log->order)->code }}
@else
{{ optional($affiliate_log->order_detail->order)->code }}
@endif
</td>
<td> {{ ucwords(str_replace('_',' ', $affiliate_log->affiliate_type)) }}</td>
<td>
@if($affiliate_log->order_detail_id != null && $affiliate_log->order_detail)
{{ optional($affiliate_log->order_detail->product)->name }}
@endif
</td>
<td>{{ $affiliate_log->created_at->format('d, F Y') }} </td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $affiliate_logs->links() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,47 @@
<form action="{{ route('withdraw_request.payment_store') }}" method="POST">
@csrf
<div class="modal-header">
<h5 class="modal-title h6">{{translate('Affiliate Withdraw Request')}}</h5>
<button type="button" class="close" data-dismiss="modal">
</button>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered" >
<tbody>
<tr>
<td>{{ translate('Paypal Email') }}</td>
<td>{{ $affiliate_user->paypal_email }}</td>
</tr>
<tr>
<td>{{ translate('Bank Information') }}</td>
<td>{{ $affiliate_user->bank_information }}</td>
</tr>
</tbody>
</table>
<input type="hidden" name="affiliate_user_id" value="{{ $affiliate_user->id }}">
<input type="hidden" name="affiliate_withdraw_request_id" value="{{ $affiliate_withdraw_request->id }}">
<div class="form-group row">
<label class="col-sm-3 col-from-label" for="amount">{{translate('Amount')}}</label>
<div class="col-sm-9">
<input type="hidden" name="amount" value="{{$affiliate_withdraw_request->amount}}" class="form-control">
<input type="number" value="{{$affiliate_withdraw_request->amount}}" class="form-control" disabled>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-from-label" for="payment_method">{{translate('Payment Method')}}</label>
<div class="col-sm-9">
<select name="payment_method" id="payment_method" class="form-control aiz-selectpicker" required>
<option value="">{{translate('Select Payment Method')}}</option>
<option value="Paypal">{{translate('Paypal')}}</option>
<option value="Bank">{{translate('Bank')}}</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-sm btn-primary" type="submit">{{ translate('Pay')}}</button>
<button type="button" class="btn btn-sm btn-light" data-dismiss="modal">{{translate('Cancel')}}</button>
</div>
</form>

View File

@@ -0,0 +1,117 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{translate('Affiliate Withdraw Request')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead>
<tr>
<th>#</th>
<th data-breakpoints="lg">{{translate('Date')}}</th>
<th>{{translate('Name')}}</th>
<th data-breakpoints="lg">{{translate('Email')}}</th>
<th>{{translate('Amount')}}</th>
<th data-breakpoints="lg">{{translate('Status')}}</th>
<th data-breakpoints="lg">{{translate('options')}}</th>
</tr>
</thead>
<tbody>
@foreach($affiliate_withdraw_requests as $key => $affiliate_withdraw_request)
@php $status = $affiliate_withdraw_request->status ; @endphp
@if ($affiliate_withdraw_request->user != null)
<tr>
<td>{{ ($key+1) + ($affiliate_withdraw_requests->currentPage() - 1)*$affiliate_withdraw_requests->perPage() }}</td>
<td>{{ $affiliate_withdraw_request->created_at}}</td>
<td>{{ optional($affiliate_withdraw_request->user)->name}}</td>
<td>{{ optional($affiliate_withdraw_request->user)->email}}</td>
<td>{{ single_price($affiliate_withdraw_request->amount)}}</td>
<td>
@if($status == 1)
<span class="badge badge-inline badge-success">{{translate('Approved')}}</span>
@elseif($status == 2)
<span class="badge badge-inline badge-danger">{{translate('Rejected')}}</span>
@else
<span class="badge badge-inline badge-info">{{translate('Pending')}}</span>
@endif
</td>
<td class="text-right">
@if($status == 0)
@can('accept_affiliate_withdraw_requests')
<a href="#" class="btn btn-soft-primary btn-icon btn-circle btn-sm" onclick="show_affiliate_withdraw_modal('{{$affiliate_withdraw_request->id}}');" title="{{ translate('Pay Now') }}">
<i class="las la-money-bill"></i>
</a>
@endcan
@can('reject_affiliate_withdraw_request')
<a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm" onclick="affiliate_withdraw_reject_modal('{{route('affiliate.withdraw_request.reject', $affiliate_withdraw_request->id)}}');" title="{{ translate('Reject') }}">
<i class="las la-trash"></i>
</a>
@endcan
@else
{{ translate('No Action Available')}}
@endif
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="clearfix">
<div class="pull-right">
{{ $affiliate_withdraw_requests->links() }}
</div>
</div>
</div>
</div>
@endsection
@section('modal')
<div class="modal fade" id="affiliate_withdraw_modal">
<div class="modal-dialog">
<div class="modal-content" id="modal-content">
</div>
</div>
</div>
<div class="modal fade" id="affiliate_withdraw_reject_modal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title h6">{{ translate('Affiliate Withdraw Request Reject')}}</h5>
<button type="button" class="close" data-dismiss="modal">
</button>
</div>
<div class="modal-body">
<p>{{translate('Are you sure, You want to reject this?')}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light" data-dismiss="modal">{{translate('Cancel')}}</button>
<a href="#" id="reject_link" class="btn btn-primary">{{ translate('Reject') }}</a>
</div>
</div>
</div>
</div>
@endsection
@section('script')
<script type="text/javascript">
function show_affiliate_withdraw_modal(id){
$.post('{{ route('affiliate_withdraw_modal') }}',{_token:'{{ @csrf_token() }}', id:id}, function(data){
$('#affiliate_withdraw_modal #modal-content').html(data);
$('#affiliate_withdraw_modal').modal('show', {backdrop: 'static'});
AIZ.plugins.bootstrapSelect('refresh');
});
}
function affiliate_withdraw_reject_modal(reject_link){
$('#affiliate_withdraw_reject_modal').modal('show');
document.getElementById('reject_link').setAttribute('href' , reject_link);
}
</script>
@endsection

View File

@@ -0,0 +1,192 @@
@extends('backend.layouts.app')
@section('content')
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Affiliate Registration Form')}}</h5>
</div>
<div class="card-body">
<form action="{{ route('affiliate.configs.store') }}" method="post" enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-lg-8 form-horizontal" id="form">
@foreach (json_decode(\App\Models\AffiliateConfig::where('type', 'verification_form')->first()->value) as $key => $element)
@if ($element->type == 'text' || $element->type == 'file')
<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">
<input type="hidden" name="type[]" value="{{ $element->type }}">
<div class="col-lg-3">
<label class="control-label">{{ ucfirst($element->type) }}</label>
</div>
<div class="col-lg-7">
<input class="form-control" type="text" name="label[]" value="{{ $element->label }}" placeholder="Label">
</div>
<div class="col-lg-2"><span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span></div>
</div>
@elseif ($element->type == 'select' || $element->type == 'multi_select' || $element->type == 'radio')
<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">
<input type="hidden" name="type[]" value="{{ $element->type }}">
<input type="hidden" name="option[]" class="option" value="{{ $key }}">
<div class="col-lg-3">
<label class="control-label">{{ ucfirst(str_replace('_', ' ', $element->type)) }}</label>
</div>
<div class="col-lg-7">
<input class="form-control" type="text" name="label[]" value="{{ $element->label }}" placeholder="Select Label" style="margin-bottom:10px">
<div class="customer_choice_options_types_wrap_child">
@if (is_array(json_decode($element->options)))
@foreach (json_decode($element->options) as $value)
<div class="form-group row">
<div class="col-sm-6 col-sm-offset-4">
<input class="form-control" type="text" name="options_{{ $key }}[]" value="{{ $value }}" required="">
</div>
<div class="col-sm-2"> <span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span></div>
</div>
@endforeach
@endif
</div>
<button class="btn btn-success pull-right" type="button" onclick="add_customer_choice_options(this)"><i class="glyphicon glyphicon-plus"></i> Add option</button>
</div>
<div class="col-lg-2"><span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span></div>
</div>
@endif
@endforeach
</div>
<div class="col-lg-4">
<ul class="list-group">
<li class="list-group-item btn" style="text-align: left;" onclick="appenddToForm('text')">{{translate('Text Input')}}</li>
<li class="list-group-item btn" style="text-align: left;" onclick="appenddToForm('select')">{{translate('Select')}}</li>
<li class="list-group-item btn" style="text-align: left;" onclick="appenddToForm('multi-select')">{{translate('Multiple Select')}}</li>
<li class="list-group-item btn" style="text-align: left;" onclick="appenddToForm('radio')">{{translate('Radio')}}</li>
<li class="list-group-item btn" style="text-align: left;" onclick="appenddToForm('file')">{{translate('File')}}</li>
</ul>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-primary">{{translate('Save')}}</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('script')
<script type="text/javascript">
var i = 0;
function add_customer_choice_options(em){
var j = $(em).closest('.form-group.row').find('.option').val();
var str = '<div class="form-group row">'
+'<div class="col-sm-6 col-sm-offset-4">'
+'<input class="form-control" type="text" name="options_'+j+'[]" value="" required>'
+'</div>'
+'<div class="col-sm-2"> <span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span>'
+'</div>'
+'</div>'
$(em).parent().find('.customer_choice_options_types_wrap_child').append(str);
}
function delete_choice_clearfix(em){
$(em).parent().parent().remove();
}
function appenddToForm(type){
//$('#form').removeClass('seller_form_border');
if(type == 'text'){
var str = '<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">'
+'<input type="hidden" name="type[]" value="text">'
+'<div class="col-lg-3">'
+'<label class="control-label">Text</label>'
+'</div>'
+'<div class="col-lg-7">'
+'<input class="form-control" type="text" name="label[]" placeholder="Label">'
+'</div>'
+'<div class="col-lg-2">'
+'<span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span>'
+'</div>'
+'</div>';
$('#form').append(str);
}
else if (type == 'select') {
i++;
var str = '<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">'
+'<input type="hidden" name="type[]" value="select"><input type="hidden" name="option[]" class="option" value="'+i+'">'
+'<div class="col-lg-3">'
+'<label class="control-label">Select</label>'
+'</div>'
+'<div class="col-lg-7">'
+'<input class="form-control" type="text" name="label[]" placeholder="Select Label" style="margin-bottom:10px">'
+'<div class="customer_choice_options_types_wrap_child">'
+'</div>'
+'<button class="btn btn-success pull-right" type="button" onclick="add_customer_choice_options(this)"><i class="glyphicon glyphicon-plus"></i> Add option</button>'
+'</div>'
+'<div class="col-lg-2">'
+'<span class="btn btn-icon btn-circle icon-lg fa fa-times" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span>'
+'</div>'
+'</div>';
$('#form').append(str);
}
else if (type == 'multi-select') {
i++;
var str = '<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">'
+'<input type="hidden" name="type[]" value="multi_select"><input type="hidden" name="option[]" class="option" value="'+i+'">'
+'<div class="col-lg-3">'
+'<label class="control-label">Multiple select</label>'
+'</div>'
+'<div class="col-lg-7">'
+'<input class="form-control" type="text" name="label[]" placeholder="Multiple Select Label" style="margin-bottom:10px">'
+'<div class="customer_choice_options_types_wrap_child">'
+'</div>'
+'<button class="btn btn-success pull-right" type="button" onclick="add_customer_choice_options(this)"><i class="glyphicon glyphicon-plus"></i> Add option</button>'
+'</div>'
+'<div class="col-lg-2">'
+'<span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span>'
+'</div>'
+'</div>';
$('#form').append(str);
}
else if (type == 'radio') {
i++;
var str = '<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">'
+'<input type="hidden" name="type[]" value="radio"><input type="hidden" name="option[]" class="option" value="'+i+'">'
+'<div class="col-lg-3">'
+'<label class="control-label">Radio</label>'
+'</div>'
+'<div class="col-lg-7">'
+'<input class="form-control" type="text" name="label[]" placeholder="Radio Label" style="margin-bottom:10px">'
+'<div class="customer_choice_options_types_wrap_child">'
+'</div>'
+'<button class="btn btn-success pull-right" type="button" onclick="add_customer_choice_options(this)"><i class="glyphicon glyphicon-plus"></i> Add option</button>'
+'</div>'
+'<div class="col-lg-2">'
+'<span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span>'
+'</div>'
+'</div>';
$('#form').append(str);
}
else if (type == 'file') {
var str = '<div class="form-group row" style="background:rgba(0,0,0,0.1);padding:10px 0;">'
+'<input type="hidden" name="type[]" value="file">'
+'<div class="col-lg-3">'
+'<label class="control-label">File</label>'
+'</div>'
+'<div class="col-lg-7">'
+'<input class="form-control" type="text" name="label[]" placeholder="Label">'
+'</div>'
+'<div class="col-lg-2">'
+'<span class="btn btn-icon btn-circle" onclick="delete_choice_clearfix(this)"><i class="las la-times"></i></span>'
+'</div>'
+'</div>';
$('#form').append(str);
}
}
</script>
@endsection

View File

@@ -0,0 +1,169 @@
@extends('frontend.layouts.app')
@section('content')
<section class="pt-4 mb-4">
<div class="container">
<div class="row">
<div class="col-lg-6 text-center text-lg-left">
<h1 class="fw-600 h4">{{ translate('Affiliate Informations') }}</h1>
</div>
<div class="col-lg-6">
<ul class="breadcrumb bg-transparent p-0 justify-content-center justify-content-lg-end">
<li class="breadcrumb-item opacity-50">
<a class="text-reset" href="{{ route('home') }}">{{ translate('Home') }}</a>
</li>
<li class="text-dark fw-600 breadcrumb-item">
<a class="text-reset" href="{{ route('affiliate.apply') }}">"{{ translate('Affiliate') }}"</a>
</li>
</ul>
</div>
</div>
<div class="row mt-4">
<div class="col-lg-8 mx-auto">
<form class="" action="{{ route('affiliate.store_affiliate_user') }}" method="POST" enctype="multipart/form-data">
@csrf
@if (!Auth::check())
<div class="card rounded-0 shadow-none">
<div class="card-header border-bottom-0">
<h5 class="mb-0 fs-15 fw-600">{{translate('User Info')}}</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="form-group">
<div class="input-group input-group--style-1">
<input type="text" class="form-control rounded-0{{ $errors->has('name') ? ' is-invalid' : '' }}" value="{{ old('name') }}" placeholder="{{ translate('Name') }}" name="name">
<span class="input-group-addon">
<i class="las la-user"></i>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<div class="input-group input-group--style-1">
<input type="email" class="form-control rounded-0{{ $errors->has('email') ? ' is-invalid' : '' }}" value="{{ old('email') }}" placeholder="{{ translate('Email') }}" name="email">
<span class="input-group-addon">
<i class="las la-envelope"></i>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<div class="input-group input-group--style-1">
<input type="password" class="form-control rounded-0{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ translate('Password') }}" name="password">
<span class="input-group-addon">
<i class="las la-lock"></i>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<div class="input-group input-group--style-1">
<input type="password" class="form-control rounded-0" placeholder="{{ translate('Confirm Password') }}" name="password_confirmation">
<span class="input-group-addon">
<i class=" las la-lock"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
<div class="card rounded-0 shadow-none">
<div class="card-header border-bottom-0">
<h5 class="mb-0 fs-15 fw-600">{{translate('Verification info')}}</h5>
</div>
<div class="card-body">
@php
$verification_form = \App\Models\AffiliateConfig::where('type', 'verification_form')->first()->value;
@endphp
@foreach (json_decode($verification_form) as $key => $element)
@if ($element->type == 'text')
<div class="row">
<label class="col-md-2 col-form-label">{{ $element->label }} <span class="text-danger">*</span></label>
<div class="col-md-10">
<input type="{{ $element->type }}" class="form-control rounded-0 mb-3" placeholder="{{ $element->label }}" name="element_{{ $key }}" required>
</div>
</div>
@elseif($element->type == 'file')
<div class="row">
<label class="col-md-2 col-form-label">{{ $element->label }}</label>
<div class="col-md-10">
<input type="{{ $element->type }}" name="element_{{ $key }}" id="file-{{ $key }}" class="custom-input-file custom-input-file--4" data-multiple-caption="{count} files selected" required/>
<label for="file-{{ $key }}" class="mw-100 mb-3">
<span></span>
<strong>
<i class="fa fa-upload"></i>
{{translate('Choose file')}}
</strong>
</label>
</div>
</div>
@elseif ($element->type == 'select' && is_array(json_decode($element->options)))
<div class="row">
<label class="col-md-2 col-form-label">{{ $element->label }}</label>
<div class="col-md-10">
<div class="mb-3">
<select class="form-control rounded-0 selectpicker" data-minimum-results-for-search="Infinity" name="element_{{ $key }}" required>
@foreach (json_decode($element->options) as $value)
<option value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
</div>
</div>
</div>
@elseif ($element->type == 'multi_select' && is_array(json_decode($element->options)))
<div class="row">
<label class="col-md-2 col-form-label">{{ $element->label }}</label>
<div class="col-md-10">
<div class="mb-3">
<select class="form-control rounded-0 selectpicker" data-minimum-results-for-search="Infinity" name="element_{{ $key }}[]" multiple required>
@foreach (json_decode($element->options) as $value)
<option value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
</div>
</div>
</div>
@elseif ($element->type == 'radio')
<div class="row">
<label class="col-md-2 col-form-label">{{ $element->label }}</label>
<div class="col-md-10">
<div class="mb-3">
@foreach (json_decode($element->options) as $value)
<div class="radio radio-inline">
<input type="radio" name="element_{{ $key }}" value="{{ $value }}" id="{{ $value }}" required>
<label for="{{ $value }}">{{ $value }}</label>
</div>
@endforeach
</div>
</div>
</div>
@endif
@endforeach
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-primary rounded-0 w-150px">{{translate('Save')}}</button>
</div>
</form>
</div>
</div>
</div>
</section>
@endsection

View File

@@ -0,0 +1,294 @@
@extends('frontend.layouts.app')
@section('content')
<section class="py-5">
<div class="container">
<div class="d-flex align-items-start">
@include('frontend.inc.user_side_nav')
<div class="aiz-user-panel">
<div class="aiz-titlebar mb-4">
<div class="row align-items-center">
<div class="col-md-6">
<h1 class="fs-20 fw-700 text-dark">{{ translate('Affiliate') }}</h1>
</div>
</div>
</div>
<div class="row gutters-16 mb-2">
<!-- Affiliate Balance -->
<div class="col-md-4 mx-auto mb-4" >
<div class="bg-dark text-white overflow-hidden text-center p-4 h-100">
<svg xmlns="http://www.w3.org/2000/svg" width="17.402" height="32" viewBox="0 0 17.402 32">
<path id="Path_32606" data-name="Path 32606" d="M14.888-4.338a4.994,4.994,0,0,0-2.021-1.9,6.687,6.687,0,0,0-3.175-.7,5.029,5.029,0,0,0-3.258.969,3.108,3.108,0,0,0-1.2,2.536q0,2.515,3.34,3.175l3.052.577a13.933,13.933,0,0,1,2.8.825,7.913,7.913,0,0,1,2.227,1.381,5.876,5.876,0,0,1,1.485,2.082A7.211,7.211,0,0,1,18.682,7.5a6.445,6.445,0,0,1-.536,2.7,6.111,6.111,0,0,1-1.505,2.041A7.129,7.129,0,0,1,14.332,13.6a11.987,11.987,0,0,1-2.907.66v2.474a1.62,1.62,0,0,1-.371,1.093,1.334,1.334,0,0,1-1.072.433,1.334,1.334,0,0,1-1.072-.433,1.62,1.62,0,0,1-.371-1.093V14.219A9.33,9.33,0,0,1,5.61,13.5a9.09,9.09,0,0,1-2.082-1.258,6.581,6.581,0,0,1-1.34-1.464,6.227,6.227,0,0,1-.7-1.381,2.691,2.691,0,0,1-.206-.948A1.548,1.548,0,0,1,1.734,7.27a1.6,1.6,0,0,1,1.155-.433,1.3,1.3,0,0,1,.928.33,3.373,3.373,0,0,1,.639.866,13.046,13.046,0,0,0,.763,1.175A4.954,4.954,0,0,0,6.332,10.3a5.722,5.722,0,0,0,1.67.8,7.922,7.922,0,0,0,2.351.309,4.989,4.989,0,0,0,3.629-1.175,3.727,3.727,0,0,0,1.2-2.742,3.53,3.53,0,0,0-1.052-2.763,6.445,6.445,0,0,0-3.072-1.361L7.837,2.755A8.572,8.572,0,0,1,3.115.507a5.631,5.631,0,0,1-1.381-3.9A5.738,5.738,0,0,1,3.589-7.843,8.258,8.258,0,0,1,8.538-9.822v-2.433a1.45,1.45,0,0,1,.412-1.072,1.45,1.45,0,0,1,1.072-.412,1.316,1.316,0,0,1,1.031.412,1.542,1.542,0,0,1,.371,1.072v2.474a9.785,9.785,0,0,1,2.412.66,9.885,9.885,0,0,1,1.856,1.031,6.7,6.7,0,0,1,1.32,1.216,6.849,6.849,0,0,1,.8,1.216A2.018,2.018,0,0,1,18.1-4.627,1.4,1.4,0,0,1,17.692-3.6a1.5,1.5,0,0,1-1.113.412,1.5,1.5,0,0,1-.99-.309A3.423,3.423,0,0,1,14.888-4.338Z" transform="translate(-1.28 13.74)" fill="#fff"/>
</svg>
<div class="py-2 mt-2">
<div class="fs-14 fw-400 text-center">{{ translate('Affiliate Balance') }}</div>
<div class="fs-30 fw-700 text-center">{{ single_price(Auth::user()->affiliate_user->balance) }}</div>
</div>
</div>
</div>
<!-- Configure Payout -->
<div class="col-md-4 mx-auto mb-4" >
<a href="{{ route('affiliate.payment_settings') }}">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light">
<span class="size-60px rounded-circle mx-auto bg-dark d-flex align-items-center justify-content-center mb-3">
<i class="las la-cog la-3x text-white"></i>
</span>
<div class="fs-14 fw-600 text-dark">{{ translate('Configure Payout') }}</div>
</div>
</a>
</div>
<!-- Affiliate Withdraw Request -->
<div class="col-md-4 mx-auto mb-4" >
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light" onclick="show_affiliate_withdraw_modal()">
<span class="size-60px rounded-circle mx-auto bg-dark d-flex align-items-center justify-content-center mb-3">
<i class="las la-plus la-3x text-white"></i>
</span>
<div class="fs-14 fw-600 text-dark">{{ translate('Affiliate Withdraw Request') }}</div>
</div>
</div>
</div>
<!-- Copy Url -->
@if (addon_is_activated('affiliate_system')
&& \App\Models\AffiliateOption::where('type', 'user_registration_first_purchase')->first()->status)
<div class="row">
@php
if(Auth::user()->referral_code == null){
Auth::user()->referral_code = substr(Auth::user()->id.Str::random(), 0, 10);
Auth::user()->save();
}
$referral_code = Auth::user()->referral_code;
$referral_code_url = URL::to('/users/registration')."?referral_code=$referral_code";
@endphp
<div class="col mb-2">
<div class="card rounded-0 shadow-none border mb-4">
<div class="form-box-content p-4">
<div class="row gutters-16">
<div class="col-lg-10 col-sm-9 form-group mb-3 mb-sm-0">
<textarea id="referral_code_url" class="form-control rounded-0" readonly type="text">{{$referral_code_url}}</textarea>
</div>
<div class="col-lg-2 col-sm-3">
<button type=button id="ref-cpurl-btn" class="btn btn-primary btn-block rounded-0" data-attrcpy="{{translate('Copied')}}" onclick="copyToClipboard('url')" >{{translate('Copy Url')}}</button>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
<!-- Affiliate Stats -->
<div class="card rounded-0 shadow-none border mb-3">
<form class="" id="sort_blogs" action="" method="GET">
<div class="card-header border-bottom-0 row pt-4">
<div class="col text-center text-md-left">
<h5 class="mb-md-0 fs-18 fw-700 text-dark">{{translate('Affiliate Status')}}</h5>
</div>
<div class="col-md-5 col-xl-4">
<div class="input-group mb-0">
<select class="form-control aiz-selectpicker" name="type" data-live-search="true">
<option value="">Choose</option>
<option value="Today" @if($type == 'Today') selected @endif>Today</option>
<option value="7" @if($type == '7') selected @endif>Last 7 Days</option>
<option value="30" @if($type == '30') selected @endif>Last 30 Days</option>
</select>
<button class="btn btn-primary rounded-0 input-group-append" type="submit">{{ translate('Filter') }}</button>
</div>
</div>
</div>
</form>
<div class="card-body">
<div class="row gutters-16">
<!-- No. of Click -->
<div class="col-md-3 mx-auto mb-3">
<a href="#">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light">
<span class="fs-30 fw-700 text-dark mb-3">
@if($affliate_stats->count_click)
{{ $affliate_stats->count_click }}
@else
0
@endif
</span>
<div class="fs-14 fw-700 text-dark">{{ translate('No. of Click') }}</div>
</div>
</a>
</div>
<!-- No. of Item -->
<div class="col-md-3 mx-auto mb-3" >
<a href="#">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light">
<span class="fs-30 fw-700 text-dark">
@if($affliate_stats->count_item)
{{ $affliate_stats->count_item }}
@else
0
@endif
</span>
<div class="fs-14 fw-700 text-dark">{{ translate('No. of Item') }}</div>
</div>
</a>
</div>
<!-- No. of Deliverd -->
<div class="col-md-3 mx-auto mb-3" >
<a href="#">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light">
<span class="fs-30 fw-700 text-dark">
@if($affliate_stats->count_delivered)
{{ $affliate_stats->count_delivered }}
@else
0
@endif
</span>
<div class="fs-14 fw-700 text-dark">{{ translate('No. of Deliverd') }}</div>
</div>
</a>
</div>
<!-- No. of Cancel -->
<div class="col-md-3 mx-auto mb-3" >
<a href="#">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light">
<span class="fs-30 fw-700 text-dark">
@if($affliate_stats->count_cancel)
{{ $affliate_stats->count_cancel }}
@else
0
@endif
</span>
<div class="fs-14 fw-700 text-dark">{{ translate('No. of Cancel') }}</div>
</div>
</a>
</div>
</div>
</div>
</div>
<br>
<!-- Affiliate Earning History -->
<div class="card rounded-0 shadow-none border">
<div class="card-header border-bottom-0">
<h5 class="mb-0 fs-18 fw-700 text-dark mt-4">{{translate('Affiliate Earning History')}}</h5>
</div>
<div class="card-body pt-0">
<table class="table aiz-table mb-0">
<thead class="text-gray fs-12">
<tr>
<th class="pl-0">#</th>
<th>{{ translate('Referral User')}}</th>
<th>{{ translate('Amount')}}</th>
<th data-breakpoints="lg">{{ translate('Order Id')}}</th>
<th data-breakpoints="lg">{{ translate('Referral Type') }}</th>
<th data-breakpoints="lg">{{ translate('Product') }}</th>
<th data-breakpoints="lg" class="text-right pr-0">{{ translate('Date') }}</th>
</tr>
</thead>
<tbody class="fs-14">
@foreach($affiliate_logs as $key => $affiliate_log)
<tr>
<td class="pl-0" style="vertical-align: middle;">{{ sprintf('%02d', ($key+1) + ($affiliate_logs->currentPage() - 1)*$affiliate_logs->perPage()) }}</td>
<td class="fw-700" style="vertical-align: middle;">
@if($affiliate_log->user_id !== null)
{{ $affiliate_log->user->name }}
@else
{{ translate('Guest').' ('. $affiliate_log->guest_id.')' }}
@endif
</td>
<td class="fw-700" style="vertical-align: middle;">{{ single_price($affiliate_log->amount) }}</td>
<td class="fw-700 text-primary" style="vertical-align: middle;">
@if($affiliate_log->order_id != null)
{{ $affiliate_log->order->code }}
@else
{{ $affiliate_log->order_detail->order->code }}
@endif
</td>
<td style="vertical-align: middle;"> {{ ucwords(str_replace('_',' ', $affiliate_log->affiliate_type)) }}</td>
<td class="fw-700" style="vertical-align: middle;">
@if($affiliate_log->order_detail_id != null)
@php
$url = $affiliate_log->order_detail->product->auction_product == 1 ? route('auction-product', $affiliate_log->order_detail->product->slug) : route('product', $affiliate_log->order_detail->product->slug)
@endphp
<a href="{{ $url }}" target="_blank"
title="{{ $affiliate_log->order_detail->product->name }}" class="text-reset text-truncate hov-text-primary">
{{ $affiliate_log->order_detail->product->name }}
</a>
@endif
</td>
<td class="text-right pr-0" style="vertical-align: middle;">{{ $affiliate_log->created_at->format('d-m-Y') }} </td>
</tr>
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $affiliate_logs->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('modal')
<!-- Affiliate Withdraw Modal -->
<div class="modal fade" id="affiliate_withdraw_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{ translate('Affiliate Withdraw Request') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
</div>
<form class="" action="{{ route('affiliate.withdraw_request.store') }}" method="post">
@csrf
<div class="modal-body gry-bg px-3 pt-3">
<div class="row">
<div class="col-md-3">
<label>{{ translate('Amount')}} <span class="text-danger">*</span></label>
</div>
<div class="col-md-9">
<input type="number" class="form-control mb-3 rounded-0" name="amount" min="1" max="{{ Auth::user()->affiliate_user->balance }}" placeholder="{{ translate('Amount')}}" required>
</div>
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-sm btn-primary rounded-0 transition-3d-hover mr-1">{{translate('Confirm')}}</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('script')
<script>
function copyToClipboard(btn){
// var el_code = document.getElementById('referral_code');
var el_url = document.getElementById('referral_code_url');
// var c_b = document.getElementById('ref-cp-btn');
var c_u_b = document.getElementById('ref-cpurl-btn');
// if(btn == 'code'){
// if(el_code != null && c_b != null){
// el_code.select();
// document.execCommand('copy');
// c_b .innerHTML = c_b.dataset.attrcpy;
// }
// }
if(btn == 'url'){
if(el_url != null && c_u_b != null){
el_url.select();
document.execCommand('copy');
c_u_b .innerHTML = c_u_b.dataset.attrcpy;
}
}
}
function show_affiliate_withdraw_modal(){
$('#affiliate_withdraw_modal').modal('show');
}
</script>
@endsection

View File

@@ -0,0 +1,140 @@
@extends('frontend.layouts.app')
@section('content')
<section class="py-5">
<div class="container">
<div class="d-flex align-items-start">
@include('frontend.inc.user_side_nav')
<div class="aiz-user-panel">
<div class="aiz-titlebar mb-4">
<div class="row align-items-center">
<div class="col-md-6">
<h1 class="fs-20 fw-700 text-dark">{{ translate('Affiliate') }}</h1>
</div>
</div>
</div>
<div class="row gutters-16 mb-2">
<!-- Affiliate Balance -->
<div class="col-md-6 mx-auto mb-4" >
<div class="bg-dark text-white overflow-hidden text-center p-4 h-100">
<svg xmlns="http://www.w3.org/2000/svg" width="17.402" height="32" viewBox="0 0 17.402 32">
<path id="Path_32606" data-name="Path 32606" d="M14.888-4.338a4.994,4.994,0,0,0-2.021-1.9,6.687,6.687,0,0,0-3.175-.7,5.029,5.029,0,0,0-3.258.969,3.108,3.108,0,0,0-1.2,2.536q0,2.515,3.34,3.175l3.052.577a13.933,13.933,0,0,1,2.8.825,7.913,7.913,0,0,1,2.227,1.381,5.876,5.876,0,0,1,1.485,2.082A7.211,7.211,0,0,1,18.682,7.5a6.445,6.445,0,0,1-.536,2.7,6.111,6.111,0,0,1-1.505,2.041A7.129,7.129,0,0,1,14.332,13.6a11.987,11.987,0,0,1-2.907.66v2.474a1.62,1.62,0,0,1-.371,1.093,1.334,1.334,0,0,1-1.072.433,1.334,1.334,0,0,1-1.072-.433,1.62,1.62,0,0,1-.371-1.093V14.219A9.33,9.33,0,0,1,5.61,13.5a9.09,9.09,0,0,1-2.082-1.258,6.581,6.581,0,0,1-1.34-1.464,6.227,6.227,0,0,1-.7-1.381,2.691,2.691,0,0,1-.206-.948A1.548,1.548,0,0,1,1.734,7.27a1.6,1.6,0,0,1,1.155-.433,1.3,1.3,0,0,1,.928.33,3.373,3.373,0,0,1,.639.866,13.046,13.046,0,0,0,.763,1.175A4.954,4.954,0,0,0,6.332,10.3a5.722,5.722,0,0,0,1.67.8,7.922,7.922,0,0,0,2.351.309,4.989,4.989,0,0,0,3.629-1.175,3.727,3.727,0,0,0,1.2-2.742,3.53,3.53,0,0,0-1.052-2.763,6.445,6.445,0,0,0-3.072-1.361L7.837,2.755A8.572,8.572,0,0,1,3.115.507a5.631,5.631,0,0,1-1.381-3.9A5.738,5.738,0,0,1,3.589-7.843,8.258,8.258,0,0,1,8.538-9.822v-2.433a1.45,1.45,0,0,1,.412-1.072,1.45,1.45,0,0,1,1.072-.412,1.316,1.316,0,0,1,1.031.412,1.542,1.542,0,0,1,.371,1.072v2.474a9.785,9.785,0,0,1,2.412.66,9.885,9.885,0,0,1,1.856,1.031,6.7,6.7,0,0,1,1.32,1.216,6.849,6.849,0,0,1,.8,1.216A2.018,2.018,0,0,1,18.1-4.627,1.4,1.4,0,0,1,17.692-3.6a1.5,1.5,0,0,1-1.113.412,1.5,1.5,0,0,1-.99-.309A3.423,3.423,0,0,1,14.888-4.338Z" transform="translate(-1.28 13.74)" fill="#fff"/>
</svg>
<div class="py-2 mt-2">
<div class="fs-14 fw-400 text-center">{{ translate('Affiliate Balance') }}</div>
<div class="fs-30 fw-700 text-center">{{ single_price(Auth::user()->affiliate_user->balance) }}</div>
</div>
</div>
</div>
<!-- Affiliate Withdraw Request -->
<div class="col-md-6 mx-auto mb-4">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light" onclick="show_affiliate_withdraw_modal()">
<span class="size-60px rounded-circle mx-auto bg-dark d-flex align-items-center justify-content-center mb-3">
<i class="las la-plus la-3x text-white"></i>
</span>
<div class="fs-14 fw-600 text-dark">{{ translate('Affiliate Withdraw Request') }}</div>
</div>
</div>
</div>
<!-- Affiliate payment history -->
<div class="card rounded-0 shadow-none border">
<div class="card-header border-bottom-0">
<h5 class="mb-0 fs-20 fw-700 text-dark">{{ translate('Affiliate payment history')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead class="text-gray fs-12">
<tr>
<th class="pl-0">#</th>
<th>{{ translate('Date') }}</th>
<th>{{translate('Amount')}}</th>
<th class="pr-0">{{translate('Payment Method')}}</th>
</tr>
</thead>
<tbody class="fs-14">
@foreach ($affiliate_payments as $key => $affiliate_payment)
<tr>
<td class="pl-0">{{ sprintf('%02d', $key+1) }}</td>
<td>{{ date('d-m-Y', strtotime($affiliate_payment->created_at)) }}</td>
<td>{{ single_price($affiliate_payment->amount) }}</td>
<td class="pr-0">{{ ucfirst(str_replace('_', ' ', $affiliate_payment ->payment_method)) }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $affiliate_payments->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('modal')
<!-- Affiliate Withdraw Modal -->
<div class="modal fade" id="affiliate_withdraw_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{ translate('Affiliate Withdraw Request') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
</div>
<form class="" action="{{ route('affiliate.withdraw_request.store') }}" method="post">
@csrf
<div class="modal-body gry-bg px-3 pt-3">
<div class="row">
<div class="col-md-3">
<label>{{ translate('Amount')}} <span class="text-danger">*</span></label>
</div>
<div class="col-md-9">
<input type="number" class="form-control mb-3 rounded-0" name="amount" min="1" max="{{ Auth::user()->affiliate_user->balance }}" placeholder="{{ translate('Amount')}}" required>
</div>
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-sm btn-primary rounded-0 transition-3d-hover mr-1">{{translate('Confirm')}}</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('script')
<script>
function copyToClipboard(btn){
// var el_code = document.getElementById('referral_code');
var el_url = document.getElementById('referral_code_url');
// var c_b = document.getElementById('ref-cp-btn');
var c_u_b = document.getElementById('ref-cpurl-btn');
// if(btn == 'code'){
// if(el_code != null && c_b != null){
// el_code.select();
// document.execCommand('copy');
// c_b .innerHTML = c_b.dataset.attrcpy;
// }
// }
if(btn == 'url'){
if(el_url != null && c_u_b != null){
el_url.select();
document.execCommand('copy');
c_u_b .innerHTML = c_u_b.dataset.attrcpy;
}
}
}
function show_affiliate_withdraw_modal(){
$('#affiliate_withdraw_modal').modal('show');
}
</script>
@endsection

View File

@@ -0,0 +1,47 @@
@extends('frontend.layouts.app')
@section('content')
<section class="py-5">
<div class="container">
<div class="d-flex align-items-start">
@include('frontend.inc.user_side_nav')
<div class="aiz-user-panel">
<div class="aiz-titlebar mb-4">
<div class="row align-items-center">
<div class="col-md-6">
<h1 class="fs-20 fw-700 text-dark">{{ translate('Affiliate') }}</h1>
</div>
</div>
</div>
<div class="card rounded-0 shadow-none border">
<div class="card-header border-bottom-0">
<h5 class="mb-0 fs-18 fw-700 text-dark">{{ translate('Payment Settings')}}</h5>
</div>
<div class="card-body">
<form action="{{ route('affiliate.payment_settings_store') }}" method="POST">
@csrf
<div class="form-group row">
<label class="col-md-2 col-form-label">{{translate('Paypal Email')}}</label>
<div class="col-md-10">
<input type="email" class="form-control rounded-0" placeholder="{{ translate('Paypal Email')}}" name="paypal_email" value="{{ $affiliate_user->paypal_email }}">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">{{translate('Bank Informations')}}</label>
<div class="col-md-10">
<input type="text" class="form-control rounded-0" placeholder="{{ translate('Acc. No, Bank Name etc')}}" name="bank_information" value="{{ $affiliate_user->bank_information }}">
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-primary rounded-0">{{translate('Update Payment Settings')}}</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection

View File

@@ -0,0 +1,125 @@
@extends('frontend.layouts.app')
@section('content')
<section class="py-5">
<div class="container">
<div class="d-flex align-items-start">
@include('frontend.inc.user_side_nav')
<div class="aiz-user-panel">
<div class="aiz-titlebar mb-4">
<div class="row align-items-center">
<div class="col-md-6">
<h1 class="fs-20 fw-700 text-dark">{{ translate('Affiliate') }}</h1>
</div>
</div>
</div>
<div class="row gutters-16 mb-2">
<!-- Affiliate Balance -->
<div class="col-md-6 mx-auto mb-4" >
<div class="bg-dark text-white overflow-hidden text-center p-4 h-100">
<svg xmlns="http://www.w3.org/2000/svg" width="17.402" height="32" viewBox="0 0 17.402 32">
<path id="Path_32606" data-name="Path 32606" d="M14.888-4.338a4.994,4.994,0,0,0-2.021-1.9,6.687,6.687,0,0,0-3.175-.7,5.029,5.029,0,0,0-3.258.969,3.108,3.108,0,0,0-1.2,2.536q0,2.515,3.34,3.175l3.052.577a13.933,13.933,0,0,1,2.8.825,7.913,7.913,0,0,1,2.227,1.381,5.876,5.876,0,0,1,1.485,2.082A7.211,7.211,0,0,1,18.682,7.5a6.445,6.445,0,0,1-.536,2.7,6.111,6.111,0,0,1-1.505,2.041A7.129,7.129,0,0,1,14.332,13.6a11.987,11.987,0,0,1-2.907.66v2.474a1.62,1.62,0,0,1-.371,1.093,1.334,1.334,0,0,1-1.072.433,1.334,1.334,0,0,1-1.072-.433,1.62,1.62,0,0,1-.371-1.093V14.219A9.33,9.33,0,0,1,5.61,13.5a9.09,9.09,0,0,1-2.082-1.258,6.581,6.581,0,0,1-1.34-1.464,6.227,6.227,0,0,1-.7-1.381,2.691,2.691,0,0,1-.206-.948A1.548,1.548,0,0,1,1.734,7.27a1.6,1.6,0,0,1,1.155-.433,1.3,1.3,0,0,1,.928.33,3.373,3.373,0,0,1,.639.866,13.046,13.046,0,0,0,.763,1.175A4.954,4.954,0,0,0,6.332,10.3a5.722,5.722,0,0,0,1.67.8,7.922,7.922,0,0,0,2.351.309,4.989,4.989,0,0,0,3.629-1.175,3.727,3.727,0,0,0,1.2-2.742,3.53,3.53,0,0,0-1.052-2.763,6.445,6.445,0,0,0-3.072-1.361L7.837,2.755A8.572,8.572,0,0,1,3.115.507a5.631,5.631,0,0,1-1.381-3.9A5.738,5.738,0,0,1,3.589-7.843,8.258,8.258,0,0,1,8.538-9.822v-2.433a1.45,1.45,0,0,1,.412-1.072,1.45,1.45,0,0,1,1.072-.412,1.316,1.316,0,0,1,1.031.412,1.542,1.542,0,0,1,.371,1.072v2.474a9.785,9.785,0,0,1,2.412.66,9.885,9.885,0,0,1,1.856,1.031,6.7,6.7,0,0,1,1.32,1.216,6.849,6.849,0,0,1,.8,1.216A2.018,2.018,0,0,1,18.1-4.627,1.4,1.4,0,0,1,17.692-3.6a1.5,1.5,0,0,1-1.113.412,1.5,1.5,0,0,1-.99-.309A3.423,3.423,0,0,1,14.888-4.338Z" transform="translate(-1.28 13.74)" fill="#fff"/>
</svg>
<div class="py-2 mt-2">
<div class="fs-14 fw-400 text-center">{{ translate('Affiliate Balance') }}</div>
<div class="fs-30 fw-700 text-center">{{ single_price(Auth::user()->affiliate_user->balance) }}</div>
</div>
</div>
</div>
<!-- Affiliate Withdraw Request -->
<div class="col-md-6 mx-auto mb-4">
<div class="p-4 mb-3 c-pointer text-center bg-light has-transition border h-100 hov-bg-soft-light" onclick="show_affiliate_withdraw_modal()">
<span class="size-60px rounded-circle mx-auto bg-dark d-flex align-items-center justify-content-center mb-3">
<i class="las la-plus la-3x text-white"></i>
</span>
<div class="fs-14 fw-600 text-dark">{{ translate('Affiliate Withdraw Request') }}</div>
</div>
</div>
</div>
<!-- Affiliate withdraw request history -->
<div class="card rounded-0 shadow-none border">
<div class="card-header border-bottom-0">
<h5 class="mb-0 fs-20 fw-700 text-dark">{{ translate('Affiliate withdraw request history')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead class="text-gray fs-12">
<tr>
<th class="pl-0">#</th>
<th>{{ translate('Date') }}</th>
<th>{{ translate('Amount')}}</th>
<th data-breakpoints="lg">{{ translate('Status')}}</th>
</tr>
</thead>
<tbody class="fs-14">
@foreach ($affiliate_withdraw_requests as $key => $affiliate_withdraw_request)
<tr>
<td class="pl-0">{{ sprintf('%02d', $key+1) }}</td>
<td>{{ date('d-m-Y', strtotime($affiliate_withdraw_request->created_at)) }}</td>
<td class="fw-700">{{ single_price($affiliate_withdraw_request->amount) }}</td>
<td>
@if($affiliate_withdraw_request->status == 1)
<span class="badge badge-inline badge-success p-3 fs-12" style="border-radius: 25px; min-width: 80px !important;">{{translate('Approved')}}</span>
@elseif($affiliate_withdraw_request->status == 2)
<span class="badge badge-inline badge-danger p-3 fs-12" style="border-radius: 25px; min-width: 80px !important;">{{translate('Rejected')}}</span>
@else
<span class="badge badge-inline badge-info p-3 fs-12" style="border-radius: 25px; min-width: 80px !important;">{{translate('Pending')}}</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $affiliate_withdraw_requests->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('modal')
<!-- Affiliate Withdraw Modal -->
<div class="modal fade" id="affiliate_withdraw_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{ translate('Affiliate Withdraw Request') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
</div>
<form class="" action="{{ route('affiliate.withdraw_request.store') }}" method="post">
@csrf
<div class="modal-body gry-bg px-3 pt-3">
<div class="row">
<div class="col-md-3">
<label>{{ translate('Amount')}} <span class="text-danger">*</span></label>
</div>
<div class="col-md-9">
<input type="number" class="form-control mb-3 rounded-0" name="amount" min="1" max="{{ Auth::user()->affiliate_user->balance }}" placeholder="{{ translate('Amount')}}" required>
</div>
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-sm btn-primary rounded-0 transition-3d-hover mr-1">{{translate('Confirm')}}</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('script')
<script>
function show_affiliate_withdraw_modal(){
$('#affiliate_withdraw_modal').modal('show');
}
</script>
@endsection

View File

@@ -0,0 +1,236 @@
@extends('backend.layouts.app')
@section('content')
<div class="row">
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h6 class="mb-0 h6">{{ translate('Basic Affiliate')}}</h6>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('affiliate.store') }}" method="POST">
@csrf
<div class="form-group row">
<input type="hidden" name="type" value="user_registration_first_purchase">
<div class="col-lg-4">
<label class="control-label">{{ translate('User Registration & First Purchase')}}</label>
</div>
<div class="col-lg-6">
@php
if(\App\Models\AffiliateOption::where('type', 'user_registration_first_purchase')->first() != null){
$percentage = \App\Models\AffiliateOption::where('type', 'user_registration_first_purchase')->first()->percentage;
$status = \App\Models\AffiliateOption::where('type', 'user_registration_first_purchase')->first()->status;
}
else {
$percentage = null;
}
@endphp
<input type="number" min="0" step="0.01" max="100" class="form-control" name="percentage" value="{{ $percentage }}" placeholder="Percentage of Order Amount" required>
</div>
<div class="col-lg-2">
<label class="control-label">%</label>
</div>
</div>
<div class="form-group row">
<div class="col-lg-4">
<label class="control-label">{{ translate('Status')}}</label>
</div>
<div class="col-lg-8">
<label class="aiz-switch aiz-switch-success mb-0">
<input value="1" name="status" type="checkbox" @if ($status)
checked
@endif>
<span class="slider round"></span>
</label>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{translate('Save')}}</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h3 class="mb-0 h6">{{ translate('Product Sharing Affiliate')}}</h3>
</div>
<div class="card-body">
<form action="{{ route('affiliate.store') }}" method="POST">
@csrf
<div class="form-group row">
<input type="hidden" name="type" value="product_sharing">
<label class="col-lg-3 col-from-label">{{ translate('Product Sharing and Purchasing')}}</label>
<div class="col-lg-6">
@php
if(\App\Models\AffiliateOption::where('type', 'product_sharing')->first() != null && \App\Models\AffiliateOption::where('type', 'product_sharing')->first()->details != null){
$commission_product_sharing = json_decode(\App\Models\AffiliateOption::where('type', 'product_sharing')->first()->details)->commission;
$commission_type_product_sharing = json_decode(\App\Models\AffiliateOption::where('type', 'product_sharing')->first()->details)->commission_type;
$status = \App\Models\AffiliateOption::where('type', 'product_sharing')->first()->status;
}
else {
$commission_product_sharing = null;
$commission_type_product_sharing = null;
}
@endphp
<input type="number" min="0" step="0.01" max="100" class="form-control" name="amount" value="{{ $commission_product_sharing }}" placeholder="Percentage of Order Amount" required>
</div>
<div class="col-md-3">
<select class="form-control aiz-selectpicker" name="amount_type">
<option value="amount" @if ($commission_type_product_sharing == "amount") selected @endif>$</option>
<option value="percent" @if ($commission_type_product_sharing == "percent") selected @endif>%</option>
</select>
</div>
</div>
<div class="form-group row">
<div class="col-lg-4">
<label class="control-label">{{ translate('Status')}}</label>
</div>
<div class="col-lg-8">
<label class="aiz-switch aiz-switch-success mb-0">
<input value="1" name="status" type="checkbox" @if ($status) checked @endif>
<span class="slider round"></span>
</label>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{translate('Save')}}</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h3 class="mb-0 h6">{{ translate('Product Sharing Affiliate (Category Wise)')}}</h3>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('affiliate.store') }}" method="POST">
@csrf
@php
if(\App\Models\AffiliateOption::where('type', 'category_wise_affiliate')->first() != null){
$category_wise_affiliate_status = \App\Models\AffiliateOption::where('type', 'category_wise_affiliate')->first()->status;
}
@endphp
<div class="form-group row">
<div class="col-lg-4">
<label class="control-label">{{ translate('Status')}}</label>
</div>
<div class="col-lg-8">
<label class="aiz-switch aiz-switch-success mb-0">
<input value="1" name="status" type="checkbox" @if ($category_wise_affiliate_status) checked @endif>
<span class="slider round"></span>
</label>
</div>
</div>
@if (\App\Models\AffiliateOption::where('type', 'category_wise_affiliate')->first() != null)
<input type="hidden" name="type" value="category_wise_affiliate">
@foreach (\App\Models\Category::all() as $key => $category)
@php
$found = false;
@endphp
@if(\App\Models\AffiliateOption::where('type', 'category_wise_affiliate')->first()->details != null)
@foreach (json_decode(\App\Models\AffiliateOption::where('type', 'category_wise_affiliate')->first()->details) as $key => $data)
@if($data->category_id == $category->id)
@php
$found = true;
$value = $data;
@endphp
@endif
@endforeach
@endif
@if ($found)
<div class="form-group row">
<div class="col-lg-5">
<input type="hidden" name="categories_id_{{ $value->category_id }}" value="{{ $value->category_id }}">
<input type="text" class="form-control" value="{{ \App\Models\Category::find($value->category_id)->name }}" readonly>
</div>
<div class="col-lg-4">
<input type="number" min="0" step="0.01" class="form-control" name="commison_amounts_{{ $value->category_id }}" value="{{ $value->commission }}">
</div>
<div class="col-md-3">
<select class="form-control aiz-selectpicker" name="commison_types_{{ $value->category_id }}">
<option value="amount" @if($value->commission_type == 'amount') selected @endif>$</option>
<option value="percent" @if($value->commission_type == 'percent') selected @endif>%</option>
</select>
</div>
</div>
@else
<div class="form-group row">
<div class="col-lg-5">
<input type="hidden" name="categories_id_{{ $category->id }}" value="{{ $category->id }}">
<input type="text" class="form-control" value="{{ $category->getTranslation('name') }}" readonly>
</div>
<div class="col-lg-4">
<input type="number" min="0" step="0.01" class="form-control" name="commison_amounts_{{ $category->id }}" value="0">
</div>
<div class="col-md-3">
<select class="form-control aiz-selectpicker" name="commison_types_{{ $category->id }}">
<option value="amount">$</option>
<option value="percent">%</option>
</select>
</div>
</div>
@endif
@endforeach
@endif
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{translate('Save')}}</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card bg-gray-light">
<div class="card-header">
<h5 class="mb-0 h6">
<i>{{ translate('N:B: You can not enable Single Product Sharing Affiliate and Category Wise Affiliate at a time.') }}</i>
</h5>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card bg-gray-light">
<div class="card-header">
<h3 class="mb-0 h6">{{ translate('Affiliate Link Validatin Time (Days)')}}</h3>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('affiliate.configs.store') }}" method="POST">
@csrf
@php
$validation_time_info = \App\Models\AffiliateConfig::where('type', 'validation_time')->first();
$validation_time = '';
if($validation_time_info) {
$validation_time = $validation_time_info->value;
}
@endphp
<div class="form-group row">
<div class="col-lg-4">
<input type="hidden" class="form-control" name="type" value="validation_time">
<label class="control-label">{{ translate('Validation Time')}}</label>
</div>
<div class="col-lg-8">
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="No of Days" name="validation_time" value="{{$validation_time}}">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Days</span>
</div>
</div>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{translate('Save')}}</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,35 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Affiliate payments of ').$affiliate_user->user->name }}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead>
<tr>
<th>#</th>
<th>{{ translate('Date')}}</th>
<th>{{ translate('Amount')}}</th>
<th>{{ translate('Payment Method') }}</th>
</tr>
</thead>
<tbody>
@foreach($affiliate_payments as $key => $payment)
<tr>
<td>{{ $key+1 }}</td>
<td>{{ $payment->created_at }}</td>
<td>
{{ single_price($payment->amount) }}
</td>
<td>{{ ucfirst($payment->payment_method) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection

View File

@@ -0,0 +1,55 @@
<form action="{{ route('affiliate_user.payment_store') }}" method="POST">
@csrf
<div class="modal-header">
<h5 class="modal-title h6">{{ translate('Affiliate Payment')}}</h5>
<button type="button" class="close" data-dismiss="modal">
</button>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered" >
<tbody>
<tr>
@if($affiliate_user->balance >= 0)
<td>{{ translate('Due Amount') }}</td>
<td><strong>{{ single_price($affiliate_user->balance) }}</strong></td>
@endif
</tr>
<tr>
<td>{{ translate('Paypal Email') }}</td>
<td>{{ $affiliate_user->paypal_email }}</td>
</tr>
<tr>
<td>{{ translate('Bank Information') }}</td>
<td>{{ $affiliate_user->bank_information }}</td>
</tr>
</tbody>
</table>
@if ($affiliate_user->balance > 0)
<input type="hidden" name="affiliate_user_id" value="{{ $affiliate_user->id }}">
<div class="form-group row">
<label class="col-sm-3 col-from-label" for="amount">{{ translate('Amount')}}</label>
<div class="col-sm-9">
<input type="number" min="0" step="0.01" name="amount" id="amount" value="{{ $affiliate_user->balance }}" class="form-control" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-from-label" for="payment_method">{{ translate('Payment Method')}}</label>
<div class="col-sm-9">
<select name="payment_method" id="payment_method" class="form-control aiz-selectpicker" required>
<option value="">{{ translate('Select Payment Method')}}</option>
<option value="Paypal">{{ translate('Paypal')}}</option>
<option value="Bank">{{ translate('Bank')}}</option>
</select>
</div>
</div>
@endif
</div>
<div class="modal-footer">
@if ($affiliate_user->balance > 0)
<button class="btn btn-sm btn-primary" type="submit">{{ translate('Pay')}}</button>
@endif
<button type="button" class="btn btn-sm btn-light" data-dismiss="modal">{{translate('Cancel')}}</button>
</div>
</form>

View File

@@ -0,0 +1,43 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Refferal Users')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead>
<tr>
<th>#</th>
<th>{{ translate('Name')}}</th>
<th data-breakpoints="lg">{{ translate('Phone')}}</th>
<th data-breakpoints="lg">{{ translate('Email Address')}}</th>
<th data-breakpoints="lg">{{ translate('Reffered By')}}</th>
</tr>
</thead>
<tbody>
@foreach($refferal_users as $key => $refferal_user)
@if ($refferal_user != null)
<tr>
<td>{{ ($key+1) + ($refferal_users->currentPage() - 1)*$refferal_users->perPage() }}</td>
<td>{{$refferal_user->name}}</td>
<td>{{$refferal_user->phone}}</td>
<td>{{$refferal_user->email}}</td>
<td>
@if (\App\Models\User::find($refferal_user->referred_by) != null)
{{ \App\Models\User::find($refferal_user->referred_by)->name }} ({{ \App\Models\User::find($refferal_user->referred_by)->email }})
@endif
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $refferal_users->appends(request()->input())->links() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,59 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Affiliate User Verification')}}</h5>
</div>
<div class="card-body row">
<div class="col-md-4">
<h6 class="mb-4">{{ translate('User Info') }}</h6>
<p class="text-muted">
<strong>{{ translate('Name') }} :</strong>
<span class="ml-2">{{ $affiliate_user->user->name }}</span>
</p>
<p class="text-muted">
<strong>{{translate('Email')}}</strong>
<span class="ml-2">{{ $affiliate_user->user->email }}</span>
</p>
<p class="text-muted">
<strong>{{translate('Address')}}</strong>
<span class="ml-2">{{ $affiliate_user->user->address }}</span>
</p>
<p class="text-muted">
<strong>{{translate('Phone')}}</strong>
<span class="ml-2">{{ $affiliate_user->user->phone }}</span>
</p>
</div>
<div class="col-md-6">
<h6 class="mb-4">{{ translate('Verification Info') }}</h6>
<table class="table table-striped table-bordered" cellspacing="0" width="100%">
<tbody>
@foreach (json_decode($affiliate_user->informations) as $key => $info)
<tr>
<th class="text-muted">{{ $info->label }}</th>
@if ($info->type == 'text' || $info->type == 'select' || $info->type == 'radio')
<td>{{ $info->value }}</td>
@elseif ($info->type == 'multi_select')
<td>
{{ implode(json_decode($info->value), ', ') }}
</td>
@elseif ($info->type == 'file')
<td>
<a href="{{ static_asset($info->value) }}" target="_blank" class="btn-info">{{ translate('Click here')}}</a>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
<div class="text-center">
<a href="{{ route('affiliate_user.reject', $affiliate_user->id) }}" class="btn btn-sm btn-default d-innline-block">{{ translate('Reject')}}</a></li>
<a href="{{ route('affiliate_user.approve', $affiliate_user->id) }}" class="btn btn-sm btn-dark d-innline-block">{{ translate('Accept')}}</a>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,113 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Affiliate Users')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table">
<thead>
<tr>
<th>#</th>
<th>{{ translate('Name')}}</th>
<th data-breakpoints="lg">{{ translate('Phone')}}</th>
<th data-breakpoints="lg">{{ translate('Email Address')}}</th>
<th data-breakpoints="lg">{{ translate('Verification Info')}}</th>
<th>{{ translate('Approval')}}</th>
<th data-breakpoints="lg">{{ translate('Due Amount') }}</th>
<th width="10%" class="text-right">{{ translate('Options')}}</th>
</tr>
</thead>
<tbody>
@foreach($affiliate_users as $key => $affiliate_user)
@if($affiliate_user->user != null)
<tr>
<td>{{ ($key+1) + ($affiliate_users->currentPage() - 1)*$affiliate_users->perPage() }}</td>
<td>{{$affiliate_user->user->name}}</td>
<td>{{$affiliate_user->user->phone}}</td>
<td>{{$affiliate_user->user->email}}</td>
<td>
@if ($affiliate_user->informations != null)
<a href="{{ route('affiliate_users.show_verification_request', $affiliate_user->id) }}">
<span class="badge badge-inline badge-info">{{translate('Show')}}</span>
</a>
@endif
</td>
<td>
<label class="aiz-switch aiz-switch-success mb-0">
<input onchange="update_approved(this)" value="{{ $affiliate_user->id }}" type="checkbox" <?php if($affiliate_user->status == 1) echo "checked";?> >
<span class="slider round"></span>
</label>
</td>
<td>
@if ($affiliate_user->balance >= 0)
{{ single_price($affiliate_user->balance) }}
@endif
</td>
<td class="text-right">
@can('pay_to_affiliate_user')
<a href="#" class="btn btn-soft-primary btn-icon btn-circle btn-sm" onclick="show_payment_modal('{{$affiliate_user->id}}');" title="{{ translate('Pay Now') }}">
<i class="las la-money-bill"></i>
</a>
@endcan
@can('affiliate_users_payment_history')
<a class="btn btn-soft-success btn-icon btn-circle btn-sm" href="{{route('affiliate_user.payment_history', encrypt($affiliate_user->id))}}" title="{{ translate('Payment History') }}">
<i class="las la-history"></i>
</a>
@endcan
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $affiliate_users->appends(request()->input())->links() }}
</div>
</div>
</div>
@endsection
@section('modal')
@include('modals.delete_modal')
<div class="modal fade" id="payment_modal">
<div class="modal-dialog">
<div class="modal-content" id="modal-content">
</div>
</div>
</div>
@endsection
@section('script')
<script type="text/javascript">
function show_payment_modal(id){
$.post('{{ route('affiliate_user.payment_modal') }}',{_token:'{{ @csrf_token() }}', id:id}, function(data){
$('#payment_modal #modal-content').html(data);
$('#payment_modal').modal('show', {backdrop: 'static'});
AIZ.plugins.bootstrapSelect('refresh');
});
}
function update_approved(el){
if(el.checked){
var status = 1;
}
else{
var status = 0;
}
$.post('{{ route('affiliate_user.approved') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
if(data == 1){
AIZ.plugins.notify('success', '{{ translate('Approved sellers updated successfully') }}');
}
else{
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
}
});
}
</script>
@endsection