ext操作及页面排版布局

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>学员管理中心</title>
		<script type="text/javascript">
			function changetheme(){
				var theme=document.getElementById("theme").value;
				window.location.href="main.jsp?theme="+theme;
			}
		</script>
		<link rel="StyleSheet" href="css/dtree.css" type="text/css" />
		<link rel="StyleSheet" href="css/index.css" type="text/css" />
		<link rel="stylesheet" type="text/css"
			href="ext/resources/css/ext-all.css">
		<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="ext/ext-all.js"></script>
		<script type="text/javascript" src="js/dtree.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<%
		int t = Integer.parseInt(request.getParameter("theme")==null?"0":request.getParameter("theme"));
			if (t==1) {
		 %>
		 <link rel="StyleSheet" href="ext/resources/css/xtheme-gray.css" type="text/css" />
		 <%
			}else if (t==3) {
		 %>
		  <link rel="StyleSheet" href="ext/resources/css/xtheme-access.css" type="text/css" />
		 <%
			}else{
		 %>
		  <link rel="StyleSheet" href="ext/resources/css/xtheme-blue.css" type="text/css" />
		  <%
			};
		 %>
		<%
			String sid = (String) request.getParameter("id");
			if (sid == null) {
		%>
		<script type="text/javascript" src="js/index.js"></script>
		<%
			} else {
				int id = Integer.parseInt(sid);
				switch (id) {
					case 10 :
		%>
		<script type="text/javascript" src="js/student/showStudent.js"></script>
		<%
			break;
					case 11 :
		%>
		<script type="text/javascript" src="js/student/showStudent.js"></script>
		<%
			break;
					case 12 :
		%>
		<script type="text/javascript" src="js/student/addStudent.js"></script>
		<%
			break;
					case 13 :
		%>
		<script type="text/javascript" src="js/student/addStudent.js"></script>
		<%
			break;
					case 14 :
		%>
		<script type="text/javascript" src="js/student/showStudent.js"></script>
		<%
			break;
				};
			};
		%>
	</head>

	<body οnlοad="getTime();">
		<div id="north-div">
			<img alt="" src="images/top/logo_head.jpg" />
			<span id="exit"> 
				<select id="theme" οnchange="changetheme();">
					<option value="0">默认主题</option>
					<option value="1">复古灰</option>
					<option value="2">清新蓝色</option>
					<option value="3">深遂黑</option>
				</select>
				<img alt="" src="images/top/top_logout.gif">
			</span>
			<div>
				<span id="hello"></span>
				<span id="admin"> <font color="red">很拽の土豆</font>,欢迎登录学员管理系统 </span>
				<span id="say"> <marquee scrolldelay="200">
						<span id="words"></span>
					</marquee> </span>
			</div>
		</div>
		<div id="east-div"></div>
		<div id="west-div" style="font-size: 12px;">
			<script type="text/javascript">
	var d = new dTree('d');
	d.add(0, -1, '部门管理员您好');
	d.add(1, 0, '课程管理');
	d.add(2, 1, '查看课程', 'main.jsp?id=1', '', '');
	d.add(3, 1, '修改课程', 'main.jsp?id=2', '', '');
	d.add(4, 1, '添加课程', 'main.jsp?id=3', '', '');
	d.add(5, 0, '班级管理');
	d.add(6, 5, '查看班级', 'main.jsp?id=4', '', '');
	d.add(7, 5, '修改班级', 'main.jsp?id=5', '', '');
	d.add(8, 5, '添加班级', 'main.jsp?id=6', '', '');
	d.add(9, 0, '教师信息管理');
	d.add(10, 9, '查看教师', 'main.jsp?id=7', '', '');
	d.add(11, 9, '修改教师信息', 'main.jsp?id=8', '', '');
	d.add(12, 9, '添加教师', 'main.jsp?id=9', '', '');
	d.add(29, 0, '学员信息管理');
	d.add(30, 29, '查看学员', 'main.jsp?id=10', '', '');
	d.add(31, 29, '修改学员信息', 'main.jsp?id=11', '', '');
	d.add(32, 29, '添加学员', 'main.jsp?id=12', '', '');
	d.add(13, 0, '成绩管理');
	d.add(14, 13, '查看成绩', 'CoreManage.jsp?id=13', '', '');
	d.add(15, 13, '修改成绩', 'CoreManage.jsp?id=14', '', '');
	d.add(16, 13, '添加成绩', 'CoreManage.jsp?id=15', '', '');
	d.add(17, 0, '文件管理');
	d.add(18, 17, '文件上传', 'CoreManage.jsp?id=16', '', '');
	d.add(19, 18, '教学资料', 'CoreManage.jsp?id=17', '', '');
	d.add(20, 18, '日常管理', 'CoreManage.jsp?id=18', '', '');
	d.add(21, 17, '文件修改', 'CoreManage.jsp?id=19', '', '');
	d.add(22, 21, '教学资料', 'CoreManage.jsp?id=20', '', '');
	d.add(23, 21, '日常管理', 'CoreManage.jsp?id=21', '', '');
	d.add(24, 0, '最新消息');
	d.add(25, 24, '通知', 'CoreManage.jsp?id=22', '', '');
	d.add(26, 24, '奖惩情况', 'CoreManage.jsp?id=23', '', '');
	d.add(27, 26, '奖励情况', 'CoreManage.jsp?id=24', '', '');
	d.add(28, 26, '惩罚情况', 'CoreManage.jsp?id=25', '', '');
	document.write(d);
