D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
kavyaeventz.in
/
admin
/
Filename :
testimonial-form.php
back
Copy
<?php include('include/header.php'); ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <div class="container-full"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="d-flex align-items-center"> <div class="me-auto"> <h4 class="page-title">Add Blog</h4> </div> </div> </div> <!-- Main content --> <div class="row"> <div class="col-xl-12 dash-xl-100"> <div class="card "> <div class="card-body"> <?php $id = $_GET['eid']; $sql1 = "select * from testimonials where id = '$id'"; $query1 = mysqli_query($conn, $sql1); $row1 = mysqli_fetch_array($query1); ?> <div class="theme-form mega-form" > <div class="row"> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Name</label> <input class="form-control" type="text" value="<?= $row1['name'];?>" id="pname"> <input class="form-control" type="hidden" value="<?= $id;?>" id="id"> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Profile</label> <input class="form-control" type="text" value="<?= $row1['profile'];?>" id="profile"> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Profile Image</label> <input class="form-control" type="file" id="banner"> <input class="form-control" type="hidden" value="<?= $row1['photo'];?>" id="bannerold"> <div class="row"> <?php if($id != ""){ ?> <div class="col"> <img src="images/new/<?= $row1['photo'];?>" alt="zo-th-1" height="100"/> </div> <?php } ?> </div> </div> </div> <div class="col-6"> <label class="col-form-label">Image Alt</label> <input class="form-control" type="text" value="<?= $row1['altp'];?>" id="alt"> </div> </div> <div class="mb-3"> <label class="col-form-label">Description</label> <div id="editor1"><?= html_entity_decode($row1['des']);?></div> </div> <div class="card-footer"> <?php if($id == ""){ ?> <input type="Submit" value="Submit" id="Submit" class="btn btn-primary"> <?php }else{ ?> <input type="Submit" value="Update" id="update" class="btn btn-primary"> <?php } ?> </div> </div> </div> </div> </div> </div> <!-- /.content --> </div> </div> <!-- /.content-wrapper --> <?php include('include/footer.php') ?> <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>--> <script src="https://cdn.ckeditor.com/ckeditor5/40.0.0/classic/ckeditor.js"></script> <script> let editor1; ClassicEditor .create( document.querySelector( '#editor1' ) ) .then( newEditor => { editor1 = newEditor; } ) .catch( error => { console.error( error ); } ); $(document).ready(function(){ $("#Submit").click(function(){ var pname = $("#pname").val(); var profile = $("#profile").val(); var alt = $("#alt").val(); var banner = $("#banner")[0].files[0]; const editordata1 = editor1.getData(); var fd = new FormData(); fd.append("pname", pname); fd.append("profile", profile); fd.append("alt", alt); fd.append("banner", banner); fd.append("editordata1", editordata1); $.ajax({ url:"ajax/testimonial-ajax.php", type:"POST", data:fd, dataType: 'json', contentType: false, processData: false, success:function(resp){ if(resp == 1){ alert('Good Job !'); location.reload(); }else{ alert('something Went Wrong!'); } } }) }); $("#update").click(function(){ var id = $("#id").val(); var pname = $("#pname").val(); var profile = $("#profile").val(); var alt = $("#alt").val(); var banner = $("#banner")[0].files[0]; var bannerold = $("#bannerold").val(); const editordata1 = editor1.getData(); var fd = new FormData(); fd.append("id", id); fd.append("pname", pname); fd.append("profile", profile); fd.append("alt", alt); fd.append("banner", banner); fd.append("bannerold", bannerold); fd.append("editordata1", editordata1); $.ajax({ url:"ajax/testimonial-update.php", type:"POST", data:fd, dataType: 'json', contentType: false, processData: false, success:function(resp){ if(resp == 1){ alert('Good Job !'); window.location.href="service-category.php"; }else{ alert('something Went Wrong!'); } } }) }); }); </script>