<?php
error_reporting(0);
session_start();
include '../include/connection.php';
$conn     = db();
@extract($_REQUEST);
$folder='../upload/';
if($_FILES['image']['name'])
{
$file=time().@str_replace(' ','-',$_FILES['image']['name']);
if(move_uploaded_file(@$_FILES['image']['tmp_name'],$folder.$file))
{
$image=$file;
}
}
else
{
$websel=mysqli_query($conn,"select * from tbl_admin where uid='".$_SESSION['uid']."'");
$webres=mysqli_fetch_array($websel);
$image=$webres['image'];
}
$sql="update tbl_admin set
name='".$_REQUEST['name']."',
phone='".$_REQUEST['phone']."',
email='".$_REQUEST['email']."',
image='".$image."',
designation='".$_REQUEST['designation']."' where uid='".$_SESSION['uid']."'";
if(mysqli_query($conn,$sql))
{
$_SESSION['manage-profile-msg']="Updated Successfully";
?>
<script>window.location.href='profile.php'</script>
<?php } ?>