<?
$C_126cmsadmin_tname = 'menu_config';

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



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

if($job == "modify"){
  $postdb = $_POST['postdb'];
  
  $query="UPDATE `w6_menu` 
          SET `name`='".$postdb['name']."' , `linkurl`='".$postdb['linkurl']."' , `color`='".$postdb['color']."' , `target`='".$postdb['target']."' , `hide`='".$postdb['hide']."' , `list`='".$postdb['list']."' , `m_bz_1`='".$postdb['m_bz_1']."' , `m_bz_1_sm`='".$postdb['m_bz_1_sm']."' , `m_bz_2`='".$postdb['m_bz_2']."' , `m_bz_2_sm`='".$postdb['m_bz_2_sm']."'
		  WHERE `id`=".$postdb['id']; 
		  
  $result = mysql_query($query) or die(mysql_error());
  if ($result)
     {
       $showmsg = "导航菜单修改成功！";
	   $formurl = "menu_modify.php?id=".$postdb['id'];
     }
  else
     {
       $showmsg = "导航菜单修改失败！";
	   $formurl = "menu_modify.php?id=".$postdb['id'];
     }
	 
  include('showmsg.php');
  exit;
  
}

//从数据库中读出 产品的内容

$id          =  $submitted_vars["id"];

$query       =  "SELECT * FROM `w6_menu` WHERE `id` = '$id'";
$result      =  mysql_query($query);

$postdb['name']        =  stripslashes(mysql_result($result,"0","name"));
$postdb['linkurl']     =  stripslashes(mysql_result($result,"0","linkurl"));
$postdb['color']       =  stripslashes(mysql_result($result,"0","color"));
$postdb['target']      =  stripslashes(mysql_result($result,"0","target"));
$postdb['hide']        =  stripslashes(mysql_result($result,"0","hide"));
$postdb['list']        =  stripslashes(mysql_result($result,"0","list"));
$postdb['m_bz_1']      =  stripslashes(mysql_result($result,"0","m_bz_1"));
$postdb['m_bz_1_sm']   =  stripslashes(mysql_result($result,"0","m_bz_1_sm"));
$postdb['m_bz_2']      =  stripslashes(mysql_result($result,"0","m_bz_2"));
$postdb['m_bz_2_sm']   =  stripslashes(mysql_result($result,"0","m_bz_2_sm"));

?><!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]" value="<?=$postdb['name']?>" /></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">链接地址</td>
          <td bgcolor="#FFFFFF"><input name="postdb[linkurl]" value="<?=$postdb['linkurl']?>" size="50" />
            首页链接可直接加“/”</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 style="color:<? if($postdb['color']) echo $postdb['color'];?>;" name="postdb[color]" onclick="foreColor_font(this);" value="<?=$postdb['color']?>" /></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">打开方式</td>
          <td bgcolor="#FFFFFF"><input type="radio" value="0" name="postdb[target]" <? if($postdb['target'] == '0'){ echo 'checked="checked"';}?>/>
本窗口打开
  <input type="radio" value="1" name="postdb[target]" <? if($postdb['target'] == '1'){ echo 'checked="checked"';}?>/>
新窗口打开</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">隐藏/显示</td>
          <td bgcolor="#FFFFFF"><input type="radio" value="0" name="postdb[hide]" <? if($postdb['hide'] == '0'){ echo 'checked="checked"';}?>/>
显示
  <input type="radio" value="1" name="postdb[hide]" <? if($postdb['hide'] == '1'){ echo 'checked="checked"';}?>/>
隐藏</td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">排序值</td>
          <td bgcolor="#FFFFFF"><input name="postdb[list]" value="<?=$postdb['list']?>" size="5" maxlength="4" />
(数字) </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" value="<?=$postdb['m_bz_1']?>" size="20" />
          (字段名：m_bz_1)
            说明：
              <input name="postdb[m_bz_1_sm]" type="text" id="m_bz_1_sm" value="<?=$postdb['m_bz_1_sm']?>" size="30" /></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" value="<?=$postdb['m_bz_2']?>" size="20" />
          (字段名：m_bz_2)
说明：
  <input name="postdb[m_bz_2_sm]" type="text" id="m_bz_2_sm" value="<?=$postdb['m_bz_2_sm']?>" size="30" /></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="modify" />
            <input name="postdb[id]" type="hidden" id="id" value="<?=$id?>" /></td>
        </tr>
      </table>
        </form>
      </td>
    </tr>
  </table>
  </div>
</body>
</html>
