<?php include('../../config/setup.php');?>

<?php
if(isset($_POST['Lee_home_img_edit'])){
	$id = $_POST['Edit_home_id'];
    $aboutimage = $_FILES['home_image']['name'];
    $aboutphoto="../../../img/home/".$aboutimage;
    move_uploaded_file($_FILES["home_image"]["tmp_name"],$aboutphoto);
    $imageediton=date('Y-m-d'); 
    $sql="UPDATE cms SET home_img ='$aboutimage' where cms_id= '$id' ";
    $update_about_photo=mysqli_query($config,$sql);
    if($update_about_photo==false)
    {
        echo  "<script>window.location.href='../homepage.php?erro=0';</script>".mysqli_error($update_abot);	 
    }
    else{
        echo  "<script>window.location.href='../homepage.php?mes=0';</script>";	   
    }
}


    if(isset($_POST['Lee_home_edit'])){ 
        $sql = "update cms set home_title='".$_POST['home_title']."' , home_desc='".$_POST['home_desc']."' where cms_id='".$_POST['Edit_home_cms_id']."'"; 
        $update_about=mysqli_query($config,$sql);
        if($update_about==false) {
            echo  "<script>window.location.href='../homepage.php?erro=0';</script>".mysqli_error($update_abot);	 
        }else{
            echo  "<script>window.location.href='../homepage.php?mes=0';</script>";	 	
        }
    }
?>