@extends('layouts.admin.master')
@section('content')
<!-- Include Alert Blade -->
@include('admin.alert.alert')
<div class="row">
<div class="col-12 box-margin">
<div class="card">
<div class="card-body">
<div class="d-md-flex justify-content-between align-items-center mb-20">
<h6 class="card-title mb-0">{{ __('content.features') }}</h6>
<div>
<button type="button" class="btn btn-primary mb-3 mr-2" data-toggle="modal" data-target="#featureSectionModal">{{ __('content.section_title_and_desc') }}</button>
<button type="button" class="btn btn-primary mb-3" data-toggle="modal" data-target="#featureModal">+ {{ __('content.add_feature') }}</button>
</div>
</div>
@if (count($features) > 0)
<div class="mr-3">
<input id="check_all" type="checkbox" onclick="showHideDeleteButton(this)">
<label for="check_all">{{ __('content.all') }}</label>
<a id="deleteChecked" class="ml-2" href="#" data-toggle="modal" data-target="#deleteCheckedModal">
<i class="fa fa-trash text-danger font-18"></i>
</a>
</div>
@if ($demo_mode == "on")
<!-- Include Alert Blade -->
@include('admin.demo_mode.demo-mode')
@else
<form onsubmit="return btnCheckListGet()" action="{{ route('feature.destroy_checked') }}" method="POST">
@method('DELETE')
@csrf
@endif
<input type="hidden" id="checked_lists" name="checked_lists" value="">
<!-- Modal -->
<div class="modal fade" id="deleteCheckedModal" tabindex="-1" role="dialog" aria-labelledby="deleteCheckedModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteCheckedModalCenterTitle">{{ __('content.delete') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="{{ __('content.close') }}">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body text-center">
{{ __('content.delete_selected') }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">{{ __('content.cancel') }}</button>
<button onclick="btnCheckListGet()" type="submit" class="btn btn-success">{{ __('content.yes_delete_it') }}</button>
</div>
</div>
</div>
</div>
</form>
<table id="basic-datatable" class="table table-striped dt-responsive w-100">
<thead>
<tr>
<th scope="col">#</th>
<th>{{ __('content.image') }}</th>
<th>{{ __('content.title') }}</th>
<th>{{ __('content.description') }}</th>
<th>{{ __('content.order') }}</th>
<th class="custom-width-action">{{ __('content.action') }}</th>
</tr>
</thead>
<tbody>
@php $desc = count($features); $asc=0; @endphp
@foreach ($features as $feature)
<tr>
<td>
<input name="check_list[]" type="checkbox" value="{{ $feature->id }}" onclick="showHideDeleteButton2(this)"> <span class="d-none">{{ $asc++ }}{{ $desc-- }}</span>
</td>
<td>
@if ($feature->type == 'icon')
<i class="{{ $feature->icon }}"></i> {{ $feature->icon }}
@else
@if (!empty($feature->feature_image))
<img class="image-size img-fluid" src="{{ asset('uploads/img/features/'.$feature->feature_image) }}" alt="blog image">
@else
<img class="image-size img-fluid" src="{{ asset('uploads/img/dummy/no-image.jpg') }}" alt="no image">
@endif
@endif
</td>
<td>{{ $feature->title }}</td>
<td>{{ $feature->desc }}</td>
<td>{{ $feature->order }}</td>
<td>
<div>
<a href="{{ route('feature.edit', $feature->id) }}" class="mr-2">
<i class="fa fa-edit text-info font-18"></i>
</a>
<a href="#" data-toggle="modal" data-target="#deleteModal{{ $feature->id }}">
<i class="fa fa-trash text-danger font-18"></i>
</a>
</div>
</td>
</tr>
<!-- Modal -->
<div class="modal fade" id="deleteModal{{ $feature->id }}" tabindex="-1" role="dialog" aria-labelledby="featureModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="featureModalCenterTitle">{{ __('content.delete') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="{{ __('content.close') }}">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body text-center">
{{ __('content.you_wont_be_able_to_revert_this') }}
</div>
<div class="modal-footer">
@if ($demo_mode == "on")
<!-- Include Alert Blade -->
@include('admin.demo_mode.demo-mode')
@else
<form class="d-inline-block" action="{{ route('feature.destroy', $feature->id) }}" method="POST">
@method('DELETE')
@csrf
@endif
<button type="button" class="btn btn-danger" data-dismiss="modal">{{ __('content.cancel') }}</button>
<button type="submit" class="btn btn-success">{{ __('content.yes_delete_it') }}</button>
</form>
</div>
</div>
</div>
</div>
@endforeach
</tbody>
</table>
@else
<span>{{ __('content.not_yet_created') }}</span>
@endif
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div><!-- end row-->
<div class="modal fade" id="featureSectionModal" tabindex="-1" role="dialog" aria-labelledby="featureSectionModalLabel" aria-modal="false">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mt-0 font-16" id="featureModalLabel">{{ __('content.section_title_and_desc') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
@if (isset($feature_section))
@if ($demo_mode == "on")
<!-- Include Alert Blade -->
@include('admin.demo_mode.demo-mode')
@else
<form action="{{ route('feature-section.update', $feature_section->id) }}" method="POST">
@method('PUT')
@csrf
@endif
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="section_title">{{ __('content.section_title') }} <span class="text-red">*</span></label>
<input type="text" name="section_title" class="form-control" id="section_title" value="{{ $feature_section->section_title }}" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="title">{{ __('content.title') }} <span class="text-red">*</span></label>
<input type="text" name="title" class="form-control" id="title" value="{{ $feature_section->title }}" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<small class="form-text text-muted">{{ __('content.required_fields') }}</small>
</div>
</div>
</div>
<button type="submit" class="btn btn-sm btn-primary">{{ __('content.submit') }}</button>
</form>
@else
@if ($demo_mode == "on")
<!-- Include Alert Blade -->
@include('admin.demo_mode.demo-mode')
@else
<form action="{{ route('feature-section.store') }}" method="POST">
@csrf
@endif
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="section_title">{{ __('content.section_title') }} <span class="text-red">*</span></label>
<input type="text" name="section_title" class="form-control" id="section_title" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="title">{{ __('content.title') }} <span class="text-red">*</span></label>
<input type="text" name="title" class="form-control" id="title" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<small class="form-text text-muted">{{ __('content.required_fields') }}</small>
</div>
</div>
</div>
<button type="submit" class="btn btn-sm btn-primary">{{ __('content.submit') }}</button>
</form>
@endif
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="featureModal" tabindex="-1" role="dialog" aria-labelledby="featureModalLabel" aria-modal="false">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mt-0 font-16" id="serviceModalLabel">{{ __('content.add_new') }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
@if ($demo_mode == "on")
<!-- Include Alert Blade -->
@include('admin.demo_mode.demo-mode')
@else
<form action="{{ route('feature.store') }}" method="POST" enctype="multipart/form-data">
@csrf
@endif
<div class="row">
<div class="col-md-12">
<fieldset class="form-group">
<legend class="font-14">{{ __('content.type') }}</legend>
<div class="form-check pl-0 mb-2">
<label class="form-check-label">
<input type="radio" class="form-check-input mr-2" name="type" id="optionsRadios1" onclick="showHideTypeDiv()" value="icon" checked=""><span class="ml-3">Icon</span>
<i class="input-helper"></i>
</label>
</div>
<div class="form-check pl-0">
<label class="form-check-label">
<input type="radio" class="form-check-input mr-1" name="type" id="optionsRadios2" onclick="showHideTypeDiv()" value="image"><span class="ml-3">Image</span>
<i class="input-helper"></i></label>
</div>
</fieldset>
</div>
<div class="col-md-12" id="icon-type">
<div class="form-group">
<label for="icon" class="d-block">{{ __('content.icon') }}</label>
<div class="btn-group">
<input type="hidden" name="icon" class="form-control" id="icon">
<button type="button" class="btn btn-primary iconpicker-component"><i id="icon-value" class="iconpicker-component"></i></button>
<button type="button" id="iconPickerBtn" class="icp icp-dd btn btn-primary dropdown-toggle iconpicker-component" data-selected="fa-car" data-toggle="dropdown">
<span class="caret"></span>
</button>
<div class="dropdown-menu"></div>
</div>
</div>
</div>
<div class="col-md-12" id="image-type" style="display: none;">
<div class="form-group">
<label for="feature_image">{{ __('content.image') }} ({{ __('content.size') }} 60 x 60) (.svg, .jpg, .jpeg, .png)</label>
<input type="file" name="feature_image" class="form-control-file" id="feature_image">
<small id="feature_image" class="form-text text-muted">{{ __('content.please_use_recommended_sizes') }}</small>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="title">{{ __('content.title') }} <span class="text-red">*</span></label>
<input type="text" name="title" class="form-control" id="title" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="desc">{{ __('content.description') }}</label>
<textarea name="desc" class="form-control" id="desc"></textarea>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="order">{{ __('content.order') }}</label>
<input type="number" name="order" class="form-control" id="order" value="0" required>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<small class="form-text text-muted">{{ __('content.required_fields') }}</small>
</div>
</div>
</div>
<button type="submit" class="btn btn-sm btn-primary">{{ __('content.submit') }}</button>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
@endsection |