<?php
	include_once("check_login.php");
	include_once("include/config.php");
	$action = trim($_GET["action"]);
	if($action == "save"){
		check_site_url();
		$order_arr = $_POST["order"];
		$des_arr = $_POST["des"];
		foreach($order_arr as $key => $val){
			//order是否为数字
			$val = intval($val);
			if(!check_is_numb($val) || $val < 0)
				show_err("图片顺序号必须是数字");
			mysql_query("update hmcss_img set img_order = $val,img_des = '" . addslashes(trim($des_arr[$key])) . "' where img_id = $key")
				or show_err("更新幻灯图片出错,请联系管理员");
		}
		set_flash_xml();
		show_err("幻灯图片已成功修改","set_img_flash.php");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页FLASH图片</title>
<style type="text/css">
.set_photo li{width:388px; height:330px;}
</style>
<link rel="stylesheet" type="text/css" href="style.css" />
<script language="javascript">
function show_menu(numb)
{
	document.getElementById("menu_" + numb).style.display="inline";
}
function noshow_menu(numb)
{
	document.getElementById("menu_" + numb).style.display="none";
}
</script>
</head>

<body>
<div class="head_menu"><span class="head_menu_on"><a href="set_img_flash.php">首页幻灯图</a></span><a href="set_img_honner.php">企业荣誉图片</a><a href="set_img_best.php">实力展示图片</a><a href="set_product_img.php">产品图片</a><a href="set_img_upload.php">图片上传</a></div>
<div class="set_main_out">
	<?php
		if(!$hm_arr = get_hm_imgs("flash"))
			echo "取网站图片信息出错(幻灯图)，或暂时没有幻灯图片";
		else
		{
			echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"set_img_flash.php?action=save\">";
			echo "	<div class=\"set_photo\" style=\"width:860px;\">\n";
			echo "		<ul>\n";
        	foreach($hm_arr as $key=>$val)
				echo "<li onmouseover=\"show_menu($key)\" onmouseout=\"noshow_menu($key)\"><a href=\"../flash_pic/$val[1]\" target=\"_blank\"><img src=\"../flash_pic/$val[1]\" border=\"0\" style=\"width:388px; height:300px;\" /></a><div id=\"menu_$key\" class=\"div_menu\"><span class=\"del_img\"><a href=\"javascript:if(confirm('确定要删除这个文件吗[不可恢复]')) location.href='DEL.php?type=flash&id=$val[0]';\">删除</a></span></div><span>顺序:<input name=\"order[$val[0]]\" type=\"text\" id=\"order[$val[0]]\" maxlength=\"2\" style=\"margin-top:2px; width:30px;\" value=\"$val[3]\" />&nbsp;&nbsp;描述:<input name=\"des[$val[0]]\" type=\"text\" id=\"des[$val[0]]\" maxlength=\"50\" style=\"margin-top:2px; width:250px;\" value=\"$val[2]\" /></span></li>\n";
			echo "    	</ul>";
			echo "	</div>";
			echo "<div style=\"width:840px; margin:20px auto; text-align:center; clear:both;\">\n";
			echo "<input type=\"submit\" name=\"button\" id=\"button\" value=\"  提 交  \" />\n";
			echo "</div>\n";
			echo "</form>";
		}
	?>
</div>
</body>
</html>