<%@ LANGUAGE=VBScript%>
<% 
Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
if Session("zhbg_name")="" or Session("zhbg_id")="" then response.end
name=Session("zhbg_name")
grade=Session("zhbg_grade")
myid=session("zhbg_id")
	
%>
   
<!--#include file="dadata.asp"-->
<% 
     
      sql="select * from 物品 where 类型='主料' and 拥有者='" & name & "'"
 		set rs=connt.execute(sql)
      if rs.eof or rs.bof then%>
  <script language=vbscript>
 MsgBox "你没有干面，快去菜场买吧。"
 location.href = "ciachang.asp"
 </script>
	<%connt.close
	response.end
else

mw=rs("美味度")
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")

                    sql="select * from 巧面 where  拥有者='" & name & "'"
			set rs=connt.execute(sql)
		if rs.eof or rs.bof then
                    sql="insert into 巧面 (拥有者,美味度) values ('"& name &"'," & mw & ")"
                   rs=connt.execute(sql)
sql="select * from 物品 where 类型='主料' and 拥有者='" & name & "'"
                 sql="delete * from 物品 where 类型='主料' and 拥有者='" & name & "'" 
			set rs=connt.execute(sql)
connt.close
conn.close
set rs=nothing
%>
                <script language=vbscript>
 MsgBox "你把面放进锅里，一碗好面就快在眼前了。"
 location.href = "m4.htm"
 </script>


                      
                    <%else
                     sql="update 巧面 set 美味度=美味度+" &mw& " where 拥有者='" & name & "'"
                     rs=connt.execute(sql)
                    sql="delete * from 物品 where 类型='主料' and 拥有者='" & name & "'"
			set rs=connt.execute(sql)
connt.close
conn.close
set rs=nothing
%>
 <script language=vbscript>
 MsgBox "你把 面放进锅里，一碗好面就快在眼前了。"
 location.href = "m4.htm"
 </script><%
  end if	

  end if	

		
%>
