<?
$C_126cmsadmin_tname = 'menu_config';

include(dirname(__FILE__)."/global.php");



@$job = $submitted_vars["job"];

if($job == "add"){
  $postdb = $_POST['postdb'];
  
    //写入数据库
  $query = "insert into `w6_menu`
            (`name`,`linkurl`,`color`,`target`,`hide`,`list`,`m_bz_1`,`m_bz_1_sm`,`m_bz_2`,`m_bz_2_sm`)
            values
            ('".$postdb['name']."','".$postdb['linkurl']."','".$postdb['color']."','".$postdb['target']."','".$postdb['hide']."','".$postdb['list']."','".$postdb['m_bz_1']."','".$postdb['m_bz_1_sm']."','".$postdb['m_bz_2']."','".$postdb['m_bz_2_sm']."')";

  $result = mysql_query($query) or die(mysql_error());
  if ($result)
     {
       $showmsg = "导航菜单添加成功！";
	   $formurl = "menu.php";
     }
  else
     {
       $showmsg = "导航菜单添加失败！";
	   $formurl = "menu_add.php";
     }
	 
  include('showmsg.php');
  exit;
  
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: underline;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
-->
</style></head>

<body>
<div align="center" class="font12">
  <table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#A4B6D7">
    <tr>
      <td width="100%" height="22" align="center" background="images/titlebg.jpg">&nbsp;</td>
    </tr>
  </table>
  <br />
  <table width="100%" height="25" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td align="left" bgcolor="#FFFFFF"> [<a 
      href="menu.php" class="a_bt">菜单管理</a>] 
      [<a 
      href="menu_add.php" class="a_bt">新添加一个链接</a>] </td>
    </tr>
  </table>
  <br />
  <br />
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tr>
      <td height="22" align="left" class="head">菜单管理</td>
    </tr>
    <tr>
      <td height="24" align="left">
	  <form id="form1" name="form1" method="post" action="">
	  <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="table2">
        <tr>
          <td width="34%" height="28" bgcolor="#FFFFFF">菜单名称 </td>
          <td width="66%" bgcolor="#FFFFFF"><input name="postdb[name]" /></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">链接地址</td>
          <td bgcolor="#FFFFFF"><input size="50" name="postdb[linkurl]" />
          首页链接可直接加“/”</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">字体颜色<SCRIPT>
function foreColor_font(obj)
{
  var arr = showModalDialog('images/selcolor.htm', '', 'dialogWidth:18.5em; dialogHeight:17.5em; status:0');
  if (arr != null) { obj.value=arr;obj.style.color=arr;}
  else  obj.focus();
  
}
</SCRIPT></td>
          <td bgcolor="#FFFFFF"><input onclick="foreColor_font(this);" name="postdb[color]" /></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">打开方式</td>
          <td bgcolor="#FFFFFF"><input type="radio" checked="checked" value="0" name="postdb[target]" />
本窗口打开
  <input type="radio" value="1" name="postdb[target]" />
新窗口打开</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">隐藏/显示</td>
          <td bgcolor="#FFFFFF"><input type="radio" checked="checked" value="0" name="postdb[hide]" />
显示
  <input type="radio" value="1" name="postdb[hide]" />
隐藏</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">排序值</td>
          <td bgcolor="#FFFFFF"><input maxlength="4" size="5" name="postdb[list]" />
(数字) </td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">备注1：</td>
          <td bgcolor="#FFFFFF"><input name="postdb[m_bz_1]]" type="text" id="m_bz_1" size="44" />
            说明：
              <input name="postdb[m_bz_1_sm]" type="text" id="m_bz_1_sm" size="36" /></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">备注2：</td>
          <td bgcolor="#FFFFFF"><input name="postdb[m_bz_2]" type="text" id="m_bz_2" size="44" />
说明：
  <input name="postdb[m_bz_2_sm]" type="text" id="m_bz_2_sm" size="36" /></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">&nbsp;</td>
          <td bgcolor="#FFFFFF"><input type="submit" value="提交" name="Submit" />
            <input name="job" type="hidden" id="job" value="add" /></td>
        </tr>
      </table>
        </form>
      </td>
    </tr>
  </table>
  </div>
</body>
</html>
