#12004/11/8 13:39:24
switch($subtype)
{
case "add":
$title=addslashes($title);
$content=addslashes($content);
$type=addslashes($type);
$from=addslashes($from);
$author=addslashes($author);
$date=addslashes($date);
$sql="insert into news set newstitle='$title',newscontent='$content',newstype='$type',newsfrom='$from',newsauthor='$author',newsdate='$date'";
$result=mysql_query($sql);
if ($result)
{
echo "<table width='90%' height='90%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle' class='titlewhite'>数据库更新成功,系统将在2秒中后返回,如需要手动返回请点击 [ <a href='newslist.php' target='rightframe' class='menu'>这里</a> ]</td></tr></table>";
}
else
{
echo "<table width='90%' height='90%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle' class='titlewhite'>数据库更新失败,系统将在2秒中后返回,如需要手动返回请点击 [ <a href='newslist.php' target='rightframe' class='menu'>这里</a> ]</td></tr></table>";
}
break;
case "edit":
$title=addslashes($title);
$content=addslashes($content);
$type=addslashes($type);
$from=addslashes($from);
$author=addslashes($author);
$date=addslashes($date);
$sql="update news set newstitle='$title',newscontent='$content',newstype='$type',newsfrom='$from',newsauthor='$author',newsdate='$date' where newsid=$id ";
$result=mysql_query($sql);
if ($result)
{
echo "<table width='90%' height='90%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle' class='titlewhite'>数据库更新成功,系统将在2秒中后返回,如需要手动返回请点击 [ <a href='newslist.php' target='rightframe' class='menu'>这里</a> ]</td></tr></table>";
}
else
{
echo "<table width='90%' height='90%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle' class='titlewhite'>数据库更新失败,系统将在2秒中后返回,如需要手动返回请点击 [ <a href='newslist.php' target='rightframe' class='menu'>这里</a> ]</td></tr></table>";
}
break;
case "del":
#echo "$cone";
$sql="delete from news where newsid in ('$cone')";
$result=mysql_query($sql);
if ($result)
{
echo "<table width='90%' height='90%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle' class='titlewhite'>数据库更新成功,系统将在2秒中后返回,如需要手动返回请点击 [ <a href='newslist.php' target='rightframe' class='menu'>这里</a> ]</td></tr></table>";
}
else
{
echo "<table width='90%' height='90%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center' valign='middle' class='titlewhite'>数据库更新失败,系统将在2秒中后返回,如需要手动返回请点击 [ <a href='newslist.php' target='rightframe' class='menu'>这里</a> ]</td></tr></table>";
}
break;
}