<?php 
	require_once('_approot.php');	
	
	$selectcate=$_GET['selectcate'];
	$ls_msg="添加下载";
	$title_sql = "select * from ls_config";
	$title_query = $opendb->query($title_sql);
	$title_value = mysqli_fetch_assoc($title_query);
	
?>
<!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">
		<link href="css/admin.css" rel="stylesheet" type="text/css">
        <link rel="stylesheet" href="css/style2.css" />
        <script language="JavaScript" src="js/jquery.js"></script>
		<script language="JavaScript" src="js/ls.js"></script>
		<title>无标题文档</title>
	</head>
	<body>
		<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
			<tr>
                <td height="18" style="border-bottom:2px solid #00c0ef; padding-bottom:5px;"><div align="center"><font color="#3c8dbc" style="font-size:16px;">添加下载</font></div>
				</td>
			</tr>
			<tr>
				<td height="213" valign="top"><br>
				 <form name="newsform" enctype="multipart/form-data" method="post" action="savedownload.php?selectcate=<?=$selectcate?>" onSubmit="return Checkaddnews()">
					<input type="hidden" value="insert" name="ls">
					<table border="0" width="98%" align="center">
						<tr>
							<td>提示：<font color="#FF0000"><?php echo $ls_msg; ?></font></td>
							<td align="right"><img src="images/shao.gif">&nbsp;<a href="download.php?selectcate=<?=$selectcate?>">返回</a></td>
						</tr>
					</table>
					<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f0f0ee" style="padding-right:2%;">
					  <tr bgcolor="#f0f0ee"> 
						<td height="28" colspan="4"></td>
					  </tr>
					  <tr>
					    <td style="padding-left:20px;">分类 *</td>
					    <td width="38%"><input type="text" name="cateName"  id="cateName" value="<?=$selectcate==""?"":$selectcate?>" style="width:46%;"   />
					      <select name="select2" id="select2"  onchange="this.form.cateName.value=this.value;">
					        <option value="0">请选择分类：</option>
					        <?php 			$news_sql="SELECT distinct(cateName) FROM ls_download  where enable=1 and cateName!='' order by Num";//count the error by searchtype
			$news_query=$opendb->query($news_sql);
			while($news_rows2=mysqli_fetch_assoc($news_query))
		  	{
				echo "<option value=".$news_rows2['cateName'].">".$news_rows2['cateName']."</option>";

			}

			?>
				          </select>
					      可直接添分类</td>
                          <td width="14%" style="padding-left:20px;">标题 Title *</td>
                          <td width="38%"><input name="newsTitle" id="newsTitle" type="text" value="<?php echo $_POST['productTitle'];?>" style="width:96%;"  size="70" /></td>
				      </tr>
					  <tr> 
						<td style="padding-left:20px;" width="10%">标题</td>
						<td><input type="text" name="downloadTitle" style="width:96%;"  onblur="if($('#newsTitle').val().length <= 0){$('#newsTitle').val(this.value+' - '+$('#cateName').val()); 
                        $('#newsKeywords').val('<?=$title_value['siteKeywords']?>');
                        $('#newsDescription').val('<?=$title_value['siteDescription']?>');
                        }" ></td>
                        <td style="padding-left:20px;">关键字 Keywords</td>
                        <td><input name="newsKeywords" id="newsKeywords" type="text" value="<?php echo $_POST['productKeywords'];?>" style="width:96%;"  size="70" /></td>
					  </tr>
					  <tr> 
						<td style="padding-left:20px;" width="10%">下载文件</td>
						<td><input type="file" name="downloadName" style="width:300px;" ></td>
                        <td style="padding-left:20px;">描述 Description *</td>
                        <td><textarea name="newsDescription" style="width:96%;"  rows="3" id="newsDescription"></textarea>
                        <?=$promlv>1?$seo:""?></td>
					  </tr>
					  <tr> 
						<td height="58" colspan="4" align="center"><button type="submit" value="确定">确定</button></td>
					  </tr>
					</table>
				</form>
				</td>
			</tr>
		</table>
	</body>
</html>