<?
$C_126cmsadmin_tname = 'wnm_config';

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




$module_id = $submitted_vars['module_id'];

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

if($job == "modify"){


  $array['field_id']         =    'field_set';
  $array['module_id']         =    $_POST["module_id"];
  $array['title_show_name']     =    $_POST["title_show_name"];
  $array['title_sm']     =    $_POST["title_sm"];
  $array['bdh_name']     =    $_POST["bdh_name"];
  $array['began_php']     =    $_POST["began_php"];
  $array['end_php']     =    $_POST["end_php"];

  //先从数据库中读出原来的设置参数,再加上现在的参数
  $query="SELECT * FROM `w6_module` WHERE `module_id`='".$module_id."'";
  $result=mysql_query($query);
  $f_module_config       =  mysql_result($result,"0","module_config");
  $f_array = unserialize($f_module_config);

  $field_name = 'field_set';
  $f_array[$field_name]=$array;	
  
  //print_r($f_array);exit;
  $module_config=addslashes(serialize($f_array));

  mysql_query("UPDATE `w6_module` SET `module_config`='$module_config' WHERE module_id='$module_id'");

}

//读取显示
  $query="SELECT * FROM `w6_module` WHERE `module_id`='".$module_id."'";
  $result=mysql_query($query);
  $f_module_config       =  mysql_result($result,"0","module_config");
  $f_array = unserialize($f_module_config);
  $field_set = $f_array['field_set'];
  //print_r($field_set);
  
  $field_set['title_sm'] = stripslashes($field_set['title_sm']);
  $field_set['began_php'] = stripslashes($field_set['began_php']);
  $field_set['end_php'] = stripslashes($field_set['end_php']);
  
  $field_set['title_sm'] = str_replace('&','&amp;',$field_set['title_sm']);
  $field_set['began_php'] = str_replace('&','&amp;',$field_set['began_php']);
  $field_set['end_php'] = str_replace('&','&amp;',$field_set['end_php']);

?>
<!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>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
}
.red {color: #FF0000}
-->
</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="module_list.php">模块分类管理</a>] [<a href="field_list.php?module_id=<?=$module_id?>" target="">全部字段</a>] [<a href="field_insert.php?module_id=<?=$module_id;?>">添加字段</a><a href="field_insert.php"></a>] [<a href="field_set.php?module_id=<?=$module_id;?>">综合设置</a>]<br />
</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="21%" height="28" bgcolor="#FFFFFF">title显示名称 </td>
          <td width="79%" bgcolor="#FFFFFF"><input name="title_show_name" id="title_show_name" value="<?=$field_set['title_show_name']?>" /></td>
        </tr>
		<tr>
          <td width="21%" height="38" bgcolor="#FFFFFF">title说明 </td>
          <td width="79%" bgcolor="#FFFFFF"><textarea name="title_sm" cols="60" rows="2" id="textarea"><?=$field_set['title_sm']?></textarea></td>
        </tr>
        <tr>
          <td height="28" bgcolor="#FFFFFF">图片本地化元素的变量名</td>
          <td bgcolor="#FFFFFF"><input name="bdh_name" id="bdh_name" value="<?=$field_set['bdh_name']?>" /></td>
        </tr>
		<!--
        <tr>
          <td height="100" bgcolor="#FFFFFF">开头语法</td>
          <td bgcolor="#FFFFFF"><textarea name="began_php" cols="60" rows="6" id="began_php"><?=$field_set['began_php']?></textarea>
对php不熟悉者请勿修改,区分发布和修改(发布页:$wn_action = 'post'; 编辑页:$wn_action = 'modify';)</td>
        </tr>//-->
        <tr>
          <td height="100" bgcolor="#FFFFFF">结尾语法</td>
          <td bgcolor="#FFFFFF"><textarea name="end_php" cols="60" rows="6" id="end_php"><?=$field_set['end_php']?></textarea>
            对php不熟悉者请勿修改,区分发布和修改(发布页:$wn_action = 'post'; 编辑页:$wn_action = 'modify';)</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="module_id" type="hidden" id="id" value="<?=$module_id?>" /></td>
        </tr>
      </table>
        </form>
      </td>
    </tr>
  </table>
</div>
  <p><br />
    <br />
系统常量：</p>
  <p>ROOT126CMS - 系统根目录 </p>
</body>
</html>
