<!--#include file="conn.asp"-->
<!--#include file="cook_conn.asp"-->
<!--#include file="inc/const.asp"-->
<%
'********************************************
'插件名称: 雪石厨房插件 FOR DVBBS 7.1.0 SP1
'插件版本: V1.2
'插件属性: 共享插件 
'插件说明: 支持动网 7.1.0 SP1版
'插件制作: 破大头
'插件原创: http://www.52xj.net/
'发布日期: 2005年9月23日
'版权所有：雪石论坛
'********************************************
dim sql
%>
<title><%=dvbbs.Forum_info(0)%>--管理页面</title>

<script language="JavaScript">
function checkform()
{
if(document.pledit.plname.value == ""){
 alert("请输入配料名称！");
 return false ;
 }
if(document.pledit.price.value == ""){
 alert("配料价格不能为空，请输入数字！");
 return false ;
 }
 else{
 return numericCheck(document.pledit.price.value);
 }
if(document.menuedit.needfire.value != "大" && document.menuedit.needfire.value != "中" && document.menuedit.needfire.value != "小"){
 alert("请输入火候“大”、“中”、“小”！");
 return false ;
 }
if(document.menuedit.needtime.value != "5" && document.menuedit.needtime.value != "10" && document.menuedit.needtime.value != "15"){
 alert("请输入烹饪时间“5”、“10”、“15”！");
 return false ;
 }
if(document.menuedit.lever1.value == ""){
 alert("请输入1级菜名！");
 return false ;
 }
if(document.menuedit.wealth1.value == "" || document.menuedit.ep1.value == "" || document.menuedit.cp1.value == "" || document.menuedit.wealth2.value == "" || document.menuedit.ep2.value == "" || document.menuedit.cp2.value == "" || document.menuedit.wealth3.value == "" || document.menuedit.ep3.value == "" || document.menuedit.cp3.value == ""){
 alert("卖价\加经验\加魅力不能为空，请输入数字！");
 return false ;
 }
}


function numericCheck(nr1){
flg=0;
str="";
spc=""
arw="";
for (var i=0;i<nr1.length;i++){
cmp="0123456789"
tst=nr1.substring(i,i+1)
if (cmp.indexOf(tst)<0){
flg++;
str+=" "+tst;
spc+=tst;
arw+="^";
}
else{arw+="_";}
}
if (flg!=0){
if (spc.indexOf(" ")>-1) {
str+="和空格";
}
alert("这里只接受数字，发现"
+flg+"个不可接受的字符:\n"+str);
return false;
}
}
</script>
<%
	Head()
	if not Dvbbs.master then 'or instr(","&session("flag")&",",admin_flag)=0 then
		Response.redirect "showerr.asp?ErrCodes=<li>本页面为管理员专用，请<a href=admin_login.asp target=_top>登录</a>后进入。&action=OtherErr"
	else
		call main()
		set rs=nothing
		conn.close
		set conn=nothing
	end if
dim iiii,plrs,rs
	sub main()
%>

      <table class="tableBorder" cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr>
        <th class="tableHeaderText" align=center>欢迎<font color=red><b><%=Dvbbs.membername%></b></font>进入管理页面</th>
        </tr>
            <tr>
              <td class="forumRowHighlight" width="100%" valign=top>
    <p align=center><a href="cook_admin_kitchen.asp?id=0&type=pllist">做菜配料管理</a></p>
    <p align=center><a href="cook_admin_kitchen.asp?id=0&type=mnlist">做菜菜谱管理</a></p>
    <p align=center><a href="cook_admin_connsql.asp">厨房数据库管理</a></p>
<%
select case request("type")
	case "pllist"
		call pllist()
	case "edit"
		call pledit()
	case "dele"
		call pldele()
	case "editsave"
		call plupdate()
	case "addsave"
		call plupdate()
		
	case "mnlist"
		call mnlist()
	case "mnedit"
		call mnedit()
	case "mndele"
		call mndele()
	case "mneditsave"
		call mnupdate()
	case "mnaddsave"
		call mnupdate()
	case else
		
end select
%>
	      </td>
            </tr>
        </table>

<%
end sub


