![]() 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/module/textbox/ |
@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($content,['method' => 'POST','route' => ['admin.module.textbox.update',$content->id], 'id' => 'frm_edit', 'class'=>'form','enctype'=>'multipart/form-data']) !!} <input type="hidden" name="subtitle" id="subtitle" value="{{$content->subtitle}}"> <input type="hidden" name="id" value="{{$content->id}}"> <div class="box-body"> <div class="col-md-12"> <h3 class="bold">Edit Text Box</h3> <div class="row"> <div class="col-md-12"> <div class="alert alert-primary" role="alert"> If adding a video url, then this video will be displayed instead of the image. Please keep this video url empty if you don't want the video to display </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="title">Title <span class="text-danger">*</span></label> <input type="text" name="title" id="title" placeholder="Title" class="form-control input-lg @if(!empty($content->title)) bg-success @endif" value="{{ $content->title }}"> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label for="content">Content <span class="text-danger">*</span></label> <textarea name="content" id="content" class="form-control input-lg ckeditor" >{{ $content->content }}</textarea> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="image">Image</label> <input type="file" name="image" id="image" class="form-control input-lg @if (!empty($content->image)) bg-success @endif" value="{{$content->image}}"> <input type="hidden" name="image_old" id="image_old" class="form-control input-lg" value="{{ $content->image }}"> </div> </div> @if (!empty($content->image)) <div class="col-md-6"> <img id="upd-imag" class="img-responsive img-thumbnail" src="{{ URL::to('/') }}/public/img/images_uploaded/{{$content->image}}" /> <div> <button type="button" class="btn btn-danger btn-sm btn-block remove_image">Remove image?</button><br> </div> </div> @endif </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="image">Alternative Text (for image)</label> <input type="text" name="img_meta_alt" id="img_meta_alt" class="form-control input-lg @if(!empty($content->img_meta_alt)) bg-success @endif" placeholder="Alternative Text" value="{{ $content->img_meta_alt }}"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="video_url">Video Url</label> <input type="text" name="video_url" id="video_url" placeholder="https://..." class="form-control input-lg @if(!empty($content->video_url)) bg-success @endif" value="{{ $content->video_url }}"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="button_text">Button 1 - Text</label> @if(!empty($content->button_text)) {!! Form::text('button_text', null, array('placeholder' => 'Button 1 - Text', 'class' => 'form-control input-lg bg-success', 'id'=>'button_text')) !!} @else {!! Form::text('button_text', null, array('placeholder' => 'Button 1 - Text', 'class' => 'form-control input-lg', 'id'=>'button_text')) !!} @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="button_link">Button 1 - Url</label> @if(!empty($content->button_link)) {!! Form::text('button_link', null, array('placeholder' => 'https://...', 'class' => 'form-control input-lg bg-success', 'id'=>'button_link')) !!} @else {!! Form::text('button_link', null, array('placeholder' => 'https://...', 'class' => 'form-control input-lg', 'id'=>'button_link')) !!} @endif </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="button_text2">Button 2 - Text</label> @if(!empty($content->button_text2)) {!! Form::text('button_text2', null, array('placeholder' => 'Button 2 - Text', 'class' => 'form-control input-lg bg-success', 'id'=>'button_text2')) !!} @else {!! Form::text('button_text2', null, array('placeholder' => 'Button 2 - Text', 'class' => 'form-control input-lg', 'id'=>'button_text2')) !!} @endif </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="button_link2">Button 2 - Url</label> @if(!empty($content->button_link2)) {!! Form::text('button_link2', null, array('placeholder' => 'https://...', 'class' => 'form-control input-lg bg-success', 'id'=>'button_link2')) !!} @else {!! Form::text('button_link2', null, array('placeholder' => 'https://...', 'class' => 'form-control input-lg', 'id'=>'button_link2')) !!} @endif </div> </div> </div> <!--<div class="col-md-6"> <div class="form-group"> <label for="video_url">HTML Code</label> <textarea name="iframe" id="iframe" class="form-control input-lg" placeholder="HTML Code">{{$content->iframe}}</textarea> </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.module.textbox.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 }, content: { required: true } }, messages: { title: { required: 'Please enter a title' }, content: { required: 'Please enter a content' } } }); $(document).on('click','.remove_image',function(e){ e.preventDefault(); var data = {_token: "{{ csrf_token() }}",id : "{{$content->id}}"}; $.ajax({ type: "POST", url: "{{url('admin/page/'.$content->id.'/textbox/remove-image')}}", data : data, contentType: "application/json", success: function(data){ if(data){ $('#upd-imag').remove(); $('#image_old').remove(); $(".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