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.133.111.249
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : add_testimonial.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="AddTestimonialForm">
	                                	@csrf
	                                    <div class="login-form form-content">
	                                        <h4>Add New Testimonial</h4>
	                                        <div class="input-field">
	                                            <label for="">Client Name</label>
	                                            <div class="input-field">
	                                                <input class="custom-input" type="text" name="clientName">
	                                            </div>
	                                        </div>
	                                        <div class="input-field">
	                                            <label for="">Client Position</label>
	                                            <div class="input-field">
	                                                <input class="custom-input" type="text" name="clientPosition">
	                                            </div>
	                                        </div>
	                                        <div class="input-field">
	                                            <label for="">Testimonial Text</label>
	                                            <div class="input-field">
	                                                <textarea class="custom-input ckeditor" type="text" name="testiText" id="testiText"></textarea>
	                                            </div>
	                                        </div>
	                                        <br>
	                                        <div class="input-field">
		                                        <label for="">Client Rating</label>
		                                        <select name="clientRating" class="form-control custom-input" id="clientRating">
		                                        	<option value="">Select</option>
		                                        	<option value="1">1</option>
		                                        	<option value="2">2</option>
		                                        	<option value="3">3</option>
		                                        	<option value="4">4</option>
		                                        	<option value="5">5</option>
		                                        </select>
		                                    </div>
	                                        <div class="input-field">
                                                <label>Client Image</label>
                                                <div class="img-upload-wrapper">
                                                    <input class="img-upload" type="file" name="clientImg" id="clientImg" accept="image/png, image/jpeg">
                                                </div>
                                                <div class="btn-wrapper">
                                                    <label class="btn img-upload-btn" for="clientImg">Select
                                                        Image</label>
                                                </div>
                                            </div>
                                            <div class="input-field">
                                                <label for="">Status</label>
                                                <div class="custom-switch checked">
                                                    <input checked type="checkbox" name="testiStatus">
                                                    <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>

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


                        <!-- Insert Testimonial -->

                        <script>
                        	$(document).ready(function(){
                        		$("#AddTestimonialForm").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: "insert_testimonial",
										method: "POST",
										data: data,
										datatype: "json",
										cache: false,
										contentType: false,
										processData: false,
										success:function(data)
										{
											if($.isEmptyObject(data.error))
											{
												toastr.success(data.success,"Added",{timeOut: 1500});
												document.getElementById('AddTestimonialForm').reset();
												CKEDITOR.instances.testiText.setData("");
												window.location = "testimonial";
											}
											else if(data.error.testiText)
											{
												toastr.error(data.error.testiText,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.clientRating)
											{
												toastr.error(data.error.clientRating,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.clientImg)
											{
												toastr.error(data.error.clientImg,"Error",{timeOut: 1500});
												return false;
											}
											else if(data.error.clientImg[1])
											{
												toastr.error(data.error.clientImg[1],"Error",{timeOut: 1500});
												return false;
											}
										},
										error:function()
										{
											toastr.error("SomeThing Went Wrong...","Error");
											return false;
										},
									});
                        		});
                        	});
                        </script>

                        <!-- Insert Testimonial Ends Here -->

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