diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f3d6549d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/ \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 00000000..6675c3f6 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,4 @@ +untuk mencoba website, buka index.html. + +username : admin +password : admin diff --git a/MEMBER.md b/MEMBER.md new file mode 100644 index 00000000..a72bb5db --- /dev/null +++ b/MEMBER.md @@ -0,0 +1,4 @@ +Member : +18210077 - Ananta Pandu - anpandu +13510049 - Fandi Pradhana - fandip +13510047 - Luthfi Chandra - luthfichandra \ No newline at end of file diff --git a/build.xml b/build.xml new file mode 100644 index 00000000..ed9b1534 --- /dev/null +++ b/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project TUBES3. + + + diff --git a/dist/TUBES3.war b/dist/TUBES3.war new file mode 100644 index 00000000..29c15668 Binary files /dev/null and b/dist/TUBES3.war differ diff --git a/images/Book-icon.png b/images/Book-icon.png new file mode 100644 index 00000000..91837319 Binary files /dev/null and b/images/Book-icon.png differ diff --git a/images/Check.png b/images/Check.png new file mode 100644 index 00000000..e2f1a59d Binary files /dev/null and b/images/Check.png differ diff --git a/images/Cross.png b/images/Cross.png new file mode 100644 index 00000000..6b552e93 Binary files /dev/null and b/images/Cross.png differ diff --git a/images/black_header.png b/images/black_header.png new file mode 100644 index 00000000..64b56167 Binary files /dev/null and b/images/black_header.png differ diff --git a/images/edit.png b/images/edit.png new file mode 100644 index 00000000..4324747e Binary files /dev/null and b/images/edit.png differ diff --git a/images/header.png b/images/header.png new file mode 100644 index 00000000..06a04101 Binary files /dev/null and b/images/header.png differ diff --git a/images/headerlogo.png b/images/headerlogo.png new file mode 100644 index 00000000..2cb5a9b3 Binary files /dev/null and b/images/headerlogo.png differ diff --git a/images/homeheader.png b/images/homeheader.png new file mode 100644 index 00000000..4f243505 Binary files /dev/null and b/images/homeheader.png differ diff --git a/images/homeheaderlogo.png b/images/homeheaderlogo.png new file mode 100644 index 00000000..cb05e920 Binary files /dev/null and b/images/homeheaderlogo.png differ diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 00000000..e61a264a Binary files /dev/null and b/images/logo.png differ diff --git a/images/menguasai-dunia.png b/images/menguasai-dunia.png new file mode 100644 index 00000000..b3943192 Binary files /dev/null and b/images/menguasai-dunia.png differ diff --git a/images/paper.png b/images/paper.png new file mode 100644 index 00000000..816c8910 Binary files /dev/null and b/images/paper.png differ diff --git a/images/profilebg.png b/images/profilebg.png new file mode 100644 index 00000000..84d6983f Binary files /dev/null and b/images/profilebg.png differ diff --git a/images/ranger1.jpg b/images/ranger1.jpg new file mode 100644 index 00000000..b88da5f5 Binary files /dev/null and b/images/ranger1.jpg differ diff --git a/images/ranger2.jpg b/images/ranger2.jpg new file mode 100644 index 00000000..8112cf48 Binary files /dev/null and b/images/ranger2.jpg differ diff --git a/images/ranger3.jpg b/images/ranger3.jpg new file mode 100644 index 00000000..17eab1e3 Binary files /dev/null and b/images/ranger3.jpg differ diff --git a/images/ranger4.jpg b/images/ranger4.jpg new file mode 100644 index 00000000..c3ae9a91 Binary files /dev/null and b/images/ranger4.jpg differ diff --git a/images/ranger5.jpg b/images/ranger5.jpg new file mode 100644 index 00000000..35fb6ffe Binary files /dev/null and b/images/ranger5.jpg differ diff --git a/images/registerglass.png b/images/registerglass.png new file mode 100644 index 00000000..5df4a1ac Binary files /dev/null and b/images/registerglass.png differ diff --git a/images/search.png b/images/search.png new file mode 100644 index 00000000..22923418 Binary files /dev/null and b/images/search.png differ diff --git a/images/tambah.png b/images/tambah.png new file mode 100644 index 00000000..8d61f82e Binary files /dev/null and b/images/tambah.png differ diff --git a/images/zz.jpg b/images/zz.jpg new file mode 100644 index 00000000..428cab28 Binary files /dev/null and b/images/zz.jpg differ diff --git a/nbproject/ant-deploy.xml b/nbproject/ant-deploy.xml new file mode 100644 index 00000000..2d5f8778 --- /dev/null +++ b/nbproject/ant-deploy.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 00000000..bbf66c2c --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1071 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.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.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 00000000..6420f3c0 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d91d619d +build.xml.script.CRC32=8cf7af2c +build.xml.stylesheet.CRC32=651128d4@1.36.1.1 +# 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=d91d619d +nbproject/build-impl.xml.script.CRC32=a3ace00f +nbproject/build-impl.xml.stylesheet.CRC32=b7883b1f@1.36.1.1 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 00000000..68fd5bd9 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,7 @@ +deploy.ant.properties.file=C:\\Users\\LCF\\.netbeans\\7.1\\gfv3-1993747689.properties +j2ee.platform.is.jsr109=true +j2ee.server.domain=C:/Program Files/glassfish-3.1.1/glassfish/domains/domain1 +j2ee.server.home=C:/Program Files/glassfish-3.1.1/glassfish +j2ee.server.instance=[C:\\Program Files\\glassfish-3.1.1\\glassfish;C:\\Program Files\\glassfish-3.1.1\\glassfish\\domains\\domain1]deployer:gfv3ee6wc:localhost:4848 +j2ee.server.middleware=C:/Program Files/glassfish-3.1.1 +user.properties.file=C:\\Users\\LCF\\.netbeans\\7.1\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 00000000..c1f155a7 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 00000000..b096a2ad --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,87 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +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.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-6.0.classpath} +excludes= +includes=** +j2ee.compile.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.6-web +j2ee.platform.classpath=${j2ee.server.home}/modules/jsf-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.enterprise.deploy.jar:${j2ee.server.home}/modules/javax.ejb.jar:${j2ee.server.home}/modules/javax.transaction.jar:${j2ee.server.home}/modules/jstl-impl.jar:${j2ee.server.home}/modules/jsf-impl.jar:${j2ee.server.home}/modules/javax.management.j2ee.jar:${j2ee.server.home}/modules/javax.jms.jar:${j2ee.server.home}/modules/endorsed/javax.annotation.jar:${j2ee.server.home}/modules/jersey-core.jar:${j2ee.server.home}/modules/javax.security.jacc.jar:${j2ee.server.home}/modules/javax.resource.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/javax.security.auth.message.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.servlet.jar +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/javax.ejb.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/javax.ejb.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv3ee6 +jar.compress=false +javac.classpath=\ + ${libs.MySQLDriver.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +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.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +no.dependencies=false +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=TUBES3.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 00000000..280ce7f9 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,23 @@ + + + org.netbeans.modules.web.project + + + TUBES3 + 1.6.5 + + + ${libs.MySQLDriver.classpath} + WEB-INF/lib + + + + + + + + + + + + diff --git a/progin_405_13510047.sql b/progin_405_13510047.sql new file mode 100644 index 00000000..107a34fe --- /dev/null +++ b/progin_405_13510047.sql @@ -0,0 +1,422 @@ +-- phpMyAdmin SQL Dump +-- version 3.2.0.1 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Apr 13, 2013 at 04:50 PM +-- Server version: 5.1.37 +-- PHP Version: 5.3.0 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `progin` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `accounts` +-- + +CREATE TABLE IF NOT EXISTS `accounts` ( + `idaccounts` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(30) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `email` varchar(30) DEFAULT NULL, + `nama_lengkap` varchar(30) DEFAULT NULL, + `tgl_lahir` date DEFAULT NULL, + `avatar` varchar(255) DEFAULT NULL, + PRIMARY KEY (`idaccounts`), + UNIQUE KEY `username_UNIQUE` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; + +-- +-- Dumping data for table `accounts` +-- + +INSERT INTO `accounts` (`idaccounts`, `username`, `password`, `email`, `nama_lengkap`, `tgl_lahir`, `avatar`) VALUES +(1, 'panda', 'ce61649168c4550c2f7acab92354dc6e', 'anpandumail@gmail.com', 'pandu', '1992-10-11', 'pict/pandaa.jpg'), +(2, 'pandu', 'pandu', 'anpandumail@gmail.com', 'pandu', '1992-10-11', 'pict/cute-panda.jpg'), +(3, 'pandi', 'pandi', 'anpandumail@gmail.com', 'pandi', '2013-03-21', 'pict/kunfu-panda.jpg'), +(4, 'anpandu', '22d7fe8c185003c98f97e5d6ced420c7', 'anpandu@ymail.com', 'asd zxc', '2013-03-03', 'upload/293341_263226573699052_261443193877390_902753_1681182897_n.jpg'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `accounts_has_tugas` +-- + +CREATE TABLE IF NOT EXISTS `accounts_has_tugas` ( + `accounts_idaccounts` int(11) NOT NULL, + `tugas_idtugas` int(11) NOT NULL, + `pembuat` tinyint(1) DEFAULT NULL, + KEY `fk_accounts_has_tugas_tugas1` (`tugas_idtugas`), + KEY `fk_accounts_has_tugas_accounts1` (`accounts_idaccounts`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `accounts_has_tugas` +-- + +INSERT INTO `accounts_has_tugas` (`accounts_idaccounts`, `tugas_idtugas`, `pembuat`) VALUES +(1, 2, 0), +(4, 3, 1), +(3, 3, 0), +(1, 5, 0), +(1, 6, 0), +(3, 6, 0), +(4, 6, 0), +(4, 1, 0), +(1, 1, 0), +(2, 67, 0), +(2, 68, 0), +(2, 69, 0), +(2, 70, 0), +(2, 71, 0), +(2, 72, 0), +(2, 74, 0), +(2, 74, 0), +(2, 75, 0), +(2, 76, 0), +(2, 77, 0), +(2, 78, 0), +(2, 79, 0), +(2, 80, 0), +(2, 81, 0), +(2, 82, 0), +(2, 83, 0), +(2, 84, 0), +(2, 85, 0), +(2, 86, 0), +(2, 87, 0), +(2, 88, 0), +(2, 89, 0); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `assignee_has_kategori` +-- + +CREATE TABLE IF NOT EXISTS `assignee_has_kategori` ( + `accounts_idaccounts` int(11) NOT NULL, + `kategori_idkategori` int(11) NOT NULL, + KEY `fk_accounts_has_kategori_kategori1` (`kategori_idkategori`), + KEY `fk_accounts_has_kategori_accounts1` (`accounts_idaccounts`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `assignee_has_kategori` +-- + +INSERT INTO `assignee_has_kategori` (`accounts_idaccounts`, `kategori_idkategori`) VALUES +(4, 3), +(4, 3), +(1, 3), +(4, 4), +(4, 4); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `attachment` +-- + +CREATE TABLE IF NOT EXISTS `attachment` ( + `idtable1` int(11) NOT NULL AUTO_INCREMENT, + `path` varchar(45) DEFAULT NULL, + `nama` varchar(255) DEFAULT NULL, + `tugas_idtugas` int(11) NOT NULL, + PRIMARY KEY (`idtable1`), + KEY `fk_attachment_tugas1` (`tugas_idtugas`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=38 ; + +-- +-- Dumping data for table `attachment` +-- + +INSERT INTO `attachment` (`idtable1`, `path`, `nama`, `tugas_idtugas`) VALUES +(1, 'attachment/Pemrograman Master-f8b58ec0/', 'weird-funny-gif-picard-shuttle.gif', 1), +(2, 'attachment/Pemrograman Master-f8b58ec0/', '293341_263226573699052_261443193877390_902753_1681182897_n.jpg', 1), +(3, 'attachment/Pemrograman Master-f8b58ec0/', 'baby laughing.mp4', 1), +(4, 'attachment/Pemrograman Master-f8b58ec0/', 'database.png', 1), +(5, 'attachment/a-01ef5c55/', 'database.png', 2), +(6, 'attachment/internet hacking-3a2bd3ba/', 'avatar1516022_15.gif', 3), +(7, 'attachment/progmaster-fece3373/', 'SAX ROLL - Epic Sax Guy Looped for 10 mins (+ mp3_wav).mp4', 5), +(8, 'attachment/progmaster-fece3373/', 'ZJadwal Kuliah IF-STI 2011 Semester 3.jpg', 5), +(9, 'attachment/internet hacking-c2ac32e1/', 'SAX ROLL - Epic Sax Guy Looped for 10 mins (+ mp3_wav).mp4', 6), +(10, 'attachment/internet hacking-c2ac32e1/', 'hearing1.jpg', 6), +(11, 'attachment/', 'hearing1.jpg', 77), +(12, 'attachment/tes-83125', 'url.jpg', 78), +(13, 'attachment/tes-270621', '', 79), +(14, 'attachment/tes-246070', '', 80), +(15, 'attachment/null-837982', '', 81), +(16, 'attachment/null-660755', '', 82), +(17, 'attachment/tes-221805', 'happy-derp.jpg', 83), +(18, 'attachment/tes-50791', 'happy-derp.jpg', 83), +(19, 'attachment/tes-80207', 'happy-derp.jpg', 83), +(20, 'attachment/tes-823590', 'happy-derp.jpg', 83), +(21, 'attachment/tes-827591', 'happy-derp.jpg', 83), +(22, 'attachment/tes2-280561', 'null', 84), +(23, 'attachment/tes2-280561', 'happy-derp.jpg', 84), +(24, 'attachment/tes2-280561', 'null', 84), +(25, 'attachment/tes2-280561', 'null', 84), +(26, 'attachment/tes2-280561', 'null', 84), +(27, 'attachment/tes-485049', 'happy-derp.jpg', 85), +(28, 'attachment/JavaServerPages-285964', '818102_15563142_lz.jpg', 86), +(29, 'attachment/JavaServerPages-57667', '', 87), +(30, 'attachment/JavaServerPages-57667', '', 87), +(31, 'attachment/JavaServerPages-57667', '', 87), +(32, 'attachment/JavaServerPages-88266', '0307016.jpg', 88), +(33, 'attachment/JavaServerPages-88266', '316628_285460648134968_100000131056562_1319514_585737016_n.jpg', 88), +(34, 'attachment/JavaServerPages-88266', '41GGHKYE4DL.jpg', 88), +(35, 'attachment/JavaServerPages-61149', '[8-bit] Blink 182 - anthem part 2.mp4', 89), +(36, 'attachment/JavaServerPages-61149', '316628_285460648134968_100000131056562_1319514_585737016_n.jpg', 89), +(37, 'attachment/JavaServerPages-61149', 'Tugas_SBP.pdf', 89); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `kategori` +-- + +CREATE TABLE IF NOT EXISTS `kategori` ( + `idkategori` int(11) NOT NULL AUTO_INCREMENT, + `nama` varchar(30) DEFAULT NULL, + `pembuat` int(11) NOT NULL, + PRIMARY KEY (`idkategori`), + KEY `fk_kategori_accounts1` (`pembuat`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; + +-- +-- Dumping data for table `kategori` +-- + +INSERT INTO `kategori` (`idkategori`, `nama`, `pembuat`) VALUES +(1, 'tubes', 1), +(2, 'tugas sangat besar', 4), +(3, 'tugas sangat kecil', 4), +(4, 'tugas lain', 4); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `komentar` +-- + +CREATE TABLE IF NOT EXISTS `komentar` ( + `idkomentar` int(11) NOT NULL AUTO_INCREMENT, + `isi` varchar(511) DEFAULT NULL, + `tugas_idtugas` int(11) NOT NULL, + `accounts_idaccounts` int(11) NOT NULL, + `CREATED` datetime DEFAULT NULL, + PRIMARY KEY (`idkomentar`), + KEY `fk_komentar_tugas1` (`tugas_idtugas`), + KEY `fk_komentar_accounts1` (`accounts_idaccounts`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ; + +-- +-- Dumping data for table `komentar` +-- + +INSERT INTO `komentar` (`idkomentar`, `isi`, `tugas_idtugas`, `accounts_idaccounts`, `CREATED`) VALUES +(1, 'Halo semua', 1, 1, '2013-03-23 16:46:56'), +(2, 'berisik', 1, 2, '2013-03-23 16:47:27'), +(7, 'kau yang berisik', 1, 3, '2013-03-23 16:52:56'), +(32, 'komentar tes, bisa loh', 1, 4, '2013-03-23 22:41:20'), +(33, 'hai', 6, 1, '2013-04-04 14:11:58'), +(34, 'lagi', 6, 1, '2013-04-04 14:12:12'), +(35, 'a', 6, 1, '2013-04-04 14:12:25'), +(36, 'aaaa', 6, 1, '2013-04-04 14:12:27'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tag` +-- + +CREATE TABLE IF NOT EXISTS `tag` ( + `idtag` int(11) NOT NULL AUTO_INCREMENT, + `nama` varchar(30) DEFAULT NULL, + PRIMARY KEY (`idtag`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ; + +-- +-- Dumping data for table `tag` +-- + +INSERT INTO `tag` (`idtag`, `nama`) VALUES +(1, 'tubes'), +(2, 'tucil'), +(3, 'tubesar'), +(4, 'inet'), +(5, 'asd'), +(6, 'lagu'), +(7, 'tucil,'), +(8, 'tucil,,'), +(9, 'tubes,'), +(10, ' tubes'), +(11, ' tucil'), +(12, ' tubes'), +(13, ' asd'), +(14, 'semuanya'), +(15, ' '); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tugas` +-- + +CREATE TABLE IF NOT EXISTS `tugas` ( + `idtugas` int(11) NOT NULL AUTO_INCREMENT, + `nama` varchar(45) DEFAULT NULL, + `deadline` date DEFAULT NULL, + `status_selesai` tinyint(1) DEFAULT NULL, + `kategori_idkategori` int(11) NOT NULL, + PRIMARY KEY (`idtugas`), + KEY `fk_tugas_kategori1` (`kategori_idkategori`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=90 ; + +-- +-- Dumping data for table `tugas` +-- + +INSERT INTO `tugas` (`idtugas`, `nama`, `deadline`, `status_selesai`, `kategori_idkategori`) VALUES +(1, 'Pemrograman Master', '2013-03-05', 0, 1), +(2, 'a', '2013-03-12', 0, 1), +(3, 'internet hacking', '2013-03-01', 0, 3), +(5, 'progmaster', '2013-03-03', 0, 3), +(6, 'internet hacking', '2013-03-03', 0, 3), +(67, 'tes', '2013-03-12', 0, 1), +(68, 'tes', '2013-03-12', 0, 1), +(69, 'JavaServerPages', '2013-03-12', 0, 1), +(70, 'JavaServerPages2', '2013-03-03', 0, 1), +(71, 'JavaServerPages2', '2013-03-03', 0, 1), +(72, 'JavaServerPages2', '2013-03-03', 0, 1), +(73, 'asd', '2013-03-03', 0, 1), +(74, 'asd', '2013-03-03', 0, 1), +(75, 'asd', '2013-03-03', 0, 1), +(76, 'JavaServerPages2', '2013-03-03', 0, 1), +(77, 'JavaServerPages', '2013-03-03', 0, 1), +(78, 'tes', '2013-04-01', 0, 1), +(79, 'tes', '2013-04-01', 0, 1), +(80, 'tes', '2013-04-01', 0, 1), +(81, 'null', '2013-04-01', 0, 1), +(82, 'null', '2013-04-01', 0, 1), +(83, 'tes', '2013-04-01', 0, 1), +(84, 'tes2', '2013-04-01', 0, 1), +(85, 'tes', '2013-04-01', 0, 1), +(86, 'JavaServerPages', '2013-04-01', 0, 1), +(87, 'JavaServerPages', '2013-03-03', 0, 2), +(88, 'JavaServerPages', '2013-04-01', 0, 2), +(89, 'JavaServerPages', '2013-04-01', 0, 2); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tugas_has_tag` +-- + +CREATE TABLE IF NOT EXISTS `tugas_has_tag` ( + `tugas_idtugas` int(11) NOT NULL, + `tag_idtag` int(11) NOT NULL, + KEY `fk_tugas_has_tag_tag1` (`tag_idtag`), + KEY `fk_tugas_has_tag_tugas1` (`tugas_idtugas`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `tugas_has_tag` +-- + +INSERT INTO `tugas_has_tag` (`tugas_idtugas`, `tag_idtag`) VALUES +(2, 1), +(3, 1), +(5, 1), +(6, 1), +(1, 1), +(1, 14), +(67, 1), +(68, 1), +(69, 1), +(70, 1), +(71, 1), +(72, 1), +(74, 1), +(74, 1), +(75, 1), +(76, 1), +(77, 1), +(78, 2), +(79, 2), +(80, 2), +(81, 2), +(82, 2), +(83, 2), +(84, 2), +(85, 2), +(86, 1), +(87, 1), +(88, 2), +(89, 2); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `accounts_has_tugas` +-- +ALTER TABLE `accounts_has_tugas` + ADD CONSTRAINT `fk_accounts_has_tugas_accounts1` FOREIGN KEY (`accounts_idaccounts`) REFERENCES `accounts` (`idaccounts`) ON DELETE NO ACTION ON UPDATE NO ACTION, + ADD CONSTRAINT `fk_accounts_has_tugas_tugas1` FOREIGN KEY (`tugas_idtugas`) REFERENCES `tugas` (`idtugas`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +-- +-- Constraints for table `assignee_has_kategori` +-- +ALTER TABLE `assignee_has_kategori` + ADD CONSTRAINT `fk_accounts_has_kategori_accounts1` FOREIGN KEY (`accounts_idaccounts`) REFERENCES `accounts` (`idaccounts`) ON DELETE NO ACTION ON UPDATE NO ACTION, + ADD CONSTRAINT `fk_accounts_has_kategori_kategori1` FOREIGN KEY (`kategori_idkategori`) REFERENCES `kategori` (`idkategori`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +-- +-- Constraints for table `attachment` +-- +ALTER TABLE `attachment` + ADD CONSTRAINT `fk_attachment_tugas1` FOREIGN KEY (`tugas_idtugas`) REFERENCES `tugas` (`idtugas`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +-- +-- Constraints for table `kategori` +-- +ALTER TABLE `kategori` + ADD CONSTRAINT `fk_kategori_accounts1` FOREIGN KEY (`pembuat`) REFERENCES `accounts` (`idaccounts`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +-- +-- Constraints for table `komentar` +-- +ALTER TABLE `komentar` + ADD CONSTRAINT `fk_komentar_accounts1` FOREIGN KEY (`accounts_idaccounts`) REFERENCES `accounts` (`idaccounts`) ON DELETE NO ACTION ON UPDATE NO ACTION, + ADD CONSTRAINT `fk_komentar_tugas1` FOREIGN KEY (`tugas_idtugas`) REFERENCES `tugas` (`idtugas`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +-- +-- Constraints for table `tugas` +-- +ALTER TABLE `tugas` + ADD CONSTRAINT `fk_tugas_kategori1` FOREIGN KEY (`kategori_idkategori`) REFERENCES `kategori` (`idkategori`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +-- +-- Constraints for table `tugas_has_tag` +-- +ALTER TABLE `tugas_has_tag` + ADD CONSTRAINT `fk_tugas_has_tag_tag1` FOREIGN KEY (`tag_idtag`) REFERENCES `tag` (`idtag`) ON DELETE NO ACTION ON UPDATE NO ACTION, + ADD CONSTRAINT `fk_tugas_has_tag_tugas1` FOREIGN KEY (`tugas_idtugas`) REFERENCES `tugas` (`idtugas`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/src/dashboard.html b/src/dashboard.html new file mode 100644 index 00000000..c9f031d8 --- /dev/null +++ b/src/dashboard.html @@ -0,0 +1,242 @@ + + + + + +Dashboard + + + + + + + + + + + +
+ + +
+
+ Kategori +
+ +
+
+ +
+
+ Kuliah +
+
+ +
+
+ +
+
+ Eksperimen +
+
+ +
+
+ +
+
+ Menguasai Dunia +
+
+ +
+
+ +
+
+ Tambah kategori... +
+
+
+
+
+ Tasks +
+ +
+

