<?php
error_reporting(0);
session_start();
include '../include/connection.php';
$conn     = db();
@extract($_REQUEST);
$folder='../upload/banner/';
$file=time().@str_replace(' ','-',$_FILES['image']['name']);
if(move_uploaded_file(@$_FILES['image']['tmp_name'],$folder.$file))
{
$image=$file;
}

$logofile=time().@str_replace(' ','-',$_FILES['logo_image']['name']);
if(move_uploaded_file(@$_FILES['logo_image']['tmp_name'],$folder.$logofile))
{
$logo_image=$logofile;
}

$sql="insert into tbl_gallery set
gallery_title='".$_REQUEST['gallery_title']."',
gallery_position='".$_REQUEST['gallery_position']."',
gallery_link='".$_REQUEST['gallery_link']."',
gallery_alt='".$_REQUEST['gallery_alt']."',
pg_status='".$_REQUEST['pg_status']."',
logo_image='".$logo_image."',
gallery_image='".$image."'";
if(mysqli_query($conn,$sql))
{
$_SESSION['add-banner-msg']="Add Successfully";
?>
<script>window.location.href='add-gallery.php'</script>
<?php } ?>