<?php 
	require_once('_approot.php');

	$ls_msg="修改下载操作";
	$id=$_GET['id'];
	$selectcate=$_GET['selectcate'];
		
	$download_sql="select * from ls_download where ID=".$id." ";
	$download_query=$opendb->query($download_sql);
	$download_rows=mysqli_fetch_assoc($download_query);
	
	$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">
        <script language="JavaScript" src="js/jquery.js"></script>
		<script language="JavaScript" src="js/ls.js"></script>
        <link rel="stylesheet" href="css/style2.css" />
		<title>无标题文档</title>
		
	</head>

	<body>
		<table width="98%" 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="update" name="ls">
					<input type="hidden" value="<?php echo $id;?>" name="id">
					<input type="hidden" value="<?php echo $download_rows['downloadName'];?>" name="Pic">
					<input type="hidden" name="ChangecatePagePic" value="no">
					 <table border="0" width="96%" 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="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f0f0ee">
					 
					  <tr> 
						<td height="28" colspan="4"></td>
					  </tr>
					  <tr bgcolor="#f4f4f4">
					    <td style="padding-left:20px;">分类</td>
					    <td width="43%">
					      <input type="text" name="cateName"  id="cateName" value="<?=$download_rows['cateName']?>" style="width:150px;"  />
					      <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="50%" colspan="2" rowspan="3" style="padding-left:20px;"><table width="100%" border="0">
  <tr>
    <td width="24%">标题 Title *</td>
    <td width="76%"><input name="newsTitle" id="newsTitle" type="text" value="<?php echo $download_rows['newsTitle'];?>" size="70" /></td>
  </tr>
  <tr>
    <td>关键字 Keywords</td>
    <td><input name="newsKeywords" id="newsKeywords" type="text" value="<?php echo $download_rows['newsKeywords'];?>" size="70" /></td>
  </tr>
  <tr>
    <td>描述 Description *</td>
    <td><textarea name="newsDescription" cols="71" rows="3" id="newsDescription"><?php echo $download_rows['newsDescription'];?></textarea></td>
  </tr>
</table>
</td>
                      </tr>
					  <tr bgcolor="#f4f4f4"> 
						<td style="padding-left:20px;" width="7%">标题 *</td>
						<td><input type="text" name="downloadTitle" id="downloadTitle" style="width:300px;" value="<?php echo $download_rows['downloadTitle'];?>"></td>
                      </tr>
					 
					  <tr bgcolor="#f4f4f4"> 
						<td style="padding-left:20px;" width="7%">下载
							 *						  <?php
								$name=substr($download_rows['downloadName'],-3);
								//echo $name;
								switch ($name)
								{
									case "doc":
										echo "<a href=\"../".$downloadFolders."/".$download_rows['downloadName']."\" title=\"查看\">";
										echo "<img src='images/doc.gif' border='0'>";
										echo "</a>";
										break;
									case "xls":
										echo "<a href=\"../".$downloadFolders."/".$download_rows['downloadName']."\" title=\"查看\">";
										echo "<img src='images/xls.gif' border='0'>";
										echo "</a>";
										break;
									case "rar":
										echo "<a href=\"../".$downloadFolders."/".$download_rows['downloadName']."\" title=\"查看\" >";
										echo "<img src='images/rar.gif' border='0'>";
										echo "</a>";
										break;
								}	
							?>
							
						</td>
						<td>
						文件名：
						  <input type="text" name="downloadName1" id="downloadName1" style="width:150px;"  readonly="readonly" value="<?php echo $download_rows['downloadName'];?>" />
                        <input type="file" name="downloadName" style="width:220px;" onChange="newsform.ChangecatePagePic.value='yes';">
</td>
                      </tr>
					  <tr bgcolor="#f0f0ee"> 
						<td height="25" colspan="4" align="center"><button name="submit3" type="submit" value="确定" onClick="
                        if($('#productDescription').val().length <= 0){
                        	$('#productDescription').val(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix1']?><?=$lan['seoSufix2']?>'+', '+document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix2']?><?=$lan['seoSufix2']?>');
                        }"/> 确定</button>
                        <button type="button" name="button" id="button" value="SEO" onclick="
                            if(confirm('您确定要修改SEO设置吗？')){
                            $('#newsTitle').val($('#downloadTitle').val()+' - '+$('#cateName').val()); 
                        $('#newsKeywords').val('<?=$title_value['siteKeywords']?>');
                        $('#newsDescription').val('<?=$title_value['siteDescription']?>');
	}else{
		return false;
	}"/>SEO</button>
    
   
    
    
                        </td>
					  </tr>
					</table>
				</form>
				</td>
			</tr>
		</table>
	</body>
</html>