Tambah Task...

+
+ +
+ +
+ Deadline: 21 February 2013 +
+
+ Tags: kuliah +
+
+ +
+
+ Tugas Intelegensia Buatan +
+
+ Deadline: 22 February 2013 +
+
+ Tags: kuliah, IB, tugas +
+
+ +
+
+ Cari Monyet +
+
+ Deadline: 24 February 2013 +
+
+ Tags: eksperimen +
+
+ +
+
+ Beli Formalin +
+
+ Deadline: 25 February 2013 +
+
+ Tags: eksperimen +
+
+ +
+
+ Tugas IMK +
+
+ Deadline: 25 February 2013 +
+
+ Tags: kuliah, IMK, tugas +
+
+ +
+
+ Kuis IMK +
+
+ Deadline: 28 February 2013 +
+
+ Tags: kuliah, IMK, kuis +
+
+ +
+
+ Latihan Silat +
+
+ Deadline: 28 February 2013 +
+
+ Tags: bela diri +
+
+
+
+ + + + + + diff --git a/src/index.html b/src/index.html new file mode 100644 index 00000000..122422ac --- /dev/null +++ b/src/index.html @@ -0,0 +1,243 @@ + + +Organize Homepage + + + + + + + + + + + + + + +
+ + +
+ Register dong gan +
+ +
+
+
+
+
+ Username: +
+
+ +
+
+
+
+
+
+ Password: +
+
+ +
+
+
+
+
+
+ Confirm Password: +
+
+ +
+
+
+
+
+
+ Nama lengkap: +
+
+ +
+
+
+
+
+
+ Tanggal lahir: +
+
+ + + +
+
+
+
+
+
+ Email: +
+
+ +
+
+
+
+
+
+ Avatar: +
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + diff --git a/src/java/ConnectDB/ConnectDB.java b/src/java/ConnectDB/ConnectDB.java new file mode 100644 index 00000000..4c3543ec --- /dev/null +++ b/src/java/ConnectDB/ConnectDB.java @@ -0,0 +1,103 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package ConnectDB; + +import java.sql.*; +import java.util.ArrayList; +import javax.servlet.ServletException; + +/** + * + * @author LCF + * + * Informasi database tinggal ambil dari sini + */ +public class ConnectDB { + public static final String dbURL = "jdbc:mysql://localhost:3306/progin"; + public static final String dbUsername = "progin"; + public static final String dbPassword = "progin"; + + /* + * Untuk query yang ada hasilnya. Seperti query SELECT + */ + public static String[][] getHasilQuery(String query) throws ServletException, SQLException { + Connection con = null; + Statement st = null; + ResultSet rs = null; + ResultSetMetaData metadata; + int jumlah_kolom = 0; + ArrayList data = null; + try { + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection(ConnectDB.dbURL, ConnectDB.dbUsername, ConnectDB.dbPassword); + st = con.createStatement(); + rs = st.executeQuery(query); + metadata = rs.getMetaData(); + jumlah_kolom = metadata.getColumnCount(); + data = new ArrayList(); + + while (rs.next()) { + String[] row = new String[jumlah_kolom]; + for (int i = 0; i < jumlah_kolom; i++) { + row[i] = rs.getString(i + 1); + } + data.add(row); + } + } catch (SQLException e) { + System.out.println(e.getMessage()); + throw new ServletException("Servlet Could not display records.", e); + } catch (ClassNotFoundException e) { + throw new ServletException("JDBC Driver not found.", e); + } finally { + if (rs != null) { + rs.close(); + rs = null; + } + if (st != null) { + st.close(); + st = null; + } + if (con != null) { + con.close(); + con = null; + } + } + String[][] hasil = new String[data.size()][jumlah_kolom]; + for (int i = 0; i < data.size(); i++) { + System.arraycopy(data.get(i), 0, hasil[i], 0, jumlah_kolom); + } + + return hasil; + } + + /* + * Untuk query yang ga ada hasilnya. Seperti INSERT + */ + public static void jalankanQuery(String query) throws ServletException, SQLException { + Connection con = null; + Statement st = null; + + try { + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection(ConnectDB.dbURL, ConnectDB.dbUsername, ConnectDB.dbPassword); + st = con.createStatement(); + st.executeUpdate(query); + } catch (SQLException e) { + throw new ServletException("Servlet Could not display records.", e); + } catch (ClassNotFoundException e) { + throw new ServletException("JDBC Driver not found.", e); + } finally { + if (st != null) { + st.close(); + st = null; + } + if (con != null) { + con.close(); + con = null; + } + } + + } +} diff --git a/src/java/Servlets/Kategori.java b/src/java/Servlets/Kategori.java new file mode 100644 index 00000000..73dfe7db --- /dev/null +++ b/src/java/Servlets/Kategori.java @@ -0,0 +1,191 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import ConnectDB.ConnectDB; +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author LCF + */ +public class Kategori extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException, SQLException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet Kategori"); + out.println(""); + out.println(""); + + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + HttpSession session = request.getSession(); + try { + if (request.getParameter("aksi").equals("lihat")) { + showKategori(request.getParameter("uid"), response); + } else if (request.getParameter("aksi").equals("tambah")) { + addKategori(request.getParameter("namaKategori"), (String) session.getAttribute("id"), request.getParameter("assignee"), response); + } else if (request.getParameter("aksi").equals("hapus")) { + deleteKategori((String) session.getAttribute("id"), response); + } + } catch (SQLException ex) { + Logger.getLogger(Kategori.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + HttpSession session = request.getSession(); + try { + addKategori(request.getParameter("nama"), (String) session.getAttribute("id"), request.getParameter("assignees"), response); + } catch (SQLException ex) { + Logger.getLogger(Kategori.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + + private void showKategori(String userID, HttpServletResponse response) throws IOException, ServletException, SQLException { + PrintWriter out = response.getWriter(); + out.println("
"); + out.println("Kategori"); + out.println("
"); + String query = "SELECT nama, idkategori, pembuat FROM kategori, assignee_has_kategori WHERE idkategori = kategori_idkategori AND accounts_idaccounts = " + userID; + String[][] hasil = ConnectDB.getHasilQuery(query); + + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + if (hasil[i][2].equals(userID)) { + out.println(""); + out.println("
"); + out.println("X"); + out.println("
"); + out.println("
"); + } + out.println("
"); + out.println(""); + out.println("
"); + out.println("
"); + out.println(hasil[i][0]); + out.println("
"); + out.println("
"); + } + out.println("
"); + out.println("
"); + out.println(""); + out.println("
"); + out.println("
"); + out.println("Tambah kategori..."); + out.println("
"); + out.println("
"); + if (hasil.length > 0) { + out.println("
"); + out.println("
"); + out.println(""); + out.println("
"); + out.println("
"); + out.println("Hapus kategori..."); + out.println("
"); + out.println("
"); + } + } + + private void addKategori(String namaKategori, String idPembuat, String assignee, HttpServletResponse response) throws ServletException, SQLException, IOException { + //query bikin kategori baru + + String query1 = "INSERT INTO kategori (nama, pembuat) VALUES('" + namaKategori + "'," + idPembuat + ")"; + ConnectDB.jalankanQuery(query1); + + //query update assignee_has_kategori masukin pembuat sebagai assignee + String query2 = "INSERT INTO assignee_has_kategori (accounts_idaccounts, kategori_idkategori) VALUES(" + idPembuat + ",(SELECT idkategori from kategori where nama = '" + namaKategori + "' and pembuat = " + idPembuat + "))"; + ConnectDB.jalankanQuery(query2); + + //query update assignee_has_kategori masukin semua assignee + if (assignee.contains(", ")) { + String[] list_assignee = assignee.split(", "); + for (int i = 0; i < list_assignee.length; i++) { + String query3 = "INSERT INTO assignee_has_kategori (accounts_idaccounts, kategori_idkategori) VALUES((SELECT idaccounts FROM accounts WHERE username = '" + list_assignee[i] + "'),(SELECT idkategori from kategori where nama = '" + namaKategori + "' and pembuat = " + idPembuat + "))"; + ConnectDB.jalankanQuery(query3); + } + } + response.sendRedirect("dashboard.jsp"); + } + + private void deleteKategori(String idkategori, HttpServletResponse response) throws ServletException, SQLException, IOException { + String query1 = "DELETE FROM accounts_has_tugas WHERE tugas_idtugas in (SELECT idtugas FROM tugas WHERE kategori_idkategori = " + idkategori + ")"; + String query2 = "DELETE FROM tugas_has_tag WHERE tugas_idtugas in (SELECT idtugas FROM tugas WHERE kategori_idkategori =" + idkategori + ")"; + String query3 = "DELETE FROM tugas WHERE kategori_idkategori = " + idkategori; + String query4 = "DELETE FROM assignee_has_kategori WHERE kategori_idkategori = " + idkategori; + String query5 = "DELETE FROM kategori WHERE idkategori = " + idkategori; + + ConnectDB.jalankanQuery(query1); + ConnectDB.jalankanQuery(query2); + ConnectDB.jalankanQuery(query3); + ConnectDB.jalankanQuery(query4); + ConnectDB.jalankanQuery(query5); + response.sendRedirect("dashboard.jsp"); + } +} diff --git a/src/java/Servlets/Search.java b/src/java/Servlets/Search.java new file mode 100644 index 00000000..b4d82478 --- /dev/null +++ b/src/java/Servlets/Search.java @@ -0,0 +1,332 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import ConnectDB.ConnectDB; +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author LCF + */ +public class Search extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet Search"); + out.println(""); + out.println(""); + out.println("

Servlet Search at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + if (request.getParameter("aksi").equals("cari")) { + if (request.getParameter("key").equals("username")) { + try { + hasil_username(request.getParameter("value"), 0, 10, response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("key").equals("kategori")) { + try { + hasil_kategori(request.getParameter("value"), 0, 10, response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("key").equals("task")) { + try { + hasil_task(request.getParameter("value"), 0, 10, response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("key").equals("email")) { + } else if (request.getParameter("key").equals("komentar")) { + } else if (request.getParameter("key").equals("semua")) { + try { + hasil_username(request.getParameter("value"), 0, 10, response); + hasil_kategori(request.getParameter("value"), 0, 10, response); + hasil_task(request.getParameter("value"), 0, 10, response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + else if(request.getParameter("aksi").equals("suggest")){ + if(request.getParameter("key").equals("username")){ + try { + suggest_username(request.getParameter("value"), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } + else if(request.getParameter("key").equals("kategori")){ + try { + suggest_kategori(request.getParameter("value"), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } + else if(request.getParameter("key").equals("task")){ + try { + suggest_task(request.getParameter("value"), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } + else if(request.getParameter("key").equals("semua")){ + try { + suggest_all(request.getParameter("value"), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + else if(request.getParameter("aksi").equals("more")){ + if (request.getParameter("key").equals("username")) { + try { + hasil_username(request.getParameter("value"), Integer.parseInt(request.getParameter("limit1")), Integer.parseInt(request.getParameter("limit2")), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("key").equals("kategori")) { + try { + hasil_kategori(request.getParameter("value"), Integer.parseInt(request.getParameter("limit1")), Integer.parseInt(request.getParameter("limit2")), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("key").equals("task")) { + try { + hasil_task(request.getParameter("value"), Integer.parseInt(request.getParameter("limit1")), Integer.parseInt(request.getParameter("limit2")), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("key").equals("email")) { + } else if (request.getParameter("key").equals("komentar")) { + } else if (request.getParameter("key").equals("semua")) { + System.out.println("masuk"); + try { + hasil_username(request.getParameter("value"), Integer.parseInt(request.getParameter("limit1")), Integer.parseInt(request.getParameter("limit2")), response); + hasil_kategori(request.getParameter("value"), Integer.parseInt(request.getParameter("limit1")), Integer.parseInt(request.getParameter("limit2")), response); + hasil_task(request.getParameter("value"), Integer.parseInt(request.getParameter("limit1")), Integer.parseInt(request.getParameter("limit2")), response); + } catch (SQLException ex) { + Logger.getLogger(Search.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + + private void hasil_username(String input, int limit1, int limit2, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + String query = "SELECT idaccounts, username, nama_lengkap, avatar FROM accounts WHERE username like '%" + input + "%' LIMIT " + limit1 + ", " + limit2; + out.println("
"); + String[][] hasil = ConnectDB.getHasilQuery(query); + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + + out.println("
"); + out.println(""); + out.println("
"); + + out.println("
"); + out.print("Username: "); + out.println(hasil[i][1]); + out.println("
"); + + out.println("
"); + out.print("Fullname: "); + out.println(hasil[i][2]); + out.println("
"); + + + out.println("
"); + } + out.println("
"); + } + + private void hasil_kategori(String input, int limit1, int limit2, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + String query = "SELECT nama FROM kategori WHERE nama like '%" + input + "%' LIMIT " + limit1 + ", " + limit2; + String[][] hasil = ConnectDB.getHasilQuery(query); + out.println("
"); + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + out.println("
"); + out.println(""); + out.println("
"); + + out.println("
"); + out.println(hasil[i][0]); + out.println("
"); + out.println("
"); + } + out.println("
"); + } + + private void hasil_task(String input, int limit1, int limit2, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + out.println("
"); + String query = "SELECT DISTINCT idtugas, tugas.nama, deadline, status_selesai FROM tag, tugas, tugas_has_tag WHERE (tugas_idtugas = idtugas AND tag.nama like '%" + input + "%' AND tag_idtag = idtag) OR (tugas.nama LIKE '%" + input + "%') LIMIT " + limit1 + ", " + limit2; + String[][] hasil = ConnectDB.getHasilQuery(query); + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + out.println("
"); + out.println(""); + out.println(hasil[i][1]); + out.println(""); + out.println("
"); + + out.println("
"); + out.println(hasil[i][2]); + out.println("
"); + + String query_tag = "SELECT DISTINCT nama FROM tag, tugas_has_tag WHERE tugas_idtugas = "+hasil[i][0]; + String[][] result_tag = ConnectDB.getHasilQuery(query_tag); + out.println("
"); + out.println("Tags: "); + for(int j = 0; j < result_tag.length; j++){ + out.println(result_tag[j][0]+"; "); + } + out.println("
"); + + //status selesai + out.println("
"); + if(hasil[i][3].equals("0")){ + out.println("Belum Selesai"); + } + else{ + out.println("Selesai"); + } + out.println("
"); + out.println("
"); + } + out.println("
"); + } + + private void suggest_username(String input, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + + String query = "SELECT idaccounts, username, avatar FROM accounts WHERE username like '%" + input + "%' LIMIT 0,10"; + String[][] hasil = ConnectDB.getHasilQuery(query); + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + out.println(hasil[i][1]); + out.println("
"); + } + } + + private void suggest_kategori(String input, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + + String query = "SELECT idkategori, nama FROM kategori WHERE nama like '%" + input + "%' LIMIT 0,10"; + String[][] hasil = ConnectDB.getHasilQuery(query); + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + out.println(hasil[i][1]); + out.println("
"); + } + } + + private void suggest_task(String input, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + + String query = "SELECT DISTINCT idtugas, tugas.nama FROM tag, tugas, tugas_has_tag WHERE (tugas_idtugas = idtugas AND tag.nama like '%" + input + "%' AND tag_idtag = idtag) OR (tugas.nama LIKE '%" + input + "%') LIMIT 0, 10"; + String[][] hasil = ConnectDB.getHasilQuery(query); + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + out.println(""); + out.println(hasil[i][1]); + out.println(""); + out.println("
"); + } + } + + //masih error + private void suggest_all(String input, HttpServletResponse response) throws ServletException, SQLException, IOException { + PrintWriter out = response.getWriter(); + + out.println("
"); + out.println("Username"); + suggest_username(input, response); + out.println("
"); + + out.println("
"); + out.println("Kategori"); + suggest_kategori(input, response); + out.println("
"); + + out.println("
"); + out.println("Task"); + suggest_task(input, response); + out.println("
"); + } +} diff --git a/src/java/Servlets/Task.java b/src/java/Servlets/Task.java new file mode 100644 index 00000000..ccffbb8c --- /dev/null +++ b/src/java/Servlets/Task.java @@ -0,0 +1,291 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import ConnectDB.ConnectDB; +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author LCF + */ +public class Task extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + HttpSession session = request.getSession(); + if (request.getParameter("aksi").equals("lihat_list_task")) { + try { + showTaskList(request.getParameter("idKategori"), request.getParameter("uid"), response); + } catch (SQLException ex) { + Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("aksi").equals("lihat_done_task")) { + try { + showDoneTask((String) session.getAttribute("id"), response); + } catch (SQLException ex) { + Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("aksi").equals("lihat_undone_task")) { + try { + showUndoneTask((String) session.getAttribute("id"), response); + } catch (SQLException ex) { + Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("aksi").equals("harddelete")) { + try { + hardDelete(request.getParameter("taskid"), response); + } catch (SQLException ex) { + Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("aksi").equals("softdelete")) { + try { + softDelete(request.getParameter("taskid"), response); + } catch (SQLException ex) { + Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (request.getParameter("aksi").equals("ubahstatus")) { + try { + System.out.println("ubah"); + ubahStatus(request.getParameter("taskid"), request.getParameter("newstatus"), response); + } catch (SQLException ex) { + Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex); + } + } + + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + + private void showTaskList(String idKategori, String userID, HttpServletResponse response) throws IOException, ServletException, SQLException { + PrintWriter out = response.getWriter(); + out.println("
"); + out.println("Tasks"); + out.println("
"); + + out.println("
"); + out.println("

Tambah Task...

"); + out.println("
"); + + String query = "SELECT idtugas, nama, deadline, status_selesai FROM tugas, accounts_has_tugas WHERE kategori_idkategori = " + idKategori + " AND tugas_idtugas = idtugas AND accounts_idaccounts = " + userID; + String[][] hasil = ConnectDB.getHasilQuery(query); + + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + String query2 = "SELECT * FROM accounts_has_tugas WHERE accounts_idaccounts = " + userID + " AND pembuat = 1"; + if (ConnectDB.getHasilQuery(query2).length > 0) { + // hard delete + out.println(""); + out.println("
"); + out.println("X"); + out.println("
"); + out.println("
"); + } else { + // soft delete + out.println(""); + out.println("
"); + out.println("X"); + out.println("
"); + out.println("
"); + } + + + out.println("
"); + out.println(""); + out.println(hasil[i][1]); + out.println(""); + out.println("
"); + + out.println("
"); + out.println(hasil[i][2]); + out.println("
"); + + String query_tag = "SELECT DISTINCT nama FROM tag, tugas_has_tag WHERE tugas_idtugas = " + hasil[i][0]; + String[][] result_tag = ConnectDB.getHasilQuery(query_tag); + out.println("
"); + out.println("Tags: "); + for (int j = 0; j < result_tag.length; j++) { + out.println(result_tag[j][0] + "; "); + } + out.println("
"); + + //status selesai + + if (hasil[i][3].equals("0")) { + out.println("
"); + out.print("Belum Selesai"); + } else { + out.println("
"); + out.print("Selesai"); + } + out.println("
"); + + out.println("
"); + } + + if (hasil.length > 0) { + out.println("
"); + out.println("

Hapus Task...

"); + out.println("
"); + } + } + + private void showDoneTask(String userID, HttpServletResponse response) throws IOException, ServletException, SQLException { + PrintWriter out = response.getWriter(); + + String query = "SELECT idtugas, nama, deadline, status_selesai FROM tugas, accounts_has_tugas WHERE status_selesai = 1 AND tugas_idtugas = idtugas AND accounts_idaccounts = " + userID; + String[][] hasil = ConnectDB.getHasilQuery(query); + + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + + out.println("
"); + out.println(""); + out.println(hasil[i][1]); + out.println(""); + out.println("
"); + + out.println("
"); + out.println(hasil[i][2]); + out.println("
"); + + String query_tag = "SELECT DISTINCT nama FROM tag, tugas_has_tag WHERE tugas_idtugas = " + hasil[i][0]; + String[][] result_tag = ConnectDB.getHasilQuery(query_tag); + out.println("
"); + out.println("Tags: "); + for (int j = 0; j < result_tag.length; j++) { + out.println(result_tag[j][0] + "; "); + } + out.println("
"); + out.println("
"); + } + } + + private void showUndoneTask(String userID, HttpServletResponse response) throws IOException, ServletException, SQLException { + PrintWriter out = response.getWriter(); + + String query = "SELECT idtugas, nama, deadline, status_selesai FROM tugas, accounts_has_tugas WHERE status_selesai = 0 AND tugas_idtugas = idtugas AND accounts_idaccounts = " + userID; + String[][] hasil = ConnectDB.getHasilQuery(query); + + for (int i = 0; i < hasil.length; i++) { + out.println("
"); + + out.println("
"); + out.println(""); + out.println(hasil[i][1]); + out.println(""); + out.println("
"); + + out.println("
"); + out.println(hasil[i][2]); + out.println("
"); + + String query_tag = "SELECT DISTINCT nama FROM tag, tugas_has_tag WHERE tugas_idtugas = " + hasil[i][0]; + String[][] result_tag = ConnectDB.getHasilQuery(query_tag); + out.println("
"); + out.println("Tags: "); + for (int j = 0; j < result_tag.length; j++) { + out.println(result_tag[j][0] + "; "); + } + out.println("
"); + out.println("
"); + } + } + + private void hardDelete(String idTask, HttpServletResponse response) throws SQLException, ServletException { + String query1 = "DELETE FROM accounts_has_tugas WHERE tugas_idtugas = " + idTask; + String query2 = "DELETE FROM tugas_has_tag WHERE tugas_idtugas = " + idTask; + String query3 = "DELETE FROM tugas WHERE idtugas = " + idTask; + + ConnectDB.jalankanQuery(query1); + ConnectDB.jalankanQuery(query2); + ConnectDB.jalankanQuery(query3); + } + + private void softDelete(String idTask, HttpServletResponse response) throws SQLException, ServletException { + String query1 = "DELETE FROM accounts_has_tugas WHERE tugas_idtugas = " + idTask; + + ConnectDB.jalankanQuery(query1); + } + + private void ubahStatus(String idTask, String newStatus, HttpServletResponse response) throws SQLException, ServletException, IOException { + PrintWriter out = response.getWriter(); + + String query = "UPDATE tugas SET status_selesai = " + newStatus + " WHERE idtugas = " + idTask; + ConnectDB.jalankanQuery(query); + + if (newStatus.equals("1")) { + out.print("Selesai"); + } else { + out.print("Belum Selesai"); + } + } +} diff --git a/src/java/Servlets/createtask.java b/src/java/Servlets/createtask.java new file mode 100644 index 00000000..24d97302 --- /dev/null +++ b/src/java/Servlets/createtask.java @@ -0,0 +1,305 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import ConnectDB.ConnectDB; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.sql.*; +import java.util.List; +import java.util.Scanner; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Part; +import javax.servlet.annotation.MultipartConfig; +import javax.servlet.annotation.WebServlet; + +@MultipartConfig(location = "/attachment", fileSizeThreshold = 1024 * 1024 *50, maxFileSize = 1024 * 1024 * 50 ,maxRequestSize = 1024 * 1024 * 50 * 5) +/** + * + * @author PANDU + */ +public class createtask extends HttpServlet { + + public String[] allowedExts; + public String namaFile; + public String folder; + public String path; + public String idtugas; + public String tes2; + + + String taskname; + String attachment; + String deadline; + String assignee; + String tag; + String kategori; + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + //processRequest(request, response); + +// setAssignee(request.getParameter("assignee")); +// setAttachment(request.getParameter("attachment")); +// setDeadline(request.getParameter("deadline")); +// setTag(request.getParameter("tag")); +// setTaskname(request.getParameter("taskname")); + + setAssignee2(request); + setDeadline2(request); + setTag2(request); + setTaskname2(request); + setKategori2(request); + + String x = Create() ; + setAttachment2(request, response, x); + response.sendRedirect("lihattask.jsp?tujuan=lihat&id="+x); + + } catch (ClassNotFoundException ex) { + Logger.getLogger(createtask.class.getName()).log(Level.SEVERE, null, ex); + } catch (SQLException ex) { + Logger.getLogger(createtask.class.getName()).log(Level.SEVERE, null, ex); + } + } + private String getFilename(Part part) { + for (String cd : part.getHeader("content-disposition").split(";")) { + if (cd.trim().startsWith("filename")) { + return cd.substring(cd.indexOf('=') + 1).trim().replace("\"", ""); + } + } + return null; + } + + protected void processRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException, ClassNotFoundException, SQLException { + + response.setContentType("text/html;charset=UTF-8"); + Statement s = null; + ResultSet rs =null; + Connection con = null; + String uploadTo = getServletContext().getRealPath("/") + "images/"; + Part p; +// try { +// +// } catch (IOException ex) { +// Logger.getLogger(createtask.class.getName()).log(Level.SEVERE, null, ex); +// } finally { +// //out.close(); +// if (con != null) { +// try { +// con.close(); +// con = null; +// } catch (SQLException ex) { +// Logger.getLogger(createtask.class.getName()).log(Level.SEVERE, null, ex); +// } +// } +// if (s != null) { +// try { +// s.close(); +// s = null; +// } catch (SQLException ex) { +// Logger.getLogger(createtask.class.getName()).log(Level.SEVERE, null, ex); +// } +// } +// if (rs != null) { +// try { +// rs.close(); +// rs = null; +// } catch (SQLException ex) { +// Logger.getLogger(createtask.class.getName()).log(Level.SEVERE, null, ex); +// } +// } +// } + } + /**/ + public createtask () { + allowedExts = new String[]{"jpg", "jpeg", "gif", "png", "avi", "mp4", "flv", "3gp", "wmv"}; + namaFile = ""; + folder = "attachment/"; + path = ""; + } + + public void setTaskname( String value ) { taskname = value; } + public void setAttachment( String value ) { attachment = value; } + public void setDeadline( String value ) { deadline = value; } + public void setAssignee( String value ) { assignee = value; } + public void setTag( String value ) { tag = value; } + + public void setTaskname2(HttpServletRequest request) throws IOException, ServletException { + Part p; + p = request.getPart("taskname"); + Scanner scan = new Scanner(p.getInputStream()); + if (scan.hasNext()) { + taskname = scan.nextLine(); + } else { + taskname = "null"; + } + scan.close(); + } + public void setDeadline2(HttpServletRequest request) throws IOException, ServletException { + Part p; + p = request.getPart("deadline"); + Scanner scan = new Scanner(p.getInputStream()); + if (scan.hasNext()) { + deadline = scan.nextLine(); + } else { + deadline = "null"; + } + scan.close(); + } + public void setAssignee2(HttpServletRequest request) throws IOException, ServletException { + Part p; + p = request.getPart("assignee"); + Scanner scan = new Scanner(p.getInputStream()); + if (scan.hasNext()) { + assignee = scan.nextLine(); + } else { + assignee = "null"; + } + scan.close(); + } + public void setTag2(HttpServletRequest request) throws IOException, ServletException { + Part p; + p = request.getPart("tag"); + Scanner scan = new Scanner(p.getInputStream()); + if (scan.hasNext()) { + tag = scan.nextLine(); + } else { + tag = "null"; + } + scan.close(); + } + public void setAttachment2(HttpServletRequest request, HttpServletResponse response, String UID) throws IOException, ServletException, ClassNotFoundException, SQLException { + response.setContentType("text/html;charset=UTF-8"); + Scanner scan; + //Part p; + Part[] LP = new Part[0]; + LP = request.getParts().toArray(LP); + + // Buat Path penyimpanan + path = folder + taskname + "-" + (int)(Math.random()*1000000); + + //Ambil file name + for (Part p : LP) { + if (getFilename(p)!=null) { + InputStream is = p.getInputStream(); + String namafile = getFilename(p); + + // Update DB Attachment + String sql = "INSERT INTO attachment (nama, path, tugas_idtugas) "; + sql += "VALUES ('"+namafile+"', '"+path+"', '"+UID+"')"; + ConnectDB.jalankanQuery(sql); + + // Upload Attachment + String outputfile = this.getServletContext().getRealPath(path+namafile); // get path on the server + FileOutputStream os = new FileOutputStream (outputfile); + // write bytes taken from uploaded file to target file + int ch = is.read(); + while (ch != -1) { + os.write(ch); + ch = is.read(); + } + os.close(); + } + } + } + public void setKategori2(HttpServletRequest request) throws IOException, ServletException { + Part p; + p = request.getPart("kategori"); + Scanner scan = new Scanner(p.getInputStream()); + if (scan.hasNext()) { + kategori = scan.nextLine(); + } else { + kategori = "null"; + } + scan.close(); + } + + public String getTaskname() { return taskname; } + public String getAttachment() { return attachment; } + public String getDeadline() { return deadline; } + public String getAssignee() { return assignee; } + public String getTag() { return tag; } + + public String Create () throws IOException, ServletException, SQLException { + + String sql = ""; + String[][] hasil; + + // TAMBAH Tugas + sql = "INSERT INTO tugas (nama, deadline, status_selesai, kategori_idkategori) "; + sql += "VALUES ('"+taskname+"', '"+deadline+"', '0', '"+kategori+"')"; + ConnectDB.jalankanQuery(sql); + // --> kategori + + // Ambil ID tugas buat ForKey Attachment + sql = "SELECT idtugas FROM tugas ORDER BY idtugas DESC LIMIT 1"; + hasil = ConnectDB.getHasilQuery(sql); + idtugas = hasil[0][0]; + + + // TAMBAH Tag + TambahTag(); + + // TAMBAH Assignee + TambahAssignee(); + + return idtugas; + } + + public void TambahAssignee () throws IOException, ServletException, SQLException { + String[] t = assignee.split(","); + for (String i : t) { + if (i!="") { + String sql = "SELECT idaccounts FROM accounts WHERE username = '"+i+"'"; + String[][] hasil = ConnectDB.getHasilQuery(sql); + String[] fetch = hasil[0]; + sql = "INSERT "; + sql += "INTO accounts_has_tugas (accounts_idaccounts, tugas_idtugas, pembuat)"; + sql += "VALUES ('"+fetch[0]+"','"+idtugas+"','0');"; + ConnectDB.jalankanQuery(sql); + } + } + } + private void TambahTag () throws IOException, ServletException, SQLException { + String[] t = tag.split(","); + for (String i : t) { + if (i!="") { + String sql = "SELECT idtag FROM tag WHERE nama = '"+i+"'"; + String[][] hasil = ConnectDB.getHasilQuery(sql); + String[] fetch; + if (hasil.length==0) { + sql = "INSERT "; + sql += "INTO tag (nama)"; + sql += "VALUES ('"+i+"');"; + ConnectDB.jalankanQuery(sql); + sql = "SELECT idtag FROM tag WHERE nama = '"+i+"' "; + hasil = ConnectDB.getHasilQuery(sql); + } + fetch = hasil[0]; + sql = "INSERT "; + sql += "INTO tugas_has_tag (tag_idtag, tugas_idtugas)"; + sql += "VALUES ('"+fetch[0]+"','"+idtugas+"');"; + ConnectDB.jalankanQuery(sql); + } + } + } + + public boolean tes() throws IOException, ServletException, SQLException { + String[] t = assignee.split(","); + String sql = "SELECT idtag FROM tag WHERE nama = '"+t[0]+"'"; + String[][] hasil = ConnectDB.getHasilQuery(sql); + //String[] fetch = hasil[0]; + + return (hasil.length==0); + } +} diff --git a/src/java/Servlets/editprofile.java b/src/java/Servlets/editprofile.java new file mode 100644 index 00000000..165a4df0 --- /dev/null +++ b/src/java/Servlets/editprofile.java @@ -0,0 +1,236 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import java.io.*; +import java.sql.*; +import java.util.List; +import java.util.Scanner; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.http.*; + +/** + * + * @author user + */ +public class editprofile extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet login2"); + out.println(""); + out.println(""); + out.println("

Servlet login2 at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + Connection con = null; + ResultSet rs = null; + Statement s = null; + try + { + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection("jdbc:mysql://localhost:3306/progin","progin","progin"); + s = con.createStatement(); + HttpSession session = request.getSession(); + String usernama = (String) session.getAttribute("username"); + + Scanner scan; + Part p; + + p = request.getPart("namaleng"); + scan = new Scanner(p.getInputStream()); + String namalengkap; + if (scan.hasNext()) + { + namalengkap = scan.nextLine(); + } + else + { + namalengkap = "null"; + } + scan.close(); + + p = request.getPart("password"); + scan = new Scanner(p.getInputStream()); + String pass; + if (scan.hasNext()) + { + pass = scan.nextLine(); + } + else + { + pass = "null"; + } + scan.close(); + + p = request.getPart("tanggal"); + scan = new Scanner(p.getInputStream()); + String tgl; + if (scan.hasNext()) + { + tgl = scan.nextLine(); + } + else + { + tgl = "null"; + } + scan.close(); + + //Ambil data avatar + p = request.getPart("avatar"); + InputStream is = p.getInputStream(); + //Ambil file name + String ava; + ava = getFilename(p); + rs = s.executeQuery("SELECT * FROM accounts WHERE username='"+usernama+"'"); + + if (rs.next()) + { + int a,b,c,d; + if (namalengkap.equals("null") || namalengkap.equals(rs.getString("nama_lengkap"))) + { + a = 0; + } + else + { + Statement stemp = con.createStatement(); + stemp.executeUpdate("UPDATE accounts SET nama_lengkap='"+namalengkap+"'WHERE username='"+usernama+"'"); + a = 1; + } + + if(pass.equals("null") || pass.equals(rs.getString("password"))) + { + b = 0; + } + else + { + Statement stemp = con.createStatement(); + stemp.executeUpdate("UPDATE accounts SET password='"+pass+"'WHERE username='"+usernama+"'"); + b = 1; + } + + if (tgl.equals("null") || tgl.equals(rs.getString("tgl_lahir"))) + { + c = 0; + } + else + { + Statement stemp = con.createStatement(); + stemp.executeUpdate("UPDATE accounts SET tgl_lahir='" + tgl + "'WHERE username='" + usernama + "'"); + c = 1; + } + + if (ava.equals("null") || ava.equals(rs.getString("avatar"))){ + d = 0; + }else{ + + Statement stemp = con.createStatement(); + stemp.executeUpdate("UPDATE accounts SET avatar='upload/"+ava+"'WHERE username='"+usernama+"'"); + + // get filename to use on the server + String outputfile = this.getServletContext().getRealPath("./upload/"+ava); // get path on the server + FileOutputStream os = new FileOutputStream (outputfile); + + // write bytes taken from uploaded file to target file + int ch = is.read(); + while (ch != -1) { + os.write(ch); + ch = is.read(); + } + os.close(); + out.println("

File uploaded successfully!

"); + d=1; + } + response.sendRedirect("profile.jsp?a="+a+"&b="+b+"&c="+c+"&d="+d+""); + con.close(); + s.close(); + rs.close(); + } + + }catch (Exception ex) + { + out.println("Exception : " + ex.getMessage()); + }finally + { + out.close(); + } + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }//
+ + private String getFilename(Part part) { + for (String cd : part.getHeader("content-disposition").split(";")) { + if (cd.trim().startsWith("filename")) { + return cd.substring(cd.indexOf('=') + 1).trim().replace("\"", ""); + } + } + return null; + } +} diff --git a/src/java/Servlets/getLocal.java b/src/java/Servlets/getLocal.java new file mode 100644 index 00000000..badcf71a --- /dev/null +++ b/src/java/Servlets/getLocal.java @@ -0,0 +1,152 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author user + */ +public class getLocal extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet getLocal"); + out.println(""); + out.println(""); + out.println("

Servlet getLocal at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + String locals = request.getParameter("locals"); + ResultSet rs = null; + Statement s = null; + Connection con = null; + try + { + con = DriverManager.getConnection("jdbc:mysql://localhost:3306/progin","progin","progin"); + s = con.createStatement(); + rs = s.executeQuery("select* from accounts where username='"+locals+"'"); + if(rs.next()) + { + if(locals.trim().equals(rs.getString("username").trim())) + { + //New Session Creation + HttpSession session = request.getSession(true); + + //Setting atrribute on session + session.setAttribute("username", locals); + session.setAttribute("id",rs.getString("idaccounts")); + + + out.println(true); + } + else + { + out.println(false); + } + } + else + { + + out.println(false); + } + }catch(SQLException e) { + throw new ServletException("Servlet Could not display records.", e); + } finally { + if (rs != null) { + try { + rs.close(); + rs = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (con != null) { + try { + con.close(); + con = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + out.close(); + } + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/src/java/Servlets/login2.java b/src/java/Servlets/login2.java new file mode 100644 index 00000000..7f3e8603 --- /dev/null +++ b/src/java/Servlets/login2.java @@ -0,0 +1,171 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author user + */ +public class login2 extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet login2"); + out.println(""); + out.println(""); + out.println("

Servlet login2 at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + ResultSet rs = null; + Statement s = null; + Connection con = null; + try + { + String name = request.getParameter("userid"); + String pass = request.getParameter("passid"); + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection("jdbc:mysql://localhost:3306/progin","progin","progin"); + s = con.createStatement(); + rs = s.executeQuery("select* from accounts where username='"+name+"'"); + if(rs.next()) + { + if((name.trim().equals(rs.getString("username").trim())) && (pass.trim().equals(rs.getString("password").trim()))) + { + //New Session Creation + HttpSession session = request.getSession(true); + + //Setting atrribute on session + session.setAttribute("username", name); + session.setAttribute("id",rs.getString("idaccounts")); + + //send request to next page + //RequestDispatcher view = request.getRequestDispatcher("dashboard.jsp"); + //view.forward(request, response); + out.println(true); + } + else + { + //RequestDispatcher view = request.getRequestDispatcher("index.jsp"); + //view.include(request, response); + out.println(false); + //out.println(""); + } + } + else + { + //RequestDispatcher view=request.getRequestDispatcher("index.jsp"); + //view.include(request, response); + //out.println(""); + out.println(false); + } + }catch(SQLException e) { + throw new ServletException("Servlet Could not display records.", e); + } catch (ClassNotFoundException e) { + throw new ServletException("JDBC Driver not found.", e); + } finally { + if (rs != null) { + try { + rs.close(); + rs = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (s != null) { + try { + s.close(); + s = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (con != null) { + try { + con.close(); + con = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + out.close(); + } + + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/src/java/Servlets/logout.java b/src/java/Servlets/logout.java new file mode 100644 index 00000000..d2d58c5e --- /dev/null +++ b/src/java/Servlets/logout.java @@ -0,0 +1,109 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author user + */ +public class logout extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet logout"); + out.println(""); + out.println(""); + out.println("

Servlet logout at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try + { + HttpSession session = request.getSession(); + session.invalidate(); + //send request to next page + RequestDispatcher view = request.getRequestDispatcher("index.jsp"); + view.forward(request, response); + }finally + { + out.close(); + } + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/src/java/Servlets/signup_process.java b/src/java/Servlets/signup_process.java new file mode 100644 index 00000000..937f88b1 --- /dev/null +++ b/src/java/Servlets/signup_process.java @@ -0,0 +1,238 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import java.io.*; +import java.sql.*; +import java.util.List; +import java.util.Scanner; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.http.*; + + +/** + * + * @author user + */ +public class signup_process extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException{ + + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + Statement s = null; + ResultSet rs =null; + Connection con = null; + // get your absolute path + String uploadTo = getServletContext().getRealPath("/") + "images/"; + + try { + /* + * TODO output your page here. You may use following sample code. + */ + Scanner scan; + Part p; + + p = request.getPart("username"); + scan = new Scanner(p.getInputStream()); + String name; + if (scan.hasNext()) + { + name = scan.nextLine(); + }else + { + name = "null"; + } + scan.close(); + + p = request.getPart("password"); + scan = new Scanner(p.getInputStream()); + String pass; + if (scan.hasNext()) + { + pass = scan.nextLine(); + }else + { + pass = "null"; + } + scan.close(); + + p = request.getPart("namaleng"); + scan = new Scanner(p.getInputStream()); + String namalengkap; + if (scan.hasNext()) + { + namalengkap = scan.nextLine(); + }else + { + namalengkap = "null"; + } + scan.close(); + + p = request.getPart("tanggal"); + scan = new Scanner(p.getInputStream()); + String tanggal; + if (scan.hasNext()) + { + tanggal = scan.nextLine(); + }else + { + tanggal = "null"; + } + scan.close(); + + p = request.getPart("email"); + scan = new Scanner(p.getInputStream()); + String email; + if (scan.hasNext()) + { + email = scan.nextLine(); + }else + { + email = "null"; + } + scan.close(); + + //Ambil data avatar + p = request.getPart("avatar"); + InputStream is = p.getInputStream(); + //Ambil file name + String avatar; + avatar = getFilename(p); + + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection("jdbc:mysql://localhost:3306/progin","progin","progin"); + s = con.createStatement(); + s.executeUpdate("insert into accounts(username,password,email,nama_lengkap,tgl_lahir,avatar) values('"+name+"','"+pass+"','"+email+"','"+namalengkap+"','"+tanggal+"','upload/"+avatar+"')"); + // get filename to use on the server + + String outputfile = this.getServletContext().getRealPath("./upload/"+avatar); // get path on the server + FileOutputStream os = new FileOutputStream (outputfile); + + // write bytes taken from uploaded file to target file + int ch = is.read(); + while (ch != -1) { + os.write(ch); + ch = is.read(); + } + os.close(); + + HttpSession session = request.getSession(true); + session.setAttribute("username", name); + RequestDispatcher view = request.getRequestDispatcher("dashboard.jsp"); + view.forward(request, response); + + +/* + out.println(""); + out.println(""); + out.println("Servlet signup_process"); + out.println(""); + out.println(""); + out.println("

Servlet signup_process at " + request.getContextPath() + "

"); + out.println(""); + out.println("");*/ + + + }catch (Exception ex) { + ex.printStackTrace(); + } finally { + out.close(); + if (con != null) { + try { + con.close(); + con = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (s != null) { + try { + s.close(); + s = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (rs != null) { + try { + rs.close(); + rs = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + + } + + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// + + private String getFilename(Part part) { + for (String cd : part.getHeader("content-disposition").split(";")) { + if (cd.trim().startsWith("filename")) { + return cd.substring(cd.indexOf('=') + 1).trim().replace("\"", ""); + } + } + return null; + } +} diff --git a/src/java/Servlets/validasiRegist.java b/src/java/Servlets/validasiRegist.java new file mode 100644 index 00000000..7e63613c --- /dev/null +++ b/src/java/Servlets/validasiRegist.java @@ -0,0 +1,146 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author user + */ +public class validasiRegist extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet validasiRegist"); + out.println(""); + out.println(""); + out.println("

Servlet validasiRegist at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException + { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + ResultSet rs = null; + Statement s = null; + Connection con = null; + try + { + String name = request.getParameter("username"); + String email = request.getParameter("email"); + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection("jdbc:mysql://localhost:3306/progin","progin","progin"); + s = con.createStatement(); + rs = s.executeQuery("select* from accounts where username='"+name+"' or email='"+email+"'"); + if(rs.next()) + { + out.println(false); + } + else + { + out.println(true); + } + }catch(SQLException e) { + throw new ServletException("Servlet Could not display records.", e); + } catch (ClassNotFoundException e) { + throw new ServletException("JDBC Driver not found.", e); + } finally { + if (rs != null) { + try { + rs.close(); + rs = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (s != null) { + try { + s.close(); + s = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + if (con != null) { + try { + con.close(); + con = null; + } catch (SQLException ex) { + Logger.getLogger(login2.class.getName()).log(Level.SEVERE, null, ex); + } + } + out.close(); + } + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/src/java/Servlets/viewtask.java b/src/java/Servlets/viewtask.java new file mode 100644 index 00000000..d187e94b --- /dev/null +++ b/src/java/Servlets/viewtask.java @@ -0,0 +1,106 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package Servlets; + +import ConnectDB.ConnectDB; +import java.io.IOException; +import java.sql.SQLException; +import javax.servlet.ServletException; + +/** + * + * @author PANDU + */ +public class viewtask { + public String[] task; + public String[][] attach; + public String[][] tag; + public String[][] assignee; + public String[][] komen; + public String[][] komentator; + + public viewtask (String x) throws IOException, ServletException, SQLException { + + String sql = ""; + String[][] hasil; + + // AMBIL tugas + sql = "SELECT * FROM tugas WHERE idtugas='"+x+"'"; + hasil = ConnectDB.getHasilQuery(sql); + if (hasil.length!=0) { // jika ga kosong + task = hasil[0]; + + // AMBIL attachment + sql = "SELECT * FROM attachment"; + sql += " WHERE tugas_idtugas='"+x+"'"; + attach = ConnectDB.getHasilQuery(sql); + + // AMBIL assignee + sql = "SELECT a.* FROM accounts_has_tugas AS b, accounts AS a"; + sql += " WHERE b.tugas_idtugas='"+x+"'"; + sql += " AND b.accounts_idaccounts = a.idaccounts"; + assignee = ConnectDB.getHasilQuery(sql); + + // AMBIL tag + sql = "SELECT idtag, nama FROM tugas_has_tag AS b, tag AS a"; + sql += " WHERE b.tugas_idtugas='"+x+"'"; + sql += " AND b.tag_idtag = a.idtag"; + tag = ConnectDB.getHasilQuery(sql); + + // AMBIL komen & komentator + sql = "SELECT * FROM komentar"; + sql += " WHERE tugas_idtugas='"+x+"'"; + sql += " ORDER BY created"; + hasil = ConnectDB.getHasilQuery(sql); + komen = new String[hasil.length][]; + komentator = new String[hasil.length][]; + int i=0; + for (String[] temp : hasil) { + komen[i] = temp; + // Ambil Komentator + String sql2 = "SELECT * FROM accounts"; + sql2 += " WHERE idaccounts='"+temp[3]+"'"; + String[][] hasil2 = ConnectDB.getHasilQuery(sql2); + komentator[i] = hasil2[0]; + i = i+1; + } + } + else + { + task = new String[5]; + attach = new String[5][]; + tag = new String[5][]; + assignee = new String[5][]; + komen = new String[5][]; + komentator = new String[5][]; + // isi dengan null + for (int i=0; i<5; i++) { + task[i] = ""; + attach[i] = new String[9]; + tag[i] = new String[9]; + assignee[i] = new String[9]; + komen[i] = new String[9]; + komentator[i] = new String[9]; + } + for (int i=0; i<9; i++) { + for (int j=0; j<5; j++) { + attach[j][i] = ""; + tag[j][i] = ""; + assignee[j][i] = ""; + komen[j][i] = ""; + komentator[j][i] = ""; + } + } + } + + } + public String[] getTask() { return task; } + public String[][] getAttachment() { return attach; } + public String[][] getAssignee() { return assignee; } + public String[][] getTag() { return tag; } + public String[][] getKomen() { return komen; } + public String[][] getKomentator() { return komentator; } + +} diff --git a/src/newtask.html b/src/newtask.html new file mode 100644 index 00000000..fd411489 --- /dev/null +++ b/src/newtask.html @@ -0,0 +1,186 @@ + + + Insert New Task + + + + + + +
+ +
+ +
+
+ +
+
+
+
+
+
+ Nama Tugas +
+
+ +
+
+
+
+
+
+ Attachment +
+
+ +
+
+
+
+
+
+ Deadline +
+
+ + + +
+
+
+
+
+
+ Assignee +
+
+ +
+
+
+
+
+
+ Tag +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/src/profile.html b/src/profile.html new file mode 100644 index 00000000..3a66f2a9 --- /dev/null +++ b/src/profile.html @@ -0,0 +1,177 @@ + + +Profile + + + + + +
+ +
+
+ +
+
+
+ Username : dummy

+ Fullname : Dummy

+ Birthdate : 20 Feb 2013

+ Handphone : 081912345-XXX

+ Email : dummy@students.itb.ac.id
+ +
+
+
+
+ Undone Task +
+
+ Done Task +
+
+
+
+ Cari Buku +
+
+ Deadline: 21 February 2013 +
+
+ Tags: kuliah +
+
+ +
+
+ Tugas Intelegensia Buatan +
+
+ Deadline: 22 February 2013 +
+
+ Tags: kuliah, IB, tugas +
+
+ +
+
+ Cari Monyet +
+
+ Deadline: 24 February 2013 +
+
+ Tags: eksperimen +
+
+ +
+
+ Beli Formalin +
+
+ Deadline: 25 February 2013 +
+
+ Tags: eksperimen +
+
+ +
+
+ Tugas IMK +
+
+ Deadline: 25 February 2013 +
+
+ Tags: kuliah, IMK, tugas +
+
+ +
+
+ Kuis IMK +
+
+ Deadline: 28 February 2013 +
+
+ Tags: kuliah, IMK, kuis +
+
+ +
+
+ Latihan Silat +
+
+ Deadline: 28 February 2013 +
+
+ Tags: bela diri +
+
+ +
+
+
+
+ Ngulang Pelajaran +
+
+ Deadline: 12 February 2013 +
+
+ Tags: kuliah +
+
+ +
+
+ Beli Racun +
+
+ Deadline: 15 February 2013 +
+
+ Tags: eksperimen +
+
+ +
+
+ Belajar Progin +
+
+ Deadline: 18 February 2013 +
+
+ Tags: kuliah +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/register.html b/src/register.html new file mode 100644 index 00000000..194db0df --- /dev/null +++ b/src/register.html @@ -0,0 +1,190 @@ + + + + + + + + + + + + +
+
+
+
+ Username: +
+
+ +
+
+
+
+
+
+ Password: +
+
+ +
+
+
+
+
+
+ Confirm Password: +
+
+ +
+
+
+
+
+
+ Nama lengkap: +
+
+ +
+
+
+
+
+
+ Tanggal lahir: +
+
+ + + +
+
+
+
+
+
+ Email: +
+
+ +
+
+
+
+
+
+ Avatar: +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ + + diff --git a/src/styles/calendar.css b/src/styles/calendar.css new file mode 100644 index 00000000..1d2976c5 --- /dev/null +++ b/src/styles/calendar.css @@ -0,0 +1,37 @@ +.calendar-box { + display:none; + background-color:#fff; + border:1px solid #444; + position:absolute; + z-index: 3; + width:250px; + padding: 0 5px; +} +.calendar-box select.calendar-month { + width:90px; +} +.calendar-box select.calendar-year { + width:70px; +} +.calendar-box .calendar-cancel { + width:100%; +} +.calendar-box table td { + width:14%; +} +.calendar-box .calendar-title { + text-align:center; +} +.calendar-box a { + text-decoration:none; +} +.calendar-box .today a { + padding:0 5px; + margin-left:-5px; + background-color:#ffe9c6; +} +.calendar-box .selected a { + padding:0 5px; + margin-left:-5px; + background-color:#c9ff8b; +} \ No newline at end of file diff --git a/src/styles/dashboard.css b/src/styles/dashboard.css new file mode 100644 index 00000000..98127cae --- /dev/null +++ b/src/styles/dashboard.css @@ -0,0 +1,272 @@ +#category{ + height:572px; + width:350px; + float:left; + border-right: 2px solid #d9d9d9; + +} + +#category_head{ + margin-top:10px; + margin-bottom:10px; + margin-left:20px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.category_block{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + border: #d9d9d9 solid 7px; + background-color:#dfdfdf; +} +.category_block:hover{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + border: #836fff solid 7px; + background-color:#dfdfdf; +} + +.category_pic{ + width:50px; + float:left; +} + +.category_name{ + width:270px; + float: right; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:10px; +} + + +#task{ + height:572px; + width:992px; + float:left; +} + +.category_name a{ + color:#000; + text-decoration:none; +} + +#task_header{ + margin-top:10px; + margin-bottom:10px; + margin-left:40px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +#tambah_task{ + border: dashed 2px #e2e2e2; + box-shadow: 0px 0px 0px #535353; +} + +#tambah_task:hover{ + border: dashed 2px #836fff; + box-shadow: 0px 0px 0px #535353; +} + +.task_block p{ + font:normal 25px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:5px; + margin-bottom:5px; + text-align: center; +} + +.task_block{ + width:95%; + border: solid 1px #e2e2e2; + margin-left: 20px; + margin-bottom:10px; + box-shadow: 1px 1px 1px #535353; +} + +.task_judul{ + margin-top:5px; + margin-left: 10px; + width:100%; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_deadline{ + margin-left:10px; + margin-bottom:5px; + color:red; + width:30%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_tag{ + margin-left:10px; + margin-bottom:5px; + width:70%; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.panel { + background-color: #444; + height: 34px; + padding: 10px; +} +.panel a#tambah_pop { + border: 2px solid #aaa; + color: #fff; + display: block; + float: right; + margin-right: 10px; + padding: 5px 10px; + text-decoration: none; + text-shadow: 1px 1px #000; + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; +} + +.overlay { + background-color: rgba(0, 0, 0, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + width:30%; + background-color: #fff; + border: 3px solid #fff; + display: inline-block; + left: 50%; + opacity: 0; + padding: 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 50%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} + +.selected{ +margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + background-color:#dfdfdf; + border: #836fff solid 7px; +} + +.form_baris{ + width: 100%; + margin-top: 10px; +} + +.form_kiri{ + float:left; + width:50%; +} + +.form_kanan{ + float:left; + width:50%; +} + +.form_kanan input{ + width:98%; +} + +#fs{ + margin-top:10px; + float:left; + width:100%; +} + +#button_buat_kategori{ + margin-top:10px; +} + +.gambar_kecil{ + float:left; + margin-right: 5px; + margin-bottom: 5px; + border: solid #606060 1px; +} diff --git a/src/styles/header.css b/src/styles/header.css new file mode 100644 index 00000000..e1bdfe7d --- /dev/null +++ b/src/styles/header.css @@ -0,0 +1,120 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + float:left; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + margin-left:5px; + height:50px; + width:150px; + float:left; +} +#space{ + height:50px; + width:150px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} diff --git a/src/styles/home.css b/src/styles/home.css new file mode 100644 index 00000000..b6966d72 --- /dev/null +++ b/src/styles/home.css @@ -0,0 +1,174 @@ +@media screen and (min-width: 1000px){ +#container { + width: 100%; + height: 100%; + background-image:url(../../images/paper.png); + background-attachment: fixed; + background-repeat: no-repeat; + margin: 0; +} + +#header{ + height:50px; + width:100%; + + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + margin-left:5px; + width:150px; + float:left; +} +#space{ + float:left; + width:400px; +} + +.login_form{ + color:#ffffff; + margin-top:15px; + margin-right:15px; + float:right; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + +#left_tab{ + margin-top:50px; + margin-left:50px; + width:700px; + float:left; +} + +#register_tab{ + margin-top:50px; + margin-left:50px; + float:left; + width:520px; +} + +.form_field{ + +} + +.field_kiri{ + font: arial; + font-size:18px; + margin-bottom:10px; + width:50%; + float:left; +} + +.field_kanan{ + margin-bottom:10px; + width:50%; + float:left; +} + +.field_kanan input{ + width:100%; +} + +.field_kanan select{ + width:33%; +} + + +} + +@media screen and (min-width: 240px){ +#container { + width: 100%; + height: 100%; + margin: 0; +} + +#header{ + height:50px; + width:100%; + + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + margin-left:5px; + width:150px; + float:left; +} +#space{ + float:left; + width:400px; +} + +.login_form{ + color:#ffffff; + margin-top:15px; + margin-right:15px; + float:right; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + +#left_tab{ + margin-top:50px; + margin-left:50px; + width:700px; + float:left; +} + +#register_tab{ + margin-top:50px; + margin-left:50px; + float:left; + width:520px; +} + +.form_field{ + +} + +.field_kiri{ + font: arial; + font-size:18px; + margin-bottom:10px; + width:50%; + float:left; +} + +.field_kanan{ + margin-bottom:10px; + width:50%; + float:left; +} + +.field_kanan input{ + width:100%; +} + +.field_kanan select{ + width:33%; +} +} diff --git a/src/styles/newtask.css b/src/styles/newtask.css new file mode 100644 index 00000000..4b5f6913 --- /dev/null +++ b/src/styles/newtask.css @@ -0,0 +1,182 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + float:left; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + height:50px; + width:150px; + float:left; +} +#space{ + height:50px; + width:150px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#leftspace{ + height:572px; + width:20%; + float:left; +} +#newtask{ + height:572px; + width:60%; + float:left; +} +#rightspace{ + height:572px; + width:20%; + float:right; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + +.form_field { + height:7%; + width:100%; +} + +#formulir { + width:95%; + border: solid 1px #e2e2e2; + margin-left: 20px; + margin-bottom:10px; + box-shadow: 3px 3px 3px #535353; + background-color:white; +} + +#newtask_space{ + height:40%; + width:100%; +} + +.newtask_label { + margin-top:5px; + margin-left: 10px; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + width:30%; + float:left; +} + +.newtask_field { + margin-top:5px; + margin-left: 10px; + width:40%; + float:left; +} + +.newtask_warning { + margin-top:5px; + margin-left: 10px; + float:left; +} + +.inputtext { + height:25px; + font-size:16px; +} +body { + background-color:gray; +} \ No newline at end of file diff --git a/src/styles/profile.css b/src/styles/profile.css new file mode 100644 index 00000000..5efb1b3d --- /dev/null +++ b/src/styles/profile.css @@ -0,0 +1,249 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + height:50px; + width:200px; + float:left; +} +#space{ + height:50px; + width:100px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profilearea { + height:594px; + width:390px; + float:left; + border-left:5px solid gray; + border-bottom:5px solid gray; + margin-top:10px; + margin-left:10px; +} +.profilephoto{ + height:245px; + width:200px; +} +.biodata{ + height:350px; + width:390px; + font:18px andy,sans-serif; + border-top:2px solid gray; + padding-left:5px; +} + +#listarea{ + height:589px; + width:918px; + border:5px solid gray; + float:left; + margin-top:10px; + margin-left:10px; +} + +#undonetasktitle{ + height:45px; + width:439px; + float:left; + border-bottom:2px solid gray; + margin-right:10px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; + padding-left:10px; + padding-top:5px; +} +#donetasktitle{ + height:45px; + width:434px; + float:left; + border-bottom:2px solid gray; + border-left:5px solid gray; + margin-right:10px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; + padding-left:10px; + padding-top:5px; +} +#undonetask{ + height:529px; + width:459px; + float:left; + border-right:5px solid gray; + margin-top:10px; +} +#donetask{ + height:529px; + width:454px; + float:left; + margin-top:10px; +} + +.task_block p{ + font:normal 25px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:5px; + margin-bottom:5px; + text-align: center; +} + +.task_block{ + width:95%; + border: solid 1px #e2e2e2; + margin-left: 10px; + margin-right: 10px; + margin-bottom:10px; + box-shadow: 1px 1px 1px #535353; +} +.task_judul{ + margin-top:5px; + margin-left: 10px; + width:100%; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +#donetask .task_deadline{ + margin-left:10px; + margin-bottom:5px; + width:50%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:#15ff00; +} + +.task_deadline{ + margin-left:10px; + margin-bottom:5px; + width:50%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:#ff0000; +} + +.task_tag{ + margin-left:10px; + margin-bottom:5px; + width:100%; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} +#editbutton{ + height:50px; + width:50px; + position:absolute; + top:295px; + left:355px; + background: transparent url(../../images/edit.png) no-repeat; + overflow: hidden; + border:0; +} +#editbutton:hover{ + height:50px; + width:50px; + position:absolute; + top:290px; + left:355px; + background: transparent url(../../images/edit.png) no-repeat; + overflow: hidden; + border:0; +} \ No newline at end of file diff --git a/src/styles/viewtask.css b/src/styles/viewtask.css new file mode 100644 index 00000000..6c99772e --- /dev/null +++ b/src/styles/viewtask.css @@ -0,0 +1,274 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + float:left; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + height:50px; + width:150px; + float:left; +} +#space{ + height:50px; + width:150px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#leftspace{ + height:100%; + width:200px; + float:left; + border-right:1px solid gray; +} +#viewtask{ + height:100%; + width:500px; + float:left; + margin-left: 1%; +} +#rightspace{ + height:100%; + width:547px; + float:right; + border-left:1px solid gray; +} + +.form_field { + width:100%; + height: 7%; + display : inline-block; +} + +.form_attachment{ + width:100%; + height:550px; + overflow: scroll; +} + +.viewtask_label { + margin-top:5px; + margin-left:10px; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + width:30%; + float:left; +} + +.viewtask_field { + margin-top:5px; + margin-left:10px; + font:normal 16px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:grey; + float:left; +} + +.viewtask_edit { + margin-top:5px; + margin-left:10px; + float:right; +} + +#fieldset { + width:250px; +} + +#commentLabel { + font:normal 16px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +#dlvalue { + display:inline; +} + +#asvalue { + display:inline; +} + +#tagvalue { + display:inline; +} + +#savebutton { + display:none; +} + +#dl { + display:none; +} + +#as { + display:none; +} + +#tag { + display:none; +} + +body { + margin: 0px; +} + +.form_field { + border:1px solid gray; +} +.form_attachment img{ + margin-top:10px; + margin-left:10%; +} + +.form_attachment video{ + margin-top:10px; + margin-left:10%; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + +.imgattach { + width: 80%; + border: 1px solid #000000; +} +.vidattach { + width: 80%; +} +#viewtask_komen { + float: none; + height: 330px; + overflow: scroll; + font-size: 10pt; +} + +.komenkolom { + display: inline-block; + margin-right: 10px; + vertical-align: top; +} +.komennama { + text-decoration: none; + color: #000; + font-size: large; + margin-bottom: 100px; +} +.komenkomen { + width: 250px; +} +.komenwaktu { + margin-top: 20px; + text-decoration: none; + font-style: italic; + color: #666; +} +.komenava { + width: 50px; +} +.komennama:hover { + color: #e58100; +} + +.kotakwarna { + background-color: #ececec; +} +.daftarkomen{ + width: 100%-10px; + color: #333333; + padding-top: 5px; + padding-left: 10px; + margin-bottom: 10px; + margin-right: 10px; + font-family: Calibri; +} \ No newline at end of file diff --git a/src/viewtask.html b/src/viewtask.html new file mode 100644 index 00000000..d9accd9d --- /dev/null +++ b/src/viewtask.html @@ -0,0 +1,245 @@ + + + View Task + + + + + + +
+ +
+ +
+
+
+
+
+ Task Name +
+
+ Mengerjakan tugas progin +
+
+
+ + +
+
+
+ Attachment +
+ +
+
+
+ Deadline +
+
+
+

+
+
+ + + +
+
+
+ + +
+
+
+
+ Assignee +
+
+

Bambang

+ + + + +
+
+ +
+ +
+
+
+ Tag +
+
+

Urgent; Kuliah

+ +
+
+ +
+
+
+
+
+
+
+
+ Comment +

Deadlinenya sebentar lagi nih!

+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/videos/attachmentsample.ogg b/videos/attachmentsample.ogg new file mode 100644 index 00000000..34588aa1 Binary files /dev/null and b/videos/attachmentsample.ogg differ diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml new file mode 100644 index 00000000..330c4340 --- /dev/null +++ b/web/WEB-INF/web.xml @@ -0,0 +1,80 @@ + + + + Kategori + Servlets.Kategori + + + Task + Servlets.Task + + + Search + Servlets.Search + + + login2 + Servlets.login2 + + + validasiRegist + Servlets.validasiRegist + + + logout + Servlets.logout + + + getLocal + Servlets.getLocal + + + signup_process + Servlets.signup_process + + + editprofile + Servlets.editprofile + + + Kategori + /Kategori + + + Task + /Task + + + Search + /Search + + + login2 + /login2 + + + validasiRegist + /validasiRegist + + + logout + /logout + + + getLocal + /getLocal + + + signup_process + /signup_process + + + editprofile + /editprofile + + + + 30 + + + diff --git a/web/dashboard.jsp b/web/dashboard.jsp new file mode 100644 index 00000000..71d6db85 --- /dev/null +++ b/web/dashboard.jsp @@ -0,0 +1,74 @@ +<%-- + Document : dashboard + Created on : Apr 5, 2013, 11:06:49 AM + Author : LCF +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + +<% + if(session.getAttribute("username")== null) + { + response.sendRedirect("index.jsp"); + } + else + { + + } +%> + + + Dashboard + + + + + + )"> + <%@include file="header.jsp" %> +
+ + +
+
+ Kategori +
+
+ +
+
+ Tasks +
+
+
+ + + + + + \ No newline at end of file diff --git a/web/header.jsp b/web/header.jsp new file mode 100644 index 00000000..9d19a6cf --- /dev/null +++ b/web/header.jsp @@ -0,0 +1,76 @@ +<%-- + Document : header + Created on : Apr 9, 2013, 11:51:34 AM + Author : LCF +--%> + +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + diff --git a/web/images/Book-icon.png b/web/images/Book-icon.png new file mode 100644 index 00000000..91837319 Binary files /dev/null and b/web/images/Book-icon.png differ diff --git a/web/images/Check.png b/web/images/Check.png new file mode 100644 index 00000000..e2f1a59d Binary files /dev/null and b/web/images/Check.png differ diff --git a/web/images/Cross.png b/web/images/Cross.png new file mode 100644 index 00000000..6b552e93 Binary files /dev/null and b/web/images/Cross.png differ diff --git a/web/images/black_header.png b/web/images/black_header.png new file mode 100644 index 00000000..64b56167 Binary files /dev/null and b/web/images/black_header.png differ diff --git a/web/images/blank.png b/web/images/blank.png new file mode 100644 index 00000000..caaf908e Binary files /dev/null and b/web/images/blank.png differ diff --git a/web/images/canceled.png b/web/images/canceled.png new file mode 100644 index 00000000..3728b9ea Binary files /dev/null and b/web/images/canceled.png differ diff --git a/web/images/centang.png b/web/images/centang.png new file mode 100644 index 00000000..922d37e0 Binary files /dev/null and b/web/images/centang.png differ diff --git a/web/images/edit.png b/web/images/edit.png new file mode 100644 index 00000000..4324747e Binary files /dev/null and b/web/images/edit.png differ diff --git a/web/images/header.png b/web/images/header.png new file mode 100644 index 00000000..06a04101 Binary files /dev/null and b/web/images/header.png differ diff --git a/web/images/headerlogo.png b/web/images/headerlogo.png new file mode 100644 index 00000000..2cb5a9b3 Binary files /dev/null and b/web/images/headerlogo.png differ diff --git a/web/images/homeheader.png b/web/images/homeheader.png new file mode 100644 index 00000000..4f243505 Binary files /dev/null and b/web/images/homeheader.png differ diff --git a/web/images/homeheaderlogo.png b/web/images/homeheaderlogo.png new file mode 100644 index 00000000..cb05e920 Binary files /dev/null and b/web/images/homeheaderlogo.png differ diff --git a/web/images/logo.png b/web/images/logo.png new file mode 100644 index 00000000..e61a264a Binary files /dev/null and b/web/images/logo.png differ diff --git a/web/images/menguasai-dunia.png b/web/images/menguasai-dunia.png new file mode 100644 index 00000000..b3943192 Binary files /dev/null and b/web/images/menguasai-dunia.png differ diff --git a/web/images/paper.png b/web/images/paper.png new file mode 100644 index 00000000..816c8910 Binary files /dev/null and b/web/images/paper.png differ diff --git a/web/images/profilebg.png b/web/images/profilebg.png new file mode 100644 index 00000000..84d6983f Binary files /dev/null and b/web/images/profilebg.png differ diff --git a/web/images/ranger1.jpg b/web/images/ranger1.jpg new file mode 100644 index 00000000..b88da5f5 Binary files /dev/null and b/web/images/ranger1.jpg differ diff --git a/web/images/ranger2.jpg b/web/images/ranger2.jpg new file mode 100644 index 00000000..8112cf48 Binary files /dev/null and b/web/images/ranger2.jpg differ diff --git a/web/images/ranger3.jpg b/web/images/ranger3.jpg new file mode 100644 index 00000000..17eab1e3 Binary files /dev/null and b/web/images/ranger3.jpg differ diff --git a/web/images/ranger4.jpg b/web/images/ranger4.jpg new file mode 100644 index 00000000..c3ae9a91 Binary files /dev/null and b/web/images/ranger4.jpg differ diff --git a/web/images/ranger5.jpg b/web/images/ranger5.jpg new file mode 100644 index 00000000..35fb6ffe Binary files /dev/null and b/web/images/ranger5.jpg differ diff --git a/web/images/registerglass.png b/web/images/registerglass.png new file mode 100644 index 00000000..5df4a1ac Binary files /dev/null and b/web/images/registerglass.png differ diff --git a/web/images/search.png b/web/images/search.png new file mode 100644 index 00000000..22923418 Binary files /dev/null and b/web/images/search.png differ diff --git a/web/images/tambah.png b/web/images/tambah.png new file mode 100644 index 00000000..8d61f82e Binary files /dev/null and b/web/images/tambah.png differ diff --git a/web/images/zz.jpg b/web/images/zz.jpg new file mode 100644 index 00000000..428cab28 Binary files /dev/null and b/web/images/zz.jpg differ diff --git a/web/index.jsp b/web/index.jsp new file mode 100644 index 00000000..cd297fd7 --- /dev/null +++ b/web/index.jsp @@ -0,0 +1,149 @@ +<%-- + Document : index + Created on : Apr 5, 2013, 9:38:21 AM + Author : LCF +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + if(session.getAttribute("username")!= null) + { + response.sendRedirect("dashboard.jsp"); + } + else + { + + } +%> + + + + + Organize Homepage + + + + + + + + +
+
+ Register dong gan +
+ +
+
+
+
+
+ Username: +
+
+ + icon2 +
+
+
+
+
+
+ Password: +
+
+ + icon3 +
+
+
+
+
+
+ Confirm Password: +
+
+ + icon4 +
+
+
+
+
+
+ Nama lengkap: +
+
+ + icon5 +
+
+
+
+
+
+ Tanggal lahir: +
+
+ + + icon8 +
+
+
+
+
+
+ Email: +
+
+ + icon6 +
+
+
+
+
+
+ Avatar: +
+
+ + icon7 +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + diff --git a/web/js/calendar.js b/web/js/calendar.js new file mode 100644 index 00000000..bc0cf310 --- /dev/null +++ b/web/js/calendar.js @@ -0,0 +1,232 @@ +/** + * Calendar Script + * Creates a calendar widget which can be used to select the date more easily than using just a text box + * http://www.openjs.com/scripts/ui/calendar/ + * + * Example: + * + * + */ +calendar = { + month_names: ["January","February","March","April","May","June","July","Augest","September","October","November","December"], + weekdays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + month_days: [31,28,31,30,31,30,31,31,30,31,30,31], + //Get today's date - year, month, day and date + today : new Date(), + opt : {}, + data: [], + + //Functions + /// Used to create HTML in a optimized way. + wrt:function(txt) { + this.data.push(txt); + }, + + /* Inspired by http://www.quirksmode.org/dom/getstyles.html */ + getStyle: function(ele, property){ + if (ele.currentStyle) { + var alt_property_name = property.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});//background-color becomes backgroundColor + var value = ele.currentStyle[property]||ele.currentStyle[alt_property_name]; + + } else if (window.getComputedStyle) { + property = property.replace(/([A-Z])/g,"-$1").toLowerCase();//backgroundColor becomes background-color + + var value = document.defaultView.getComputedStyle(ele,null).getPropertyValue(property); + } + + //Some properties are special cases + if(property == "opacity" && ele.filter) value = (parseFloat( ele.filter.match(/opacity\=([^)]*)/)[1] ) / 100); + else if(property == "width" && isNaN(value)) value = ele.clientWidth || ele.offsetWidth; + else if(property == "height" && isNaN(value)) value = ele.clientHeight || ele.offsetHeight; + return value; + }, + getPosition:function(ele) { + var x = 0; + var y = 0; + while (ele) { + x += ele.offsetLeft; + y += ele.offsetTop; + ele = ele.offsetParent; + } + if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") { + x += document.body.leftMargin; + offsetTop += document.body.topMargin; + } + + var xy = new Array(x,y); + return xy; + }, + /// Called when the user clicks on a date in the calendar. + selectDate:function(year,month,day) { + var ths = _calendar_active_instance; + document.getElementById(ths.opt["input"]).value = year + "-" + month + "-" + day; // Date format is :HARDCODE: + ths.hideCalendar(); + }, + /// Creates a calendar with the date given in the argument as the selected date. + makeCalendar:function(year, month, day) { + year = parseInt(year); + month= parseInt(month); + day = parseInt(day); + + //Display the table + var next_month = month+1; + var next_month_year = year; + if(next_month>=12) { + next_month = 0; + next_month_year++; + } + + var previous_month = month-1; + var previous_month_year = year; + if(previous_month< 0) { + previous_month = 11; + previous_month_year--; + } + + this.wrt(""); + this.wrt(""); + this.wrt(""); + this.wrt(""); + this.wrt(""); + for(var weekday=0; weekday<7; weekday++) this.wrt(""); + this.wrt(""); + + //Get the first day of this month + var first_day = new Date(year,month,1); + var start_day = first_day.getDay(); + + var d = 1; + var flag = 0; + + //Leap year support + if(year % 4 == 0) this.month_days[1] = 29; + else this.month_days[1] = 28; + + var days_in_this_month = this.month_days[month]; + + //Create the calender + for(var i=0;i<=5;i++) { + if(w >= days_in_this_month) break; + this.wrt(""); + for(var j=0;j<7;j++) { + if(d > days_in_this_month) flag=0; //If the days has overshooted the number of days in this month, stop writing + else if(j >= start_day && !flag) flag=1;//If the first day of this month has come, start the date writing + + if(flag) { + var w = d, mon = month+1; + if(w < 10) w = "0" + w; + if(mon < 10)mon = "0" + mon; + + //Is it today? + var class_name = ''; + var yea = this.today.getYear(); + if(yea < 1900) yea += 1900; + + if(yea == year && this.today.getMonth() == month && this.today.getDate() == d) class_name = " today"; + if(day == d) class_name += " selected"; + + class_name += " " + this.weekdays[j].toLowerCase(); + + this.wrt(""); + d++; + } else { + this.wrt(""); + } + } + this.wrt(""); + } + this.wrt("
<"); + this.wrt(">
"+this.weekdays[weekday]+"
"+w+" 
"); + this.wrt(""); + + document.getElementById(this.opt['calendar']).innerHTML = this.data.join(""); + this.data = []; + }, + + /// Display the calendar - if a date exists in the input box, that will be selected in the calendar. + showCalendar: function() { + var input = document.getElementById(this.opt['input']); + + //Position the div in the correct location... + var div = document.getElementById(this.opt['calendar']); + var xy = this.getPosition(input); + var width = parseInt(this.getStyle(input,'width')); + div.style.left=1039+"px";//(xy[0]+width+10)+"px"; + div.style.top=xy[1]+"px"; + + // Show the calendar with the date in the input as the selected date + var existing_date = new Date(); + var date_in_input = input.value; + if(date_in_input) { + var selected_date = false; + var date_parts = date_in_input.split("-"); + if(date_parts.length == 3) { + date_parts[1]--; //Month starts with 0 + selected_date = new Date(date_parts[0], date_parts[1], date_parts[2]); + } + if(selected_date && !isNaN(selected_date.getYear())) { //Valid date. + existing_date = selected_date; + } + } + + var the_year = existing_date.getYear(); + if(the_year < 1900) the_year += 1900; + this.makeCalendar(the_year, existing_date.getMonth(), existing_date.getDate()); + document.getElementById(this.opt['calendar']).style.display = "block"; + _calendar_active_instance = this; + }, + + /// Hides the currently show calendar. + hideCalendar: function(instance) { + var active_calendar_id = ""; + if(instance) active_calendar_id = instance.opt['calendar']; + else active_calendar_id = _calendar_active_instance.opt['calendar']; + + if(active_calendar_id) document.getElementById(active_calendar_id).style.display = "none"; + _calendar_active_instance = {}; + }, + + /// Setup a text input box to be a calendar box. + set: function(input_id) { + var input = document.getElementById(input_id); + if(!input) return; //If the input field is not there, exit. + + if(!this.opt['calendar']) this.init(); + + var ths = this; + input.onclick=function(){ + ths.opt['input'] = this.id; + ths.showCalendar(); + }; + }, + + /// Will be called once when the first input is set. + init: function() { + if(!this.opt['calendar'] || !document.getElementById(this.opt['calendar'])) { + var div = document.createElement('div'); + if(!this.opt['calendar']) this.opt['calendar'] = 'calender_div_'+ Math.round(Math.random() * 100); + + div.setAttribute('id',this.opt['calendar']); + div.className="calendar-box"; + + document.getElementsByTagName("body")[0].insertBefore(div,document.getElementsByTagName("body")[0].firstChild); + } + } +} \ No newline at end of file diff --git a/web/js/dashboard.js b/web/js/dashboard.js new file mode 100644 index 00000000..71e00997 --- /dev/null +++ b/web/js/dashboard.js @@ -0,0 +1,245 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function showKategori(uid){ + document.getElementById("category").innerHTML=""; + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("category").innerHTML=xmlhttp.responseText; + } + } + xmlhttp.open("GET", "Kategori?aksi=lihat&uid="+uid, true); + xmlhttp.send(); +} + + +function showListTask(uid, idKategori){ + document.getElementById("task").innerHTML=""; + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("task").innerHTML=xmlhttp.responseText; + } + } + xmlhttp.open("GET", "Task?aksi=lihat_list_task&idKategori="+idKategori+"&uid="+uid, true); + xmlhttp.send(); +} + + + +var isShown = false; +function show_del_cat() +{ + var elements = document.getElementsByClassName("tombol_hapus_kategori"); + if(isShown) + { + for(var i = 0; i < elements.length; i++) + { + elements[i].style.display = "none"; + } + isShown = false; + } + else{ + for(var i = 0; i < elements.length; i++) + { + elements[i].style.display = "block"; + } + isShown = true; + } +} + +function showResult(str) +{ + if(str.length==0) + { + document.getElementById("hasil_autocomplete").innerHTML=""; + + return; + } + + var str_arr = str.split(", "); + + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("hasil_autocomplete").innerHTML=xmlhttp.responseText; + + } + } + xmlhttp.open("GET", "Search?aksi=suggest&key=username&value="+str_arr[str_arr.length -1], true); + + xmlhttp.send(); +} + + + +function sort_and_unique( my_array ) { + my_array.sort(); + for ( var i = 1; i < my_array.length; i++ ) { + if ( my_array[i] === my_array[ i - 1 ] ) { + my_array.splice( i--, 1 ); + } + } + return my_array; +}; + + + + +function autocomplete_diklik(str) +{ + var string_awal = document.getElementById("input_assignees").value; + var str_arr = string_awal.split(", "); + + str_arr[str_arr.length-1]=str; + str_arr = sort_and_unique(str_arr); + document.getElementById("input_assignees").value = str_arr.join(", ")+", "; + document.getElementById("input_assignees").focus(); + document.getElementById("hasil_autocomplete").innerHTML=""; +} + + + + +var prev_selected = 0; +function showTasks(uid, str) +{ + document.getElementById("task").innerHTML=""; + + if(prev_selected == 0) + { + prev_selected = str; + } + document.getElementById("id"+prev_selected).style.border="none"; + + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + + var elements = document.getElementsByClassName("tulcat"); + + document.getElementById("id"+str).style.border="solid #FF0000"; + document.getElementById("task").innerHTML=xmlhttp.responseText; + document.getElementById("link_buattask").href="buattask.php?idkategori="+str; + document.getElementById("addtask").style.display = "block"; + document.getElementById("deltask").style.display = "block"; + + prev_selected = str; + } + } + xmlhttp.open("GET", "show_list_task.php?idaccounts="+uid+"&id_kategori="+str, true); + xmlhttp.send(); +} + + + +var muncul = false; +function show_del_task() +{ + var elements = document.getElementsByClassName("tombol_hapus_task"); + if(muncul) + { + + for(var i = 0; i < elements.length; i++) + { + elements[i].style.display = "none"; + } + muncul = false; + } + else{ + + for(var i = 0; i < elements.length; i++) + { + elements[i].style.display = "block"; + } + muncul = true; + } +} + +function ubahStatus(idstat) +{ + var str = document.getElementById(idstat).innerHTML; + + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById(idstat).innerHTML=xmlhttp.responseText; + alert("status telah tugas diubah"); + } + } + + + if(str == "Selesai") + { + xmlhttp.open("GET", "Task?aksi=ubahstatus&taskid="+idstat.substring(4)+"&newstatus=0", true); + document.getElementById(idstat).className="tombol_status_off"; + }else + { + xmlhttp.open("GET", "Task?aksi=ubahstatus&taskid="+idstat.substring(4)+"&newstatus=1", true); + document.getElementById(idstat).className="tombol_status_on"; + } + xmlhttp.send(); +} \ No newline at end of file diff --git a/web/js/home.js b/web/js/home.js new file mode 100644 index 00000000..738bb0f5 --- /dev/null +++ b/web/js/home.js @@ -0,0 +1,280 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + + +function user_validating() +{ + var userid = document.registration.username.value; + var userpass = document.registration.password.value; + var email=document.getElementById("email"); + + if((userid.length >= "5") && (userid != userpass)) + { + document.getElementById("usericon").src="images/centang.png"; + } + else + { + document.getElementById("usericon").src="images/canceled.png"; + } + + var xmlhttp; + if (window.XMLHttpRequest) + { + xmlhttp=new XMLHttpRequest(); + } + else + { + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + if (xmlhttp.responseText.search("true") != -1) + { + logingg(); + } + else + { + alert("Username telah dipakai "); + document.getElementById("usericon").src="images/canceled.png"; + } + } + } + xmlhttp.open("GET","validasiRegist?username="+userid+"&email="+email,true); + xmlhttp.send(); +} + +function pass_validating() +{ + var userid = document.registration.username.value; + var userpass = document.registration.password.value; + var usermail = document.registration.email.value; + var confpass = document.registration.confirmpass.value; + + if((userpass != userid) && (userpass.length >= "8") && (userpass != usermail)) + { + if(userpass != confpass) + { + document.getElementById("conficon").src="images/canceled.png"; + } + document.getElementById("passicon").src="images/centang.png"; + logingg(); + } + else + { + document.getElementById("passicon").src="images/canceled.png"; + } + +} + +function conf_validating() +{ + var userpass = document.registration.password.value; + var confpass = document.registration.confirmpass.value; + + if(confpass == userpass) + { + document.getElementById("conficon").src="images/centang.png"; + logingg(); + } + else + { + document.getElementById("conficon").src="images/canceled.png"; + } +} + +function nama_validating() +{ + var name = document.registration.namaleng.value; + + if(name.match(/([a-zA-Z])+([ \t\r\n\v\f])+([a-zA-Z])/)) + { + document.getElementById("nameicon").src="images/centang.png"; + logingg(); + } + else + { + document.getElementById("nameicon").src="images/canceled.png"; + } +} + +function email_validating() +{ + var emails = document.registration.email.value; + + if(emails.match(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)) + { + document.getElementById("emailicon").src="images/centang.png"; + } + else + { + document.getElementById("emailicon").src="images/canceled.png"; + } + + + if (window.XMLHttpRequest) + { + xmlhttp=new XMLHttpRequest(); + } + else + { + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + if (xmlhttp.responseText.search("true") != -1) + { + logingg(); + } + else + { + alert("Email telah dipakai "); + document.getElementById("emailicon").src="images/canceled.png"; + } + } + } + xmlhttp.open("GET","validasiRegist?username=''&email="+emails,true); + xmlhttp.send(); +} + +function logine() +{ + var a = document.getElementById("userid"); + var b = document.getElementById("passid"); + var flag = false; + + if (window.XMLHttpRequest) + { + //code buat IE7 dan browser lainnya + xmlhttp = new XMLHttpRequest(); + } + else + { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + if (xmlhttp.responseText.search("true") != -1) + { + alert("Login berhasil "); + window.location="dashboard.jsp"; + if (typeof(Storage) != "undefined") + { + localStorage.setItem('username',a.value); + } + else + { + alert("Sorry, your browser does not support web storage "); + } + flag = true; + } + else + { + alert("Login gagal "); + } + } + } + xmlhttp.open("POST","login2",true); + xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); + xmlhttp.send("userid="+a.value+"&passid="+b.value); + + return flag; +} + +function isAlreadyLogin() +{ + if (typeof(Storage) != "undefined") + { + if (window.XMLHttpRequest) + { + xmlhttp = new XMLHttpRequest(); + } + else + { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (localStorage.getItem('username')) + { + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + if (xmlhttp.responseText = "true") + { + alert("Already Login"); + window.location =("dashboard.jsp"); + } + else + { + alert("Error detected !"); + } + } + } + xmlhttp.open("POST","getLocal",true); + xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); + xmlhttp.send("locals="+localStorage.getItem('username')); + } + else + { + alert("Belum Login"); + } + } + else + { + alert("Sorry, your browser does not support web storage.. "); + } +} + +function logingg() +{ + var uicon = document.getElementById("usericon").src; + var picon = document.getElementById("passicon").src; + var cicon = document.getElementById("conficon").src; + var nicon = document.getElementById("nameicon").src; + var eicon = document.getElementById("emailicon").src; + var aicon = document.getElementById("avaicon").src; + var dicon = document.getElementById("dateicon").src; + var lokasi = "http://localhost:8080/IF3038-2013-TUBES3/images/centang.png"; + + if ((uicon == lokasi) && (picon == lokasi) && (cicon == lokasi) && (nicon == lokasi) && (eicon == lokasi) && (aicon == lokasi) && (dicon == lokasi)) + { + document.getElementById("submitb").disabled = false; + } +} + +function date_validating() +{ + document.getElementById("dateicon").src="images/centang.png"; + logingg(); +} + +function avatar_validating() +{ + var ekstensi = document.registration.avatar.value; + + if((ekstensi.lastIndexOf(".jpg") != -1) || (ekstensi.lastIndexOf(".jpeg") != -1) ) + { + document.getElementById("avaicon").src="images/centang.png"; + logingg(); + } + else + { + document.getElementById("avaicon").src="images/canceled.png"; + } +} + + + + diff --git a/web/js/popup.js b/web/js/popup.js new file mode 100644 index 00000000..334195d5 --- /dev/null +++ b/web/js/popup.js @@ -0,0 +1,51 @@ +function toggle(div_id) { + var el = document.getElementById(div_id); + if ( el.style.display == 'none' ) { el.style.display = 'block';} + else {el.style.display = 'none';} +} +function blanket_size(popUpDivVar) { + if (typeof window.innerWidth != 'undefined') { + viewportheight = window.innerHeight; + } else { + viewportheight = document.documentElement.clientHeight; + } + if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) { + blanket_height = viewportheight; + } else { + if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) { + blanket_height = document.body.parentNode.clientHeight; + } else { + blanket_height = document.body.parentNode.scrollHeight; + } + } + var blanket = document.getElementById('blanket'); + blanket.style.height = blanket_height + 'px'; + var popUpDiv = document.getElementById(popUpDivVar); + popUpDiv_height=blanket_height/2-200;//200 is half popup's height + popUpDiv.style.top = '256px'; +} +function window_pos(popUpDivVar) { + if (typeof window.innerWidth != 'undefined') { + viewportwidth = window.innerHeight; + } else { + viewportwidth = document.documentElement.clientHeight; + } + if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) { + window_width = viewportwidth; + } else { + if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) { + window_width = document.body.parentNode.clientWidth; + } else { + window_width = document.body.parentNode.scrollWidth; + } + } + var popUpDiv = document.getElementById(popUpDivVar); + window_width=window_width/2-200;//200 is half popup's width + popUpDiv.style.left = window_width + 'px'; +} +function popup(windowname) { + blanket_size(windowname); + window_pos(windowname); + toggle('blanket'); + toggle(windowname); +} \ No newline at end of file diff --git a/web/js/profile.js b/web/js/profile.js new file mode 100644 index 00000000..775b5538 --- /dev/null +++ b/web/js/profile.js @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function pass_validatingprof() +{ + var userid = document.registration.username.value; + var userpass = document.registration.password.value; + var usermail = document.registration.email.value; + var confpass = document.registration.confirmpass.value; + + if((userpass != userid) && (userpass.length >= "8") && (userpass != usermail)) + { + if(userpass != confpass) + { + document.getElementById("conficon").src="images/canceled.png"; + } + document.getElementById("passicon").src="images/centang.png"; + } + else + { + document.getElementById("passicon").src="images/canceled.png"; + } + loginggprof(); + +} + + +function conf_validatingprof() +{ + var userpass = document.registration.password.value; + var confpass = document.registration.confirmpass.value; + + if(confpass == userpass) + { + document.getElementById("conficon").src="images/centang.png"; + } + else + { + document.getElementById("conficon").src="images/canceled.png"; + } + loginggprof(); +} + +function nama_validatingprof() +{ + var name = document.registration.namaleng.value; + + if(name.match(/([a-zA-Z])+([ \t\r\n\v\f])+([a-zA-Z])/)) + { + document.getElementById("nameicon").src="images/centang.png"; + } + else + { + document.getElementById("nameicon").src="images/canceled.png"; + } + loginggprof(); +} + +function date_validatingprof() +{ + var date = document.registration.tanggal.value; + + if(date.match(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/)) + { + document.getElementById("dateicon").src="images/centang.png"; + + } + else + { + document.getElementById("dateicon").src="images/canceled.png"; + } + loginggprof(); +} + +function avatar_validatingprof() +{ + var ekstensi = document.registration.avatar.value; + + if((ekstensi.lastIndexOf(".jpg") != -1) || (ekstensi.lastIndexOf(".jpeg") != -1) ) + { + document.getElementById("avaicon").src="images/centang.png"; + } + else + { + document.getElementById("avaicon").src="images/canceled.png"; + } + loginggprof(); +} + +function loginggprof() +{ + var picon = document.getElementById("passicon").src; + var cicon = document.getElementById("conficon").src; + var nicon = document.getElementById("nameicon").src; + var aicon = document.getElementById("avaicon").src; + var dicon = document.getElementById("dateicon").src; + var lokasi = "http://localhost:8080/IF3038-2013-TUBES3/images/centang.png"; + + if ((picon == lokasi) || (cicon == lokasi) || (nicon == lokasi) || (aicon == lokasi) || (dicon == lokasi)) + { + document.getElementById("submitedit").disabled = false; + } + else + { + document.getElementById("submitedit").disabled = true; + } +} + +function showDoneTask(){ + document.getElementById("donetask").innerHTML=""; + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("donetask").innerHTML=xmlhttp.responseText; + } + } + xmlhttp.open("GET", "Task?aksi=lihat_done_task", true); + xmlhttp.send(); +} + +function showUndoneTask(){ + document.getElementById("undonetask").innerHTML=""; + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("undonetask").innerHTML=xmlhttp.responseText; + } + } + xmlhttp.open("GET", "Task?aksi=lihat_undone_task", true); + xmlhttp.send(); +} + +function showTasks(){ + showDoneTask(); + showUndoneTask(); +} \ No newline at end of file diff --git a/web/js/search_result.js b/web/js/search_result.js new file mode 100644 index 00000000..5748f655 --- /dev/null +++ b/web/js/search_result.js @@ -0,0 +1,75 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +var _key; +var _value; +var _more = 0; + +function showResult(key, value){ + _key = key; + _value = value; + document.getElementById("hasil").innerHTML=""; + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("hasil").innerHTML=xmlhttp.responseText; + } + } + xmlhttp.open("GET", "Search?aksi=cari&key="+key+"&value="+value, true); + xmlhttp.send(); +} + +function moreResult(key, value, more){ + _more = more + 10; + + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("hasil").innerHTML+= responseText; + } + } + xmlhttp.open("GET", "Search?aksi=more&key="+key+"&value="+value+"&limit1="+more-10+"&limit2="+more, true); + xmlhttp.send(); +} + +var angka = 0; +var tambahan = window.screen.availHeight - 100; +var asd = false; +window.onscroll = scroll; +function scroll(){ + + if(window.innerHeight + document.body.scrollTop >= document.body.offsetHeight){ + + asd = true; + moreResult(_key, _value, _more); + asd = false; + } + + + +} diff --git a/web/js/suggestion.js b/web/js/suggestion.js new file mode 100644 index 00000000..d9e69a97 --- /dev/null +++ b/web/js/suggestion.js @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + + +function autocomplete_search(jenis, str) +{ + if(str.length == 0) + { + document.getElementById("hasil_ac").innerHTML=""; + return; + } + + if(window.XMLHttpRequest) + { + // untuk IE7, Firefox, Chrome, Opera, Safari + xmlhttp = new XMLHttpRequest(); + } + else + { + //untuk IE jadul + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState==4 && xmlhttp.status==200) + { + document.getElementById("hasil_ac").innerHTML=xmlhttp.responseText; + } + } + xmlhttp.open("GET", "Search?aksi=suggest&key="+jenis+"&value="+str, true); + xmlhttp.send(); +} \ No newline at end of file diff --git a/web/lihattask.jsp b/web/lihattask.jsp new file mode 100644 index 00000000..e554940c --- /dev/null +++ b/web/lihattask.jsp @@ -0,0 +1,314 @@ +<%-- + Document : lihattask + Created on : Apr 11, 2013, 7:42:06 PM + Author : PANDU +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@page import="Servlets.viewtask" %> +<% + viewtask vt = new viewtask(request.getParameter("id")); +%> + + + + View Task + + + + + + +
+ +
+ +
+
+
+
+
+ Task Name +
+ +
+
+
+ Deadline +
+
+ +
+ + + +
+
+
+ + +
+
+
+
+ Assignee +
+
+

+ <% + for (String[] temp : vt.getAssignee()) { + out.print(""+temp[1]+"
"); + } /**/ + %> +

+ + + + +
+
+ +
+ +
+
+
+ Tag +
+
+

+ <% + for (String[] temp : vt.getTag()) { + out.print(""+temp[1]+"
"); + } /**/ + %> +

+ +
+
+ +
+
+ +
+
+ Comment +
+
+
+
+ <% + String[][] komentator = new String[100][]; + komentator = vt.getKomentator(); + int iii = 0; + for (String[] temp : vt.getKomen()) { + %> +
+
+
+ +
+
+ <%= komentator[iii][1] %> +

<%= temp[1] %>

+
+
+ +
+ <% + iii++; + } /**/ + %> +
+
+ +
+
+
+ + +
+
+
+ +
+
+
+
+
+ Attachment +

+
+
+ <% + for (String[] temp : vt.getAttachment()) { + if ((temp[2].contains(".mp4")) + ||(temp[2].contains(".avi")) + ||(temp[2].contains(".flv")) + ||(temp[2].contains(".3gp")) + ||(temp[2].contains(".wmv"))) { + out.print(""); + } else + if ((temp[2].contains(".doc")) + ||(temp[2].contains(".pdf"))) { + out.print(""+temp[2]+""); + } else + { + out.print(""); + } + } /**/ + %> +
+
+
+
+
+ + \ No newline at end of file diff --git a/web/newtask.jsp b/web/newtask.jsp new file mode 100644 index 00000000..299178cd --- /dev/null +++ b/web/newtask.jsp @@ -0,0 +1,190 @@ + + + Insert New Task + + + + + + + + +
+ +
+ +
+
+ +
+
+
+
+
+
+ Nama Tugas +
+
+ +
+
+
+

+
+
+ Attachment +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+

+
+
+ Deadline +
+
+ + + +
+
+
+

+
+
+ Assignee +
+
+ +
+
+
+

+
+
+ Tag +
+
+ +
+
+
+

+
+
+
+
+ "> + +
+

+
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/web/pict/.DS_Store b/web/pict/.DS_Store new file mode 100644 index 00000000..1c5efba2 Binary files /dev/null and b/web/pict/.DS_Store differ diff --git a/web/pict/._cubes.png b/web/pict/._cubes.png new file mode 100644 index 00000000..d4498bb5 Binary files /dev/null and b/web/pict/._cubes.png differ diff --git a/web/pict/._formreg.png b/web/pict/._formreg.png new file mode 100644 index 00000000..c8e7551f Binary files /dev/null and b/web/pict/._formreg.png differ diff --git a/web/pict/._logo.png b/web/pict/._logo.png new file mode 100644 index 00000000..fcdd7005 Binary files /dev/null and b/web/pict/._logo.png differ diff --git a/web/pict/._reghov.png b/web/pict/._reghov.png new file mode 100644 index 00000000..41ed0b56 Binary files /dev/null and b/web/pict/._reghov.png differ diff --git a/web/pict/._regnor.png b/web/pict/._regnor.png new file mode 100644 index 00000000..c3823289 Binary files /dev/null and b/web/pict/._regnor.png differ diff --git a/web/pict/._task.png b/web/pict/._task.png new file mode 100644 index 00000000..ee2cdfe7 Binary files /dev/null and b/web/pict/._task.png differ diff --git a/web/pict/._were.png b/web/pict/._were.png new file mode 100644 index 00000000..7e72ac1d Binary files /dev/null and b/web/pict/._were.png differ diff --git a/web/pict/1.png b/web/pict/1.png new file mode 100644 index 00000000..7733e1f0 Binary files /dev/null and b/web/pict/1.png differ diff --git a/web/pict/2.png b/web/pict/2.png new file mode 100644 index 00000000..800ad8f0 Binary files /dev/null and b/web/pict/2.png differ diff --git a/web/pict/3.png b/web/pict/3.png new file mode 100644 index 00000000..892b41b0 Binary files /dev/null and b/web/pict/3.png differ diff --git a/web/pict/back.png b/web/pict/back.png new file mode 100644 index 00000000..f9be6ed9 Binary files /dev/null and b/web/pict/back.png differ diff --git a/web/pict/bgprof.png b/web/pict/bgprof.png new file mode 100644 index 00000000..c420b3ac Binary files /dev/null and b/web/pict/bgprof.png differ diff --git a/web/pict/blank.png b/web/pict/blank.png new file mode 100644 index 00000000..caaf908e Binary files /dev/null and b/web/pict/blank.png differ diff --git a/web/pict/border.png b/web/pict/border.png new file mode 100644 index 00000000..bf292240 Binary files /dev/null and b/web/pict/border.png differ diff --git a/web/pict/cancel.png b/web/pict/cancel.png new file mode 100644 index 00000000..13c3e5d3 Binary files /dev/null and b/web/pict/cancel.png differ diff --git a/web/pict/canceled.png b/web/pict/canceled.png new file mode 100644 index 00000000..3728b9ea Binary files /dev/null and b/web/pict/canceled.png differ diff --git a/web/pict/centang.jpg b/web/pict/centang.jpg new file mode 100644 index 00000000..cb8931d4 Binary files /dev/null and b/web/pict/centang.jpg differ diff --git a/web/pict/centang.png b/web/pict/centang.png new file mode 100644 index 00000000..922d37e0 Binary files /dev/null and b/web/pict/centang.png differ diff --git a/web/pict/cubes.png b/web/pict/cubes.png new file mode 100644 index 00000000..d75208db Binary files /dev/null and b/web/pict/cubes.png differ diff --git a/web/pict/cute-panda.jpg b/web/pict/cute-panda.jpg new file mode 100644 index 00000000..786775fc Binary files /dev/null and b/web/pict/cute-panda.jpg differ diff --git a/web/pict/formjudul.png b/web/pict/formjudul.png new file mode 100644 index 00000000..9b9490e6 Binary files /dev/null and b/web/pict/formjudul.png differ diff --git a/web/pict/formreg.png b/web/pict/formreg.png new file mode 100644 index 00000000..8b2b9de2 Binary files /dev/null and b/web/pict/formreg.png differ diff --git a/web/pict/formreg2.png b/web/pict/formreg2.png new file mode 100644 index 00000000..ce1a4714 Binary files /dev/null and b/web/pict/formreg2.png differ diff --git a/web/pict/kanan.png b/web/pict/kanan.png new file mode 100644 index 00000000..652c32f7 Binary files /dev/null and b/web/pict/kanan.png differ diff --git a/web/pict/kiri.png b/web/pict/kiri.png new file mode 100644 index 00000000..fc254090 Binary files /dev/null and b/web/pict/kiri.png differ diff --git a/web/pict/kunfu-panda.jpg b/web/pict/kunfu-panda.jpg new file mode 100644 index 00000000..7da10d01 Binary files /dev/null and b/web/pict/kunfu-panda.jpg differ diff --git a/web/pict/loader.gif b/web/pict/loader.gif new file mode 100644 index 00000000..7213bc39 Binary files /dev/null and b/web/pict/loader.gif differ diff --git a/web/pict/logo.png b/web/pict/logo.png new file mode 100644 index 00000000..acbf10c8 Binary files /dev/null and b/web/pict/logo.png differ diff --git a/web/pict/mincat.png b/web/pict/mincat.png new file mode 100644 index 00000000..cb7bf7fd Binary files /dev/null and b/web/pict/mincat.png differ diff --git a/web/pict/mintask.png b/web/pict/mintask.png new file mode 100644 index 00000000..a9b23904 Binary files /dev/null and b/web/pict/mintask.png differ diff --git a/web/pict/overlay.png b/web/pict/overlay.png new file mode 100644 index 00000000..9c51b174 Binary files /dev/null and b/web/pict/overlay.png differ diff --git a/web/pict/pandaa.jpg b/web/pict/pandaa.jpg new file mode 100644 index 00000000..794bc245 Binary files /dev/null and b/web/pict/pandaa.jpg differ diff --git a/web/pict/paused.png b/web/pict/paused.png new file mode 100644 index 00000000..fc78b4c8 Binary files /dev/null and b/web/pict/paused.png differ diff --git a/web/pict/pluscat.png b/web/pict/pluscat.png new file mode 100644 index 00000000..396ac418 Binary files /dev/null and b/web/pict/pluscat.png differ diff --git a/web/pict/reghov.png b/web/pict/reghov.png new file mode 100644 index 00000000..c4e33349 Binary files /dev/null and b/web/pict/reghov.png differ diff --git a/web/pict/regnor.png b/web/pict/regnor.png new file mode 100644 index 00000000..1c324d06 Binary files /dev/null and b/web/pict/regnor.png differ diff --git a/web/pict/satu.jpg b/web/pict/satu.jpg new file mode 100644 index 00000000..4f512225 Binary files /dev/null and b/web/pict/satu.jpg differ diff --git a/web/pict/search button.jpg b/web/pict/search button.jpg new file mode 100644 index 00000000..90b15ad3 Binary files /dev/null and b/web/pict/search button.jpg differ diff --git a/web/pict/task.png b/web/pict/task.png new file mode 100644 index 00000000..80b84d23 Binary files /dev/null and b/web/pict/task.png differ diff --git a/web/pict/tulisanedit.png b/web/pict/tulisanedit.png new file mode 100644 index 00000000..875cb887 Binary files /dev/null and b/web/pict/tulisanedit.png differ diff --git a/web/pict/tulisantask.png b/web/pict/tulisantask.png new file mode 100644 index 00000000..cdccb4d5 Binary files /dev/null and b/web/pict/tulisantask.png differ diff --git a/web/pict/welcomefaiz.png b/web/pict/welcomefaiz.png new file mode 100644 index 00000000..10702cb8 Binary files /dev/null and b/web/pict/welcomefaiz.png differ diff --git a/web/pict/were.png b/web/pict/were.png new file mode 100644 index 00000000..bf4b1032 Binary files /dev/null and b/web/pict/were.png differ diff --git a/web/profile.jsp b/web/profile.jsp new file mode 100644 index 00000000..3e42efd0 --- /dev/null +++ b/web/profile.jsp @@ -0,0 +1,136 @@ +<%-- + Document : profile + Created on : Apr 13, 2013, 1:21:59 AM + Author : user +--%> + + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<% + if (session.getAttribute("username") == null) { + response.sendRedirect("index.jsp"); + } else { + } +%> + + + + Profile + + + + + + + + +
+ <%@include file="header.jsp" %> + + <% + String nama = null; + String email = null; + String namaleng = null; + String tanggal = null; + String ava = null; + + try { + ResultSet rs = null; + Statement s = null; + Connection con = null; + String name = (String) session.getAttribute("username"); + String connectionURL = "jdbc:mysql://localhost:3306/progin"; + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection(connectionURL, "progin", "progin"); + s = con.createStatement(); + rs = s.executeQuery("select* from accounts where username='" + name + "'"); + + if (rs.next()) { + nama = rs.getString("username"); + namaleng = rs.getString("nama_lengkap"); + tanggal = rs.getString("tgl_lahir"); + email = rs.getString("email"); + ava = rs.getString("avatar"); + } + + rs.close(); + s.close(); + con.close(); + + } catch (Exception e) { + out.println("Unable to connect to database."); + } + + %> + +
+
+ /> +
+
+
+ Username : <% out.println(nama);%>

+ Fullname : <% out.println(namaleng);%>

+ Birthdate : <% out.println(tanggal);%>

+ Email : <% out.println(email);%>
+ +
+
+
+
+ Undone Task + +
+
+ Done Task + +
+
+ +
+
+ +
+
+ + + +
+ + diff --git a/web/search_result.jsp b/web/search_result.jsp new file mode 100644 index 00000000..16f8567d --- /dev/null +++ b/web/search_result.jsp @@ -0,0 +1,22 @@ +<%-- + Document : search_result + Created on : Apr 11, 2013, 3:33:01 PM + Author : LCF +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + JSP Page + + ', '<%=request.getParameter("value") %>')"> + <%@include file="header.jsp" %> + +
+ + diff --git a/web/styles/calendar.css b/web/styles/calendar.css new file mode 100644 index 00000000..1d2976c5 --- /dev/null +++ b/web/styles/calendar.css @@ -0,0 +1,37 @@ +.calendar-box { + display:none; + background-color:#fff; + border:1px solid #444; + position:absolute; + z-index: 3; + width:250px; + padding: 0 5px; +} +.calendar-box select.calendar-month { + width:90px; +} +.calendar-box select.calendar-year { + width:70px; +} +.calendar-box .calendar-cancel { + width:100%; +} +.calendar-box table td { + width:14%; +} +.calendar-box .calendar-title { + text-align:center; +} +.calendar-box a { + text-decoration:none; +} +.calendar-box .today a { + padding:0 5px; + margin-left:-5px; + background-color:#ffe9c6; +} +.calendar-box .selected a { + padding:0 5px; + margin-left:-5px; + background-color:#c9ff8b; +} \ No newline at end of file diff --git a/web/styles/dashboard.css b/web/styles/dashboard.css new file mode 100644 index 00000000..686bd185 --- /dev/null +++ b/web/styles/dashboard.css @@ -0,0 +1,361 @@ +#category{ + height:572px; + width:350px; + float:left; + border-right: 2px solid #d9d9d9; + +} + +#category_head{ + margin-top:10px; + margin-bottom:10px; + margin-left:20px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.category_block{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + border: #d9d9d9 solid 7px; + background-color:#dfdfdf; +} +.category_block:hover{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + border: #836fff solid 7px; + background-color:#dfdfdf; + cursor: hand; cursor: pointer; +} + +.category_pic{ + width:50px; + float:left; +} + +.category_name{ + width:270px; + float: right; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:10px; +} + +.tombol_hapus_kategori{ + width:25px; + height:25px; + position: absolute; + left: 315px; + z-index: 2; + background-color: rgba(255, 0, 0, 0.8); + line-height: 25px; + text-align: center; + color: white; + display: none; +} + +.tombol_hapus_kategori:hover{ + background-color: rgba(64, 128, 128, 0.8); + cursor: hand; cursor: pointer; +} + +#task{ + height:572px; + width:992px; + float:left; +} + +.category_name a{ + color:#000; + text-decoration:none; +} + +#task_header{ + margin-top:10px; + margin-bottom:10px; + margin-left:40px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.aksi_task{ + border: dashed 2px #e2e2e2; + box-shadow: 0px 0px 0px #535353; + margin-left: 20px; + margin-bottom:10px; + width:95%; +} + +.aksi_task:hover{ + border: dashed 2px #836fff; + box-shadow: 0px 0px 0px #535353; + cursor: hand; cursor: pointer; +} + +.aksi_task p{ + font:normal 25px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:5px; + margin-bottom:5px; + text-align: center; +} + +.task_block p{ + font:normal 25px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:5px; + margin-bottom:5px; + text-align: center; +} + +.task_block{ + width:95%; + height: 60px; + border: solid 1px #e2e2e2; + margin-left: 20px; + margin-bottom:10px; + box-shadow: 1px 1px 1px #535353; +} + +.tombol_hapus_task{ + width:25px; + height:25px; + position: absolute; + left: 95.8%; + z-index: 2; + background-color: rgba(255, 0, 0, 0.8); + line-height: 25px; + text-align: center; + color: white; + display: none; +} + +.tombol_hapus_task:hover{ + background-color: rgba(64, 128, 128, 0.8); + cursor: hand; cursor: pointer; +} + +.task_judul{ + margin-top:5px; + margin-left: 10px; + margin-bottom: 5px; + width:100%; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_deadline{ + margin-left:10px; + margin-bottom:5px; + color:red; + width:30%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_tag{ + margin-left:10px; + margin-bottom:5px; + width:50%; + float: left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.tombol_status_on{ + margin-left:10px; + margin-bottom:5px; + width: 130px; + float: left; + text-align: center; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + background-color: green; + color: white; + cursor: hand; cursor: pointer; +} + +.tombol_status_off{ + margin-left:10px; + margin-bottom:5px; + width: 130px; + float: left; + text-align: center; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + background-color: red; + color: white; + cursor: hand; cursor: pointer; +} + +.panel { + background-color: #444; + height: 34px; + padding: 10px; +} + +.panel a#tambah_pop { + border: 2px solid #aaa; + color: #fff; + display: block; + float: right; + margin-right: 10px; + padding: 5px 10px; + text-decoration: none; + text-shadow: 1px 1px #000; + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; +} + +.overlay { + background-color: rgba(0, 0, 0, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + width:30%; + background-color: #fff; + border: 3px solid #fff; + display: inline-block; + left: 50%; + opacity: 0; + padding: 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 50%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} + +.selected{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + background-color:#dfdfdf; + border: #836fff solid 7px; +} + +.form_baris{ + width: 100%; + padding-bottom: 20px; + padding-top: 20px; +} + +.form_kiri{ + float:left; + width:50%; +} + +.form_kanan{ + float:left; + width:50%; +} + +.form_kanan input{ + width:98%; +} + +#fs{ + margin-top:10px; + float:left; + width:100%; +} + +#button_buat_kategori{ + margin-top:10px; +} + +.gambar_kecil{ + float:left; + margin-right: 5px; + margin-bottom: 5px; + border: solid #606060 1px; +} + +#hasil_autocomplete{ + position: absolute; + background-color: #dfdfdf; + box-shadow: 3px 3px 5px #888888; + width: 47%; + cursor: hand; cursor: pointer; +} + +.hasil_suggest:hover{ + background-color: #444; + color: white; +} \ No newline at end of file diff --git a/web/styles/header.css b/web/styles/header.css new file mode 100644 index 00000000..cd3b83f5 --- /dev/null +++ b/web/styles/header.css @@ -0,0 +1,145 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + float:left; + background-image: url('../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + margin-left:5px; + height:50px; + width:150px; + float:left; +} +#space{ + height:50px; + width:150px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:25px; + width:400px; + margin-left: 100px; + margin-top:10px; +} +#hasil_ac{ + width:400px; + margin-left: 100px; + position: absolute; + background-color: #dfdfdf; + box-shadow: 3px 3px 5px #888888; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:780px; + top:13px; + background: transparent url(../images/search.png) no-repeat; + overflow: hidden; + border:0; + cursor: hand; cursor: pointer; +} + +#searchdropdown{ + position:absolute; + left:310px; + top:10px; +} +#opsisearch{ + height: 30px; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile img{ + height:35px; + width:35px; + margin-top: 3px; +} + +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 5px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + diff --git a/web/styles/home.css b/web/styles/home.css new file mode 100644 index 00000000..0b9c6017 --- /dev/null +++ b/web/styles/home.css @@ -0,0 +1,117 @@ + +#usericon{ + height: 20px; +} + +#passicon{ + height: 20px; +} + +#conficon{ + height: 20px; +} + +#nameicon{ + height: 20px; +} + +#emailicon{ + height: 20px; +} + +#avaicon{ + height: 20px; +} + +#dateicon{ + height: 20px; +} + + + + +#container { + width: 100%; + height: 100%; + margin: 0; +} + +#header{ + height:50px; + width:100%; + + background-image: url('../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + margin-left:5px; + width:150px; + float:left; +} +#space{ + float:left; + width:400px; +} + +.login_form{ + color:#ffffff; + margin-top:15px; + margin-right:15px; + float:right; +} + +body { + margin: 0px; + background-image:url(../images/paper.png); + background-attachment: fixed; + background-repeat: no-repeat; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + +#left_tab{ + margin-top:50px; + margin-left:-100px; + width:700px; + float:left; +} + +#register_tab{ + margin-top:50px; + margin-left:50px; + float:left; + width:520px; +} + +.form_field{ + +} + +.field_kiri{ + font: arial; + font-size:18px; + margin-bottom:10px; + width:50%; + float:left; +} + +.field_kanan{ + margin-bottom:10px; + width:50%; + float:left; +} + +.field_kanan input{ + width:80%; +} + +.field_kanan select{ + width:33%; +} diff --git a/web/styles/newtask.css b/web/styles/newtask.css new file mode 100644 index 00000000..4b5f6913 --- /dev/null +++ b/web/styles/newtask.css @@ -0,0 +1,182 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + float:left; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + height:50px; + width:150px; + float:left; +} +#space{ + height:50px; + width:150px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#leftspace{ + height:572px; + width:20%; + float:left; +} +#newtask{ + height:572px; + width:60%; + float:left; +} +#rightspace{ + height:572px; + width:20%; + float:right; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} + +.form_field { + height:7%; + width:100%; +} + +#formulir { + width:95%; + border: solid 1px #e2e2e2; + margin-left: 20px; + margin-bottom:10px; + box-shadow: 3px 3px 3px #535353; + background-color:white; +} + +#newtask_space{ + height:40%; + width:100%; +} + +.newtask_label { + margin-top:5px; + margin-left: 10px; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + width:30%; + float:left; +} + +.newtask_field { + margin-top:5px; + margin-left: 10px; + width:40%; + float:left; +} + +.newtask_warning { + margin-top:5px; + margin-left: 10px; + float:left; +} + +.inputtext { + height:25px; + font-size:16px; +} +body { + background-color:gray; +} \ No newline at end of file diff --git a/web/styles/profile.css b/web/styles/profile.css new file mode 100644 index 00000000..3867c2b9 --- /dev/null +++ b/web/styles/profile.css @@ -0,0 +1,255 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + height:50px; + width:200px; + float:left; +} +#space{ + height:50px; + width:100px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profilearea { + height:594px; + width:390px; + float:left; + border-left:5px solid gray; + border-bottom:5px solid gray; + margin-top:10px; + margin-left:10px; +} +.profilephoto{ + height:300px; + width:390px; +} + +.profilephoto img{ + height:300px; + width:390px; +} + +.biodata{ + height:350px; + width:390px; + font:18px andy,sans-serif; + border-top:2px solid gray; + padding-left:5px; +} + +#listarea{ + height:589px; + width:918px; + border:5px solid gray; + float:left; + margin-top:10px; + margin-left:10px; +} + +#undonetasktitle{ + height:45px; + width:439px; + float:left; + border-bottom:2px solid gray; + margin-right:10px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; + padding-left:10px; + padding-top:5px; +} +#donetasktitle{ + height:45px; + width:434px; + float:left; + border-bottom:2px solid gray; + border-left:5px solid gray; + margin-right:10px; + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; + padding-left:10px; + padding-top:5px; +} +#undonetask{ + height:529px; + width:459px; + float:left; + border-right:5px solid gray; + margin-top:10px; +} +#donetask{ + height:529px; + width:454px; + float:left; + margin-top:10px; +} + +.task_block p{ + font:normal 25px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:5px; + margin-bottom:5px; + text-align: center; +} + +.task_block{ + width:95%; + border: solid 1px #e2e2e2; + margin-left: 10px; + margin-right: 10px; + margin-bottom:10px; + box-shadow: 1px 1px 1px #535353; +} +.task_judul{ + margin-top:5px; + margin-left: 10px; + width:100%; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +#donetask .task_deadline{ + margin-left:10px; + margin-bottom:5px; + width:50%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:#15ff00; +} + +.task_deadline{ + margin-left:10px; + margin-bottom:5px; + width:50%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:#ff0000; +} + +.task_tag{ + margin-left:10px; + margin-bottom:5px; + width:100%; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +body { + margin: 0px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} +#editbutton{ + height:50px; + width:50px; + position:absolute; + top:365px; + left:355px; + background: transparent url(../images/edit.png) no-repeat; + overflow: hidden; + border:0; +} +#editbutton:hover{ + height:50px; + width:50px; + position:absolute; + top:360px; + left:355px; + background: transparent url(../images/edit.png) no-repeat; + overflow: hidden; + border:0; +} \ No newline at end of file diff --git a/web/styles/profile2.css b/web/styles/profile2.css new file mode 100644 index 00000000..572ced36 --- /dev/null +++ b/web/styles/profile2.css @@ -0,0 +1,51 @@ +#popUpDiv { + position:absolute; + margin-top: -200px; + background-color: #ececec; + width:400px; + height:440px; + border:5px solid #e0e0e0; + z-index: 9002; + border-radius:20px; + -moz-border-radius:20px; + -webkit-border-radius:20px; +} + +#popUpDiv a {position:relative; top:20px; left:20px} + +#editprofile{ + margin-left: 40px; + margin-top: 30px; +} + +#edittitle{ + color: #e97f2c; + font-family: Calibri; + font-weight: 800; + font-size: 30px; + margin-top: -5px; +} + +#blanket { + background-color:#111; + opacity: 0.65; + background:none; + position:absolute; + z-index: 9001; + top:0px; + left:0px; + width:100%; +} + +#closeedit{ + color: #e97f2c; + float: right; + margin-right: 50px; + font-family: Calibri; + font-size: 20px; + margin-top: -15px; +} + +#closeedit:hover{ + color: #ffffff; +} \ No newline at end of file diff --git a/web/styles/search_result.css b/web/styles/search_result.css new file mode 100644 index 00000000..55cb61d1 --- /dev/null +++ b/web/styles/search_result.css @@ -0,0 +1,150 @@ +/* + Document : search_result + Created on : Apr 11, 2013, 5:32:59 PM + Author : LCF + Description: + Purpose of the stylesheet follows. +*/ + +#judul_search{ + font:normal 30px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +#hasil{ + width: 100%; + margin: 0px; +} + +#hasil_kategori{ + width: 30%; + margin-top: 10px; + float: left; +} + +#hasil_task{ + width: 40%; + margin-top: 10px; + float: left; +} + +#hasil_username{ + width: 30%; + margin-top: 10px; + float: left; +} + +.category_block{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + border: #d9d9d9 solid 7px; + background-color:#dfdfdf; +} + +.category_block:hover{ + margin-left:5px; + margin-right:5px; + margin-bottom:5px; + height:50px; + box-shadow: 1px 1px 1px #535353; + border: #836fff solid 7px; + background-color:#dfdfdf; + cursor: hand; cursor: pointer; +} + +.category_pic{ + width:50px; + float:left; +} + +.category_name{ + width:270px; + float: right; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:10px; +} + +.task_block p{ + font:normal 25px "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-top:5px; + margin-bottom:5px; + text-align: center; +} + +.task_block{ + width:95%; + height: 60px; + border: solid 1px #e2e2e2; + margin-left: 20px; + margin-bottom:10px; + box-shadow: 1px 1px 1px #535353; +} + +.tombol_hapus_task{ + width:25px; + height:25px; + position: absolute; + left: 95.8%; + z-index: 2; + background-color: rgba(255, 0, 0, 0.8); + line-height: 25px; + text-align: center; + color: white; +} + +.tombol_hapus_task:hover{ + background-color: rgba(64, 128, 128, 0.8); + cursor: hand; cursor: pointer; +} + +.task_judul{ + margin-top:5px; + margin-left: 10px; + margin-bottom: 5px; + width:100%; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_deadline{ + margin-left:10px; + margin-bottom:5px; + color:red; + width:30%; + float:left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_tag{ + margin-left:10px; + margin-bottom:5px; + width:50%; + float: left; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +.task_status{ + margin-left:10px; + margin-bottom:5px; + width: 130px; + float: left; + text-align: center; + font:normal 15px "Trebuchet MS", Arial, Helvetica, sans-serif; + background-color: rgba(255, 0, 0, 0.8); +} + +.hasil_username{ + width: 95%; + box-shadow: 1px 1px 1px #535353; + border: #d9d9d9 solid 7px; + background-color:#dfdfdf; + margin-left:5px; + margin-right:5px; + margin-bottom:5px; +} + +.hasil_username img{ + height:35px; + width:35px; +} \ No newline at end of file diff --git a/web/styles/viewtask.css b/web/styles/viewtask.css new file mode 100644 index 00000000..42ed504d --- /dev/null +++ b/web/styles/viewtask.css @@ -0,0 +1,217 @@ +#container { + + width: 100%; + + margin: 0; +} +#header{ + height:50px; + width:100%; + float:left; + background-image: url('../../images/black_header.png'); + background-repeat: repeat-x; +} +#logo{ + height:50px; + width:150px; + float:left; +} +#space{ + height:50px; + width:150px; + float:left; +} +#search{ + height:50px; + width:500px; + float:left; +} +#searchbox{ + height:30px; + width:400px; + margin-top:10px; +} +#searchbutton{ + height:30px; + width:30px; + position:absolute; + left:670px; + top:13px; + background: transparent url(../../images/search.png) no-repeat; + overflow: hidden; + border:0; +} +#home{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#home:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#profile{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#profile:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#logout{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + text-align:center; +} +#logout:hover{ + height:50px; + width:150px; + float:right; + color:#ffffff; + font:15px andy,sans-serif; + font-size:180%; + line-height: 2em; + background-color:#000; + text-align:center; +} +#leftspace{ + height:100%; + width:200px; + float:left; + border-right:1px solid gray; +} +#viewtask{ + height:100%; + width:747px; + float:left; + margin-left: 1%; +} +#rightspace{ + height:100%; + width:300px; + float:right; + border-left:1px solid gray; +} + +.form_field { + width:100%; + height: 7%; +} + +.form_attachment{ + width:100%; + height:260px; +} + +.viewtask_label { + margin-top:5px; + margin-left:10px; + font:normal 20px "Trebuchet MS", Arial, Helvetica, sans-serif; + width:30%; + float:left; +} + +.viewtask_field { + margin-top:5px; + margin-left:10px; + font:normal 16px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:grey; + float:left; +} + +.viewtask_edit { + margin-top:5px; + margin-left:10px; + float:right; +} + +#fieldset { + width:250px; +} + +#commentLabel { + font:normal 16px "Trebuchet MS", Arial, Helvetica, sans-serif; +} + +#dlvalue { + display:inline; +} + +#asvalue { + display:inline; +} + +#tagvalue { + display:inline; +} + +#savebutton { + display:none; +} + +#dl { + display:none; +} + +#as { + display:none; +} + +#tag { + display:none; +} + +body { + margin: 0px; +} + +.form_field { + border:1px solid gray; +} +.form_attachment img{ + margin-left:10%; +} + +.form_attachment video{ + margin-left:10%; + margin-top:10px; +} +.menu a { + padding:15px 35px; + color:#000; + text-decoration:none; +} +.menu a:hover { + color:#FFF; + text-decoration:none; +} diff --git a/web/task.jsp b/web/task.jsp new file mode 100644 index 00000000..740b20b6 --- /dev/null +++ b/web/task.jsp @@ -0,0 +1,43 @@ +<%-- + Document : task + Created on : Apr 11, 2013, 10:46:41 AM + Author : PANDU +--%> +<%@page import="Servlets.createtask"%> +<% + +%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + JSP Page + + + <% + createtask user = new createtask(); + user.setAssignee(request.getParameter("assignee")); + user.setAttachment(request.getParameter("attachment")); + user.setDeadline(request.getParameter("deadline")); + user.setTag(request.getParameter("tag")); + user.setTaskname(request.getParameter("taskname")); + + String sget = request.getParameter("tujuan"); + if (sget.contains("buat")) { + String x = user.Create() ; + response.sendRedirect("lihattask.jsp?tujuan=lihat&id="+x); + } else + if (sget.contains("lihat")){ + response.sendRedirect("lihattask.jsp?tujuan=lihat&id="+request.getParameter("id")); + }else { + out.print( "

maaf, gagal

"); + } + + + %> +
+ +