</script>
		</div>
		<div id="center-div">
		</div>
		<div id="south-div">
			<a href="#">土豆网</a>
			<a href="#">土豆网</a>
			<a href="#">土豆网</a>
			<a href="#">土豆网</a>
			<br />
			<br />
			© Copyright 1989-2011 很拽の土豆
			<br />
			版权所有 翻版不究
		</div>
<select id="statuslist" style="visibility:hidden"> 
	<option>On</option> 
	<option>Off</option> 
</select>
<select id="userTypes" style="visibility:hidden"> 
	<option>读者</option> 
	<option>VIP读者</option>
	<option>管理员</option> 
	<option>超级管理员</option> 
</select>
	</body>
</html>

document.οncοntextmenu=new Function("event.returnValue=false;"); //禁止右键功能,单击右键将无任何反应 
document.onselectstart=new Function("event.returnValue=false;"); //禁止先择,也就是无法复制 
   function Logout()
   {
   		Ext.MessageBox.hide();
         Ext.MessageBox.show({
         title:"退出",
    msg:"确定要退出吗?",
    buttons:{"yes":"是","no":"否"},
    fn:function(e){if(e=="yes"){window.parent.location.href="logout.jsp";}},
    animEl:"caidan",
     // width:500,
    icon:Ext.MessageBox.INFO,
    closable:false,
     progress:false,
     wait:false,
     progressText:""
   // prompt:true
   // multiline:true
         });
   }
   

   Ext.onReady(function(){
 			
         //  var btn11 = new Ext.Button({
         //    text:'登陆',
         //   type:'button',
         //   id:'login',
         //   enableToggle:true,
         //   pressed: true,
         //   allowDepress:true,
         //   toggleHandler:chushiyemian
         //  });
       
   
         var item1 = new Ext.Panel({
                title: '学员功能',
                collapsed:true,
                autoScroll:true,
                iconCls:'stu-icon',
          		//html:['<a href="javascript:studentInfo()">个人信息</a><br>','<a href="javascript:history()">历史成绩</a><br>','<a href="javascript:startQuestion()">开始答题</a>'],
                cls:'empty',
                bodyStyle:'background-color:#dee7ff',
				items: [{
			        items: {
			        	bodyStyle:'background-color:#dee7ff',
			        	scale: 'large',
			        	id:'meInfo',
			            xtype: 'button',
			            text:'个人信息',
			            iconCls:'info',
			           // enableToggle:false,
			           // toggleHandler:studentInfo,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='StudentInfo.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('个人信息');
         				//this.disable();
                    		} 
                    	}
			        }
			    }, {
			        items: {
			            xtype: 'button',
			            scale: 'large',
			            id:'history',
			            text:'历史成绩',
			            iconCls:'history',
			            enableToggle:false,
			            toggleHandler:history,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='history.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('历史成绩');   
                    		} 
                    	}
			        }
			    }, {
			        items: {
			            xtype: 'button',
			            scale: 'large',
			            id:'startq',
			            text:'开始答题',
			            iconCls:'question',
			           // enableToggle:false,
			           // toggleHandler:startQuestion,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='StartQuestion.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('开始答题');
                    		} 
                    	}
			        }
			    }]
            });
            var item2 = new Ext.Panel({
                title: '教员功能',
                 collapsed:true,
                autoScroll:true,
                iconCls:'tech-icon',
          		//html:['<a href="javascript:teacherInfo()">个人信息</a><br>','<a href="javascript:subjectManager()">科目管理</a><br>','<a href="javascript:questionManager()">试题管理</a><br>','<a href="javascript:studentManager()">学生管理</a>'],
                cls:'empty',
                bodyStyle:'background-color:#dee7ff',
				items: [{
			        items: {
			        	bodyStyle:'background-color:#dee7ff',
			        	scale: 'large',
			        	id:'meInfo',
			            xtype: 'button',
			            text:'个人信息',
			            iconCls:'tinfo',
			           // enableToggle:false,
			           // toggleHandler:studentInfo,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='TeacherInfo.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('个人信息');
         				//this.disable();
                    		} 
                    	}
			        }
			    }, {
			        items: {
			            xtype: 'button',
			            scale: 'large',
			            id:'subject',
			            text:'科目管理',
			            iconCls:'subject',
			            enableToggle:false,
			            toggleHandler:history,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='SubjectManager.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('科目管理');   
                    		} 
                    	}
			        }
			    }, {
			        items: {
			            xtype: 'button',
			            scale: 'large',
			            id:'question',
			            text:'试题管理',
			            iconCls:'question',
			           // enableToggle:false,
			           // toggleHandler:startQuestion,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='QuestionManager.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('试题管理');
                    		} 
                    	}
			        }
			    }, {
			        items: {
			            xtype: 'button',
			            scale: 'large',
			            id:'student',
			            text:'学员管理',
			            iconCls:'student',
			          //  enableToggle:false,
			          //  toggleHandler:startQuestion,
			            listeners:{   
                    	"click":function(){   
                        Ext.get('content-iframe_in_out').dom.src='StudentManager.jsp';  //你要连接的地址
         				Ext.getCmp('container').setTitle('学员管理');
                    		} 
                    	}
			        }
			    }]
            });
        
   var viewport = new Ext.Viewport({
            layout:'border',
            items:[
               new Ext.Panel({
                region:'west',
                id:'west-panel',
                iconCls:'homeMenu',
                split:false, //可以左右调整宽度
                width: 146, //宽度
                 minSize: 120,
                 maxSize: 400,
                 margins:'0 0 0 5',
                title:'菜单',
                bodyStyle:'background-color:#dee7ff',
                titleCollapse:true, //通过item的标题来打开或关闭
                collapsible:true,
                layoutConfig:{
                    animate:true
                },
                layout:'accordion',
             items: [item1,item2]
           
            }),
            new Ext.Panel({
            title: '欢迎登陆',
            region:'center',
            collapsible:false,
            autoScroll:true,
            id: 'container',
            iconCls:'home',
            width:600,
            html:'<iframe id="content-iframe_in_out" frameborder="no" src="mid.jsp" style="width:100%;height:100%"></iframe>'
                        }) 
             ]
        });
   
       function chushiyemian()  //chushiyemian对应button的toggleHandler事件
       {
         Ext.get('content-iframe_in_out').dom.src='StartQuestion.jsp';  //你要连接的地址
         Ext.getCmp('container').setTitle('开始考试');
       }
       
       viewport.render('index');
    });