'配料部分
sub pllist()
set rs=server.createobject("adodb.recordset")
%>
<table class="tableBorder" width="100%" border="0" cellspacing="1" cellpadding="3"  align=center>
<th colspan="5" ><b>做菜配料列表</b></th>
<tr>
<td class="forumRowHighlight" height="18" width="25%" align=center>名称</td>
<td class="forumRowHighlight" height="18" width="10%" align=center>价格</td>
<td class="forumRowHighlight" height="18" align=center>图片</td>
<td class="forumRowHighlight" height="18" width="20%" colspan="2" align=center>操作</td>
</tr>
<%
dim row_ii
sql="Select * from pldata"
rs.open sql,cookconn,1,1
row_ii=1
do while not rs.eof
if row_ii mod 2<>0 then
%>
<tr> 
<td class="forumRow" height="18" width="25%"><%=rs("plname")%></td>
<td class="forumRow" height="18" width="10%" align=right><%=rs("price")%></td>
<td class="forumRow" height="18" align=center><%if trim(rs("pic"))="" or isnull(rs("pic")) then%>
<img src="kitchen/img/p000000.gif" height="18" width="18"><%else %>
<img src="<%=rs("pic")%>" height="18" width="18"><%end if%></td>
<td class="forumRow" height="18" width="10%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=edit">修改</a></td>
<td class="forumRow" height="18" width="10%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=dele">删除</a></td>
</tr>
<%
else
%>
<tr> 
<td class="forumRowHighlight" height="18" width="25%"><%=rs("plname")%></td>
<td class="forumRowHighlight" height="18" width="10%" align=right><%=rs("price")%></td>
<td class="forumRowHighlight" height="18" align=center><%if trim(rs("pic"))="" or isnull(rs("pic")) then%>
<img src="kitchen/img/p000000.gif" height="18" width="18"><%else %>
<img src="<%=rs("pic")%>" height="18" width="18"><%end if%></td>
<td class="forumRowHighlight" height="18" width="10%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=edit">修改</a></td>
<td class="forumRowHighlight" height="18" width="10%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=dele">删除</a></td>
</tr>
<%
end if
row_ii=row_ii+1
rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
&nbsp;<a href="cook_admin_kitchen.asp?id=0&type=edit">新增</a>
<%
end sub

sub pledit()
set rs=server.createobject("adodb.recordset")
%>
<form name="pledit" method="POST" action=cook_admin_kitchen.asp?id=<%=request("id")%>&<%if request("id")=0 then %>type=addsave<%else %>type=editsave<%end if%> onSubmit="return checkform()">
<table class="tableBorder" width="100%" border="0" cellspacing="1" cellpadding="3"  align=center>
<th colspan="2" ><b>编辑做菜配料</b></th>
<%
if request("id")=0 then %>
<tr>
<td class="forumRow" height="18" width="25%" align=center>名称</td>
<td class="forumRow" height="18">
<input type="text" name="plname" size="35" value=""></td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>价格</td>
<td class="forumRow" height="18">
<input type="text" name="price" size="35" value=""></td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>图片地址</td>
<td class="forumRow" height="18">
<input type="text" name="pic" size="65" value=""></td>
</tr>
<%else
sql="Select * from pldata where id="&request("id")
rs.open sql,cookconn,1,1
if not rs.eof and not rs.bof then
%>
<tr>
<td class="forumRow" height="18" width="25%" align=center>名称</td>
<td class="forumRow" height="18"><%=rs("id")%>&nbsp;
<input type="text" name="plname" size="31" value="<%=rs("plname")%>"></td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>价格</td>
<td class="forumRow" height="18">
<input type="text" name="price" size="35" value="<%=rs("price")%>"></td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>图片地址</td>
<td class="forumRow" height="18">
<input type="text" name="pic" size="65" value="<%=rs("pic")%>"></td>
</tr>
<%
end if
rs.close
set rs=nothing
end if
%>
</table>
<input type="submit" name="Submit" value="更 新"><br>
<center><a href='javascript:history.back()'><font color=purple size=3>《返回</font></a>
</form>
<%
end sub

