Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mcoil.corals.io/resources/views/admin/service-box/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/resources/views/admin/service-box/edit.blade.php
@extends('layouts.admin.app')
@section('content')
<div class="row">
    <div class="col-md-12">
        <section class="content">
        @include('layouts.errors-and-messages')
            <div class="box">
            {!! Form::model($service, ['method' => 'POST', 'route' => ['admin.service.box.update',$service->id], 'id' => 'frm_edit', 'class'=>'form', 'enctype'=>'multipart/form-data']) !!}
                <div class="box-body">
                    <div class="col-md-12">
                        <h3 class="bold">Edit Service Box <small>- for creating or editing your service box settings</small></h3>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="title">Title <span class="text-danger">*</span></label>
                                    @if(!empty($service->title))
                                    {!! Form::text('title', null, array('placeholder' => 'Title', 'class' => 'form-control input-lg bg-success', 'id'=>'title')) !!}
                                    @else
                                    {!! Form::text('title', null, array('placeholder' => 'Title', 'class' => 'form-control input-lg', 'id'=>'title')) !!}
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="sub_title">Sub Title</label>
                                    @if(!empty($service->sub_title))
                                    {!! Form::text('sub_title', null, array('placeholder' => 'Sub Title', 'class' => 'form-control input-lg bg-success', 'id'=>'sub_title')) !!}
                                    @else
                                    {!! Form::text('sub_title', null, array('placeholder' => 'Sub Title', 'class' => 'form-control input-lg', 'id'=>'sub_title')) !!}
                                    @endif
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <label for="text">Content</label>
                                    @if(!empty($service->text))
                                    {!! Form::textarea('text', null, array('placeholder' => 'Content', 'class' => 'form-control input-lg bg-success', 'id'=>'text')) !!}
                                    @else
                                    {!! Form::textarea('text', null, array('placeholder' => 'Content', 'class' => 'form-control input-lg', 'id'=>'text')) !!}
                                    @endif
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="link_button">Button Link</label>
                                    @if(!empty($service->link_button))
                                    {!! Form::text('link_button', null, array('placeholder' => 'Button Link', 'class' => 'form-control input-lg bg-success', 'id'=>'link_button')) !!}
                                    @else
                                    {!! Form::text('link_button', null, array('placeholder' => 'Button Link', 'class' => 'form-control input-lg', 'id'=>'link_button')) !!}
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="background_img">Background Image</label>
                                    {!! Form::file('background_img', array('placeholder' => 'Background Image','class' => 'form-control input-lg','id'=>'background_img')) !!}
                                    @if (!empty($service->background_img))
                                        <br><img class="img-responsive img-thumbnail remove_image" src="{{ URL::to('/') }}/public/img/images_uploaded/{{basename($service->background_img)}}">
                                        <div>
                                            <button type="button" class="btn btn-danger btn-sm btn-block remove_image">Remove image?</button>
                                        </div>
                                    @endif
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="meta_alt">Alternative Text (for image)</label>
                                    @if(!empty($service->meta_alt))
                                    {!! Form::text('meta_alt', null, array('placeholder' => 'Alt', 'class' => 'form-control input-lg bg-success', 'id'=>'meta_alt')) !!}
                                    @else
                                    {!! Form::text('meta_alt', null, array('placeholder' => 'Alt', 'class' => 'form-control input-lg', 'id'=>'meta_alt')) !!}
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label for="orderNo">Sort Order</label>
                                    @if(!empty($service->orderNo))
                                    {!! Form::number('orderNo', null, array('placeholder' => 'Sort Order', 'class' => 'form-control input-lg bg-success', 'id'=>'orderNo')) !!}
                                    @else
                                    {!! Form::number('orderNo', null, array('placeholder' => 'Sort Order', 'class' => 'form-control input-lg', 'id'=>'orderNo')) !!}
                                    @endif
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <button type="submit" class="btn btn-lg btn-block btn-success">Update</button>
                            </div>
                            <div class="col-md-6">
                                <a href="{{ route('admin.service.box.list') }}" class="btn btn-lg btn-block btn-danger">Back</a>
                            </div>
                        </div>
                    </div>
                </div>
            {!! Form::close() !!}
            </div>
        </section>
    </div>
</div>
@endsection
@section('js')
<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
    $('#frm_edit').validate({
        rules: {
			title: { required: true }
		},
		messages: {
			title: { required: 'Please enter a title' }
		}
    });
    $(document).on('click','.remove_image',function(e) {
        e.preventDefault();
        var data = {_token: "{{ csrf_token() }}", id: "{{$service->id}}"};
        $.ajax({
            type: "POST",
            url: "{{url('admin/home/'.$service->id.'/service-box/remove-image')}}",
            data : data,
            contentType: "application/json",
            success: function(data) {
                if (data) {
                    $('#background_img').val('');
                    $(".remove_image").remove();
                    toastr.remove();
                    toastr.clear();
                    toastr.options.closeButton = true;
                    toastr.options.debug = false;
                    toastr.options.progressBar = false;
                    toastr.options.positionClass = 'toast-bottom-full-width';
                    toastr.options.preventDuplicates = true;
                    toastr.options.onclick = null;
                    toastr.options.showDuration = 1000;
                    toastr.options.hideDuration = 1000;
                    toastr.options.timeOut = 5000;
                    toastr.options.extendedTimeOut = 1000;
                    toastr.options.showEasing = 'swing';
                    toastr.options.hideEasing = 'linear';
                    toastr.options.showMethod = 'fadeIn';
                    toastr.options.hideMethod = 'fadeOut';
                    toastr.success('Image Removed Successfully','Success');
                } else {
                    toastr.clear();
                    toastr.options.closeButton = true;
                    toastr.options.debug = false;
                    toastr.options.progressBar = false;
                    toastr.options.positionClass = 'toast-bottom-full-width';
                    toastr.options.preventDuplicates = true;
                    toastr.options.onclick = null;
                    toastr.options.showDuration = 1000;
                    toastr.options.hideDuration = 1000;
                    toastr.options.timeOut = 5000;
                    toastr.options.extendedTimeOut = 1000;
                    toastr.options.showEasing = 'swing';
                    toastr.options.hideEasing = 'linear';
                    toastr.options.showMethod = 'fadeIn';
                    toastr.options.hideMethod = 'fadeOut';
                    toastr.error('Invalid Request','Error');
                }
            }
        });
    });
});
</script>
@endsection

Spamworldpro Mini