<?php include('../../config/setup.php');?>
<?php
 if(isset($_POST['Sub_category_content_edit']))
 { 
$editon=date('Y-m-d');
$addsugcatephoto=$_FILES['Add_sub_cate_icon']['name'];
if($addsugcatephoto){

	$addsubphoto="../../../photos/Slider/".$addsugcatephoto;
	move_uploaded_file($_FILES["Add_sub_cate_icon"]["tmp_name"],$addsubphoto);
	$update_main_cate=mysqli_query($config,"update sub_category set Sub_Category_Name='".$_POST['Edit_sub_cate_name']."',Add_sub_cate_icon='$addsugcatephoto',Sub_Category_Status='".$_POST['subcate_status']."',Sub_Category_Add_on='$editon' where Sub_Category_id='".$_POST['main_cate_id']."'");

}else{

$update_main_cate=mysqli_query($config,"update sub_category set Sub_Category_Name='".$_POST['Edit_sub_cate_name']."',Sub_Category_Status='".$_POST['subcate_status']."',Sub_Category_Add_on='$editon' where Sub_Category_id='".$_POST['main_cate_id']."'");
} 
if($update_main_cate==false)
{
echo mysqli_error();	 
}
else{
	
	echo "<script>window.location.href='../sub_category_Master.php?msg=100';</script>";	 

	
}

 }

?>

