<?php
	require '../../Run.php';
	echo head('新增小说');
	if($_POST['add'] == 'yes'){
		$mysql = new D('dd_book_name');
		$_POST['siteid'] = WAPID;
		$_POST['userid'] = MYID;
		$_POST['time']  = time();
		$_POST['pic']   = 'NULL';
		$_POST['v']    = '0';
		$_POST['ol']    = '1';
		$_POST['good']    = '0';
		$_POST['zan']    = '0';
		if($mysql -> insert()){
			echo '<div class="tip">小说添加成功</div>';
		}else{
			echo '<div class="tip">小说添加失败</div>';
		}
	}else{
		$left = '<a href="list.php?cid='.$_GET['cid'].'">返回</a>';
		$title = '添加书本';
		$right = ' ';
		echo topNav($title,$left,$right);
		echo '<div class="content">';
		echo '<form method="post" action="?">';
		echo '小说名称<br>';
		echo '<input name="title" type="text" vlue=""><br>';
		echo '<input name="gro" type="hidden" value="'.$_GET['cid'].'">';
		echo '<input name="add" type="hidden" value="yes">';
		echo '<select name="sm">
			<option value="原创">原创</option>
			<option value="转载">转载</option>
		</select></br>';
		echo '小说介绍<br>';
		echo '<textarea name="content"></textarea><br>';
		echo '<input type="submit" value="上传小说">';
		echo '</form>';
		echo '</div>';
	}
	echo footer(1);
?>