| Server IP : 92.204.40.98 / Your IP : 216.73.216.201 Web Server : LiteSpeed System : Linux amster.dnsfors.com 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : tmksyste ( 2190) PHP Version : 8.3.31 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/tmksyste/domains/tmksystems.in/private_html/NS/d2/TMAdmin/ |
Upload File : |
<?php
include"header.php";
$todo= 1;
include"sidebar.php";
?>
<!-- ============================================================== -->
<!-- Start right Content here -->
<!-- ============================================================== -->
<div class="main-content">
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Edit Video Gallery</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item">
<a href="javascript: void(0);">Video Gallery</a>
</li>
<li class="breadcrumb-item active">Edit</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<!--end col-->
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs-custom rounded card-header-tabs border-bottom-0" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#personalDetails" role="tab" aria-selected="false">
<i class="fas fa-home"/> Edit Video Gallery
</a>
</li>
</ul>
</div>
<?php
$status = "OK"; //initial status
$msg="";
if(ISSET($_POST['save'])){
$slide_title = mysqli_real_escape_string($con,$_POST['slide_title']);
//$ufile = $_POST['ufile'];
$slider_img=mysqli_query($con,"SELECT `ufile` FROM `video_gallery` WHERE `id`='$todo'");
$slider_img_res= mysqli_fetch_row($slider_img);
$slider_video = $slider_img_res[0];
if(!empty($_FILES["video"]["tmp_name"]))
{
echo "hhhh";
$uploads_dir = 'uploads/video_gallery';
$tmp_name = $_FILES["video"]["tmp_name"];
// basename() may prevent filesystem traversal attacks;
// further validation/sanitation of the filename may be appropriate
$name = basename($_FILES["video"]["name"]);
$random_digit=rand(0000,9999);
$new_file_name=$random_digit.$name;
move_uploaded_file($tmp_name, "$uploads_dir/$new_file_name");
unlink('uploads/video_gallery/'.$slider_video);
if(empty($new_file_name))
$new_file_name=$slider_video;
}
else
$new_file_name=$slider_video;
if($status=="OK")
{
$qb=mysqli_query($con,"update video_gallery set video_title='$slide_title', ufile='$new_file_name' where id='$todo'");
if($qb){
$errormsg= "
<div class='alert alert-success alert-dismissible alert-outline fade show'>
Video Gallery Updated successfully.
<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>
</div>
"; //printing error if found in validation
}
}
elseif ($status!=="OK") {
$errormsg= "
<div class='alert alert-danger alert-dismissible alert-outline fade show'>
".$msg." <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button> </div>"; //printing error if found in validation
}
else{
$errormsg= "
<div class='alert alert-danger alert-dismissible alert-outline fade show'>
Some Technical Glitch Is There. Please Try Again Later Or Ask Admin For Help.
<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>
</div>"; //printing error if found in validation
}
}
?>
<?php
$query="SELECT * FROM video_gallery where id='$todo' ";
$result = mysqli_query($con,$query);
$i=0;
while($row = mysqli_fetch_array($result))
{
$id="$row[id]";
$slide_title="$row[video_title]";
$slider_video="$row[ufile]";
}
?>
<div class="card-body p-4">
<div class="tab-content">
<div class="tab-pane active" id="personalDetails" role="tabpanel">
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
print $errormsg;
}
?>
<form action="" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-6">
<div class="mb-3">
<label for="firstnameInput" class="form-label"> Video Title</label>
<input type="text" class="form-control" id="firstnameInput" name="slide_title" value="<?php print $slide_title ?>" placeholder="Enter Service Title">
</div>
</div>
<div class="col-lg-6">
<div class="mb-3">
<label for="firstnameInput" class="form-label">Video</label>
<br>
<video autoplay muted loop id="myVideo" style="width:50%;height:auto;margin-bottom:10px;">
<source src="uploads/video_gallery/<?php print $slider_video ?>" type="video/mp4">
</video>
<input type="file" class="form-control" id="firstnameInput" name="video" accept="video/*">
</div>
</div>
<!--end col-->
<!--end col-->
<div class="col-lg-12">
<div class="hstack gap-2 justify-content-end">
<button type="submit" name="save" class="btn btn-primary">Update Video Gallery</button>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
</form>
</div>
<!--end tab-pane-->
<!--end tab-pane-->
<!--end tab-pane-->
</div>
</div>
</div>
</div>
<!--end col-->
</div>
</div>
<!-- container-fluid -->
</div>
<!-- End Page-content -->
<?php include"footer.php";?>