<%@page contentType="text/html; charset=UTF-8"%>
<%@include file="/inc/init.jsp"%>
<%@include file="/inc/checklogin.jsp"%>
<%
	String action = pu.getString("action");
	String referer=pu.referer();
	SMS_content_db scdb = new SMS_content_db();
	int scid = pu.getInt("scid");
	//添加产品
	if (action.equals("add")) {
		int classid = pu.getInt("classid");
		int orderid = pu.getInt("orderid");
		String content = pu.getStringByNoChars("content");
		String type = pu.getString("type");
		String remark = pu.getString("remark");
		String create_time = new DateUtil().getCurTime();
		scdb.insert(orderid, classid, content, type, create_time,
				remark, "", "", "", "");
		session.setAttribute("msg", "内容添加成功！");
		response.sendRedirect(referer);
		return;
	} else if (action.equals("edit")) {
		int classid = pu.getInt("classid");
		int orderid = pu.getInt("orderid");
		String content = pu.getStringByNoChars("content");
		String type = pu.getString("type");
		String remark = pu.getString("remark");
		scdb.update(scid, "content", content);
		scdb.update(scid, "remark", remark);
		scdb.update(scid, "type", type);
		scdb.update(scid, "classid", String.valueOf(classid));
		session.setAttribute("msg", "内容更新成功！");
		response.sendRedirect(referer);
		return;
	} else if (action.equals("del")) {
		scdb.delete(scid);
		session.setAttribute("msg", "内容删除成功！");
		response.sendRedirect(referer);
		return;
	}
%>