diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e7e9d11 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/.idea/ST2-Project.iml b/.idea/ST2-Project.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/ST2-Project.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..08aa60e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..33bc7bf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Employee-Management-System/build.xml b/Employee-Management-System/build.xml new file mode 100644 index 0000000..9e1b720 --- /dev/null +++ b/Employee-Management-System/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project Employee Management System. + + + diff --git a/Employee-Management-System/build/built-jar.properties b/Employee-Management-System/build/built-jar.properties new file mode 100644 index 0000000..a13315f --- /dev/null +++ b/Employee-Management-System/build/built-jar.properties @@ -0,0 +1,4 @@ +#Fri, 17 May 2019 00:35:17 +0530 + + +D\:\\JAVA\\NetBeansProjects\\Employee\ Management\ System= diff --git a/Employee-Management-System/build/classes/Employeee/Add_Employee.class b/Employee-Management-System/build/classes/Employeee/Add_Employee.class new file mode 100644 index 0000000..07387a2 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Add_Employee.class differ diff --git a/Employee-Management-System/build/classes/Employeee/Forget_Password.class b/Employee-Management-System/build/classes/Employeee/Forget_Password.class new file mode 100644 index 0000000..70999d7 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Forget_Password.class differ diff --git a/Employee-Management-System/build/classes/Employeee/Front_Page.class b/Employee-Management-System/build/classes/Employeee/Front_Page.class new file mode 100644 index 0000000..e571396 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Front_Page.class differ diff --git a/Employee-Management-System/build/classes/Employeee/Print_Data.class b/Employee-Management-System/build/classes/Employeee/Print_Data.class new file mode 100644 index 0000000..b33528c Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Print_Data.class differ diff --git a/Employee-Management-System/build/classes/Employeee/Remove_Employee.class b/Employee-Management-System/build/classes/Employeee/Remove_Employee.class new file mode 100644 index 0000000..b711aa5 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Remove_Employee.class differ diff --git a/Employee-Management-System/build/classes/Employeee/Search_Employee.class b/Employee-Management-System/build/classes/Employeee/Search_Employee.class new file mode 100644 index 0000000..af6beff Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Search_Employee.class differ diff --git a/Employee-Management-System/build/classes/Employeee/Update_Employee.class b/Employee-Management-System/build/classes/Employeee/Update_Employee.class new file mode 100644 index 0000000..f1e3a60 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/Update_Employee.class differ diff --git a/Employee-Management-System/build/classes/Employeee/View_Employee.class b/Employee-Management-System/build/classes/Employeee/View_Employee.class new file mode 100644 index 0000000..4825826 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/View_Employee.class differ diff --git a/Employee-Management-System/build/classes/Employeee/conn.class b/Employee-Management-System/build/classes/Employeee/conn.class new file mode 100644 index 0000000..48bca1c Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/conn.class differ diff --git a/Employee-Management-System/build/classes/Employeee/details.class b/Employee-Management-System/build/classes/Employeee/details.class new file mode 100644 index 0000000..e701cdf Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/details.class differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/add_employee.jpg b/Employee-Management-System/build/classes/Employeee/icons/add_employee.jpg new file mode 100644 index 0000000..4b838a8 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/add_employee.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/details.jpg b/Employee-Management-System/build/classes/Employeee/icons/details.jpg new file mode 100644 index 0000000..0eefeac Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/details.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/front.jpg b/Employee-Management-System/build/classes/Employeee/icons/front.jpg new file mode 100644 index 0000000..6c328f9 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/front.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/login.jpg b/Employee-Management-System/build/classes/Employeee/icons/login.jpg new file mode 100644 index 0000000..5acd1fd Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/login.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/print.jpg b/Employee-Management-System/build/classes/Employeee/icons/print.jpg new file mode 100644 index 0000000..07f187a Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/print.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/remove.jpg b/Employee-Management-System/build/classes/Employeee/icons/remove.jpg new file mode 100644 index 0000000..7a0be46 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/remove.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/icons/view.jpg b/Employee-Management-System/build/classes/Employeee/icons/view.jpg new file mode 100644 index 0000000..7df9080 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/icons/view.jpg differ diff --git a/Employee-Management-System/build/classes/Employeee/login.class b/Employee-Management-System/build/classes/Employeee/login.class new file mode 100644 index 0000000..594c958 Binary files /dev/null and b/Employee-Management-System/build/classes/Employeee/login.class differ diff --git a/Employee-Management-System/dist/Employee_Management_System.jar b/Employee-Management-System/dist/Employee_Management_System.jar new file mode 100644 index 0000000..1118033 Binary files /dev/null and b/Employee-Management-System/dist/Employee_Management_System.jar differ diff --git a/Employee-Management-System/dist/README.TXT b/Employee-Management-System/dist/README.TXT new file mode 100644 index 0000000..3d31541 --- /dev/null +++ b/Employee-Management-System/dist/README.TXT @@ -0,0 +1,32 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "Employee_Management_System.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, these files (folders) +are not copied. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/Employee-Management-System/dist/lib/mysql-connector-java-5.1.23-bin.jar b/Employee-Management-System/dist/lib/mysql-connector-java-5.1.23-bin.jar new file mode 100644 index 0000000..1f90414 Binary files /dev/null and b/Employee-Management-System/dist/lib/mysql-connector-java-5.1.23-bin.jar differ diff --git a/Employee-Management-System/manifest.mf b/Employee-Management-System/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/Employee-Management-System/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/Employee-Management-System/nbproject/build-impl.xml b/Employee-Management-System/nbproject/build-impl.xml new file mode 100644 index 0000000..fd06ea7 --- /dev/null +++ b/Employee-Management-System/nbproject/build-impl.xml @@ -0,0 +1,1420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Employee-Management-System/nbproject/genfiles.properties b/Employee-Management-System/nbproject/genfiles.properties new file mode 100644 index 0000000..f095e09 --- /dev/null +++ b/Employee-Management-System/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=e3edafe9 +build.xml.script.CRC32=b13953c1 +build.xml.stylesheet.CRC32=8064a381@1.80.1.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=e3edafe9 +nbproject/build-impl.xml.script.CRC32=1916c9c5 +nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 diff --git a/Employee-Management-System/nbproject/private/private.properties b/Employee-Management-System/nbproject/private/private.properties new file mode 100644 index 0000000..5010505 --- /dev/null +++ b/Employee-Management-System/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\windows 10\\AppData\\Roaming\\NetBeans\\8.2\\build.properties diff --git a/Employee-Management-System/nbproject/private/private.xml b/Employee-Management-System/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/Employee-Management-System/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Employee-Management-System/nbproject/project.properties b/Employee-Management-System/nbproject/project.properties new file mode 100644 index 0000000..f63a103 --- /dev/null +++ b/Employee-Management-System/nbproject/project.properties @@ -0,0 +1,75 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Employee_Management_System.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath=\ + ${libs.MySQLDriver.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=employee.management.system.EmployeeManagementSystem +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/Employee-Management-System/nbproject/project.xml b/Employee-Management-System/nbproject/project.xml new file mode 100644 index 0000000..8b55106 --- /dev/null +++ b/Employee-Management-System/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + Employee Management System + + + + + + + + + diff --git a/Employee-Management-System/src/Employeee/Add_Employee.java b/Employee-Management-System/src/Employeee/Add_Employee.java new file mode 100644 index 0000000..c034712 --- /dev/null +++ b/Employee-Management-System/src/Employeee/Add_Employee.java @@ -0,0 +1,201 @@ +package Employeee; + +import java.sql.*; +import java.awt.*; +import java.awt.event.*; +import java.io.*; +import javax.swing.*; + +class Add_Employee implements ActionListener{ + + JFrame f; + JLabel id,id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,id12,id15,id16,id17,lab,lab1; + JTextField t,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13; + JButton b,b1,b2,b3; + + Add_Employee(int i){} + + Add_Employee(){ + f = new JFrame("Add Employee"); + f.setBackground(Color.white); + f.setLayout(null); + + id15=new JLabel(); + id15.setBounds(0,0,900,700); + id15.setLayout(null); + ImageIcon img = new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/add_employee.jpg")); + id15.setIcon(img); + + id8 = new JLabel("New Employee Details"); + id8.setBounds(320,30,500,50); + id8.setFont(new Font("serif",Font.ITALIC,25)); + id8.setForeground(Color.black); + id15.add(id8); + f.add(id15); + + + id1 = new JLabel("Name"); + id1.setBounds(50,150,100,30); + id1.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id1); + + t1=new JTextField(); + t1.setBounds(200,150,150,30); + id15.add(t1); + + id2 = new JLabel("Father's Name"); + id2.setBounds(400,150,200,30); + id2.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id2); + + t2=new JTextField(); + t2.setBounds(600,150,150,30); + id15.add(t2); + + id3= new JLabel("Age"); + id3.setBounds(50,200,100,30); + id3.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id3); + + t3=new JTextField(); + t3.setBounds(200,200,150,30); + id15.add(t3); + + id4= new JLabel("Date Of Birth"); + id4.setBounds(400,200,200,30); + id4.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id4); + + t4=new JTextField(); + t4.setBounds(600,200,150,30); + id15.add(t4); + + id5= new JLabel("Address"); + id5.setBounds(50,250,100,30); + id5.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id5); + + t5=new JTextField(); + t5.setBounds(200,250,150,30); + id15.add(t5); + + id6= new JLabel("Phone"); + id6.setBounds(400,250,100,30); + id6.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id6); + + t6=new JTextField(); + t6.setBounds(600,250,150,30); + id15.add(t6); + + id7= new JLabel("Email Id"); + id7.setBounds(50,300,100,30); + id7.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id7); + + t7=new JTextField(); + t7.setBounds(200,300,150,30); + id15.add(t7); + + id9= new JLabel("Education"); + id9.setBounds(400,300,100,30); + id9.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id9); + + t8=new JTextField(); + t8.setBounds(600,300,150,30); + id15.add(t8); + + id10= new JLabel("Job Post"); + id10.setBounds(50,350,100,30); + id10.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id10); + + t9=new JTextField(); + t9.setBounds(200,350,150,30); + id15.add(t9); + + + id11= new JLabel("Aadhar No"); + id11.setBounds(400,350,100,30); + id11.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id11); + + t10=new JTextField(); + t10.setBounds(600,350,150,30); + id15.add(t10); + + id12= new JLabel("Employee Id"); + id12.setBounds(50,400,150,30); + id12.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id12); + + t11=new JTextField(); + t11.setBounds(200,400,150,30); + id15.add(t11); + + + + lab=new JLabel(); + lab.setBounds(200,450,250,200); + id15.add(lab); + + lab1=new JLabel(""); + lab1.setBounds(600,450,250,200); + id15.add(lab1); + + b = new JButton("Submit"); + b.setBackground(Color.BLACK); + b.setForeground(Color.WHITE); + b.setBounds(250,550,150,40); + + id15.add(b); + + b1=new JButton("Cancel"); + b1.setBackground(Color.BLACK); + b1.setForeground(Color.WHITE); + b1.setBounds(450,550,150,40); + + id15.add(b1); + + b.addActionListener(this); + b1.addActionListener(this); + + f.setVisible(true); + f.setSize(900,700); + f.setLocation(400,150); + } + + public void actionPerformed(ActionEvent ae){ + + String a = t1.getText(); + String bb = t2.getText(); + String c = t3.getText(); + String d = t4.getText(); + String e = t5.getText(); + String ff = t6.getText(); + String g = t7.getText(); + String h = t8.getText(); + String i = t9.getText(); + String j = t10.getText(); + String k = t11.getText(); + if(ae.getSource() == b){ + try{ + conn cc = new conn(); + String q = "insert into employee values('"+a+"','"+bb+"','"+c+"','"+d+"','"+e+"','"+ff+"','"+g+"','"+h+"','"+i+"','"+j+"','"+k+"')"; + cc.s.executeUpdate(q); + JOptionPane.showMessageDialog(null,"Details Successfully Inserted"); + f.setVisible(false); + new details(); + }catch(Exception ee){ + System.out.println("The error is:"+ee); + } + }else if(ae.getSource() == b1){ + f.setVisible(false); + new details(); + } + } + public static void main(String[ ] arg){ + new Add_Employee(); + } +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/Forget_Password.java b/Employee-Management-System/src/Employeee/Forget_Password.java new file mode 100644 index 0000000..3fb23ba --- /dev/null +++ b/Employee-Management-System/src/Employeee/Forget_Password.java @@ -0,0 +1,139 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Employeee; + +import java.sql.*; +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +class Forget_Password implements ActionListener +{ +JFrame f; +JTextField t,t2,t3; +JLabel l,l1,l2,l3,l4,l5; +JButton b,b1,b2; + +Forget_Password() +{ +f=new JFrame("Forget"); + +f.setBackground(Color.green); +f.setLayout(null); + +l5=new JLabel(); +l5.setBounds(0,0,500,500); +l5.setLayout(null); +ImageIcon img=new ImageIcon("5.jpg"); +l5.setIcon(img); + + +l=new JLabel("Id"); +l.setVisible(true); +l.setBounds(50,200,50,30); +l.setForeground(Color.white); +Font F1=new Font("serif",Font.BOLD,20); +l.setFont(F1); +l5.add(l); +f.add(l5); +l.setVisible(false); + +l1=new JLabel(" Nick name"); +l1.setBounds(50,50,150,30); +l1.setForeground(Color.white); +Font F2=new Font("serif",Font.BOLD,30); +l1.setFont(F2); +l5.add(l1); + +l2=new JLabel("New Password"); +l2.setBounds(50,250,200,30); +l2.setForeground(Color.white); +Font F3=new Font("serif",Font.BOLD,20); +l2.setFont(F3); +l2.setVisible(false); +l5.add(l2); + + +l3=new JLabel("Confirm Password"); +l3.setBounds(50,300,250,30); +l3.setForeground(Color.white); +Font F4=new Font("serif",Font.BOLD,20); +l3.setFont(F4); +l3.setVisible(false); +l5.add(l3); + +t=new JTextField(); +t.setBounds(250,50,150,30); +l5.add(t); + + l4=new JLabel("admin@123"); +l4.setBounds(300,200,150,30); +Font F5=new Font("serif",Font.BOLD,20); +l4.setForeground(Color.white); +l4.setFont(F5); +l4.setVisible(false); +l5.add(l4); + + + t2=new JTextField(); +t2.setBounds(300,250,150,30); +t2.setVisible(false); +l5.add(t2); + + t3=new JTextField(); +t3.setBounds(300,300,150,30); +t3.setVisible(false); +l5.add(t3); + +b=new JButton("Search"); +b.setBounds(250,100,100,30); +b.addActionListener(this); +l5.add(b); + + +b1=new JButton("Submit"); +b1.setBounds(120,370,100,30); +b1.addActionListener(this); +l5.add(b1); +b1.setVisible(false); + +b2=new JButton("Cancel"); +b2.setBounds(260,370,100,30); +b2.addActionListener(this); +l5.add(b2); +b2.setVisible(false); + +f.setSize(500,500); +f.setLocation(300,50); +f.setVisible(true); + +} + +public void actionPerformed(ActionEvent ae) +{ + +if(ae.getSource()==b2) +{ +f.setVisible(false); +login l=new login(); +} + +if(ae.getSource()==b) +{ +l.setVisible(true); +l2.setVisible(true); +l3.setVisible(true); +l4.setVisible(true); +b1.setVisible(true); +b2.setVisible(true); +} + +} +public static void main(String[]ar) +{ +Forget_Password f=new Forget_Password(); +} +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/Front_Page.java b/Employee-Management-System/src/Employeee/Front_Page.java new file mode 100644 index 0000000..9c92a43 --- /dev/null +++ b/Employee-Management-System/src/Employeee/Front_Page.java @@ -0,0 +1,81 @@ +package Employeee; + +import java.awt.*; +import javax.swing.*; +import java.lang.Thread; +import java.awt.event.*; + +class Front_Page implements ActionListener{ + JFrame f; + JLabel id,l1; + JButton b; + + Front_Page(){ + + f=new JFrame("Employee Management System"); + f.setBackground(Color.red); + f.setLayout(null); + + ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/front.jpg")); + Image i2 = i1.getImage().getScaledInstance(1200,700,Image.SCALE_DEFAULT); + ImageIcon i3 = new ImageIcon(i2); + JLabel l1 = new JLabel(i3); + + l1.setBounds(0,150,1360,530); + f.add(l1); + + + b = new JButton("CLICK HERE TO CONTINUE"); + b.setBackground(Color.BLACK); + b.setForeground(Color.WHITE); + + + b.setBounds(500,600,300,70); + b.addActionListener(this); + + id=new JLabel(); + id.setBounds(0,0,1360,750); + id.setLayout(null); + + + + JLabel lid=new JLabel("EMPLOYEE MANAGEMENT SYSTEM"); + lid.setBounds(80,30,1500,100); + lid.setFont(new Font("serif",Font.PLAIN,70)); + lid.setForeground(Color.red); + id.add(lid); + + id.add(b); + f.add(id); + + + f.getContentPane().setBackground(Color.WHITE); + + f.setVisible(true); + f.setSize(1360,750); + f.setLocation(200,100); + + while(true){ + lid.setVisible(false); // lid = j label + try{ + Thread.sleep(500); //1000 = 1 second + }catch(Exception e){} + lid.setVisible(true); + try{ + Thread.sleep(500); + }catch(Exception e){} + } + + } + public void actionPerformed(ActionEvent ae){ + + if(ae.getSource()==b){ + f.setVisible(false); + new login(); + } + } + + public static void main(String[] arg){ + Front_Page f = new Front_Page(); + } +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/Print_Data.java b/Employee-Management-System/src/Employeee/Print_Data.java new file mode 100644 index 0000000..8b1a663 --- /dev/null +++ b/Employee-Management-System/src/Employeee/Print_Data.java @@ -0,0 +1,180 @@ +package Employeee; + +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +import java.sql.*; + +class Print_Data implements ActionListener{ + JFrame f; + JLabel id8,id,aid,id1,aid1,id2,aid2,id3,aid3,id4,aid4,id5,aid5,id6,aid6,id7,aid7,id9,id10,id11,id12,id13,id14,id15,id16,id17,lab; + String emp_id,name,father,address,phone,email,education,post,age,dob,aadhar; + JButton b1,b2; + ImageIcon icon; + + Print_Data(String e_id){ + try{ + conn con = new conn(); + String str = "select * from employee where emp_id = '"+e_id+"'"; + ResultSet rs= con.s.executeQuery(str); + + while(rs.next()){ + + + name = rs.getString("name"); + father = rs.getString("fname"); + age = rs.getString("age"); + dob = rs.getString("dob"); + address = rs.getString("addess"); + phone = rs.getString("phone"); + email = rs.getString("email"); + education = rs.getString("education"); + post = rs.getString("post"); + aadhar = rs.getString("aadhar"); + emp_id = rs.getString("emp_id"); + } + }catch(Exception e){ + e.printStackTrace(); + } + + f=new JFrame("Print Data"); + f.setVisible(true); + f.setSize(595,642); + f.setLocation(450,200); + f.setBackground(Color.white); + f.setLayout(null); + + + id9=new JLabel(); + id9.setBounds(0,0,595,642); + id9.setLayout(null); + ImageIcon img=new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/print.jpg")); + id9.setIcon(img); + + id8 = new JLabel("Employee Details"); + id8.setBounds(50,10,250,30); + f.add(id8); + id8.setFont(new Font("serif",Font.BOLD,25)); + id9.add(id8); + f.add(id9); + + id = new JLabel("Employee Id:"); + id.setBounds(50,70,120,30); + id.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id); + + aid = new JLabel(emp_id); + aid.setBounds(200,70,200,30); + aid.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid); + + id1 = new JLabel("Name:"); + id1.setBounds(50,120,100,30); + id1.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id1); + + aid1 = new JLabel(name); + aid1.setBounds(200,120,300,30); + aid1.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid1); + + + id2 = new JLabel("Father's Name:"); + id2.setBounds(50,170,200,30); + id2.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id2); + + aid2 = new JLabel(father); + aid2.setBounds(200,170,300,30); + aid2.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid2); + + id3= new JLabel("Address:"); + id3.setBounds(50,220,100,30); + id3.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id3); + + aid3= new JLabel(address); + aid3.setBounds(200,220,300,30); + aid3.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid3); + + + id4= new JLabel("Mobile No:"); + id4.setBounds(50,270,100,30); + id4.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id4); + + aid4= new JLabel(phone); + aid4.setBounds(200,270,300,30); + aid4.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid4); + + + id5= new JLabel("Email Id:"); + id5.setBounds(50,320,100,30); + id5.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id5); + + aid5= new JLabel(email); + aid5.setBounds(200,320,300,30); + aid5.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid5); + + + id6= new JLabel("Education:"); + id6.setBounds(50,370,100,30); + id6.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id6); + + aid6= new JLabel(education); + aid6.setBounds(200,370,300,30); + aid6.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid6); + + + id7= new JLabel("Job Post:"); + id7.setBounds(50,420,100,30); + id7.setFont(new Font("serif",Font.BOLD,20)); + id9.add(id7); + + aid7= new JLabel(post); + aid7.setBounds(200,420,300,30); + aid7.setFont(new Font("serif",Font.BOLD,20)); + id9.add(aid7); + + + b1=new JButton("Print"); + b1.setBackground(Color.BLACK); + b1.setForeground(Color.WHITE); + b1.setBounds(100,520,100,30); + b1.addActionListener(this); + id9.add(b1); + + b2=new JButton("cancel"); + b2.setBackground(Color.BLACK); + b2.setForeground(Color.WHITE); + b2.setBounds(250,520,100,30); + b2.addActionListener(this); + id9.add(b2); + + + } + + public void actionPerformed(ActionEvent ae){ + + if(ae.getSource()==b1){ + JOptionPane.showMessageDialog(null,"printed successfully"); + f.setVisible(false); + details d=new details(); + } + if(ae.getSource()==b2){ + f.setVisible(false); + new View_Employee(); + } + } + public static void main(String[] args){ + new Print_Data("Print Data"); + } + +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/Remove_Employee.java b/Employee-Management-System/src/Employeee/Remove_Employee.java new file mode 100644 index 0000000..e2333d2 --- /dev/null +++ b/Employee-Management-System/src/Employeee/Remove_Employee.java @@ -0,0 +1,176 @@ +package Employeee; + +import java.sql.*; +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +class Remove_Employee implements ActionListener{ + JFrame f; + JTextField t; + JLabel l1,l2,l3,l4,l5,l6,l7,l8; + JButton b,b1,b2,b3; + + Remove_Employee(){ + f=new JFrame("Remove Employee"); + f.setBackground(Color.green); + f.setLayout(null); + + l5=new JLabel(); + l5.setBounds(0,0,500,500); + l5.setLayout(null); + ImageIcon img=new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/remove.jpg")); + l5.setIcon(img); + f.add(l5); + + + l1=new JLabel("Employee Id"); + l1.setBounds(50,50,250,30); + l1.setForeground(Color.white); + Font f2 = new Font("serif",Font.BOLD,25); + l1.setFont(f2); + l5.add(l1); + + t=new JTextField(); + t.setBounds(250,50,150,30); + l5.add(t); + + + b=new JButton("Search"); + b.setBounds(200,100,100,30); + b.addActionListener(this); + l5.add(b); + + b3=new JButton("back"); + b3.setBounds(360,100,100,30); + b3.addActionListener(this); + l5.add(b3); + + + l2=new JLabel("Name:"); + l2.setBounds(50,150,250,30); + l2.setForeground(Color.white); + Font f3 = new Font("serif",Font.BOLD,20); + l2.setFont(f3); + l5.add(l2); + + l6=new JLabel(); + l6.setBounds(200,150,350,30); + l6.setForeground(Color.white); + Font F6=new Font("serif",Font.BOLD,20); + l6.setFont(F6); + l5.add(l6); + + l3=new JLabel("Mobile No:"); + l3.setBounds(50,200,250,30); + l3.setForeground(Color.white); + Font f4 = new Font("serif",Font.BOLD,20); + l3.setFont(f4); + l5.add(l3); + + + l7=new JLabel(); + l7.setBounds(200,200,350,30); + l7.setForeground(Color.white); + Font F7=new Font("serif",Font.BOLD,20); + l7.setFont(F7); + l5.add(l7); + + + + l4=new JLabel("Email Id:"); + l4.setBounds(50,250,250,30); + l4.setForeground(Color.white); + Font F5=new Font("serif",Font.BOLD,20); + l4.setFont(F5); + l5.add(l4); + + l8=new JLabel(); + l8.setBounds(200,250,350,30); + l8.setForeground(Color.white); + Font f8=new Font("serif",Font.BOLD,20); + l8.setFont(f8); + l5.add(l8); + + b1=new JButton("Remove"); + b1.setBounds(120,300,100,30); + b1.addActionListener(this); + l5.add(b1); + + + b2=new JButton("Cancel"); + b2.setBounds(300,300,100,30); + b2.addActionListener(this); + l5.add(b2); + l2.setVisible(false); + l3.setVisible(false); + l4.setVisible(false); + b1.setVisible(false); + b2.setVisible(false); + + f.setSize(500,500); + f.setLocation(500,250); + f.setVisible(true); + } + + public void actionPerformed(ActionEvent ae){ + + if(ae.getSource()==b){ + try{ + conn con = new conn(); + String str = "select name,phone,email from employee where emp_id ='"+t.getText()+"' "; + ResultSet rs = con.s.executeQuery(str); + + int i=0; + if(rs.next()){ + String name = rs.getString(1); + String mob = rs.getString(2); + String email=rs.getString(3); + + l2.setVisible(true); + l3.setVisible(true); + l4.setVisible(true); + b1.setVisible(true); + b2.setVisible(true); + i=1; + l6.setText(name); + l7.setText(mob); + l8.setText(email); + } + if(i==0) + JOptionPane.showMessageDialog(null,"Id not found"); + }catch(Exception ex){} + } + if(ae.getSource()==b1){ + try{ + conn con = new conn(); + String str = "delete from employee where emp_id = '"+t.getText()+"'"; + con.s.executeUpdate(str); + JOptionPane.showMessageDialog(null,"deleted successfully"); + l2.setVisible(false); + l3.setVisible(false); + l4.setVisible(false); + l6.setVisible(false); + l7.setVisible(false); + l8.setVisible(false); + b1.setVisible(false); + b2.setVisible(false); + + }catch(Exception ex){ + JOptionPane.showMessageDialog(null,"Exception occured while delting record "+ex); + } + } + if(ae.getSource()==b2){ + f.setVisible(false); + details d=new details(); + } + if(ae.getSource()==b3){ + f.setVisible(false); + details d=new details(); + } + } + + public static void main(String[]ar){ + new Remove_Employee(); + } +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/Search_Employee.java b/Employee-Management-System/src/Employeee/Search_Employee.java new file mode 100644 index 0000000..31159a4 --- /dev/null +++ b/Employee-Management-System/src/Employeee/Search_Employee.java @@ -0,0 +1,69 @@ +package Employeee; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +class Search_Employee implements ActionListener{ + JFrame f; + JTextField t; + JLabel l,l5; + JButton b,b2; + + Search_Employee(){ + f=new JFrame("search"); + f.setBackground(Color.green); + f.setLayout(null); + + l5=new JLabel(); + l5.setBounds(0,0,500,270); + l5.setLayout(null); + ImageIcon img=new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/view.jpg")); + l5.setIcon(img); + + + l=new JLabel("Employee Id"); + l.setVisible(true); + l.setBounds(40,50,250,30); + l.setForeground(Color.white); + Font F1=new Font("serif",Font.BOLD,25); + l.setFont(F1); + l5.add(l); + f.add(l5); + + t=new JTextField(); + t.setBounds(240,50,220,30); + l5.add(t); + + b=new JButton("Search"); + b.setBounds(240,150,100,30); + b.addActionListener(this); + l5.add(b); + + + b2=new JButton("Cancel"); + b2.setBounds(360,150,100,30); + b2.addActionListener(this); + l5.add(b2); + + f.setSize(500,270); + f.setLocation(450,250); + f.setVisible(true); + } + + public void actionPerformed(ActionEvent ae){ + if(ae.getSource()==b2){ + f.setVisible(false); + details d=new details(); + } + if(ae.getSource()==b){ + new Update_Employee(t.getText()); + f.setVisible(false); + } + + } + + public static void main(String[]ar){ + new Search_Employee(); + } +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/Update_Employee.java b/Employee-Management-System/src/Employeee/Update_Employee.java new file mode 100644 index 0000000..0395f90 --- /dev/null +++ b/Employee-Management-System/src/Employeee/Update_Employee.java @@ -0,0 +1,191 @@ +package Employeee; + +import java.awt.*; +import java.sql.*; +import javax.swing.*; +import java.awt.event.*; + +class Update_Employee extends Add_Employee implements ActionListener{ + + JFrame f; + JLabel id,id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,id12,id15,lab,lab1; + JTextField t,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11; + JButton b,b1,b2,b3; + String id_emp; + + Update_Employee(String idaa){ + super(0); + f=new JFrame("update Employee details"); + f.setVisible(true); + f.setSize(900,500); + f.setLocation(450,250); + f.setBackground(Color.white); + f.setLayout(null); + + id_emp=idaa; + id15=new JLabel(); + id15.setBounds(0,0,900,500); + id15.setLayout(null); + ImageIcon img=new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/add_employee.jpg")); + id15.setIcon(img); + + id8 = new JLabel("Update Employee Detail:"); + id8.setBounds(50,10,500,50); + id8.setFont(new Font("serif",Font.ITALIC,40)); + id8.setForeground(Color.black); + id15.add(id8); + f.add(id15); + + + id1 = new JLabel("Name:"); + id1.setBounds(50,100,100,30); + id1.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id1); + + t1=new JTextField(); + t1.setBounds(200,100,150,30); + id15.add(t1); + + id2 = new JLabel("Father's Name:"); + id2.setBounds(400,100,200,30); + id2.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id2); + + t2=new JTextField(); + t2.setBounds(600,100,150,30); + id15.add(t2); + + id3= new JLabel("Address:"); + id3.setBounds(50,150,100,30); + id3.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id3); + + t3=new JTextField(); + t3.setBounds(200,150,150,30); + id15.add(t3); + + id4= new JLabel("Mobile No:"); + id4.setBounds(400,150,100,30); + id4.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id4); + + t4=new JTextField(); + t4.setBounds(600,150,150,30); + id15.add(t4); + + id5= new JLabel("Email Id:"); + id5.setBounds(50,200,100,30); + id5.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id5); + + t5=new JTextField(); + t5.setBounds(200,200,150,30); + id15.add(t5); + + id6= new JLabel("Education:"); + id6.setBounds(400,200,100,30); + id6.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id6); + + t6=new JTextField(); + t6.setBounds(600,200,150,30); + id15.add(t6); + + id7= new JLabel("Job Post:"); + id7.setBounds(50,250,100,30); + id7.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id7); + + t7=new JTextField(); + t7.setBounds(200,250,150,30); + id15.add(t7); + + id9= new JLabel("Aadhar No:"); + id9.setBounds(400,250,100,30); + id9.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id9); + + t8=new JTextField(); + t8.setBounds(600,250,150,30); + id15.add(t8); + + id10= new JLabel("Employee Id:"); + id10.setBounds(50,300,150,30); + id10.setFont(new Font("serif",Font.BOLD,20)); + id15.add(id10); + f.setVisible(false); + t9=new JTextField(); + t9.setBounds(200,300,150,30); + id15.add(t9); + + b=new JButton("update"); + b.setBounds(250,400,100,30); + b.addActionListener(this); + id15.add(b); + + b1=new JButton("Cancel"); + b1.setBounds(450,400,100,30); + b1.addActionListener(this); + id15.add(b1); + + showData(idaa); + } + + int i=0; + String age,dat; + + void showData(String s){ + try{ + conn con = new conn(); + String str = "select * from employee where emp_id = '"+s+"'"; + ResultSet rs = con.s.executeQuery(str); + + if(rs.next()){ + f.setVisible(true); + i=1; + + t1.setText(rs.getString(1)); + t2.setText(rs.getString(2)); + t3.setText(rs.getString(5)); + t4.setText(rs.getString(6)); + t5.setText(rs.getString(7)); + t6.setText(rs.getString(8)); + t7.setText(rs.getString(9)); + t8.setText(rs.getString(10)); + t9.setText(rs.getString(11)); + + age=rs.getString(3); + dat=rs.getString(4); + } + if(i==0) + JOptionPane.showMessageDialog(null,"Id not found"); + new Search_Employee(); + }catch(Exception ex){} + f.setVisible(true); + f.setSize(900,500); + f.setLocation(400,100); + } + + public void actionPerformed(ActionEvent ae){ + if(ae.getSource()==b && i==1){ + try{ + conn con = new conn(); + String str = "update employee set name='"+t1.getText()+"',fname='"+t2.getText()+"',age='"+age+"',dob='"+dat+"',addess='"+t3.getText()+"',phone='"+t4.getText()+"',email='"+t5.getText()+"',education='"+t6.getText()+"',post='"+t7.getText()+"',aadhar='"+t8.getText()+"',emp_id='"+t9.getText()+"' where emp_id='"+id_emp+"'"; + con.s.executeUpdate(str); + JOptionPane.showMessageDialog(null,"successfully updated"); + f.setVisible(false); + new Search_Employee(); + }catch(Exception e){ + System.out.println("The error is:"+e); + } + } + if(ae.getSource()==b1){ + f.setVisible(false); + details d=new details(); + } + } + + public static void main(String[] arg){ + new Update_Employee("Update Employee"); + } +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/View_Employee.java b/Employee-Management-System/src/Employeee/View_Employee.java new file mode 100644 index 0000000..722c998 --- /dev/null +++ b/Employee-Management-System/src/Employeee/View_Employee.java @@ -0,0 +1,71 @@ +package Employeee; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +class View_Employee implements ActionListener{ + + JFrame f; + JTextField t; + JLabel l1,l2; + JButton b,b2; + + View_Employee(){ + f=new JFrame("View"); + f.setBackground(Color.green); + f.setLayout(null); + + l1=new JLabel(); + l1.setBounds(0,0,500,270); + l1.setLayout(null); + ImageIcon img=new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/view.jpg")); + l1.setIcon(img); + + + l2=new JLabel("Employee Id"); + l2.setVisible(true); + l2.setBounds(40,60,250,30); + l2.setForeground(Color.white); + Font F1 = new Font("serif",Font.BOLD,30); + l2.setFont(F1); + l1.add(l2); + f.add(l1); + + + t=new JTextField(); + t.setBounds(240,60,220,30); + l1.add(t); + + b=new JButton("Search"); + b.setBounds(240,150,100,30); + b.addActionListener(this); + l1.add(b); + + b2=new JButton("Cancel"); + b2.setBounds(360,150,100,30); + b2.addActionListener(this); + l1.add(b2); + + f.setSize(500,270); + f.setLocation(450,250); + f.setVisible(true); + } + + public void actionPerformed(ActionEvent ae){ + + if(ae.getSource()==b2){ + f.setVisible(false); + details d=new details(); + } + if(ae.getSource()==b){ + f.setVisible(false); + Print_Data p=new Print_Data(t.getText()); + } + + } + + public static void main(String[]ar){ + View_Employee v=new View_Employee(); + } +} \ No newline at end of file diff --git a/Employee-Management-System/src/Employeee/conn.java b/Employee-Management-System/src/Employeee/conn.java new file mode 100644 index 0000000..4de7222 --- /dev/null +++ b/Employee-Management-System/src/Employeee/conn.java @@ -0,0 +1,20 @@ +package Employeee; + +import java.sql.*; + +public class conn{ + + public Connection c; + public Statement s; + + public conn(){ + try{ + Class.forName("com.mysql.jdbc.Driver"); + c = DriverManager.getConnection("jdbc:mysql:///project3","root",""); + s = c.createStatement(); + }catch(Exception e) { + e.printStackTrace(); + } + } +} + diff --git a/Employee-Management-System/src/Employeee/details.java b/Employee-Management-System/src/Employeee/details.java new file mode 100644 index 0000000..2ce3956 --- /dev/null +++ b/Employee-Management-System/src/Employeee/details.java @@ -0,0 +1,84 @@ +package Employeee; + +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; + +class details implements ActionListener{ + + JFrame f; + JLabel l1,l2; + JButton b1,b2,b3,b4; + + details(){ + f=new JFrame("Employee Detail"); + f.setBackground(Color.white); + f.setLayout(null); + + l1 = new JLabel(); + l1.setBounds(0,0,700,500); + l1.setLayout(null); + ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/details.jpg")); + l1.setIcon(i1); + f.add(l1); + + l2 = new JLabel("Employee Details"); + l2.setBounds(430,20,200,40); + l2.setFont(new Font("serif",Font.BOLD,25)); + l2.setForeground(Color.black); + l1.add(l2); + + b1=new JButton("Add"); + b1.setBounds(420,80,100,40); + b1.setFont(new Font("serif",Font.BOLD,15)); + b1.addActionListener(this); + l1.add(b1); + + + b2=new JButton("View"); + b2.setBounds(530,80,100,40); + b2.setFont(new Font("serif",Font.BOLD,15)); + b2.addActionListener(this); + l1.add(b2); + + b3=new JButton("Remove"); + b3.setBounds(420,140,100,40); + b3.setFont(new Font("serif",Font.BOLD,15)); + b3.addActionListener(this); + l1.add(b3); + + b4=new JButton("Update"); + b4.setBounds(530,140,100,40); + b4.setFont(new Font("serif",Font.BOLD,15)); + b4.addActionListener(this); + l1.add(b4); + + f.setVisible(true); + f.setSize(700,500); + f.setLocation(450,200); + + } + + public void actionPerformed(ActionEvent ae){ + if(ae.getSource()==b1){ + f.setVisible(false); + new Add_Employee(); + } + if(ae.getSource()==b2){ + f.setVisible(false); + new View_Employee(); + } + if(ae.getSource()==b3){ + f.setVisible(false); + new Remove_Employee(); + } + if(ae.getSource()==b4){ + f.setVisible(false); + new Search_Employee(); + } + } + + public static void main(String[ ] arg){ + details d = new details(); + } +} diff --git a/Employee-Management-System/src/Employeee/icons/add_employee.jpg b/Employee-Management-System/src/Employeee/icons/add_employee.jpg new file mode 100644 index 0000000..4b838a8 Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/add_employee.jpg differ diff --git a/Employee-Management-System/src/Employeee/icons/details.jpg b/Employee-Management-System/src/Employeee/icons/details.jpg new file mode 100644 index 0000000..0eefeac Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/details.jpg differ diff --git a/Employee-Management-System/src/Employeee/icons/front.jpg b/Employee-Management-System/src/Employeee/icons/front.jpg new file mode 100644 index 0000000..6c328f9 Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/front.jpg differ diff --git a/Employee-Management-System/src/Employeee/icons/login.jpg b/Employee-Management-System/src/Employeee/icons/login.jpg new file mode 100644 index 0000000..5acd1fd Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/login.jpg differ diff --git a/Employee-Management-System/src/Employeee/icons/print.jpg b/Employee-Management-System/src/Employeee/icons/print.jpg new file mode 100644 index 0000000..07f187a Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/print.jpg differ diff --git a/Employee-Management-System/src/Employeee/icons/remove.jpg b/Employee-Management-System/src/Employeee/icons/remove.jpg new file mode 100644 index 0000000..7a0be46 Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/remove.jpg differ diff --git a/Employee-Management-System/src/Employeee/icons/view.jpg b/Employee-Management-System/src/Employeee/icons/view.jpg new file mode 100644 index 0000000..7df9080 Binary files /dev/null and b/Employee-Management-System/src/Employeee/icons/view.jpg differ diff --git a/Employee-Management-System/src/Employeee/login.java b/Employee-Management-System/src/Employeee/login.java new file mode 100644 index 0000000..4114404 --- /dev/null +++ b/Employee-Management-System/src/Employeee/login.java @@ -0,0 +1,96 @@ +package Employeee; + +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +import java.sql.*; + +class login implements ActionListener{ + + JFrame f; + JLabel l1,l2; + JTextField t1; + JPasswordField t2; + JButton b1,b2; + + login(){ + + f=new JFrame("Login"); + + f.setBackground(Color.white); + f.setLayout(null); + + l1 = new JLabel("Username"); + l1.setBounds(40,20,100,30); + f.add(l1); + + l2 = new JLabel("Password"); + l2.setBounds(40,70,100,30); + f.add(l2); + + t1=new JTextField(); + t1.setBounds(150,20,150,30); + f.add(t1); + + t2=new JPasswordField(); + t2.setBounds(150,70,150,30); + f.add(t2); + + ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("Employeee/icons/login.jpg")); + Image i2 = i1.getImage().getScaledInstance(150,150,Image.SCALE_DEFAULT); + ImageIcon i3 = new ImageIcon(i2); + JLabel l3 = new JLabel(i3); + l3.setBounds(350,20,150,150); + f.add(l3); + + + b1 = new JButton("Login"); + b1.setBounds(40,140,120,30); + b1.setFont(new Font("serif",Font.BOLD,15)); + b1.addActionListener(this); + b1.setBackground(Color.BLACK); + b1.setForeground(Color.WHITE); + f.add(b1); + + b2=new JButton("Cancel"); + b2.setBounds(180,140,120,30); + b2.setFont(new Font("serif",Font.BOLD,15)); + b2.setBackground(Color.BLACK); + b2.setForeground(Color.WHITE); + f.add(b2); + + b2.addActionListener(this); + + f.getContentPane().setBackground(Color.WHITE); + + f.setVisible(true); + f.setSize(600,300); + f.setLocation(400,300); + + } + + public void actionPerformed(ActionEvent ae){ + + try{ + conn c1 = new conn(); + String u = t1.getText(); + String v = t2.getText(); + + String q = "select * from login where username='"+u+"' and password='"+v+"'"; + + ResultSet rs = c1.s.executeQuery(q); + if(rs.next()){ + new details().f.setVisible(true); + f.setVisible(false); + }else{ + JOptionPane.showMessageDialog(null, "Invalid login"); + f.setVisible(false); + } + }catch(Exception e){ + e.printStackTrace(); + } + } + public static void main(String[] arg){ + login l=new login(); + } +} \ No newline at end of file