D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
kavyaeventz.in
/
admin
/
Filename :
video_edit.php
back
Copy
<?php include('include/header.php'); $id=$_GET['eid']; $sql=mysqli_query($conn,"select * from videos where vid_id ='$id'"); $fetch=mysqli_fetch_array($sql); if(isset($_POST['update'])) { $id = $_POST['id']; $Vcategory =$_POST['addcategory']; $Vtitle =$_POST['title']; $date = date('Y/m/d'); $videoPath =$_POST['video']; $updateData=mysqli_query($conn,"UPDATE `videos` SET `vid_id`='$id',`category_name`='$Vcategory',`video_title`='$Vtitle',`video_name`='$videoPath',`date`='$date' WHERE vid_id ='$id'"); if($updateData) { echo "<script>alert('Data Updated');window.location.href='videos.php';</script>"; } else { echo mysqli_error($conn); } } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <div class="container-full"> <!-- Main content --> <section class="content"> <div class="box"> <div class="box-header with-border"> <h4 class="box-title">Edit Video</h4> </div> <!-- /.box-header --> <div class="box-body"> <form role="form" method="POST" enctype="multipart/form-data"> <!-- text input --> <div class="form-group"> <label class="form-label">Id</label> <input type="text" class="form-control" name="id" value="<?php echo $fetch['vid_id'];?>" readonly> </div> <div class="form-group"> <label class="form-label">Category</label> <select class="form-control" name="addcategory" required> <?php $catdata = mysqli_query($conn,"select * from video_category"); while ($row = mysqli_fetch_assoc($catdata)) { ?> <option <?php echo $fetch['category_name'] == $row['id'] ? "selected" : ""; ?> value="<?php echo $row['id']; ?>" ><?php echo $row['category_name']; ?></option> <?php }?> </select> </div> <div class="form-group"> <label class="form-label">Video Title</label> <input type="text" class="form-control" value="<?php echo $fetch['video_title'];?>" name="title" required> </div> <div class="form-group"> <label class="form-label">Video Link</label> <input type="text" class="form-control" value="<?php echo $fetch['video_name'];?>" name="video" required> </div> <div class="box-footer"> <button type="submit" class="btn btn-success" name="update">Update</button> </div> </form> <div class="error"><?php if(!empty($msg)){ echo $msg; } ?></div> </div> <!-- /.box-body --> </div> </div> <!-- /.box-body --> </div> </section> <!-- /.content --> </div> </div> <?php include('include/footer.php');?>