D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
kavyaeventz.in
/
admin
/
Filename :
banner-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 Banner Image</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 service_cat 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-4"> <div class="mb-3"> <label class="col-form-label">Banner Image</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> <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> $(document).ready(function(){ $("#Submit").click(function(){ var banner = $("#banner")[0].files[0]; var fd = new FormData(); fd.append("banner", banner); $.ajax({ url:"ajax/banner-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!'); } } }) }); }); </script>