Browse Source

Полный проект

Кинетик 6 years ago
parent
commit
868faacce9
63 changed files with 1089 additions and 0 deletions
  1. BIN
      lib/antlr-2.7.7.jar
  2. BIN
      lib/aopalliance-1.0.jar
  3. BIN
      lib/cdi-api-1.1.jar
  4. BIN
      lib/classmate-1.3.0.jar
  5. BIN
      lib/com.mysql.jdbc_5.1.5.jar
  6. BIN
      lib/commons-logging-1.2.jar
  7. BIN
      lib/dom4j-1.6.1.jar
  8. BIN
      lib/el-api-2.2.jar
  9. BIN
      lib/geronimo-jta_1.1_spec-1.1.1.jar
  10. BIN
      lib/hibernate-commons-annotations-5.0.1.Final.jar
  11. BIN
      lib/hibernate-core-5.2.3.Final.jar
  12. BIN
      lib/hibernate-jpa-2.1-api-1.0.0.Final.jar
  13. BIN
      lib/jandex-2.0.0.Final.jar
  14. BIN
      lib/javassist-3.20.0-GA.jar
  15. BIN
      lib/javax.inject-1.jar
  16. BIN
      lib/jboss-interceptors-api_1.1_spec-1.0.0.Beta1.jar
  17. BIN
      lib/jboss-logging-3.3.0.Final.jar
  18. BIN
      lib/jsr250-api-1.0.jar
  19. BIN
      lib/spring-aop-4.3.4.RELEASE.jar
  20. BIN
      lib/spring-aspects-4.3.4.RELEASE.jar
  21. BIN
      lib/spring-beans-4.3.4.RELEASE.jar
  22. BIN
      lib/spring-context-4.3.4.RELEASE.jar
  23. BIN
      lib/spring-context-support-4.3.4.RELEASE.jar
  24. BIN
      lib/spring-core-4.3.4.RELEASE.jar
  25. BIN
      lib/spring-expression-4.3.4.RELEASE.jar
  26. BIN
      lib/spring-instrument-4.3.4.RELEASE.jar
  27. BIN
      lib/spring-instrument-tomcat-4.3.4.RELEASE.jar
  28. BIN
      lib/spring-jdbc-4.3.4.RELEASE.jar
  29. BIN
      lib/spring-jms-4.3.4.RELEASE.jar
  30. BIN
      lib/spring-messaging-4.3.4.RELEASE.jar
  31. BIN
      lib/spring-orm-4.3.4.RELEASE.jar
  32. BIN
      lib/spring-oxm-4.3.4.RELEASE.jar
  33. BIN
      lib/spring-test-4.3.4.RELEASE.jar
  34. BIN
      lib/spring-tx-4.3.4.RELEASE.jar
  35. BIN
      lib/spring-web-4.3.4.RELEASE.jar
  36. BIN
      lib/spring-webmvc-4.3.4.RELEASE.jar
  37. BIN
      lib/spring-webmvc-portlet-4.3.4.RELEASE.jar
  38. BIN
      lib/spring-websocket-4.3.4.RELEASE.jar
  39. 27 0
      src/EntitiesDao/UsersDao.java
  40. 14 0
      src/HibernateEntities/ClientsEntity.hbm.xml
  41. 92 0
      src/HibernateEntities/ClientsEntity.java
  42. 12 0
      src/HibernateEntities/GroupsEntity.hbm.xml
  43. 66 0
      src/HibernateEntities/GroupsEntity.java
  44. 18 0
      src/HibernateEntities/ModeratorsEntity.hbm.xml
  45. 144 0
      src/HibernateEntities/ModeratorsEntity.java
  46. 14 0
      src/HibernateEntities/StudentsEntity.hbm.xml
  47. 92 0
      src/HibernateEntities/StudentsEntity.java
  48. 12 0
      src/HibernateEntities/UsersEntity.hbm.xml
  49. 66 0
      src/HibernateEntities/UsersEntity.java
  50. 29 0
      src/HibernateUtil/HibernateUtil.java
  51. 27 0
      src/LoginEntities/LoginUser.java
  52. 54 0
      src/controller/controller.java
  53. 22 0
      src/hibernate.cfg.xml
  54. 6 0
      web/WEB-INF/applicationContext.xml
  55. 21 0
      web/WEB-INF/dispatcher-servlet.xml
  56. 27 0
      web/WEB-INF/views/SecondPage.jsp
  57. 16 0
      web/WEB-INF/views/adminBar.jsp
  58. 7 0
      web/WEB-INF/views/bootstrap.min.css
  59. 200 0
      web/WEB-INF/views/cssforpr.css
  60. 57 0
      web/WEB-INF/views/index.jsp
  61. 16 0
      web/WEB-INF/views/ownerBar.jsp
  62. 16 0
      web/WEB-INF/views/studentBar.jsp
  63. 34 0
      web/WEB-INF/web.xml

