file_get_contents
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u247928417
/
domains
/
ecobrim.in
/
public_html
/
admin
/
Filename :
add-update-media.php
back
Copy
<?php error_reporting(0); session_start(); include("config/config.php"); $selContent="SELECT * FROM `gallery` "; $dataContent =mysqli_query($conn,$selContent) or die(mysqli_error()); if($_REQUEST['submit']){ //image $filename = $_FILES["uploadfile"]["name"]; $tempname = $_FILES["uploadfile"]["tmp_name"]; $folder = "gallery-images/".time().'-'.$filename; $AddProduct="INSERT INTO `gallery`(`image`, `status`) VALUES ('".$folder."','Active')"; $dataAdd =mysqli_query($conn,$AddProduct) or die(mysqli_error()); if(move_uploaded_file($tempname, $folder)){ $successmsg="Certification Added Successfully!"; echo '<meta http-equiv="refresh" content="2; url=add-update-certification" />'; }else{ $errormsg="Certification Not Added!"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="description" content="" /> <meta name="author" content="" /> <title>Eco Brim | Admin</title> <?php include("inc/header-files.php");?> </head> <body class="sb-nav-fixed"> <?php include("inc/header.php");?> <div id="layoutSidenav"> <?php include("inc/side-menu.php");?> <div id="layoutSidenav_content"> <main> <div class="container-fluid"> <h1 class="mt-4">Media</h1> <?php if($successmsg!=''){?> <div class="alert alert-success"><?php echo $successmsg;?></div> <?php } if($errormsg!=''){?> <div class="alert alert-danger"><?php echo $errormsg;?></div> <?php }?> <div class="card mb-4"> <div class="card-header"> <i class="fas fa-table mr-1"></i> Media Add/Update </div> <div class="card-body"> <form method="POST" enctype="multipart/form-data"> <div class="form-group"> <label class="small mb-1" for="inputEmailAddress">Media Image</label> <input class="form-control" type="file" name="uploadfile" required/> </div> <div class="form-group d-flex align-items-center justify-content-between mt-4 mb-0"> <input type="submit" name="submit" value="Add Media" class="btn btn-primary"> </div> </form> <div class="table-responsive" style="margin-top:40px;"> <table class="table table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>Media Image</th> <th>Status</th> <th>Update</th> </tr> </thead> <tbody> <?php while($ProductDetails=mysqli_fetch_assoc($dataContent)){?> <tr> <td><img src="<?php echo $ProductDetails['image'];?>" width="100"></td> <td><?php echo $ProductDetails['status'];?></td> <td><a href="update-media-image?gid=<?php echo $ProductDetails['gallery_id'];?>">Update</a></td> </tr> <?php }?> </tbody> </table> </div> </div> </div> </div> </main> <?php include("inc/footer.php");?> </div> </div> <?php include("inc/footer-files.php");?> </body> </html>