Actualizacion de Diseño Logins y Parte de Registro Negocios
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="col-lg-8 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Coupon Information Adding')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="form-horizontal" action="{{ route('coupon.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul class="mt-3">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label" for="name">{{translate('Coupon Type')}}</label>
|
||||
<div class="col-lg-9">
|
||||
<select name="type" id="coupon_type" class="form-control aiz-selectpicker" onchange="coupon_form()" required>
|
||||
<option value="">{{translate('Select One') }}</option>
|
||||
<option value="product_base" @if (old('type') == 'product_base') selected @endif>{{translate('For Products')}}</option>
|
||||
<option value="cart_base" @if (old('type') == 'cart_base') selected @endif>{{translate('For Total Orders')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="coupon_form">
|
||||
|
||||
</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">
|
||||
|
||||
function coupon_form(){
|
||||
var coupon_type = $('#coupon_type').val();
|
||||
$.post('{{ route('coupon.get_coupon_form') }}',{_token:'{{ csrf_token() }}', coupon_type:coupon_type}, function(data){
|
||||
$('#coupon_form').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
@if($errors->any())
|
||||
coupon_form();
|
||||
@endif
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,69 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="col-lg-8 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="mb-0 h6">{{translate('Coupon Information Update')}}</h3>
|
||||
</div>
|
||||
<form action="{{ route('coupon.update', $coupon->id) }}" method="POST">
|
||||
<input name="_method" type="hidden" value="PATCH">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" name="id" value="{{ $coupon->id }}" id="id">
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul class="mt-3">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label" for="name">{{translate('Coupon Type')}}</label>
|
||||
<div class="col-lg-9">
|
||||
<select name="type" id="coupon_type" class="form-control aiz-selectpicker" onchange="coupon_form()" required>
|
||||
@if ($coupon->type == "product_base"))
|
||||
<option value="product_base" selected>{{translate('For Products')}}</option>
|
||||
@elseif ($coupon->type == "cart_base")
|
||||
<option value="cart_base">{{translate('For Total Orders')}}</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="coupon_form">
|
||||
|
||||
</div>
|
||||
<div class="form-group mb-0 text-right">
|
||||
<button type="submit" class="btn btn-primary">{{translate('Save')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
@section('script')
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function coupon_form(){
|
||||
var coupon_type = $('#coupon_type').val();
|
||||
var id = $('#id').val();
|
||||
$.post('{{ route('coupon.get_coupon_form_edit') }}',{_token:'{{ csrf_token() }}', coupon_type:coupon_type, id:id}, function(data){
|
||||
$('#coupon_form').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
coupon_form();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,68 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6">
|
||||
<h1 class="h3">{{translate('All Coupons')}}</h1>
|
||||
</div>
|
||||
@can('add_coupon')
|
||||
<div class="col-md-6 text-md-right">
|
||||
<a href="{{ route('coupon.create') }}" class="btn btn-circle btn-info">
|
||||
<span>{{translate('Add New Coupon')}}</span>
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Coupon Information')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table aiz-table p-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-breakpoints="lg">#</th>
|
||||
<th>{{translate('Code')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('Type')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('Start Date')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('End Date')}}</th>
|
||||
<th width="10%">{{translate('Options')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($coupons as $key => $coupon)
|
||||
<tr>
|
||||
<td>{{$key+1}}</td>
|
||||
<td>{{$coupon->code}}</td>
|
||||
<td>
|
||||
{{ translate(Str::headline($coupon->type)) }}
|
||||
</td>
|
||||
<td>{{ date('d-m-Y', $coupon->start_date) }}</td>
|
||||
<td>{{ date('d-m-Y', $coupon->end_date) }}</td>
|
||||
<td class="text-right">
|
||||
@can('edit_coupon')
|
||||
<a class="btn btn-soft-primary btn-icon btn-circle btn-sm" href="{{route('coupon.edit', encrypt($coupon->id) )}}" title="{{ translate('Edit') }}">
|
||||
<i class="las la-edit"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('delete_coupon')
|
||||
<a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('coupon.destroy', $coupon->id)}}" title="{{ translate('Delete') }}">
|
||||
<i class="las la-trash"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('modal')
|
||||
@include('modals.delete_modal')
|
||||
@endsection
|
||||
@@ -0,0 +1,106 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deal Information')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('flash_deals.store') }}" method="POST">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label" for="name">{{translate('Title')}}</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" placeholder="{{translate('Title')}}" id="name" name="title" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label" for="background_color">{{translate('Background Color')}} <small>({{ translate('Hexa-code') }})</small></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" placeholder="{{translate('#FFFFFF')}}" id="background_color" name="background_color" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 control-label" for="name">{{translate('Text Color')}}</label>
|
||||
<div class="col-lg-9">
|
||||
<select name="text_color" id="text_color" class="form-control aiz-selectpicker" required>
|
||||
<option value="">{{translate('Select One')}}</option>
|
||||
<option value="white">{{translate('White')}}</option>
|
||||
<option value="dark">{{translate('Dark')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Banner')}}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="banner" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
<span class="small text-muted">{{ translate('This image is shown as cover banner in flash deal details page.') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label" for="start_date">{{translate('Date')}}</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control aiz-date-range" name="date_range" placeholder="{{ translate('Select Date') }}" data-time-picker="true" data-format="DD-MM-Y HH:mm:ss" data-separator=" to " autocomplete="off" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-3">
|
||||
<label class="col-sm-3 control-label" for="products">{{translate('Products')}}</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="products[]" id="products" class="form-control aiz-selectpicker" multiple required data-placeholder="{{ translate('Choose Products') }}" data-live-search="true" data-selected-text-format="count">
|
||||
@foreach(\App\Models\Product::where('published', 1)->where('approved', 1)->orderBy('created_at', 'desc')->get() as $product)
|
||||
<option value="{{$product->id}}">{{ $product->getTranslation('name') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
{{ translate('If any product has discount or exists in another flash deal, the discount will be replaced by this discount & time limit.') }}
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div class="form-group" id="discount_table">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0 text-right">
|
||||
<button type="submit" class="btn btn-primary">{{translate('Save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('#products').on('change', function(){
|
||||
var product_ids = $('#products').val();
|
||||
if(product_ids.length > 0){
|
||||
$.post('{{ route('flash_deals.product_discount') }}', {_token:'{{ csrf_token() }}', product_ids:product_ids}, function(data){
|
||||
$('#discount_table').html(data);
|
||||
AIZ.plugins.fooTable();
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('#discount_table').html(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,135 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deal Information')}}</h5>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-body p-0">
|
||||
<ul class="nav nav-tabs nav-fill border-light">
|
||||
@foreach (\App\Models\Language::all() as $key => $language)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-reset @if ($language->code == $lang) active @else bg-soft-dark border-light border-left-0 @endif py-3" href="{{ route('flash_deals.edit', ['id'=>$flash_deal->id, 'lang'=> $language->code] ) }}">
|
||||
<img src="{{ static_asset('assets/img/flags/'.$language->code.'.png') }}" height="11" class="mr-1">
|
||||
<span>{{$language->name}}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<form class="p-4" action="{{ route('flash_deals.update', $flash_deal->id) }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="_method" value="PATCH">
|
||||
<input type="hidden" name="lang" value="{{ $lang }}">
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-from-label" for="name">{{translate('Title')}} <i class="las la-language text-danger" title="{{translate('Translatable')}}"></i></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" placeholder="{{translate('Title')}}" id="name" name="title" value="{{ $flash_deal->getTranslation('title', $lang) }}" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-from-label" for="background_color">{{translate('Background Color')}}<small>({{ translate('Hexa-code') }})</small></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" placeholder="{{translate('#0000ff')}}" id="background_color" name="background_color" value="{{ $flash_deal->background_color }}" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-from-label" for="text_color">{{translate('Text Color')}}</label>
|
||||
<div class="col-lg-9">
|
||||
<select name="text_color" id="text_color" class="form-control demo-select2" required>
|
||||
<option value="">Select One</option>
|
||||
<option value="white" @if ($flash_deal->text_color == 'white') selected @endif>{{translate('White')}}</option>
|
||||
<option value="dark" @if ($flash_deal->text_color == 'dark') selected @endif>{{translate('Dark')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label" for="signinSrEmail">{{translate('Banner')}}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group" data-toggle="aizuploader" data-type="image">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text bg-soft-secondary font-weight-medium">{{ translate('Browse')}}</div>
|
||||
</div>
|
||||
<div class="form-control file-amount">{{ translate('Choose File') }}</div>
|
||||
<input type="hidden" name="banner" value="{{ $flash_deal->banner }}" class="selected-files">
|
||||
</div>
|
||||
<div class="file-preview box sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$start_date = date('d-m-Y H:i:s', $flash_deal->start_date);
|
||||
$end_date = date('d-m-Y H:i:s', $flash_deal->end_date);
|
||||
@endphp
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-from-label" for="start_date">{{translate('Date')}}</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control aiz-date-range" value="{{ $start_date.' to '.$end_date }}" name="date_range" placeholder="{{ translate('Select Date') }}" data-time-picker="true" data-format="DD-MM-Y HH:mm:ss" data-separator=" to " autocomplete="off" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-from-label" for="products">{{translate('Products')}}</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="products[]" id="products" class="form-control aiz-selectpicker" multiple required data-placeholder="{{ translate('Choose Products') }}" data-live-search="true" data-selected-text-format="count">
|
||||
@foreach(\App\Models\Product::where('published', 1)->where('approved', 1)->get() as $product)
|
||||
@php
|
||||
$flash_deal_product = \App\Models\FlashDealProduct::where('flash_deal_id', $flash_deal->id)->where('product_id', $product->id)->first();
|
||||
@endphp
|
||||
<option value="{{$product->id}}" <?php if($flash_deal_product != null) echo "selected";?> >{{ $product->getTranslation('name') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
{{ translate('If any product has discount or exists in another flash deal, the discount will be replaced by this discount & time limit.') }}
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="form-group" id="discount_table">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0 text-right">
|
||||
<button type="submit" class="btn btn-primary">{{translate('Save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
get_flash_deal_discount();
|
||||
|
||||
$('#products').on('change', function(){
|
||||
get_flash_deal_discount();
|
||||
});
|
||||
|
||||
function get_flash_deal_discount(){
|
||||
var product_ids = $('#products').val();
|
||||
if(product_ids.length > 0){
|
||||
$.post('{{ route('flash_deals.product_discount_edit') }}', {_token:'{{ csrf_token() }}', product_ids:product_ids, flash_deal_id:{{ $flash_deal->id }}}, function(data){
|
||||
$('#discount_table').html(data);
|
||||
AIZ.plugins.fooTable();
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('#discount_table').html(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,51 @@
|
||||
@if(count($product_ids) > 0)
|
||||
<table class="table table-bordered aiz-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<span>{{translate('Product')}}</span>
|
||||
</td>
|
||||
<td data-breakpoints="lg" width="20%">
|
||||
<span>{{translate('Base Price')}}</span>
|
||||
</td>
|
||||
<td data-breakpoints="lg" width="20%">
|
||||
<span>{{translate('Discount')}}</span>
|
||||
</td>
|
||||
<td data-breakpoints="lg" width="10%">
|
||||
<span>{{translate('Discount Type')}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($product_ids as $key => $id)
|
||||
@php
|
||||
$product = \App\Models\Product::findOrFail($id);
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
<div class="from-group row">
|
||||
<div class="col-auto">
|
||||
<img class="size-60px img-fit" src="{{ uploaded_asset($product->thumbnail_img)}}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<span>{{ $product->getTranslation('name') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{ $product->unit_price }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" lang="en" name="discount_{{ $id }}" value="{{ $product->discount }}" min="0" step="1" class="form-control" required>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control aiz-selectpicker" name="discount_type_{{ $id }}">
|
||||
<option value="amount">{{ translate('Flat') }}</option>
|
||||
<option value="percent">{{ translate('Percent') }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@@ -0,0 +1,52 @@
|
||||
@if(count($product_ids) > 0)
|
||||
<table class="table table-bordered aiz-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<span>{{translate('Product')}}</span>
|
||||
</td>
|
||||
<td data-breakpoints="lg" width="20%">
|
||||
<span>{{translate('Base Price')}}</span>
|
||||
</td>
|
||||
<td data-breakpoints="lg" width="20%">
|
||||
<span>{{translate('Discount')}}</span>
|
||||
</td>
|
||||
<td data-breakpoints="lg" width="10%">
|
||||
<span>{{translate('Discount Type')}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($product_ids as $key => $id)
|
||||
@php
|
||||
$product = \App\Models\Product::findOrFail($id);
|
||||
$flash_deal_product = \App\Models\FlashDealProduct::where('flash_deal_id', $flash_deal_id)->where('product_id', $product->id)->first();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-group row">
|
||||
<div class="col-auto">
|
||||
<img src="{{ uploaded_asset($product->thumbnail_img)}}" class="size-60px img-fit" >
|
||||
</div>
|
||||
<div class="col">
|
||||
<span>{{ $product->getTranslation('name') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{ $product->unit_price }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" lang="en" name="discount_{{ $id }}" value="{{ $product->discount }}" min="0" step="1" class="form-control" required>
|
||||
</td>
|
||||
<td>
|
||||
<select class="aiz-selectpicker" name="discount_type_{{ $id }}">
|
||||
<option value="amount" <?php if($product->discount_type == 'amount') echo "selected";?> >{{ translate('Flat') }}</option>
|
||||
<option value="percent" <?php if($product->discount_type == 'percent') echo "selected";?> >{{ translate('Percent') }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@@ -0,0 +1,139 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="aiz-titlebar text-left mt-2 mb-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6">
|
||||
<h1 class="h3">{{translate('All Flash Deals')}}</h1>
|
||||
</div>
|
||||
@can('add_flash_deal')
|
||||
<div class="col-md-6 text-md-right">
|
||||
<a href="{{ route('flash_deals.create') }}" class="btn btn-circle btn-info">
|
||||
<span>{{translate('Create New Flash Deal')}}</span>
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Flash Deals')}}</h5>
|
||||
<div class="pull-right clearfix">
|
||||
<form class="" id="sort_flash_deals" action="" method="GET">
|
||||
<div class="box-inline pad-rgt pull-left">
|
||||
<div class="" style="min-width: 200px;">
|
||||
<input type="text" class="form-control" id="search" name="search"@isset($sort_search) value="{{ $sort_search }}" @endisset placeholder="{{ translate('Type name & Enter') }}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table aiz-table mb-0" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-breakpoints="lg">#</th>
|
||||
<th>{{translate('Title')}}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Banner') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Start Date') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('End Date') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Status') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Featured') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Page Link') }}</th>
|
||||
<th class="text-right">{{translate('Options')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($flash_deals as $key => $flash_deal)
|
||||
<tr>
|
||||
<td>{{ ($key+1) + ($flash_deals->currentPage() - 1)*$flash_deals->perPage() }}</td>
|
||||
<td>{{ $flash_deal->getTranslation('title') }}</td>
|
||||
<td><img src="{{ uploaded_asset($flash_deal->banner) }}" alt="banner" class="h-50px"></td>
|
||||
<td>{{ date('d-m-Y H:i:s', $flash_deal->start_date) }}</td>
|
||||
<td>{{ date('d-m-Y H:i:s', $flash_deal->end_date) }}</td>
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input onchange="update_flash_deal_status(this)" value="{{ $flash_deal->id }}" type="checkbox" <?php if($flash_deal->status == 1) echo "checked";?> >
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="aiz-switch aiz-switch-success mb-0">
|
||||
<input
|
||||
@can('publish_flash_deal') onchange="update_flash_deal_feature(this)" @endcan
|
||||
value="{{ $flash_deal->id }}" type="checkbox"
|
||||
<?php if($flash_deal->featured == 1) echo "checked";?>
|
||||
@cannot('publish_flash_deal') disabled @endcan
|
||||
>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>{{ url('flash-deal/'.$flash_deal->slug) }}</td>
|
||||
<td class="text-right">
|
||||
@can('edit_flash_deal')
|
||||
<a class="btn btn-soft-primary btn-icon btn-circle btn-sm" href="{{route('flash_deals.edit', ['id'=>$flash_deal->id, 'lang'=>env('DEFAULT_LANGUAGE')] )}}" title="{{ translate('Edit') }}">
|
||||
<i class="las la-edit"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('delete_flash_deal')
|
||||
<a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('flash_deals.destroy', $flash_deal->id)}}" title="{{ translate('Delete') }}">
|
||||
<i class="las la-trash"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="clearfix">
|
||||
<div class="pull-right">
|
||||
{{ $flash_deals->appends(request()->input())->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('modal')
|
||||
@include('modals.delete_modal')
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
function update_flash_deal_status(el){
|
||||
if(el.checked){
|
||||
var status = 1;
|
||||
}
|
||||
else{
|
||||
var status = 0;
|
||||
}
|
||||
$.post('{{ route('flash_deals.update_status') }}', {_token:'{{ csrf_token() }}', id:el.value, status:status}, function(data){
|
||||
if(data == 1){
|
||||
location.reload();
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
function update_flash_deal_feature(el){
|
||||
if(el.checked){
|
||||
var featured = 1;
|
||||
}
|
||||
else{
|
||||
var featured = 0;
|
||||
}
|
||||
$.post('{{ route('flash_deals.update_featured') }}', {_token:'{{ csrf_token() }}', id:el.value, featured:featured}, function(data){
|
||||
if(data == 1){
|
||||
location.reload();
|
||||
}
|
||||
else{
|
||||
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,56 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('Send Newsletter')}}</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form class="form-horizontal" action="{{ route('newsletters.send') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-from-label" for="name">{{translate('Emails')}} ({{translate('Users')}})</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control aiz-selectpicker" name="user_emails[]" multiple data-selected-text-format="count" data-actions-box="true">
|
||||
@foreach($users as $user)
|
||||
<option value="{{$user->email}}">{{$user->email}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-from-label" for="name">{{translate('Emails')}} ({{translate('Subscribers')}})</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control aiz-selectpicker" name="subscriber_emails[]" multiple data-selected-text-format="count" data-actions-box="true">
|
||||
@foreach($subscribers as $subscriber)
|
||||
<option value="{{$subscriber->email}}">{{$subscriber->email}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-from-label" for="subject">{{translate('Newsletter subject')}}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="subject" id="subject" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-from-label" for="name">{{translate('Newsletter content')}}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea rows="8" class="form-control aiz-text-editor" data-buttons='[["font", ["bold", "underline", "italic"]],["para", ["ul", "ol"]], ["insert", ["link", "picture"]],["view", ["undo","redo"]]]' name="content" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-0 text-right">
|
||||
<button type="submit" class="btn btn-primary">{{translate('Send')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,47 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0 h6">{{translate('All Subscribers')}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table aiz-table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-breakpoints="lg">#</th>
|
||||
<th>{{translate('Email')}}</th>
|
||||
<th data-breakpoints="lg">{{translate('Date')}}</th>
|
||||
<th data-breakpoints="lg" class="text-right">{{translate('Options')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($subscribers as $key => $subscriber)
|
||||
<tr>
|
||||
<td>{{ ($key+1) + ($subscribers->currentPage() - 1)*$subscribers->perPage() }}</td>
|
||||
<td><div class="text-truncate">{{ $subscriber->email }}</div></td>
|
||||
<td>{{ date('d-m-Y', strtotime($subscriber->created_at)) }}</td>
|
||||
<td class="text-right">
|
||||
@can('delete_subscriber')
|
||||
<a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="{{route('subscriber.destroy', $subscriber->id)}}" title="{{ translate('Delete') }}">
|
||||
<i class="las la-trash"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="clearfix">
|
||||
<div class="pull-right">
|
||||
{{ $subscribers->appends(request()->input())->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('modal')
|
||||
@include('modals.delete_modal')
|
||||
@endsection
|
||||
Reference in New Issue
Block a user