<?php
include("loginkey.php");//引入权限检测文件
include("include/config.php");//引入公共变量文件
include("include/common.php");//引入公共函数文件
$lm_title = cinput($_POST['lm_title']);
$lm_content = cinput($_POST['lm_content']);
$lm_date = cinput($_POST['lm_date']);
$lm_action = cinput($_POST['lm_action']);
$atype = $_POST['atype'];
switch($atype){
  case "add":
  if($lm_title==''){
	 echo "<script>alert('标题信息不能为空');history.go(-1);</script>";
	 break;  
	}else{
    $sqlstr="insert into limao_single(lm_title,lm_content,lm_date,lm_action) value
('".mysql_real_escape_string($lm_title)."','".mysql_real_escape_string($lm_content)."','".mysql_real_escape_string($lm_date)."',
'".mysql_real_escape_string($lm_action)."')";
    limaors($sqlstr);
    viewmsg('单页信息发布成功！','single_list.php');
    break;
  }
  case "edit":
  $lm_id = intval($_POST['lm_id']);
  if(!is_numeric($lm_id)){
	echo "<script>alert('传入的参数错误');history.go(-1);</script>";
　break;
	}
   if($lm_title==''){
	 echo "<script>alert('标题信息不能为空');history.go(-1);</script>";
	 break;  
	}else{
 
   $sqlstr="update limao_single set lm_title='".mysql_real_escape_string($lm_title)."',lm_content='".mysql_real_escape_string($lm_content)."',
lm_date='".mysql_real_escape_string($lm_date)."',lm_action='".mysql_real_escape_string($lm_action)."' where lm_id='".mysql_real_escape_string($lm_id)."'";
    limaors($sqlstr);
    viewmsg('单页信息修改成功！','single_list.php');
 
    break;
  }
  
  
  default:
   
   
}


?>