<?php
include("loginkey.php");//引入权限检测文件
include("include/config.php");//引入公共变量文件
include("include/common.php");//引入公共函数文件
$lm_nmname = cinput($_POST['lm_nmname']);
$lm_nmid = cinput($_POST['lm_nmlist']);
$lm_error = cinput($_POST['lm_error']);
$lm_setname = cinput($_POST['lm_setname']);
$lm_nmseo = cinput($_POST['lm_nmseo']);
$lm_action = cinput($_POST['lm_action']);

switch($lm_nmid){
  case 0:
    $sqlstr="insert into limao_nm(lm_nmid,lm_nmname,lm_setname,lm_nmseo,lm_action,lm_error) value('".mysql_real_escape_string($lm_nmid)."','".mysql_real_escape_string($lm_nmname)."','".mysql_real_escape_string($lm_setname)."','".mysql_real_escape_string($lm_nmseo)."','".mysql_real_escape_string($lm_action)."','".mysql_real_escape_string($lm_error)."')";
    limaors($sqlstr);
    viewmsg('你成功添加一个顶级栏目','list_namo.php');
    break;
  default:
    $nmstr = "select * from limao_nm where lm_id=$lm_nmid";
    $nmrs = mysql_query($nmstr) or die('参数错误');
    $nmdata = mysql_fetch_object($nmrs);
    $lm_error = rinput($nmdata->lm_error);
    $sqlstr="insert into limao_nm(lm_nmid,lm_nmname,lm_setname,lm_nmseo,lm_action,lm_error) value('".mysql_real_escape_string($lm_nmid)."','".mysql_real_escape_string($lm_nmname)."','".mysql_real_escape_string($lm_setname)."','".mysql_real_escape_string($lm_nmseo)."','".mysql_real_escape_string($lm_action)."','".mysql_real_escape_string($lm_error)."')";
    limaors($sqlstr);
    viewmsg('你选择了添加一个二级栏目','list_namo.php');
}


?>