Uname: Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.213.251.212
Your Ip: 3.149.253.168
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : edit_services.blade.php
<x-admin.header />
<x-admin.sidebar />
<style>
	.input-field .img-upload-btn
	{
		margin: 10px;
	}
	td.col-img
	{
		display: flex;
	}
	td.col-img h6
	{
		position: relative;
		margin: 10px 0px 0px 10px !important;
	}

</style>

<main>
						<div class="main-content">
							<div class="row">
	                           	<div class="col-lg-12 col-12">
	                                <form id="EditServiceForm">
	                                	@csrf
	                                    <div class="login-form form-content">
	                                        <h4>Edit Service</h4>
	                                        <input type="hidden" name="serviceId" value="{{$edit->service_id}}">
	                                        @if(!empty($edit->service_title))
	                                        <div class="input-field">
	                                            <label for="">Service Title</label>
	                                            <div class="input-field">
	                                                <input class="custom-input" type="text" name="serviceTitle" value="{{$edit->service_title}}">
	                                            </div>
	                                        </div>
	                                        @endif
	                                        @if(!empty($edit->service_heading))
	                                        <div class="input-field">
	                                            <label for="">Service Heading</label>
	                                            <div class="input-field">
	                                                <input class="custom-input" type="text" name="serviceHeading" value="{{$edit->service_heading}}">
	                                            </div>
	                                        </div>
	                                        @endif
	                                        @if(!empty($edit->service_sub_heading))
	                                        <div class="input-field">
	                                            <label for="">Service Sub Heading</label>
	                                            <div class="input-field">
	                                                <input class="custom-input" type="text" name="serviceSubHeading" value="{{$edit->service_sub_heading}}">
	                                            </div>
	                                        </div>
	                                        @endif
	                                        @if(!empty($edit->service_short_description))
	                                        <div class="input-field">
	                                            <label for="">Service Description</label>
	                                            <div class="input-field">
	                                                <textarea class="custom-input ckeditor" type="text" name="serviceDesc" id="serviceDesc">{{$edit->service_short_description}}</textarea>
	                                                
	                                            </div>
	                                        </div><br>@endif
	                                        @if(!empty($edit->service_long_description))
	                                        <div class="input-field">
	                                            <label for="">Service Long Description</label>
	                                            <div class="input-field">
	                                                <textarea class="custom-input ckeditor" type="text" name="serviceLongDesc" id="serviceLongDesc">{{$edit->service_long_description}}</textarea>
	                                                
	                                            </div>
	                                        </div>
	                                        @endif
	                                        <br>
	                                        @if(!empty($edit->service_image))
	                                        <div class="input-field">
                                                <label>Service Image</label>
                                                <div class="img-upload-wrapper">
                                                    <input class="img-upload" type="file" name="serviceImg" id="serviceImg" accept="image/png, image/jpeg">
                                                </div>
                                                <div class="btn-wrapper">
                                                    <label class="btn img-upload-btn" for="serviceImg">Select
                                                        Image</label>
                                                </div>
                                                <img src="{{ asset('storage/images/'.$edit->service_image)}}" width="20%" />
                                            </div>
                                            @endif
                                            @if(!empty($edit->service_image2))
                                            <div class="input-field">
                                                <label>Service Second Image</label>
                                                <div class="img-upload-wrapper">
                                                    <input class="img-upload" type="file" name="serviceImg2" id="serviceImg2" accept="image/png, image/jpeg">
                                                </div>
                                                <div class="btn-wrapper">
                                                    <label class="btn img-upload-btn" for="serviceImg2">Select
                                                        Image</label>
                                                </div>
                                                <img src="{{ asset('storage/images/'.$edit->service_image2)}}" width="20%" />
                                            </div>
                                            @endif
                                            @if(!empty($edit->service_icon_image))
                                            <div class="input-field">
                                                <label>Service Icon Image</label>
                                                <div class="img-upload-wrapper">
                                                    <input class="img-upload" type="file" name="serviceIconImg" id="serviceIconImg" accept="image/png, image/jpeg">
                                                </div>
                                                <div class="btn-wrapper">
                                                    <label class="btn img-upload-btn" for="serviceIconImg">Select
                                                        Image</label>
                                                </div>
                                                <img src="{{ asset('storage/images/'.$edit->service_icon_image)}}" width="7%" />
                                            </div>
                                            @endif
                                            @if(!empty($edit->service_video))
                                            <div class="input-field">
                                                <label>Service Video</label>
                                                <div class="img-upload-wrapper">
                                                    <input class="img-upload" type="file" name="serviceVideo" id="serviceVideo">
                                                </div>
                                                <div class="btn-wrapper">
                                                    <label class="btn img-upload-btn" for="serviceVideo">Select
                                                        Video</label>
                                                </div>
                                            </div>
                                            @endif
                                            @if(!empty($edit->service_status))
                                            <div class="input-field">
                                                <label for="">Service Status</label>
                                                <div class="custom-switch checked">
                                                    <input checked type="checkbox" name="serviceStatus" id="serviceStatus">
                                                    <span class="circle"></span>
                                                    <span class="no"><i class="fa-light fa-xmark"></i></span>
                                                    <span class="yes"><i class="fa-light fa-check"></i></span>
                                                </div>
                                            </div>
                                            @endif

	                                        <!-- <h6>* Required Fields</h6> -->
	                                        <div class="form-footer">
	                                            <button type="submit">Update Service</button>
	                                        </div>
	                                    </div>
	                                </form>
	                            </div>
                            </div>
                        </div>


                        <!-- Insert Service -->

                        <script>
                        	$(document).ready(function(){
                        		$("#EditServiceForm").on('submit', function(e){
                        			e.preventDefault();

                        			for ( instance in CKEDITOR.instances )
    								CKEDITOR.instances[instance].updateElement();

                        			var data = new FormData(this);

                        			$.ajaxSetup({
									    headers: {
									        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
									    }
									});

									$.ajax({
										url: "update_service",
										method: "POST",
										data: data,
										datatype: "json",
										cache: false,
										contentType: false,
										processData: false,
										success:function(data)
										{
											if($.isEmptyObject(data.error))
											{
												toastr.success(data.success,"Updated",{timeOut: 1500});
												document.getElementById('EditServiceForm').reset();
												CKEDITOR.instances.serviceDesc.setData("");
												CKEDITOR.instances.serviceLongDesc.setData("");
												// history.go(-1);
												window.location = "{{ url('fetch_services')}}";
											}
											else if(data.error.serviceTitle)
											{
												toastr.error(data.error.serviceTitle,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceImg)
											{
												toastr.error(data.error.serviceImg,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceImg[1])
											{
												toastr.error(data.error.serviceImg[1],"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceImg2)
											{
												toastr.error(data.error.serviceImg2,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceImg2[1])
											{
												toastr.error(data.error.serviceImg2[1],"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceIconImg)
											{
												toastr.error(data.error.serviceIconImg,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceIconImg[1])
											{
												toastr.error(data.error.serviceIconImg[1],"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceVideo)
											{
												toastr.error(data.error.serviceVideo,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.serviceVideo[1])
											{
												toastr.error(data.error.serviceVideo[1],"Error",{timeOut: 1500});
												return false;
											}
										},
										error:function()
										{
											toastr.error("SomeThing Went Wrong...","Error");
											return false;
										},
									});
                        		});
                        	});
                        </script>

                        <!-- Insert Service Ends Here -->

<x-admin.footer />
© 2025 GrazzMean-Shell