<%@page contentType="text/html; charset=UTF-8"%>
<%@include file="/inc/init.jsp" %>
<%@include file="/inc/checklogin.jsp" %>
<%@include file="inc/header.jsp" %>
<%
	//分页参数
	int pagex = pu.getInt("pagex", 1);
	if (pagex < 1) {
		pagex = 1;
	}
	int length = 15;
	int start = (pagex - 1) * length;
	int count = 0;
	String querystr = pu.getQueryString();
	querystr=request.getRequestURI()+"?"+querystr;
	//分页参数
SMS_content_db scdb=new  SMS_content_db();
DOC[] docs=null;
int classid=pu.getInt("classid");
if(classid>0){  //如果有过滤条件
	docs=scdb.getListByClassid(classid);
	count=scdb.getRealCount();
}else{
	docs=scdb.getListByAll(start,length); //分页参数应用
	count=scdb.getRealCount();
}
DOC[] classdocs=null;
Product_class_db pcdb=new Product_class_db();
classdocs=pcdb.getListAll();
%>
<div id="c">
<%@include file="inc/left.jsp" %>
<div id="right">
<%@include file="inc/position.jsp" %>
<div class="right">
<div id="right_box">

	<div class="blank20"></div>
<div style="float:left;width:600px;margin-left:10px;overflow:hidden;">
     <form name="searchform" id="searchform"  action="" method="get">
       <br />
            <table width="100%" border="0" cellspacing="1">
              <tr>
              	<td width="35%" valign="middle"><br />
              		产品分类：
              		<select name="classid" id="classid" class="select" onchange="this.form.submit();">
              			<option value="">不限</option>
              			<%
	for(int i=0;i<classdocs.length;i++){
	%>
              			<option value="<%=classdocs[i].get("classid")%>" <%=classdocs[i].geti("classid")==classid?"selected":""%>><%=classdocs[i].get("name")+classdocs[i].get("retain3")%></option>
              			<%}%>
              			</select></td>
              	<td width="65%" align="left" valign="middle"><div style="width:150px;overflow:hidden;">
              		<input class="btn_c" type="button" value=" 添加内容 " onclick="javascript:window.location.href='SmsContentAdd.jsp'" />
              		</div></td>
              	</tr>
              </table>
            <br />
            <div class="blank5"></div>
            </form>
</div>
<div class="blank5"></div>
	<div id="tagscontent" class="right_box">
	  <table border="0" cellspacing="0" cellpadding="0" class="list" name="table1" id="table1" width="100%">

<thead>

<tr class="th">

<th width="8%" align="center"><!--id-->	ID</th>

<th align="center"><!--oid-->	信息内容</th>
<th width="14%" align="center">分类名称/备注</th>
<th width="14%" align="center">短信类型/备注</th>
<th width="12%" align="center">操作</th>
</tr>
</thead>
<tbody>
<%
DOC doc=null;
for(int i=0;i<docs.length;i++){
doc=pcdb.getOne(docs[i].geti("classid"));
%>
<tr class="s_out">
<td align="center"><%=docs[i].get("scid")%></td>
<td align="center" onmouseover="tooltip.show('<%=Util.htmlEncode(docs[i].get("content"))%>');" onmouseout="tooltip.hide();"><%=Util.sub_String(docs[i].get("content"),46,"..")%></td>
<td align="center"><%=doc.get("name")+ doc.get("retain3")%></td>
<td align="center" onmouseover="tooltip.show('备注：<%=docs[i].get("remark")%>');" onmouseout="tooltip.hide();"><%=Select.getText("smstype",docs[i].get("type"))%></td>
<td align="center"><a href="SmsContentEdit.jsp?scid=<%=docs[i].get("scid")%>">修改</a>
	<%if(ConfigUtil.usedel){%>
	<a href="
fun/F_smscontent.jsp?scid=<%=docs[i].get("scid")%>&amp;action=del" onclick="javascript: return confirm('确实要删除吗?删除后不可恢复！');"><font class="fontred">删除</font></a>
	<%}%></td>
</tr>
 <%
}
docs=null;  //释放对象 
%>
</tbody>
</table>
<div class="page" align="center">
<%=PagingUtil.splitPages(pagex,querystr,count, length)%> 
</div>
<div class="blank10"></div>
</div>
<div class="blank10"></div>

<div class="clear"></div>
</div>
</div>

<div class="right_bottom">
</div>
</div>

<div id="footer">
</div>
</div>
<%@include file="inc/msg.jsp" %>
<%@include file="inc/footer.jsp" %>