sub plupdate()
	set rs=server.createobject("adodb.recordset")
	sql="Select * from pldata where id="&request("id")
	rs.open sql,cookconn,1,3
	if request("type")="addsave" then 
		rs.addnew
	end if
		rs("plname")=request("plname")
		rs("price")=request("price")
		rs("pic")=request("pic")
		
		rs.update
	rs.close
	set rs=nothing
%><meta http-equiv=refresh content="1;URL=cook_admin_kitchen.asp?id=0&type=pllist">
<center><p><b>更新做菜调料数据成功！</b>
<%
end sub

sub pldele()
	set rs=server.createobject("adodb.recordset")
	sql="Select * from menu where pl1="&request("id")&" or pl2="&request("id")
	rs.open sql,cookconn,1,1
	if not rs.eof and not rs.bof then 
		%><center><p><font color=red><b>做菜调料被菜谱使用，无法删除！</b></font><p>
		<a href='javascript:history.back()'><font color=purple size=3>《返回</font></a>
		<%rs.close
		set rs=nothing
	else
		rs.close
		set rs=nothing
		sql="delete from pldata where id="&request("id")
		cookconn.execute(sql)%>
		<meta http-equiv=refresh content="1;URL=cook_admin_kitchen.asp?id=0&type=pllist">
		<center><p><b>删除做菜调料数据成功！</b>
<%	end if
end sub
'菜谱部分
sub mnlist()
set rs=server.createobject("adodb.recordset")
sql="Select * from pldata"
rs.open sql,cookconn,1,1
if rs.recordcount<1 then
	rs.close
	set rs=nothing
	%><center><p><font color=red><b>做菜配料少于一个，无法编菜谱！</b></font><p>
	<a href='javascript:history.back()'><font color=purple size=3>《返回</font></a>
	<%
	exit sub
end if
rs.close
%>
<table class="tableBorder" width="100%" border="0" cellspacing="1" cellpadding="3"  align=center>
<th colspan="4" ><b>做菜菜谱列表</b></th>
<tr> 
<td class="forumRowHighlight" height="18" width="35%" align=center>1级菜名</td>
<td class="forumRowHighlight" height="18" align=center>图片</td>
<td class="forumRowHighlight" height="18" width="30%" colspan="2" align=center>操作</td>
</tr>
<%
sql="Select * from menu"
rs.open sql,cookconn,1,1
dim row_ii
row_ii=1
do while not rs.eof
if row_ii mod 2<>0 then
%>
<tr> 
<td class="forumRow" height="18" width="25%"><%=rs("lever1")%></td>
<td class="forumRow" height="18" align=center><%if trim(rs("pic1"))="" or isnull(rs("pic1")) then%>
<img src="kitchen/img/d000000.gif" height="18" width="18"><%else %>
<img src="kitchen/<%=rs("pic1")%>" height="18" width="18"><%end if%></td>
<td class="forumRow" height="18" width="15%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=mnedit">修改</a></td>
<td class="forumRow" height="18" width="15%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=mndele">删除</a></td>
</tr>
<%
else
%>
<tr> 
<td class="forumRowHighlight" height="18" width="25%"><%=rs("lever1")%></td>
<td class="forumRowHighlight" height="18" align=center><%if trim(rs("pic1"))="" or isnull(rs("pic1")) then%>
<img src="kitchen/img/d000000.gif" height="18" width="18"><%else %>
<img src="kitchen/<%=rs("pic1")%>" height="18" width="18"><%end if%></td>
<td class="forumRowHighlight" height="18" width="15%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=mnedit">修改</a></td>
<td class="forumRowHighlight" height="18" width="15%" align=center><a href="cook_admin_kitchen.asp?id=<%=rs("id")%>&type=mndele">删除</a></td>
</tr>
<%
end if
rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
&nbsp;<a href="cook_admin_kitchen.asp?id=0&type=mnedit">新增</a>
<%
end sub

sub mnedit()
set rs=server.createobject("adodb.recordset")
%>
<form name="menuedit" id="menuedit" method="POST" action=cook_admin_kitchen.asp?id=<%=request("id")%>&<%if request("id")=0 then %>type=mnaddsave<%else %>type=mneditsave<%end if%> onSubmit="return checkform()">
<table class="tableBorder" width="100%" border="0" cellspacing="1" cellpadding="3"  align=center>
<th colspan="3"><b>编辑菜谱</b></th>
<%
set plrs=server.createobject("adodb.recordset")
sql="Select * from pldata order by id"
plrs.open sql,cookconn,1,1

