<?php 
include_once('IsLogined.php');
$Aclass  = $_POST["ClassID"];
$Atitle  = $_POST['Title'];
$Ainfo   = $_POST["Content"];
$Aeditor = $_POST["AuthorName"];
if(empty($Aclass) || empty($Atitle) || empty($Ainfo)){
	echo("<script language=javascript>alert('填写不完整!');window.history.go(-1);</script>");
	exit();
}
include_once("../config/databaseConfig.inc.php");
$sql = "SELECT * FROM Article WHERE ID = -1"; 
# 从数据库中查询出一个空的资料集
$rs = $db->Execute($sql); # 执行查询，并取得一个空的资料集
$record = array(); # 初始化一个数组，以便存放记录资料供新增用
# 设定记录中的字段值
$record["Atitle"]  = $Atitle;
$record["Aclass"]  = $Aclass;
$record["Aeditor"] = $Aeditor;
$record["Ainfo"]   = $Ainfo;
$insertSQL = $db->GetInsertSQL($rs, $record,true);
$db->Execute($insertSQL); 
$rs->close();
$db->close();
echo("<script language=javascript>alert('添加成功!');window.location = 'Service.php' </script>");
exit;
?>