<?php
	$title='修改文章信息';
    require ('./header.php');
?>
<script charset="utf-8" src="./editor/kindeditor.js"></script>
<script charset="utf-8" src="./editor/lang/zh_CN.js"></script>
<div class="mdui-container" style="margin-top: 4%;">
	<div class="panel panel-default">
		<div class="panel-heading"><b><?php echo $lang->admin->edit_wz;?></b></div>
		<div class="panel-body">
			<div class="alert alert-info" role="alert">
				<center>温馨提示：序号用来排序[数字越小排名越前]，<a href="http://www.fontawesome.com.cn/faicons">Font Awesome图标</a></center>
			</div> 
			<form action="./submit.php" method="post">
				<?php
					mysql_query("set names utf8");
					$id = $_GET['id'];
					$sql = "select * from zzdh_wz where Id = '".$id."'";//查询数据库
					$result = mysql_query($sql);
					while($row = mysql_fetch_array($result))
				{	
				?>
				<input type="text" value="edit_wz" name="from" style="display: none;">
				<input type="text" value="<?php echo $id;?>" name="id" style="display: none;">

				<div class="input-group">
					<span class="input-group-addon" id="basic-addon1">名称</span>
					<input value="<?php echo $row['name'];?>" type="text" class="form-control" placeholder="请输入分类名称[必填]" aria-describedby="basic-addon1" name="name" required>
				</div>
				<br>
				<div class="input-group">
					<span class="input-group-addon" id="basic-addon1">推荐</span>
					<input value="<?php echo $row['tui'];?>" type="number" class="form-control" placeholder="请输入[必填，且只能填数字0或1,其中1代表推荐]" aria-describedby="basic-addon1" name="tui" required>
				</div>
				<br>
				<div class="input-group">
					<span class="input-group-addon" id="basic-addon1">分类</span>
					<select name="sortname" class="form-control" required>
						<option value="<?php echo $row['sortname'];?>"><?php echo $row['sortname'];?></option>
                      	<option value="" disabled>--------------------------------</option>
						<?php
							mysql_query("set names utf8");
							$result = mysql_query("SELECT * FROM zzdh_sortwz order by sid asc");
							while($rowi = mysql_fetch_array($result))
							{
						?>
						<option value="<?php echo $rowi['sortname'];?>"><?php echo $rowi['sortname'];?></option>
						<?php }?> 
					</select>
				</div>
				<br>
				<div class="input-group">
					<span class="input-group-addon" id="basic-addon1">文章内容</span>
					<textarea id="content" rows="15" class="form-control" placeholder="请输入文章内容" aria-describedby="basic-addon1" name="introduce" required><?php echo $row['introduce'];?></textarea>
				</div>
				<br>
			    <div style="text-align: center;">
			    	<input type="submit" class="btn btn-info" style="width: 80%;" value="修改">
			    </div>
				<?php }?>
			</form>
		</div>
	</div>
</div>
<script>
loadEditor('content');
</script>
<?php
    require ('./footer.php');
?>