if request("id")=0 then 
	%>
<tr>
<td class="forumRow" height="18" width="25%" align=center>配料1</td>
<td class="forumRow" height="18" width="75%" colspan="2">
<select size="1" name="pl1"><%
iiii=0
plrs.movefirst
do while not plrs.eof
  if iiii<1 then %>
    <option selected value="<%=plrs("id")%>"><%=plrs("plname")%></option><%
  else
    %>
    <option value="<%=plrs("id")%>"><%=plrs("plname")%></option><%
  end if
  iiii=iiii+1
  plrs.movenext
loop
  %>
  </select>
</td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>配料2</td>
<td class="forumRow" height="18" width="75%" colspan="2">
<select size="1" name="pl2"><%
iiii=0
plrs.movefirst
do while not plrs.eof
  if iiii<1 then %>
    <option selected value="<%=plrs("id")%>"><%=plrs("plname")%></option><%
  else
    %>
    <option value="<%=plrs("id")%>"><%=plrs("plname")%></option><%
  end if
  iiii=iiii+1
  plrs.movenext
loop
plrs.close
set plrs=nothing
  %>
  </select>
</td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>烹饪时间</td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="needtime" size="35" value=""></td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>火候</td>
<td class="forumRow" height="18" colspan="2">
<select size="1" name="needfire">
    <option selected value="小">小</option>
    <option value="中">中</option>
    <option value="大">大</option>
  </select></td>
</tr><tr>
<td class="forumHeaderBackgroundAlternate" height="18" width="25%" align=center>1级菜名</td>
<td class="forumHeaderBackgroundAlternate" height="18" colspan="2" align=center>图片地址</td>
</tr><tr>
<td class="forumRow" height="18" width="25%">
<input type="text" name="lever1" size="15" value=""></td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="pic1" size="65" value=""></td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>卖价</td>
<td class="forumRow" height="18" width="33%" align=center>加经验</td>
<td class="forumRow" height="18" width="34%" align=center>加魅力</td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="wealth1" size="15" value=0></td>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="ep1" size="15" value=0></td>
<td class="forumRow" height="18" width="34%" align=center>
<input type="text" name="cp1" size="15" value=0></td>
</tr><tr>
<td class="forumHeaderBackgroundAlternate" height="18" width="25%" align=center>2级菜名</td>
<td class="forumHeaderBackgroundAlternate" height="18" colspan="2" align=center>图片地址</td>
</tr><tr>
<td class="forumRow" height="18" width="25%">
<input type="text" name="lever2" size="15" value=""></td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="pic2" size="65" value=""></td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>卖价</td>
<td class="forumRow" height="18" width="33%" align=center>加经验</td>
<td class="forumRow" height="18" width="34%" align=center>加魅力</td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="wealth2" size="15" value=0></td>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="ep2" size="15" value=0></td>
<td class="forumRow" height="18" width="34%" align=center>
<input type="text" name="cp2" size="15" value=0></td>
</tr><tr>
<td class="forumHeaderBackgroundAlternate" height="18" width="25%" align=center>3级菜名</td>
<td class="forumHeaderBackgroundAlternate" height="18" colspan="2" align=center>图片地址</td>
</tr><tr>
<td class="forumRow" height="18" width="25%">
<input type="text" name="lever3" size="15" value=""></td>
<td class="forumRow" height="18"  colspan="2">
<input type="text" name="pic3" size="65" value=""></td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>卖价</td>
<td class="forumRow" height="18" width="33%" align=center>加经验</td>
<td class="forumRow" height="18" width="34%" align=center>加魅力</td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="wealth3" size="15" value=0></td>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="ep3" size="15" value=0></td>
<td class="forumRow" height="18" width="34%" align=center>
<input type="text" name="cp3" size="15" value=0></td>
</tr>

<%else
sql="Select * from menu where id="&request("id")
rs.open sql,cookconn,1,1
if not rs.eof and not rs.bof then

