www.pudn.com > smartstarwap.rar > edit_menu.php, change:2005-10-04,size:3400b


<? 
    /* ====================================== 
	 * ******smartstar firm wap system****** 
	 * ====================================== 
	 * AUTHOR : 
     * ======= 
     * Copyright (C) 2006 Wap-system - A wap system designed for firm 
     * by smartstar. 
	 */ 
?> 
<? 
include("function.inc.php"); 
 
   include("../chinese/class.Chinese.php"); 
?> 
<link href=js/common.css rel=stylesheet type=text/css> 
<? 
if (isset($_GET['edit'])) 
{ 
		 if(!empty($_GET['sortname'])) 
	{ 
	include("../db_connect.php"); 
	$sortid=$_GET['sortid']; 
   $type=$_GET['type']; 
   $sortid=intval($sortid); 
   $type=intval($type); 
   $sortname=$_GET['sortname']; 
	$chs_s = new Chinese("GB2312","UTF8",trim($sortname)); 
	$sortname = $chs_s->ConvertIT(); // 将GB2312转换为UTF8 
	mysql_query("update wap_newssort set type='$type',sortname='$sortname' where sortid='$sortid'",$db) or die ("query failed"); 
	mysql_close($db); 
	echo "<p align=center>首页菜单修改成功,3秒后自动返回菜单管理页!"; 
	echo "<script>window.setTimeout(\"location.href='admin_menu.php'\",3000);</script></p>"; 
	exit; 
	} 
    else 
    { 
        echo "<p align=center>请填写菜单名!"; 
		echo "<a href=\"edit_menu.php\">返回</a></p>"; 
		exit; 
     } 
	   } 
	   ?> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>编辑首页菜单</title></head> 
<body> 
<table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#DEDFDE"> 
<form type="get" action="edit_menu.php"> 
    <tr>  
      <td colspan="2" bgcolor="#f7f7f7"><div align="center"> <strong>菜 单 编 辑</strong></div></td> 
    </tr> 
	<tr>  
      <td bgcolor="#FFFFFF"><div align="center">菜单种类:</div></td> 
<td bgcolor="#FFFFFF"> 
<? 
 include("../db_connect.php"); 
   $result=mysql_query("select * from wap_newssort where sortid='$sortid'",$db) or die ("query failed"); 
   while($row=mysql_fetch_row($result)) 
   { 
     if($row[1] == 0) 
     { 
		 		$sortname=$row[2]; 
		$chs_s = new Chinese("UTF8","GB2312",trim($sortname)); 
		$sortname = $chs_s->ConvertIT(); // 将UTF8转换为GB2312 
?> 
	   <input type="hidden" name="sortid" value="<? echo $row[0]; ?>"> 
<input type="radio" name="type" value="0" checked>只单页显示一条信息 
<input type="radio" name="type" value="1">分条显示信息 
</td></tr> 
<tr>  
      <td bgcolor="#FFFFFF"> 
<div align="center">菜单名:</div></td> 
      <td bgcolor="#FFFFFF"><input type="text" name="sortname" value="<? echo $sortname; ?>"></td> 
</tr> 
<? 
		 
     } 
     else if($row[1] == 1) 
     { 
		 $sortname=$row[2]; 
		$chs_s = new Chinese("UTF8","GB2312",trim($sortname)); 
		$sortname = $chs_s->ConvertIT(); // 将UTF8转换为GB2312 
?> 
	   <input type="hidden" name="sortid" value="<? echo $row[0]; ?>"> 
<input type="radio" name="type" value="0">只单页显示一条信息 
<input type="radio" name="type" value="1" checked>分条显示信息 
</td></tr> 
<tr>  
      <td bgcolor="#FFFFFF"> 
<div align="center">菜单名:</div></td> 
      <td bgcolor="#FFFFFF"><input type="text" name="sortname" value="<? echo $sortname; ?>"></td> 
</tr> 
<? 
     } 
   } 
	  
   mysql_close($db); 
 ?> 
<tr>  
      <td colspan="2" bgcolor="#f7f7f7"><div align="center"><input type="submit" name="edit" value="提交"></div></td> 
    </tr> 
</form> 
</table> 
<p align=center><a href=\"admin_menu.php\">返回</a></p> 
</body></html>