<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*,gbase.db.*,gbase.util.*" %>
<%@ include file="../checkLogin.jsp" %>
<SCRIPT language="JavaScript" src="../js/util.js"></SCRIPT>
<LINK href="../css/css.css" rel=stylesheet>
<%
DBOperation theDBOperation = new DBOperation();

String id = request.getParameter("id") == null ? "" :request.getParameter("id");
String action = request.getParameter("action") == null ? "" :request.getParameter("action");
String title="";
String title_desc="";
String image_url="";
String bar_id="";
String special_id="";
String content="";
String create_date="";

if(action.equals("update") || action.equals("view"))
{
String sql = "select * from web_imageinfo  where  web_account='"+web_account+"' and id="+id+"";
ResultSet rs =theDBOperation.getResultSet(sql);
if(rs.next())
{
title=rs.getString("title")==null?"":rs.getString("title");
title_desc=rs.getString("title_desc")==null?"":rs.getString("title_desc");
image_url=rs.getString("image_url")==null?"":rs.getString("image_url");
bar_id=rs.getString("bar_id")==null?"":rs.getString("bar_id");
special_id=rs.getString("special_id")==null?"":rs.getString("special_id");
content=rs.getString("content")==null?"":rs.getString("content");
create_date=rs.getString("create_date")==null?"":rs.getString("create_date");
}
}
%>
<html>
<head>
<title>
首页图片广告管理
</title>
</head>
<body leftmargin="0" topmargin="0">

<!--导航-->
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
       <tr>
		<td width="100%" height="20"  bgcolor="#eeeeee" class="p2">您当前所在的位置>>首页图片广告管理</td>
	   </tr>
       <tr>
          <td width="100%" height="2"> <img border="0" src="../images/spacer.gif" width="1" height="3"></td>
       </tr>
    </table>
<!--标题-->
  <div align="center">
   <table border="0" width="100%" cellspacing="0" cellpadding="0" height="34">
	<tr>
		<td width="159" background="../images/back_board2.gif" nowrap valign="bottom"><span class="title01">&nbsp;<span class="style1">新增/修改首页图片广告</span></span></td>
		<td valign="bottom" align="right" width="642"></td>
	</tr>
	<tr>
		<td bgcolor="#2C9CC4" colspan="2"><img border="0" src="../images/bline_3.gif" width="1" height="2"></td>
	</tr>
</table>
</div><br>
<form name="main" method="post" action="web_imageinfo_save.jsp">
<input name="action" type="hidden" value="<%=action%>">
<input name="id" type="hidden" value="<%=id%>">
<input name="bar_id" type="hidden" value="<%=web_account_id%>">
<div align="center">
<table width="85%" class="p1" border="0" cellSpacing="1" cellPadding="3" align="center" bgColor="#cccccc">
        <tr>
		<td align="right"  bgColor=#e9f0f4 width=150>标题名称：</td>
		<td onmouseover='vbscript:me.bgcolor="#F5F5F5"'	onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>&nbsp;
	            <input name="title" type="text" size="50" maxlength="25" value="<%=title%>">&nbsp;
                </td>
	</tr>
	<tr>
		<td align="right"  bgColor=#e9f0f4>图片地址：</td>
		<td onmouseover='vbscript:me.bgcolor="#F5F5F5"'	onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>&nbsp;
		   <input id="real_url" name="real_url" size=50 readonly="true" value="<%=image_url%>">&nbsp;<input type=button value='从本地上传' onclick="javascript: openWin('../htmledit/html/upload_pic1.htm','450','150');">&nbsp;
		</td>
	</tr>
	<tr>
		<td align="right"  bgColor=#e9f0f4>信息简介：</td>
		<td onmouseover='vbscript:me.bgcolor="#F5F5F5"'	onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>&nbsp;
			<TEXTAREA name=title_desc rows=4 cols=80 ><%=title_desc%></TEXTAREA>
		</td>
	</tr>
	
	<tr>
	    <td colspan="2" align="left"  bgColor=#e9f0f4>&nbsp;&nbsp;&nbsp;&nbsp;信息内容(在线编辑器)</td>
	</tr>
	<tr>
	   <td colspan="2">
	   <textarea name="content" style="display:none"><%=content%></textarea>
              <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
                <tr>
                  <td>
                  <IFRAME ID="onlineEditor" src="../htmledit/ewebeditor.htm?id=content&style=standard600&skin=office2003" frameborder="0" scrolling="no" width="100%" height="408"></IFRAME>
                  <br/>
		  </td>
                </tr>
             </table>
	   </td>
	</tr>
	
</table>

<table border="0" cellpadding="3" class="p1" width="90%" bordercolor="#D7D7D7" style="border-collapse: collapse" cellspacing="0">
	<tr>
		<td width="30%" align="right">　</td>
		<td width="70%" height="0">
		        <%if(!action.equals("view")){%>
			<img border="0" src="../images/btn/confirm.gif"  onclick = "javascript: if(check_validate(main)){main.submit();}" style="cursor:hand">
			<A href="javascript:document.form1.reset();"><IMG src="../images/btn/reset.gif" border=0></A>
			<%}%>
			<A href="javascript:window.location='web_imageinfo_list.jsp';"><IMG src="../images/btn/back.gif"  border=0></A>
		</td>
	</tr>
</table>
</div>
</form>
</body>
<Script Language="javaScript">
    function  check_validate(theForm) {
        if (isSpace(theForm.title.value)) {
            alert("标题名称不能为空！");
            theForm.title.focus();
            return false;
        }
        if (isSpace(theForm.real_url.value)) {
            alert("图片地址不能为空，请上传相应的图片！");
            theForm.real_url.focus();
            return false;
        }
        if (isSpace(theForm.bar_id.value)) {
            alert("请选择所属栏目！");
            theForm.bar_id.focus();
            return false;
        }
        
        return true;
    }
    
</Script>
<script language="javascript">
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function openWin (path ,w ,h) {
	var feature = "" ;
	var winWidth = 300;
	var winHeight =200 ;
	if ( w != "" ){
		winWidth = w ;
	}
	if ( h != "" ){
		winHeight = h ;	
	}
	var left = (window.screen.width - winWidth )/2;
	var top = (window.screen.height - winHeight)/2;
	feature += "height=";
	feature += winHeight ;
	feature += ",width=";
	feature += winWidth;
	feature += ",left=";
	feature += left ;
	feature += ",top=";
	feature += top;
	window.open (path,"",feature);
}
</script>
</html>