plrs.close
sql="Select * from pldata where id="&rs("pl1")
plrs.open sql,cookconn,1,1
%>
<tr>
<td class="forumRow" height="18" width="25%" align=center>配料1</td>
<td class="forumRow" height="18" colspan="2"><%=plrs("plname")%><input type="hidden" name="pl1" size="15" value=<%=rs("pl1")%>>
</td>
</tr><tr><%
plrs.close
sql="Select * from pldata where id="&rs("pl2")
plrs.open sql,cookconn,1,1
%>
<td class="forumRow" height="18" width="25%" align=center>配料2</td>
<td class="forumRow" height="18" colspan="2"><%=plrs("plname")%><input type="hidden" name="pl2" size="15" value=<%=rs("pl2")%>>
<%
plrs.close
set plrs=nothing
%>  
</td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>烹饪时间</td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="needtime" size="35" value=<%=rs("needtime")%>></td>
</tr><tr>
<td class="forumRow" height="18" width="25%" align=center>火候</td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="needfire" size="35" value=<%=rs("needfire")%>></td>
</tr><tr>
<td class="forumHeaderBackgroundAlternate" height="18" width="25%" align=center>1级菜名</td>
<td class="forumHeaderBackgroundAlternate" height="18"  colspan="2" align=center>图片地址</td>
</tr><tr>
<td class="forumRow" height="18" width="25%">
<input type="text" name="lever1" size="15" value="<%=rs("lever1")%>"></td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="pic1" size="65" value="<%=rs("pic1")%>"></td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>卖价</td>
<td class="forumRow" height="18" width="33%" align=center>加经验</td>
<td class="forumRow" height="18" width="34%" align=center>加魅力</td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="wealth1" size="15" value=<%=rs("wealth1")%>></td>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="ep1" size="15" value=<%=rs("ep1")%>></td>
<td class="forumRow" height="18" width="34%" align=center>
<input type="text" name="cp1" size="15" value=<%=rs("cp1")%>></td>
</tr><tr>
<td class="forumHeaderBackgroundAlternate" height="18" width="25%" align=center>2级菜名</td>
<td class="forumHeaderBackgroundAlternate" height="18"  colspan="2" align=center>图片地址</td>
</tr><tr>
<td class="forumRow" height="18" width="25%">
<input type="text" name="lever2" size="15" value="<%=rs("lever2")%>"></td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="pic2" size="65" value="<%=rs("pic2")%>"></td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>卖价</td>
<td class="forumRow" height="18" width="33%" align=center>加经验</td>
<td class="forumRow" height="18" width="34%" align=center>加魅力</td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="wealth2" size="15" value=<%=rs("wealth2")%>></td>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="ep2" size="15" value=<%=rs("ep2")%>></td>
<td class="forumRow" height="18" width="34%" align=center>
<input type="text" name="cp2" size="15" value=<%=rs("cp2")%>></td>
</tr><tr>
<td class="forumHeaderBackgroundAlternate" height="18" width="25%" align=center>3级菜名</td>
<td class="forumHeaderBackgroundAlternate" height="18"  colspan="2" align=center>图片地址</td>
</tr><tr>
<td class="forumRow" height="18" width="25%">
<input type="text" name="lever3" size="15" value="<%=rs("lever3")%>"></td>
<td class="forumRow" height="18" colspan="2">
<input type="text" name="pic3" size="65" value="<%=rs("pic3")%>"></td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>卖价</td>
<td class="forumRow" height="18" width="33%" align=center>加经验</td>
<td class="forumRow" height="18" width="34%" align=center>加魅力</td>
</tr><tr>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="wealth3" size="15" value=<%=rs("wealth3")%>></td>
<td class="forumRow" height="18" width="33%" align=center>
<input type="text" name="ep3" size="15" value=<%=rs("ep3")%>></td>
<td class="forumRow" height="18" width="34%" align=center>
<input type="text" name="cp3" size="15" value=<%=rs("cp3")%>></td>
</tr>
<%
end if
rs.close
set rs=nothing
end if
%>
</table>
<input type="submit" name="Submit" value="更 新"><br>
<center><a href='javascript:history.back()'><font color=purple size=3>《返回</font></a>
</form>
<%
end sub

