Actualizacion de Diseño Logins y Parte de Registro Negocios

This commit is contained in:
kquiroz
2023-08-23 16:11:21 -04:00
parent d71e89adae
commit 38bf59042d
3498 changed files with 691264 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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