/* SQLyog Community v9.63 MySQL - 5.5.20 : Database - dish ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`hr` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `hr`; /*Table structure for table `menu` */ DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `Depid` varchar(10) DEFAULT NULL, `user` varchar(20) DEFAULT NULL, `password` varchar(20) DEFAULT NULL, `name` varchar(20) DEFAULT NULL, `sex` varchar(5) DEFAULT NULL, `icard` varchar(18) DEFAULT NULL, `phone` varchar(11) DEFAULT NULL, `email` varchar(40) DEFAULT NULL, `salary` float(20) DEFAULT NULL, `position` varchar(10) DEFAULT NULL, `skill` varchar(30) DEFAULT NULL, KEY `Id` (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=utf8; /*Data for the table `user` */ /*Table structure for table `position` */ DROP TABLE IF EXISTS `position`; CREATE TABLE `position` ( `id` int(20) NOT NULL, `position` varchar(10) DEFAULT NULL, `descript` varchar(10) DEFAULT NULL, KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Data for the table `position` */ /*Table structure for table `department` */ DROP TABLE IF EXISTS `department`; CREATE TABLE `department` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `dep_name` varchar(20) DEFAULT NULL, `minister` varchar(10) DEFAULT NULL, PRIMARY KEY (`Id`), KEY `Id` (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; /*Data for the table `department`*/ /*Table structure for table `salary` */ DROP TABLE IF EXISTS `salary`; CREATE TABLE `salary` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `user_id` int(10) DEFAULT NULL, `base_salary` float(20) DEFAULT NULL, `month` int(3) DEFAULT NULL, `vage_day` varchar(20) DEFAULT NULL, PRIMARY KEY (`Id`), KEY `Id` (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; /*Data for the table `salary`; /*Table structure for table `train` */ DROP TABLE IF EXISTS `course`; CREATE TABLE `course` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `course` varchar(30) DEFAULT NULL, `plan_time` varchar(10) DEFAULT NULL, `descript` varchar(5) DEFAULT NULL, PRIMARY KEY (`Id`), KEY `Id` (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; /*Data for the table `salary`; /*Table structure for table `course` */ DROP TABLE IF EXISTS `selected_course`; CREATE TABLE `selected_course`( `Id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(20) DEFAULT NULL, `course` varchar(30) DEFAULT NULL, `plan_time` varchar(10) DEFAULT NULL, PRIMARY KEY (`Id`), KEY `Id` (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
package com.vo; /** * 用户 * @author liulizhi * */ public class User { private int id; private String depid; //部门id private String user; //用户名 private String password; //密码 private String name; //昵称 private String sex; //性别 private String icard; //用于判断用户是否为管理员 private String phone ; //手机号码 private String email; //电子邮件 private float salary; //薪资 private String position; //职业 private String skill; //技能 public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDepid() { return depid; } public void setDepid(String depid) { this.depid = depid; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getIcard() { return icard; } public void setIcard(String icard) { this.icard = icard; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public float getSalary() { return salary; } public void setSalary(float salary) { this.salary = salary; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } public String getSkill() { return skill; } public void setSkill(String skill) { this.skill = skill; } }
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="initApp()"textAlign="center" verticalAlign="middle"backgroundAlpha="0.5"backgroundColor="#D77C1F" xmlns:local="*"><mx:states><mx:State name="index"><mx:RemoveChild target="{loginPanel}"/><mx:AddChild position="lastChild"><mx:Label text="欢迎来到主页" fontFamily="Georgia" fontSize="20"/></mx:AddChild></mx:State></mx:states><!-- <mx:Script source="loginController.as" />--><mx:Script><![CDATA[import mx.controls.Alert;import mx.collections.ArrayCollection;import mx.rpc.events.ResultEvent;[Bindable] public var users:ArrayCollection = new ArrayCollection(); public function initApp():void{lblCheckCode.text=GenerateCheckCode();}private function loginHandler():void{if(txtUsername.text==""||txtPassword.text==""){Alert.show("用户名或者密码输入不完整!");}else if(checklogin(txtUsername,txtPassword) && txtCheckCode.text.toLocaleLowerCase()==lblCheckCode.text.toLocaleLowerCase()){currentState="index";}else{if(txtCheckCode.text.toLocaleLowerCase()!=lblCheckCode.text.toLocaleLowerCase()){Alert.show("验证码不正确!");lblCheckCode.text=GenerateCheckCode();txtCheckCode.text="";}else{Alert.show("用户名或密码输入不正确!");}}}private function resetHandle():void{txtUsername.text="";txtPassword.text="";txtCheckCode.text="";}private function GenerateCheckCode():String{var ran:Number;var number:Number;var code:String;var checkcode:String="";//生成四个随机数for(var i:int =0;i<4;i++){ran=Math.random();number=Math.round(ran*1000);if(number%2==0){code=String.fromCharCode(48+(number%10));}else{code=String.fromCharCode(65+(number%26));}checkcode+=code;}return checkcode;}//密码判断public function checklogin(name:Object,pwd:Object):Boolean{ud.getAllUser();trace(ud.getAllUser().data.name);if(name == "admin" && pwd =="admin"){return true;}else {return false;}}public function onResult(event:ResultEvent):void{ users=ArrayCollection(event.result);} ]]></mx:Script><mx:Panel width="349" height="230" layout="absolute" title="企业人力资源管理系统" fontSize="12" fontFamily="Georgia" id="loginPanel" verticalAlign="top" textAlign="center" cornerRadius="13" themeColor="#46A4DF" alpha="0.91" backgroundAlpha="1.0" backgroundColor="#FCF8F8"><mx:Label x="10" y="10" text="用户名:" id="username"/><mx:Label x="10" y="50" text="密 码:" id="pwd"/><mx:Label x="10" y="90" text="校验码:"/><mx:LinkButton x="211" y="94" label="看不清楚?" id="linkbtnReGenerate" click="lblCheckCode.text=GenerateCheckCode();" fontSize="11"/><mx:TextInput x="71" y="10" id="txtUsername" textAlign="left"/><mx:TextInput x="71" y="50" id="txtPassword" displayAsPassword="true" textAlign="left"/><mx:TextInput x="71" y="93" width="83" id="txtCheckCode" maxChars="4" textAlign="left"/><mx:Button x="71" label="登录" id="btnLogin" click="loginHandler()" bottom="20"/><mx:Button x="179" label="重置" click="resetHandle()" id="btnReset" bottom="20"/><mx:Label x="162" y="95" width="50" id="lblCheckCode" color="#377CD0" /></mx:Panel><mx:RemoteObject id="ud" destination="UserDao" result="onResult(event)" fault="Alert.show(event.fault.faultDetail,'Error')" endpoint="http://localhost:8080/QHR/messagebroker/amf" /></mx:Application>
Flex登录页面
最新推荐文章于 2023-12-09 22:50:27 发布