sub mnupdate()
	set rs=server.createobject("adodb.recordset")
	if request("type")="mnaddsave" then
		sql="select * from menu where (pl1="&request("pl1")&" and pl2="&request("pl2")&") or (pl1="&request("pl2")&" and pl2="&request("pl1")&")"
		rs.open sql,cookconn,1,1
		if not rs.eof and not rs.bof then 
			%><center><p><font color=red><b>两种做菜调料已经被菜谱使用！</b></font><p>
			<a href='javascript:history.back()'><font color=purple size=3>《返回</font></a>
			<%
			rs.close
			set rs=nothing
			exit sub
		end if
		rs.close
	end if
	sql="Select * from menu where id="&request("id")
	rs.open sql,cookconn,1,3
	if request("type")="mnaddsave" then 
		rs.addnew
	end if
		rs("pl1")=request("pl1")
		rs("pl2")=request("pl2")
		rs("needtime")=request("needtime")
		rs("needfire")=request("needfire")
		rs("lever1")=request("lever1")
		rs("pic1")=request("pic1")
		rs("wealth1")=request("wealth1")
		rs("ep1")=request("ep1")
		rs("cp1")=request("cp1")
		rs("lever2")=request("lever2")
		rs("pic2")=request("pic2")
		rs("wealth2")=request("wealth2")
		rs("ep2")=request("ep2")
		rs("cp2")=request("cp2")
		rs("lever3")=request("lever3")
		rs("pic3")=request("pic3")
		rs("wealth3")=request("wealth3")
		rs("ep3")=request("ep3")
		rs("cp3")=request("cp3")
		rs.update
	rs.close
	set rs=nothing
%><meta http-equiv=refresh content="1;URL=cook_admin_kitchen.asp?id=0&type=mnlist">
<center><p><b>更新菜谱数据成功！</b>
<%
end sub

sub mndele()

	set rs=server.createobject("adodb.recordset")
	sql="Select * from usercook where dishid="&request("id")&" and (state=1 or state=2)"
	rs.open sql,cookconn,1,1
	if not rs.eof and not rs.bof then 
		%><center><p><font color=red><b>有用户正在做这道菜，无法删除！</b></font><p>
		<a href='javascript:history.back()'><font color=purple size=3>《返回</font></a>
		<%rs.close
		set rs=nothing
	else
		rs.close
		set rs=nothing
		sql="delete from menu where id="&request("id")
		cookconn.execute(sql)%>
		<meta http-equiv=refresh content="1;URL=cook_admin_kitchen.asp?id=0&type=mnlist">
		<center><p><b>从菜谱中删除这道菜成功！</b>
<%	end if
end sub
Sub Head()
%>
<html>
<head>
	<meta http-equiv=""Content-Type"" content=""text/html;charset=gb2312"">
	<meta name=keywords content=""雪石论坛,雪石,52xj.net"">
	<meta name=""description"" content=""www.52xj.net"">
	<title>"& Dvbbs.Forum_info(0)&"-管理页面</title>
</head>
<style type=text/css>

body {

	background:#CAD7F7; font-size: 12px; margin-top:0px;

	SCROLLBAR-FACE-COLOR: #799AE1; SCROLLBAR-HIGHLIGHT-COLOR: #799AE1; 

	SCROLLBAR-SHADOW-COLOR: #799AE1; SCROLLBAR-DARKSHADOW-COLOR: #799AE1; 

	SCROLLBAR-3DLIGHT-COLOR: #799AE1; SCROLLBAR-ARROW-COLOR: #FFFFFF;

	SCROLLBAR-TRACK-COLOR: #AABFEC;

}

TD {

	FONT-SIZE: 12px

}

INPUT {

	BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px

}

TEXTAREA {

	BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px

}

SELECT {

	BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px

}

SPAN {

	FONT-SIZE: 12px; POSITION: static

}

A {

	COLOR: #000000; TEXT-DECORATION: none

}

