<%@page contentType="text/html; charset=GBK"%><%@include file="../../include/Admin.jsp"%><%@include file="../../include/DBCon.jsp"%><%if(!StrFormat.isNull(request.getParameter("act"))){if(!StrFormat.isNull(request.getParameter("title")) && request.getParameter("act").equals("mod")){try{DBStmt = DBCon.createStatement();DBSql = "select title from ad where title='"+ StrTrans.toGBK(request.getParameter("title")) +"' and id!="+request.getParameter("id");DBRs = DBStmt.executeQuery(DBSql);if(!DBRs.next()){DBSql = "update ad set title='"+StrTrans.toGBK(request.getParameter("title"))+"',url='"+StrTrans.toGBK(request.getParameter("picurl"))+"',stime='"+StrTrans.toGBK(request.getParameter("stime"))+"',etime='"+StrTrans.toGBK(request.getParameter("etime"))+"' where id="+request.getParameter("id");DBStmt.executeUpdate(DBSql);MesStr = "修改成功！";}else{MesStr = "修改失败：该名称已存在，请更换其他名称！";}}catch(Exception ie){MesStr = "修改失败！";if(isShowErr!=0){MesStr += "\\r\\nErrInfo:"+ie;}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}}else{MesStr = "操作错误！";}out.print("<script language=\"javascript\" src=\"../../js/common.js\"></script><script language=\"javascript\">alert(\""+MesStr+"\");BackURL(\"ADList.jsp\",\"\");</script>");}else{if(StrFormat.isNum(request.getParameter("id"))){DBSql = "select * from ad where id="+request.getParameter("id");try{DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);if(DBRs.next()){%><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><meta name="keywords" content="向继根,Xiang Jigen,QQ,190582560"><meta name="description" content="Programmer:向继根 QQ:190582560 Email:190582560@qq.com"><meta name="author" content="向继根,Xiang Jigen" /><title><%=TitleStr%>修改广告</title><link rel="stylesheet" type="text/css" href="../images/Style.css"/><script type="text/javascript" src="../../js/min.js"></script><script type="text/javascript" src="../../js/common.js"></script><script type="text/javascript" src="../../js/css.js"></script><script type="text/javascript" src="../../js/flv.js"></script><script type="text/javascript" src="../../js/PopupCalendar.js"></script><script type="text/javascript">var CalendarChs=new PopupCalendar("CalendarChs");CalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六");CalendarChs.monthSting=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");CalendarChs.BtnTodayTitle="今天";CalendarChs.BtnCancelTitle="取消";CalendarChs.Init();function doCheck(){if(isNull($GenID('title').value)){alert('名称不能为空！');		$GenID('title').focus();return false;}	return true;}</script></head><body><form action="?act=mod" method="post" name="form" id="form" onSubmit="return doCheck();"><table cellpadding="0" cellspacing="1" class="table_list"><caption>修改广告</caption>	<tr><th width="20%"><span class="red">*</span> <strong>广告名称</strong></th><td>&nbsp;<input name="title" type="text" id="title" value="<%=StrFormat.isNull(DBRs.getString("title"),"")%>" size="30" /></td></tr><tr><th><strong>广告地址</strong></th><td>&nbsp;<input name="pic" type="text" id="pic"value="<%=StrFormat.isNull(DBRs.getString("url"),"")%>" size="35" onpropertychange="InPicUrl();" /><input name="picurl" type="hidden" id="picurl" value="<%=StrFormat.isNull(DBRs.getString("url"),"")%>"><input name="open" type="button" class="button_style" onClick="javascript:OpenUrl('../UpSwf.jsp?filedir=ad&filename=<%=StrFormat.isNull(DBRs.getString("url"),"")%>',0);" value="上传广告"></td></tr><tr><th><strong>广告时间</strong></th><td>&nbsp;<input name="stime" type="text" id="stime" onClick="getDateString(this,CalendarChs);" value="<%=StrFormat.isNull(DBRs.getString("stime").substring(0,10),"")%>" size="20">&nbsp;&nbsp;<span class="red">至</span>&nbsp;&nbsp;<input name="etime" type="text" id="etime" onClick="getDateString(this,CalendarChs);" value="<%=StrFormat.isNull(DBRs.getString("etime").substring(0,10),"")%>" size="20"></td></tr></table><div id="button"><input name="id" type="hidden" id="id" value="<%=DBRs.getString("id")%>"><input type="submit" name="dosubmit" class="button_style" value="确 定" />&nbsp;<input type="reset" name="reset" class="button_style" value="清 除" />&nbsp;<input type="button" name="button" class="button_style" value="返 回" onClick="history.back();"></div></form></body></html><%}else{out.print("<script language=\"javascript\">alert(\"无数据！\");history.back();</script>");}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}}else{out.print("<script language=\"javascript\">alert(\"操作错误！\");history.back();</script>");}}%><%@include file="../../include/DBConClose.jsp"%>