<?php

/*

		用户偏好加载

*/

if( !is_array($Project) ){
	ob_clean();
	exit("Forbidden");	
}

///////////////////////////////////

//读取当前用户偏好设置
if( $_SESSION["Manager"]["id"] ){

	$config = $VICACHE["sys.admin"][$_SESSION["Manager"]["id"]]["config"];

	if( $config ){
		$Custom = fix_json( $config );	
	}

}

//圣诞节（共5天）
if( date("m")==12 && date("d")>20 && date("d")<30 ){

	//圣诞帽
	if( $Custom["ui-head"] != "N" ){	
		echo '<div id="newyear"><img id="lanternPoint" src="image/hat.png" alt="圣诞节快乐！" /></div>';	
	}

	//下雪花
	if( $Custom["ui-snow"] != "N" ){


		echo '<script src="source/snow/jsized.snow.min.js" type="text/javascript"></script>        
		<script type="text/javascript">createSnow("source/snow/", 60);</script>';

		//积雪
		echo '<div id="snow"></div>';

	}

}

/***********************/

//农历春节（共30天）
$lunar = new Lunar();

//得到今年春节的日期
$date = $lunar->getLar(date("Y").'-12-31',1);

//15天
$day15 = 3600*24*10;

//前后15天，共30天
if( $date - $day15 <= time() && $date + $day15 >= time() ){

	//圣诞帽
	echo '<div id="newyear" class="spring"><img id="lanternPoint" src="image/spring.png" alt="农历春节！" /></div>';

}
	
	
?>