A:hover { color:#428EFF;text-decoration:underline; }

A.highlight {

	COLOR: red; TEXT-DECORATION: none

}

A.highlight:hover {

	COLOR: red

}

A.thisclass {

	FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.thisclass:hover {

	FONT-WEIGHT: bold

}

A.navlink {

	COLOR: #000000; TEXT-DECORATION: none

}

A.navlink:hover {

	COLOR: #003399; TEXT-DECORATION: none

}

.twidth {

	WIDTH: 760px

}

.content {

	FONT-SIZE: 14px; MARGIN: 5px 20px; LINE-HEIGHT: 140%; FONT-FAMILY: Tahoma,宋体

}

.aTitle {

	FONT-WEIGHT: bold; FONT-SIZE: 15px

}

TD.forumHeaderBackgroundAlternate {

	BACKGROUND-IMAGE: url(admin/images/admin_top_bg.gif); COLOR: #000000; BACKGROUND-COLOR: #799ae1

}

#TableTitleLink A:link {

	COLOR: #ffffff; TEXT-DECORATION: none

}

#TableTitleLink A:visited {

	COLOR: #ffffff; TEXT-DECORATION: none

}

#TableTitleLink A:active {

	COLOR: #ffffff; TEXT-DECORATION: none

}

#TableTitleLink A:hover {

	COLOR: #ffffff; TEXT-DECORATION: underline

}

TD.forumRow {

	PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #F1F3F5; PADDING-BOTTOM: 3px; PADDING-TOP: 3px

}

TH {

	FONT-WEIGHT: bold; FONT-SIZE: 12px; BACKGROUND-IMAGE: url(admin/images/admin_bg_1.gif); COLOR: white; BACKGROUND-COLOR: #4455aa

}

TD.bodytitle {

	BACKGROUND-IMAGE: url(admin/images/admin_bg_2.gif)

}

TD.bodytitle1 {

	BACKGROUND-IMAGE: url(admin/images/admin_bg_3.gif)

}

TD.tablebody1 {

	PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #bebbdb; PADDING-BOTTOM: 3px; PADDING-TOP: 3px

}

TD.forumRowHighlight {

	PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #E4EDF9; PADDING-BOTTOM: 3px; PADDING-TOP: 3px

}

.tableBorder {

	BORDER-RIGHT: #183789 1px solid; BORDER-TOP: #183789 1px solid; BORDER-LEFT: #183789 1px solid; WIDTH: 98%; BORDER-BOTTOM: #183789 1px solid; BACKGROUND-COLOR: #ffffff

}

.tableBorder1 {WIDTH: 98%; }

.helplink {

	FONT: 10px verdana,arial,helvetica,sans-serif; CURSOR: help; TEXT-DECORATION: none

}

.copyright {

	PADDING-RIGHT: 1px; BORDER-TOP: #6595d6 1px dashed; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; FONT: 11px verdana,arial,helvetica,sans-serif; COLOR: #4455aa; PADDING-TOP: 1px; TEXT-DECORATION: none

}

.menuskin {

	BORDER: #666666 1px solid; VISIBILITY: hidden; FONT: 12px Verdana;

	POSITION: absolute; 

	BACKGROUND-COLOR:#EFEFEF;

	background-image:url("skins/default/dvmenubg3.gif");

	background-repeat : repeat-y;

	}

.menuskin A {

	PADDING-RIGHT: 10px; PADDING-LEFT: 25px; COLOR: black; TEXT-DECORATION: none; behavior:url(inc/noline.htc);

	}

#mouseoverstyle {

	BACKGROUND-COLOR: #C9D5E7; margin:2px; padding:0px; border:#597DB5 1px solid;

	}

#mouseoverstyle A {

	COLOR: black

}

.menuitems{

	margin:2px;padding:1px;word-break:keep-all;

}

</style>
</head>
<script language="JavaScript">
<!--

function SymError()
{
  return true;
}

window.onerror = SymError;

//-->
</script>
<script src=""admin/images/admin.js"" type=""text/javascript""></script>
<script src=""inc/main.js"" type=""text/javascript""></script>
<body leftmargin=""0"" topmargin=""0"" marginheight=""0"" marginwidth=""0"">
<div class=menuskin id=popmenu onmouseover="clearhidemenu();" onmouseout="dynamichide(event)" style="Z-index:100"></div>
<table cellpadding="3" cellspacing="0" border="0" align=center class="tableBorder1" style="width:100%">
<tr><td height=10></td></tr>
</table>
<%
End Sub
cookconn.close
Set cookconn = Nothing
%>

