<?php include('../../config/setup.php');?>
<?php
 if(isset($_POST['infra_edit']))
 { 
$editon=date('Y-m-d');
$update_main_cate=mysqli_query($config,"update infrastructure set infra_title='".$_POST['infra_title']."',infra_desc='".$_POST['infra_desc']."' where infra_id='".$_POST['infra_id']."'");
 if($update_main_cate==false)
{
echo mysqli_error();	 
}
else{
	
	echo "<script>window.location.href='../infrastructure.php?msg=100';</script>";	 

	
}

 }

?>
<?php
 if(isset($_POST['Edit_infra_image']))
 {
// 	 $up_main_cate=mysqli_query($config,"select Sub_Category_image from slider_master where slider_id='".$_POST['Edit_pro_slider_id']."'");
// $up_cate=mysqli_fetch_array($up_main_cate);
// unlink($up_cate[0]);
// $timezone = new DateTimeZone("Asia/Kolkata" );
// $date = new DateTime();
// $date->setTimezone($timezone );
// $today2=$date->format('s');	
$subimage=$_FILES['infra_image']['name'];
$subcatephoto="../../../img/infrastructure/".$subimage;
move_uploaded_file($_FILES["infra_image"]["tmp_name"],$subcatephoto);
$imageediton=date('Y-m-d'); 
 $sql="update infrastructure set infra_img='$subimage' where infra_id='".$_POST['infra_image_id']."'";

$update_service_photo=mysqli_query($config,$sql);
 if($update_service_photo==false)
{
echo "<script>window.location.href='../infrastructure.php?erro=0';</script>".mysqli_error();	 
}
else{
	
	echo "<script>window.location.href='../infrastructure.php?msg=100';</script>";	 

	
}

 }

?>

