<?php include('../../config/setup.php');?>
<?php
 
// vission and mission edit

if(isset($_POST['Lee_v&m_edit'])){
    $sql = "update cms set Vission='".$_POST['vission']."' , Mission='".$_POST['mission']."' where cms_id='".$_POST['Edit_about_cms_id']."'" ;
    $update_about=mysqli_query($config,$sql);
    if($update_about==false){
        echo  "<script>window.location.href='../vis_and_mis.php?erro=0';</script>".mysqli_error($update_bout);	 
    }else{   
        echo  "<script>window.location.href='../vis_and_mis.php?mes=0';</script>";	    
    }
}

// milestone edit

    if(isset($_POST['miles_img_edit'])){
        $id = $_POST['miles_img_id'];
        $milestoneimage = $_FILES['miles_image']['name'];
        $milestonephoto="../../../img/milestone/".$milestoneimage;
        move_uploaded_file($_FILES["miles_image"]["tmp_name"],$milestonephoto);
        $imageediton=date('Y-m-d'); 
        $sql="UPDATE cms SET miles_img ='$milestoneimage' where cms_id= '$id' ";
        $update_milestone_photo=mysqli_query($config,$sql);
        if($update_milestone_photo==false)
        {
            echo  "<script>window.location.href='../milestone.php?erro=0';</script>".mysqli_error($update_abot);	 
        }
        else{
            echo  "<script>window.location.href='../milestone.php?mes=0';</script>";	   
        }
    }


    if(isset($_POST['miles_edit'])){ 
        $sql = "update cms set miles='".$_POST['miles_title']."' , miles_desc='".$_POST['miles_desc']."' where cms_id='".$_POST['Edit_miles_id']."'";        $update_about=mysqli_query($config,$sql);
        if($update_about==false) {
            echo  "<script>window.location.href='../milestone.php?erro=0';</script>".mysqli_error($update_abot);	 
        }else{
            echo  "<script>window.location.href='../milestone.php?mes=0';</script>";	 	
        }
    }

// infrastructure

    if(isset($_POST['infra_img_edit'])){
        $id = $_POST['infra_img_id'];
        $infraimage = $_FILES['infra_image']['name'];
        $infraphoto="../../../img/infrastructure/".$infraimage;
        move_uploaded_file($_FILES["infra_image"]["tmp_name"],$infraphoto);
        $imageediton=date('Y-m-d'); 
        $sql="UPDATE cms SET infra_img ='$infraimage' WHERE cms_id= '$id' ";
        $update_infra_photo=mysqli_query($config,$sql);
        if($update_infra_photo==false)
        {
            echo  "<script>window.location.href='../infrastructure.php?erro=0';</script>".mysqli_error($update_abot);	 
        }
        else{
            echo  "<script>window.location.href='../infrastructure.php?mes=0';</script>";	   
        }
    }


    if(isset($_POST['infra_edit'])){ 
        $sql = "UPDATE cms SET infra='".$_POST['infra_title']."' , infra_desc='".$_POST['infra_desc']."' WHERE cms_id='".$_POST['Edit_infra_id']."'";        $update_about=mysqli_query($config,$sql);
        if($update_about==false) {
            echo  "<script>window.location.href='../infrastructure.php?erro=0';</script>".mysqli_error($update_abot);	 
        }else{
            echo  "<script>window.location.href='../infrastructure.php?mes=0';</script>";	 	
        }
    }



?>
 