BIN
lib/antlr-2.7.7.jar


BIN
lib/aopalliance-1.0.jar


BIN
lib/cdi-api-1.1.jar


BIN
lib/classmate-1.3.0.jar


BIN
lib/com.mysql.jdbc_5.1.5.jar


BIN
lib/commons-logging-1.2.jar


BIN
lib/dom4j-1.6.1.jar


BIN
lib/el-api-2.2.jar


BIN
lib/geronimo-jta_1.1_spec-1.1.1.jar


BIN
lib/hibernate-commons-annotations-5.0.1.Final.jar


BIN
lib/hibernate-core-5.2.3.Final.jar


BIN
lib/hibernate-jpa-2.1-api-1.0.0.Final.jar


BIN
lib/jandex-2.0.0.Final.jar


BIN
lib/javassist-3.20.0-GA.jar


BIN
lib/javax.inject-1.jar


BIN
lib/jboss-interceptors-api_1.1_spec-1.0.0.Beta1.jar


BIN
lib/jboss-logging-3.3.0.Final.jar


BIN
lib/jsr250-api-1.0.jar


BIN
lib/spring-aop-4.3.4.RELEASE.jar


BIN
lib/spring-aspects-4.3.4.RELEASE.jar


BIN
lib/spring-beans-4.3.4.RELEASE.jar


BIN
lib/spring-context-4.3.4.RELEASE.jar


BIN
lib/spring-context-support-4.3.4.RELEASE.jar


BIN
lib/spring-core-4.3.4.RELEASE.jar


BIN
lib/spring-expression-4.3.4.RELEASE.jar


BIN
lib/spring-instrument-4.3.4.RELEASE.jar


BIN
lib/spring-instrument-tomcat-4.3.4.RELEASE.jar


BIN
lib/spring-jdbc-4.3.4.RELEASE.jar


BIN
lib/spring-jms-4.3.4.RELEASE.jar


BIN
lib/spring-messaging-4.3.4.RELEASE.jar


BIN
lib/spring-orm-4.3.4.RELEASE.jar


BIN
lib/spring-oxm-4.3.4.RELEASE.jar


BIN
lib/spring-test-4.3.4.RELEASE.jar


BIN
lib/spring-tx-4.3.4.RELEASE.jar


BIN
lib/spring-web-4.3.4.RELEASE.jar


BIN
lib/spring-webmvc-4.3.4.RELEASE.jar


BIN
lib/spring-webmvc-portlet-4.3.4.RELEASE.jar


BIN
lib/spring-websocket-4.3.4.RELEASE.jar


+ 27 - 0
src/EntitiesDao/UsersDao.java

@@ -0,0 +1,27 @@
+package EntitiesDao;
+
+import HibernateEntities.UsersEntity;
+import org.hibernate.Session;
+import org.hibernate.query.Query;
+
+import java.util.HashMap;
+import java.util.List;
+
+import static HibernateUtil.HibernateUtil.getSession;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+public class UsersDao {
+    public static HashMap<String, UsersEntity> getUserList(){
+        Session session = getSession();
+        Query query = session.createQuery("FROM UsersEntity");
+        List<UsersEntity> res = query.list();
+        HashMap<String,UsersEntity> userDict = new HashMap<>();
+        for(UsersEntity us: res){
+            userDict.put(us.getUserLogin(),us);
+        }
+        session.close();
+        return userDict;
+    }
+}

+ 14 - 0
src/HibernateEntities/ClientsEntity.hbm.xml

@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.ClientsEntity" table="clients" schema="anketa">
+        <id name="clientId" column="client_id"/>
+        <property name="clFamily" column="cl_family"/>
+        <property name="clFirstName" column="cl_first_name"/>
+        <property name="clSecName" column="cl_sec_name"/>
+        <property name="clPassword" column="cl_password"/>
+    </class>
+</hibernate-mapping>

