/home3/vehiclea/public_html/admin-kalyanidentalclinics-com/banner_edit.php
<?php
include "header.php";
if(!empty($_GET['editId'])){
$banner_edit = banner_edit($_GET['editId']);
$row = mysqli_fetch_array($banner_edit);
}
if(!empty($_POST['submit'])){
banner_edit_data();
}
?>
<body>
<!-- ======= Header ======= -->
<!-- ======= Sidebar ======= -->
<main id="main" class="main">
<div class="pagetitle">
<h1>Services</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
<li class="breadcrumb-item active">Services</li>
</ol>
</nav>
</div><!-- End Page Title -->
<section>
<div class="container">
<h5 class="text-center"><strong>Edit Banners</strong></h5>
<div class="row">
<?php
if(!empty($_GET['succ']))
{
?>
<div align="center" style="color:green;"> <h4>Updated Successfully</h4></div>
<?php
}
?>
<form method="post" enctype="multipart/form-data" onsubmit="return banners_validation()">
<div class="col-md-6 mt-4">
<label for="inputText" class="col-sm-2 col-form-label">PageName</label>
<select name="page_name" id="page_name" class="form-control">
<option value="Home" <?php if($row['page_name'] == 'Home'){ echo "selected";}?>>Home</option>
<option value="About" <?php if($row['page_name'] == 'About'){ echo "selected";}?>>About Us</option>
<option value="Facility" <?php if($row['page_name'] == 'Facility'){ echo "selected";}?>>Facility</option>
<option value="Contact" <?php if($row['page_name'] == 'Contact'){ echo "selected";}?>>Contact Us</option>
<option value="Careers" <?php if($row['page_name'] == 'Careers'){ echo "selected";}?>>Careers</option>
<option value="Gallery" <?php if($row['page_name'] == 'Gallery'){ echo "selected";}?>>Gallery</option>
</select>
<div class="error" id="err1" align="center" style="color:red;"></div>
</div>
<div class="col-md-6 mt-4">
<label for="inputText" class="col-sm-2 col-form-label">PageTitle</label>
<input type="text" class="form-control" name="page_title" id="page_title" value="<?= $row['page_title']?>">
<div class="error" id="err2" align="center" style="color:red;"></div>
</div>
<div class="col-md-6 mt-4">
<label for="inputText" class="col-sm-2 col-form-label">Description</label>
<textarea class="form-control py-4 textarea-tiny" id="content" name="content" placeholder="Enter Content"
rows=10><?= $row['content']?></textarea>
<div class="error" id="err3" align="center" style="color:red;"></div>
</div>
<div class="col-md-6 mt-4">
<label for="inputText" class="col-sm-2 col-form-label">File Upload</label><strong>(Less than 1 MB)</strong>
<img src="uploads/banners/<?= $row['image']?>" width="50px">
<input class="form-control" type="file" id="formFile" name="formFile">
<div class="error" id="err4" align="center" style="color:red;"></div>
<input type="hidden" name="fileimage" id="fileimage" value="<?= $row['image']?>">
<img src="uploads/banners/<?= $row['image']?>">
</div>
<div class="col-md-6 mt-4">
<label for="inputText" class="col-sm-2 col-form-label">Status</label>
<select name="status" id="status" class="form-control">
<option value="1" <?php if($row['status'] == 1){ echo "selected";}?>>Active</option>
<option value="2" <?php if($row['status'] == 2){ echo "selected";}?>>Inactive</option>
</select>
<div class="error" id="err4" align="center" style="color:red;"></div>
</div>
<input type="hidden" name="edit_data" id="edit_data" value="<?= $row['id']?>">
<div class="col-md-6 mt-4">
<input type="submit" name="submit" value="Submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
</section>
</main><!-- End #main -->
<?php
include "footer.php";
?>
<script src="https://cloud.tinymce.com/5/tinymce.min.js"></script>
<script>
tinymce.init({
selector: '.textarea-tiny',
height: 500,
menubar: false,
width: '100%',
plugins: [
// 'advlist autolink lists link image charmap print preview anchor textcolor',
// 'searchreplace visualblocks code fullscreen',
// 'insertdatetime media table paste code help wordcount'
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc'
],
toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help',
image_advtab: true,
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tiny.cloud/css/codepen.min.css'
]
});
</script>
<style>
div.mce-branding-powered-by{
display: none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
function banners_validation(){
var image = document.getElementById('formFile');
if ($('#page_name').val() == '') {
valid_error("page_name", "Select Page Name", "err1");
return false;
}
else if ($('#formFile').val() == '') {
valid_error("formFile", "Choose File", "err4");
return false;
}
else if (image.files[0].size/(1024*1024)>=1) {
valid_error("formFile", "File size must be less than 1mb", "err4");
return false;
}
else
{
return true;
}
}
function valid_error(id, error, err) {
$('.errr').html('');
$('#' + err).show();
$('#' + err).html(error);
$('#' + id).focus();
return false;
}
</script>
@LwBee Strong Bypass
Upload File
Create New File