D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
kavyaeventz.in
/
admin
/
Filename :
service.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 products where id = '$id'"; $query1 = mysqli_query($conn, $sql1); $row1 = mysqli_fetch_array($query1); $thumbnail_image = explode(',', $row1['thumbnail_image']); $img_count = count($thumbnail_image); $video1 = $row1['video1']; $video2 = $row1['video2']; $detail_image = explode(',', $row1['detail_image']); $img_count2 = count($detail_image); ?> <div class="theme-form mega-form" > <div class="row"> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Service Category</label> <select class="form-control" id="category"> <option>--- Select category ---</option> <?php $cat_serv_sql = mysqli_query($conn, "select * from service_cat"); while($cat_serv_data = mysqli_fetch_array($cat_serv_sql)){ $name_cat = $cat_serv_data['name']; ?> <option <?php echo ($row1['catagory'] == $name_cat) ? "selected": ""; ?>><?= $name_cat;?></option> <?php } ?> </select> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Event Name</label> <input class="form-control" type="text" value="<?= $row1['pname'];?>" 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">Meta Title</label> <textarea class="form-control" type="text" value="" id="meta1"><?= $row1['meta1'];?></textarea> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Meta Keyword</label> <textarea class="form-control" type="text" value="" id="meta2"><?= $row1['meta2'];?></textarea> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Meta description</label> <textarea class="form-control" type="text" value="" id="meta3"><?= $row1['meta3'];?></textarea> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Meta slug</label> <textarea class="form-control" type="text" value="" id="meta4"><?= $row1['meta4'];?></textarea> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">SEO Syntex</label> <textarea class="form-control" value="" id="pixcel"><?= $row1['pixcel'];?></textarea> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">Script</label> <textarea class="form-control" type="text" value="" id="script"><?= $row1['script'];?></textarea> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">YT Video 1</label> <input class="form-control" type="text" value="<?= $video1;?>" id="video1"> <!--<textarea class="form-control" ></textarea>--> </div> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">YT Video 2</label> <input class="form-control" type="text" value="<?= $video2;?>" id="video2"> <!--<textarea class="form-control" value="<?= $video2;?>" id="video2"></textarea>--> </div> </div> <div class="col-3"> <div class="mb-3"> <label class="col-form-label">Banner</label> <input class="form-control" type="file" id="banner"> <input class="form-control" type="hidden" value="<?= $row1['banner'];?>" id="bannerold"> <div class="row"> <?php if($id != ""){ ?> <div class="col"> <img src="images/new/<?= $row1['banner'];?>" alt="zo-th-1" height="100"/> </div> <?php } ?> </div> </div> </div> <div class="col-3"> <label class="col-form-label">Alt Banner</label> <input class="form-control" type="text" value="<?= $row1['altb'];?>" id="altb"> </div> <div class="col-3"> <div class="mb-3"> <label class="col-form-label">Event Image</label> <input class="form-control" type="file" value="" id="formFile1" multiple=""> <div class="row"> <?php if($id != ""){ for ($i = 0; $i < $img_count; $i++) { ?> <div class="col"> <img src="images/new/<?php echo trim($thumbnail_image[$i]); ?>" alt="zo-th-1" height="100"/> </div> <?php }} ?> </div> </div> </div> <div class="col-3"> <label class="col-form-label">Alt Event</label> <input class="form-control" type="text" value="<?= $row1['alte'];?>" id="alte"> </div> <div class="col-6"> <div class="mb-3"> <label class="col-form-label">OUR PHOTO GALLERY</label> <input class="form-control" type="file" value="" id="formFile2" multiple=""> <div class="row"> <?php if($id != ""){ for ($i = 0; $i < $img_count2; $i++) { ?> <div class="col"> <img src="images/new/<?php echo trim($detail_image[$i]); ?>" alt="zo-th-1" height="100"/> </div> <?php }} ?> </div> </div> </div> <div class="col-6"> <label class="col-form-label">Alt Gallery</label> <input class="form-control" type="text" value="<?= $row1['altg'];?>" id="altg"> </div> </div> <div class="mb-3"> <label class="col-form-label">Event Description</label> <div id="editor1"><?= html_entity_decode($row1['description']);?></div> </div> <!--<div class="mb-3">--> <!-- <label class="col-form-label">Our Mission & Vission</label>--> <!-- <div id="editor3"><?= html_entity_decode($row1['additional']);?></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 ); } ); // let editor3; // ClassicEditor // .create( document.querySelector( '#editor3' ) ) // .then( newEditor => { // editor3 = newEditor; // } ) // .catch( error => { // console.error( error ); // } ); $(document).ready(function(){ $("#Submit").click(function(){ var category = $("#category").val(); var pname = $("#pname").val(); var meta1 = $("#meta1").val(); var meta2 = $("#meta2").val(); var meta3 = $("#meta3").val(); var meta4 = $("#meta4").val(); var video1 = $("#video1").val(); var video2 = $("#video2").val(); var script = $("#script").val(); var pixcel = $("#pixcel").val(); var banner = $("#banner")[0].files[0]; const editordata1 = editor1.getData(); // const editordata3 = editor3.getData(); var totalformFile1 = document.getElementById('formFile1').files.length; var totalformFile2 = document.getElementById('formFile2').files.length; var altb = $("#altb").val(); var alte = $("#alte").val(); var altg = $("#altg").val(); var fd = new FormData(); fd.append("category", category); fd.append("pname", pname); fd.append("meta1", meta1); fd.append("meta2", meta2); fd.append("meta3", meta3); fd.append("meta4", meta4); fd.append("video1", video1); fd.append("video2", video2); fd.append("script", script); fd.append("pixcel", pixcel); fd.append("banner", banner); fd.append("editordata1", editordata1); // fd.append("editordata3", editordata3); fd.append("altb", altb); fd.append("alte", alte); fd.append("altg", altg); for (var index = 0; index < totalformFile1; index++) { fd.append("formFile1[]", document.getElementById('formFile1').files[index]); } for (var index = 0; index < totalformFile2; index++) { fd.append("formFile2[]", document.getElementById('formFile2').files[index]); } $.ajax({ url:"ajax/product-insert.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;?>'; var category = $("#category").val(); var pname = $("#pname").val(); var meta1 = $("#meta1").val(); var meta2 = $("#meta2").val(); var meta3 = $("#meta3").val(); var meta4 = $("#meta4").val(); var video1 = $("#video1").val(); var video2 = $("#video2").val(); var script = $("#script").val(); var pixcel = $("#pixcel").val(); var banner = $("#banner")[0].files[0]; var bannerold = $("#bannerold").val(); const editordata1 = editor1.getData(); // const editordata3 = editor3.getData(); var totalformFile1 = document.getElementById('formFile1').files.length; var totalformFile2 = document.getElementById('formFile2').files.length; var altb = $("#altb").val(); var alte = $("#alte").val(); var altg = $("#altg").val(); var fd = new FormData(); fd.append("id", id); fd.append("category", category); fd.append("pname", pname); fd.append("meta1", meta1); fd.append("meta2", meta2); fd.append("meta3", meta3); fd.append("meta4", meta4); fd.append("video1", video1); fd.append("video2", video2); fd.append("script", script); fd.append("pixcel", pixcel); fd.append("banner", banner); fd.append("bannerold", bannerold); fd.append("editordata1", editordata1); // fd.append("editordata3", editordata3); fd.append("altb", altb); fd.append("alte", alte); fd.append("altg", altg); for (var index = 0; index < totalformFile1; index++) { fd.append("formFile1[]", document.getElementById('formFile1').files[index]); } for (var index = 0; index < totalformFile2; index++) { fd.append("formFile2[]", document.getElementById('formFile2').files[index]); } $.ajax({ url:"ajax/product-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-table.php"; }else{ alert('something Went Wrong!'); } } }) }); }); </script>