+ 92 - 0
src/HibernateEntities/ClientsEntity.java

@@ -0,0 +1,92 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+@Entity
+@Table(name = "clients", schema = "anketa", catalog = "")
+public class ClientsEntity {
+    private int clientId;
+    private String clFamily;
+    private String clFirstName;
+    private String clSecName;
+    private String clPassword;
+
+    @Id
+    @Column(name = "client_id")
+    public int getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(int clientId) {
+        this.clientId = clientId;
+    }
+
+    @Basic
+    @Column(name = "cl_family")
+    public String getClFamily() {
+        return clFamily;
+    }
+
+    public void setClFamily(String clFamily) {
+        this.clFamily = clFamily;
+    }
+
+    @Basic
+    @Column(name = "cl_first_name")
+    public String getClFirstName() {
+        return clFirstName;
+    }
+
+    public void setClFirstName(String clFirstName) {
+        this.clFirstName = clFirstName;
+    }
+
+    @Basic
+    @Column(name = "cl_sec_name")
+    public String getClSecName() {
+        return clSecName;
+    }
+
+    public void setClSecName(String clSecName) {
+        this.clSecName = clSecName;
+    }
+
+    @Basic
+    @Column(name = "cl_password")
+    public String getClPassword() {
+        return clPassword;
+    }
+
+    public void setClPassword(String clPassword) {
+        this.clPassword = clPassword;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ClientsEntity that = (ClientsEntity) o;
+
+        if (clientId != that.clientId) return false;
+        if (clFamily != null ? !clFamily.equals(that.clFamily) : that.clFamily != null) return false;
+        if (clFirstName != null ? !clFirstName.equals(that.clFirstName) : that.clFirstName != null) return false;
+        if (clSecName != null ? !clSecName.equals(that.clSecName) : that.clSecName != null) return false;
+        if (clPassword != null ? !clPassword.equals(that.clPassword) : that.clPassword != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = clientId;
+        result = 31 * result + (clFamily != null ? clFamily.hashCode() : 0);
+        result = 31 * result + (clFirstName != null ? clFirstName.hashCode() : 0);
+        result = 31 * result + (clSecName != null ? clSecName.hashCode() : 0);
+        result = 31 * result + (clPassword != null ? clPassword.hashCode() : 0);
+        return result;
+    }
+}

+ 12 - 0
src/HibernateEntities/GroupsEntity.hbm.xml

@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.GroupsEntity" table="groups" schema="anketa">
+        <id name="groupId" column="group_id"/>
+        <property name="groupName" column="group_name"/>
+        <property name="year" column="year"/>
+    </class>
+</hibernate-mapping>

+ 66 - 0
src/HibernateEntities/GroupsEntity.java

@@ -0,0 +1,66 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+@Entity
+@Table(name = "groups", schema = "anketa", catalog = "")
+public class GroupsEntity {
+    private int groupId;
+    private String groupName;
+    private String year;
+
+    @Id
+    @Column(name = "group_id")
+    public int getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(int groupId) {
+        this.groupId = groupId;
+    }
+
+    @Basic
+    @Column(name = "group_name")
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    @Basic
+    @Column(name = "year")
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        GroupsEntity that = (GroupsEntity) o;
+
+        if (groupId != that.groupId) return false;
+        if (groupName != null ? !groupName.equals(that.groupName) : that.groupName != null) return false;
+        if (year != null ? !year.equals(that.year) : that.year != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = groupId;
+        result = 31 * result + (groupName != null ? groupName.hashCode() : 0);
+        result = 31 * result + (year != null ? year.hashCode() : 0);
+        return result;
+    }
+}

+ 18 - 0
src/HibernateEntities/ModeratorsEntity.hbm.xml

@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.ModeratorsEntity" table="moderators" schema="anketa">
+        <id name="modId" column="mod_id"/>
+        <property name="modFamily" column="mod_family"/>
+        <property name="modFirstName" column="mod_first_name"/>
+        <property name="modSecName" column="mod_sec_name"/>
+        <property name="modPassword" column="mod_password"/>
+        <property name="modBirthdate" column="mod_birthdate"/>
+        <property name="modEmail" column="mod_email"/>
+        <property name="modHometown" column="mod_hometown"/>
+        <property name="modPhone" column="mod_phone"/>
+    </class>
+</hibernate-mapping>

+ 144 - 0
src/HibernateEntities/ModeratorsEntity.java

@@ -0,0 +1,144 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+@Entity
+@Table(name = "moderators", schema = "anketa", catalog = "")
+public class ModeratorsEntity {
+    private int modId;
+    private String modFamily;
+    private String modFirstName;
+    private String modSecName;
+    private String modPassword;
+    private String modBirthdate;
+    private String modEmail;
+    private String modHometown;
+    private String modPhone;
+
+    @Id
+    @Column(name = "mod_id")
+    public int getModId() {
+        return modId;
+    }
+
+    public void setModId(int modId) {
+        this.modId = modId;
+    }
+
+    @Basic
+    @Column(name = "mod_family")
+    public String getModFamily() {
+        return modFamily;
+    }
+
+    public void setModFamily(String modFamily) {
+        this.modFamily = modFamily;
+    }
+
+    @Basic
+    @Column(name = "mod_first_name")
+    public String getModFirstName() {
+        return modFirstName;
+    }
+
+    public void setModFirstName(String modFirstName) {
+        this.modFirstName = modFirstName;
+    }
+
+    @Basic
+    @Column(name = "mod_sec_name")
+    public String getModSecName() {
+        return modSecName;
+    }
+
+    public void setModSecName(String modSecName) {
+        this.modSecName = modSecName;
+    }
+
+    @Basic
+    @Column(name = "mod_password")
+    public String getModPassword() {
+        return modPassword;
+    }
+
+    public void setModPassword(String modPassword) {
+        this.modPassword = modPassword;
+    }
+
+    @Basic
+    @Column(name = "mod_birthdate")
+    public String getModBirthdate() {
+        return modBirthdate;
+    }
+
+    public void setModBirthdate(String modBirthdate) {
+        this.modBirthdate = modBirthdate;
+    }
+
+    @Basic
+    @Column(name = "mod_email")
+    public String getModEmail() {
+        return modEmail;
+    }
+
+    public void setModEmail(String modEmail) {
+        this.modEmail = modEmail;
+    }
+
+    @Basic
+    @Column(name = "mod_hometown")
+    public String getModHometown() {
+        return modHometown;
+    }
+
+    public void setModHometown(String modHometown) {
+        this.modHometown = modHometown;
+    }
+
+    @Basic
+    @Column(name = "mod_phone")
+    public String getModPhone() {
+        return modPhone;
+    }
+
+    public void setModPhone(String modPhone) {
+        this.modPhone = modPhone;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ModeratorsEntity that = (ModeratorsEntity) o;
+
+        if (modId != that.modId) return false;
+        if (modFamily != null ? !modFamily.equals(that.modFamily) : that.modFamily != null) return false;
+        if (modFirstName != null ? !modFirstName.equals(that.modFirstName) : that.modFirstName != null) return false;
+        if (modSecName != null ? !modSecName.equals(that.modSecName) : that.modSecName != null) return false;
+        if (modPassword != null ? !modPassword.equals(that.modPassword) : that.modPassword != null) return false;
+        if (modBirthdate != null ? !modBirthdate.equals(that.modBirthdate) : that.modBirthdate != null) return false;
+        if (modEmail != null ? !modEmail.equals(that.modEmail) : that.modEmail != null) return false;
+        if (modHometown != null ? !modHometown.equals(that.modHometown) : that.modHometown != null) return false;
+        if (modPhone != null ? !modPhone.equals(that.modPhone) : that.modPhone != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = modId;
+        result = 31 * result + (modFamily != null ? modFamily.hashCode() : 0);
+        result = 31 * result + (modFirstName != null ? modFirstName.hashCode() : 0);
+        result = 31 * result + (modSecName != null ? modSecName.hashCode() : 0);
+        result = 31 * result + (modPassword != null ? modPassword.hashCode() : 0);
+        result = 31 * result + (modBirthdate != null ? modBirthdate.hashCode() : 0);
+        result = 31 * result + (modEmail != null ? modEmail.hashCode() : 0);
+        result = 31 * result + (modHometown != null ? modHometown.hashCode() : 0);
+        result = 31 * result + (modPhone != null ? modPhone.hashCode() : 0);
+        return result;
+    }
+}

+ 14 - 0
src/HibernateEntities/StudentsEntity.hbm.xml

@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.StudentsEntity" table="students" schema="anketa">
+        <id name="studentsId" column="students_id"/>
+        <property name="stFamily" column="st_family"/>
+        <property name="stFirstName" column="st_first_name"/>
+        <property name="stSecName" column="st_sec_name"/>
+        <property name="stPkNumber" column="st_pk_number"/>
+    </class>
+</hibernate-mapping>

+ 92 - 0
src/HibernateEntities/StudentsEntity.java

@@ -0,0 +1,92 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+@Entity
+@Table(name = "students", schema = "anketa", catalog = "")
+public class StudentsEntity {
+    private int studentsId;
+    private String stFamily;
+    private String stFirstName;
+    private String stSecName;
+    private String stPkNumber;
+
+    @Id
+    @Column(name = "students_id")
+    public int getStudentsId() {
+        return studentsId;
+    }
+
+    public void setStudentsId(int studentsId) {
+        this.studentsId = studentsId;
+    }
+
+    @Basic
+    @Column(name = "st_family")
+    public String getStFamily() {
+        return stFamily;
+    }
+
+    public void setStFamily(String stFamily) {
+        this.stFamily = stFamily;
+    }
+
+    @Basic
+    @Column(name = "st_first_name")
+    public String getStFirstName() {
+        return stFirstName;
+    }
+
+    public void setStFirstName(String stFirstName) {
+        this.stFirstName = stFirstName;
+    }
+
+    @Basic
+    @Column(name = "st_sec_name")
+    public String getStSecName() {
+        return stSecName;
+    }
+
+    public void setStSecName(String stSecName) {
+        this.stSecName = stSecName;
+    }
+
+    @Basic
+    @Column(name = "st_pk_number")
+    public String getStPkNumber() {
+        return stPkNumber;
+    }
+
+    public void setStPkNumber(String stPkNumber) {
+        this.stPkNumber = stPkNumber;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        StudentsEntity that = (StudentsEntity) o;
+
+        if (studentsId != that.studentsId) return false;
+        if (stFamily != null ? !stFamily.equals(that.stFamily) : that.stFamily != null) return false;
+        if (stFirstName != null ? !stFirstName.equals(that.stFirstName) : that.stFirstName != null) return false;
+        if (stSecName != null ? !stSecName.equals(that.stSecName) : that.stSecName != null) return false;
+        if (stPkNumber != null ? !stPkNumber.equals(that.stPkNumber) : that.stPkNumber != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = studentsId;
+        result = 31 * result + (stFamily != null ? stFamily.hashCode() : 0);
+        result = 31 * result + (stFirstName != null ? stFirstName.hashCode() : 0);
+        result = 31 * result + (stSecName != null ? stSecName.hashCode() : 0);
+        result = 31 * result + (stPkNumber != null ? stPkNumber.hashCode() : 0);
+        return result;
+    }
+}

+ 12 - 0
src/HibernateEntities/UsersEntity.hbm.xml

@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.UsersEntity" table="users" schema="anketa">
+        <id name="userId" column="user_id"/>
+        <property name="userLogin" column="user_login"/>
+        <property name="userPassword" column="user_password"/>
+    </class>
+</hibernate-mapping>

+ 66 - 0
src/HibernateEntities/UsersEntity.java

@@ -0,0 +1,66 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+@Entity
+@Table(name = "users", schema = "anketa", catalog = "")
+public class UsersEntity {
+    private int userId;
+    private String userLogin;
+    private String userPassword;
+
+    @Id
+    @Column(name = "user_id")
+    public int getUserId() {
+        return userId;
+    }
+
+    public void setUserId(int userId) {
+        this.userId = userId;
+    }
+
+    @Basic
+    @Column(name = "user_login")
+    public String getUserLogin() {
+        return userLogin;
+    }
+
+    public void setUserLogin(String userLogin) {
+        this.userLogin = userLogin;
+    }
+
+    @Basic
+    @Column(name = "user_password")
+    public String getUserPassword() {
+        return userPassword;
+    }
+
+    public void setUserPassword(String userPassword) {
+        this.userPassword = userPassword;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        UsersEntity that = (UsersEntity) o;
+
+        if (userId != that.userId) return false;
+        if (userLogin != null ? !userLogin.equals(that.userLogin) : that.userLogin != null) return false;
+        if (userPassword != null ? !userPassword.equals(that.userPassword) : that.userPassword != null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = userId;
+        result = 31 * result + (userLogin != null ? userLogin.hashCode() : 0);
+        result = 31 * result + (userPassword != null ? userPassword.hashCode() : 0);
+        return result;
+    }
+}

+ 29 - 0
src/HibernateUtil/HibernateUtil.java

@@ -0,0 +1,29 @@
+package HibernateUtil;
+
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+public class HibernateUtil {
+    private static final SessionFactory sessionFactory;
+
+    static {
+        try {
+            Configuration configuration = new Configuration();
+            configuration.configure();
+
+            sessionFactory = configuration.buildSessionFactory();
+        } catch (Throwable ex) {
+            throw new ExceptionInInitializerError(ex);
+        }
+    }
+
+    public static Session getSession() throws HibernateException {
+        return sessionFactory.openSession();
+    }
+
+}

+ 27 - 0
src/LoginEntities/LoginUser.java

@@ -0,0 +1,27 @@
+package LoginEntities;
+
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class LoginUser {
+
+    private String name;
+    private String password;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}

+ 54 - 0
src/controller/controller.java

@@ -0,0 +1,54 @@
+package controller;
+
+
+import EntitiesDao.UsersDao;
+import HibernateEntities.UsersEntity;
+import LoginEntities.LoginUser;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Created by Кинетик on 28.12.2016.
+ */
+@Controller
+public class controller {
+    @RequestMapping(value = "/", method = RequestMethod.GET)
+    public ModelAndView main() {
+        ModelAndView modelAndView = new ModelAndView();
+        modelAndView.addObject("userJSP", new LoginUser());
+        modelAndView.setViewName("index");
+        return modelAndView;
+    }
+    @RequestMapping(value = "/check-user")
+    public ModelAndView checkUser(@ModelAttribute("userJSP") LoginUser user) {
+        ModelAndView modelAndView = new ModelAndView();
+        HashMap<String, UsersEntity> userDict = UsersDao.getUserList();
+        if(userDict.containsKey(user.getName())){
+            if(userDict.get(user.getName()).getUserPassword().equals(user.getPassword())){
+                if(Objects.equals(user.getName(), "admin")){
+                    modelAndView.setViewName("adminBar");
+                } else if(Objects.equals(user.getName(), "owner")){
+                    modelAndView.setViewName("ownerBar");
+                } else {
+                    modelAndView.setViewName("studentBar");
+                }
+            } else {
+                modelAndView.setViewName("index");
+                modelAndView.addObject("message","Bad password");
+            }
+        } else {
+            modelAndView.setViewName("index");
+            modelAndView.addObject("message", "Bad login");
+        }
+
+        return modelAndView;
+    }
+}

+ 22 - 0
src/hibernate.cfg.xml

@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+        "-//Hibernate/Hibernate Configuration DTD//EN"
+        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+    <session-factory>
+        <property name="connection.url">jdbc:mysql://localhost:3306/anketa</property>
+        <property name="connection.password">root</property>
+        <property name="connection.username">root</property>
+        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+        <mapping resource="HibernateEntities/ClientsEntity.hbm.xml"/>
+        <mapping class="HibernateEntities.ClientsEntity"/>
+        <mapping class="HibernateEntities.GroupsEntity"/>
+        <mapping resource="HibernateEntities/GroupsEntity.hbm.xml"/>
+        <mapping resource="HibernateEntities/ModeratorsEntity.hbm.xml"/>
+        <mapping class="HibernateEntities.ModeratorsEntity"/>
+        <mapping resource="HibernateEntities/StudentsEntity.hbm.xml"/>
+        <mapping class="HibernateEntities.StudentsEntity"/>
+        <mapping resource="HibernateEntities/UsersEntity.hbm.xml"/>
+        <mapping class="HibernateEntities.UsersEntity"/>
+    </session-factory>
+</hibernate-configuration>

+ 6 - 0
web/WEB-INF/applicationContext.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+</beans>

+ 21 - 0
web/WEB-INF/dispatcher-servlet.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+    <!-- DispatcherServlet Context: defines this servlet's request-processing
+        infrastructure -->
+    <context:component-scan base-package="controller" />
+
+    <!-- Resolves views selected for rendering by @Controllers to .jsp resources
+        in the /WEB-INF/views directory -->
+    <bean
+            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <property name="prefix" value="/WEB-INF/views/" />
+        <property name="suffix" value=".jsp" />
+    </bean>
+
+
+</beans>

+ 27 - 0
web/WEB-INF/views/SecondPage.jsp

@@ -0,0 +1,27 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Кинетик
+  Date: 28.12.2016
+  Time: 19:07
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Second Page</title>
+</head>
+<body>
+Введенное имя: ${userJSP.name};
+<br/>
+Введенный пароль: ${userJSP.password};
+<br/>
+<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
+<div class="logo"></div>
+<div class="login-block">
+    <h1>Login</h1>
+    <input type="text" value="" placeholder="Username" id="username" />
+    <input type="password" value="" placeholder="Password" id="password" />
+    <button>Submit</button>
+</div>
+</body>
+</html>

+ 16 - 0
web/WEB-INF/views/adminBar.jsp

@@ -0,0 +1,16 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Кинетик
+  Date: 28.12.2016
+  Time: 20:07
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Страница администратора</title>
+</head>
+<body>
+
+</body>
+</html>

File diff suppressed because it is too large
+ 7 - 0
web/WEB-INF/views/bootstrap.min.css


+ 200 - 0
web/WEB-INF/views/cssforpr.css

@@ -0,0 +1,200 @@
+body {
+    background: #ffffff;
+    font-family: 'Roboto', sans-serif;
+    margin-bottom: 60px;
+}
+
+.logo {
+    width: 213px;
+    height: 213px;
+    background: url('http://i.imgur.com/fd8Lcso.png') no-repeat;
+    margin: 30px auto;
+}
+
+.login-block {
+    width: 400px;
+    padding: 20px;
+    background: #ffffff;
+    border: 1px solid #063971;
+    border-radius: 5px;
+    border-top: 5px solid #063971;
+    margin: 0 auto;
+    margin-top: -150px;
+}
+
+.login-block h1 {
+    text-align: center;
+    color: #000;
+    font-size: 18px;
+    text-transform: uppercase;
+    margin-top: 0;
+    margin-bottom: 20px;
+}
+
+html {
+    position: relative;
+    min-height: 100%;
+}
+
+.main-footer {
+    position: absolute;
+    bottom: 0;
+    width: 100%;
+    /* Set the fixed height of the footer here */
+    height: 25px;
+    background-color: #f5f5f5;
+    text-align: center;
+}
+
+.login-block input {
+    width: 100%;
+    height: 42px;
+    box-sizing: border-box;
+    border-radius: 5px;
+    border: 1px solid #ccc;
+    margin-bottom: 20px;
+    font-size: 14px;
+    font-family: 'Roboto', sans-serif;
+    padding: 0 20px 0 50px;
+    outline: none;
+}
+
+.login-block input#username {
+    background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px top no-repeat;
+    background-size: 16px 80px;
+}
+
+.login-block input#password {
+    background: #fff url('http://i.imgur.com/Qf83FTt.png') 20px top no-repeat;
+    background-size: 16px 80px;
+}
+
+.login-block input:active, .login-block input:focus {
+    border: 1px solid #063971;
+}
+
+.login-block button {
+    width: 100%;
+    height: 40px;
+    background: #063971;
+    box-sizing: border-box;
+    border-radius: 5px;
+    border: 1px solid #063971;
+    color: #fff;
+    font-weight: bold;
+    text-transform: uppercase;
+    font-size: 14px;
+    font-family: 'Roboto', sans-serif;
+    outline: none;
+    cursor: pointer;
+}
+
+.login-block button:hover {
+    background: #063971;
+}
+
+/*
+ * Globals
+ */
+
+/* Links */
+a,
+a:focus,
+a:hover {
+    color: #fff;
+}
+
+/* Custom default button */
+.btn-secondary,
+.btn-secondary:hover,
+.btn-secondary:focus {
+    color: #333;
+    text-shadow: none; /* Prevent inheritance from `body` */
+    background-color: #fff;
+    border: .05rem solid #fff;
+}
+
+
+/*
+ * Base structure
+ */
+
+/* Extra markup and styles for table-esque vertical and horizontal centering */
+.site-wrapper {
+    display: table;
+    width: 100%;
+    height: 100%; /* For at least Firefox */
+    min-height: 100%;
+    -webkit-box-shadow: inset 0 0 5rem rgba(0,0,0,.5);
+    box-shadow: inset 0 0 5rem rgba(0,0,0,.5);
+}
+.site-wrapper-inner {
+    display: table-cell;
+    vertical-align: top;
+}
+.cover-container {
+    margin-right: auto;
+    margin-left: auto;
+}
+
+/* Padding for spacing */
+.inner {
+    padding: 2rem;
+}
+
+
+/*
+ * Header
+ */
+
+.masthead {
+    margin-bottom: 2rem;
+}
+
+.masthead-brand {
+    margin-bottom: 0;
+    color: #063971;
+    font-size: xx-large;
+}
+
+.nav-masthead .nav-link {
+    padding: .25rem 0;
+    font-weight: bold;
+    color: rgba(6, 57, 113, 0.5);
+    background-color: transparent;
+    border-bottom: .25rem solid transparent;
+}
+
+.nav-masthead .nav-link:hover,
+.nav-masthead .nav-link:focus {
+    border-bottom-color: rgba(255,255,255,.25);
+}
+
+.nav-masthead .nav-link + .nav-link {
+    margin-left: 1rem;
+}
+
+@media (min-width: 48em) {
+    .masthead-brand {
+        float: left;
+    }
+    .nav-masthead {
+        float: right;
+    }
+}
+
+@media (max-width: 767px) {
+    .login-block {
+        width: 95%;
+        padding: 20px;
+        background: #ffffff;
+        border: 1px solid #063971;
+        border-radius: 5px;
+        border-top: 5px solid #063971;
+        margin: 0 auto;
+        margin-top: -150px;
+    }
+    .nav-link{
+        margin-top: 10px;
+    }
+}

+ 57 - 0
web/WEB-INF/views/index.jsp

@@ -0,0 +1,57 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Кинетик
+  Date: 28.12.2016
+  Time: 18:51
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<link href="bootstrap.min.css" rel="stylesheet">
+
+<html>
+
+<head>
+  <title>Login Page</title>
+  <style type="text/css">
+    <%@include file="cssforpr.css" %>
+    <%@include file="bootstrap.min.css" %>
+  </style>
+</head>
+
+<body>
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="#">Войти</a>
+        <a class="nav-link" href="#">О проекте</a>
+        <a class="nav-link" href="#">Создать аккаунт</a>
+        <a class="nav-link" href="#">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+  <h1>Вход в систему</h1>
+  <spring:form method="post"  modelAttribute="userJSP" action="check-user">
+     <spring:select path="name" type="text" value="" placeholder="Логин" id="username">
+         <spring:option value="">Тип пользователя</spring:option>
+         <spring:option value="admin">Администратор</spring:option>
+         <spring:option value="owner">Заказчик</spring:option>
+         <spring:option value="student">Исполнитель</spring:option>
+     </spring:select> <br/>
+     <spring:input path="password" type="password" value="" placeholder="Пароль" id="password"/>   <br/>
+    ${message}<br/>
+    <spring:button>Вход</spring:button>
+  </spring:form>
+</div>
+
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
+
+</body>
+
+</html>

+ 16 - 0
web/WEB-INF/views/ownerBar.jsp

@@ -0,0 +1,16 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Кинетик
+  Date: 28.12.2016
+  Time: 20:07
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Страница заказчика</title>
+</head>
+<body>
+
+</body>
+</html>

+ 16 - 0
web/WEB-INF/views/studentBar.jsp

@@ -0,0 +1,16 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Кинетик
+  Date: 28.12.2016
+  Time: 20:07
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Страница студента</title>
+</head>
+<body>
+ <h1>Страница студента</h1>
+</body>
+</html>

+ 34 - 0
web/WEB-INF/web.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+         version="3.1">
+
+    <!-- Add Support for Spring -->
+    <!-- Создает Spring Container, доступный всем сервлетам и фильтрам -->
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>/WEB-INF/applicationContext.xml</param-value>
+    </context-param>
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <!-- Обрабатывает все запросы. Центральное понятие-->
+    <servlet>
+        <servlet-name>dispatcher</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.form</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+</web-app>