package com.tudou.ssh.service;

import java.util.List;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.tudou.ssh.commons.BaseDao;
import com.tudou.ssh.commons.PageModel;
import com.tudou.ssh.dao.UserDao;
import com.tudou.ssh.entity.User;

public class UserService extends BaseDao implements UserDao {

	@SuppressWarnings("unchecked")
	public String getUserJsons(int start, int pageSize) {
		StringBuffer json = new StringBuffer();
		PageModel pm = this.getDatasByHql("select u from User u", null, start,
				pageSize);
		List<User> users = pm.getDatas();
		int count = pm.getTotal();
		json.append("{total:" + count);
		json.append(",root:[");
		for (User u : users) {
			json.append("{userId:" + u.getUserId() + ",");
			json.append("userName:'" + u.getUserName() + "',");
			json.append("userPwd:'" + u.getUserPwd() + "',");
			json.append("contactName:'" + u.getContactName() + "',");
			json.append("phone:" + u.getPhone() + ",");
			json.append("officePhone:" + u.getOfficePhone() + ",");
			json.append("address:'" + u.getAddress() + "',");
			json.append("email:'" + u.getEmail() + "',");
			json.append("status:" + u.getStatus() + ",");
			json.append("createDate:'" + u.getCreateDate() + "',");
			json.append("ip:'" + u.getIp() + "',");
			json.append("lastLoginTime:'" + u.getLastLoginTime() + "',");
			json.append("membertype:'" + u.getMembertype().getMember_name()
					+ "'},");
		}
		json = new StringBuffer(json.substring(0, json.length() - 1));
		json.append("]}");
		return json.toString();
	}

	public boolean delUser(String userIds) {
		String[] userId = userIds.split(",");
		for (String s : userId) {
			this.delete(Integer.parseInt(s));
		}
		return true;
	}

	public boolean updateUser(String jsons) {
		JSONArray json = JSONArray.fromObject(jsons);
		User user = new User();
		for (Object obj : json) {
			JSONObject js = JSONObject.fromObject(obj);
			user.setUserId(js.getInt("userId"));
			user.setUserName(js.getString("userName"));
			user.setContactName(js.getString("contactName"));
			user.setPhone(js.getString("phone"));
			user.setOfficePhone(js.getString("officePhone"));
			user.setAddress(js.getString("address"));
			user.setEmail(js.getString("email"));
			user.setStatus(js.getInt("status"));
			user.setUserName(js.getString("userName"));
			user.setUserPwd(js.getString("userPwd"));
			user.setIp(js.getString("ip"));
			user.setLastLoginTime(js.getString("lastLoginTime"));
			user.setCreateDate(js.getString("createDate"));
			// user.setMembertype(membertype)(js.getString("membertype"));
		}
		return this.saveOrUpdate(user);
	}
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值