diff --git a/build.xml b/build.xml
new file mode 100644
index 00000000..d4510c0e
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project Simple-Blog.
+
+
+
diff --git a/build/web/META-INF/MANIFEST.MF b/build/web/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..59499bce
--- /dev/null
+++ b/build/web/META-INF/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
diff --git a/build/web/WEB-INF/classes/.netbeans_automatic_build b/build/web/WEB-INF/classes/.netbeans_automatic_build
new file mode 100644
index 00000000..e69de29b
diff --git a/build/web/WEB-INF/classes/.netbeans_update_resources b/build/web/WEB-INF/classes/.netbeans_update_resources
new file mode 100644
index 00000000..e69de29b
diff --git a/build/web/WEB-INF/glassfish-web.xml b/build/web/WEB-INF/glassfish-web.xml
new file mode 100644
index 00000000..13e0059f
--- /dev/null
+++ b/build/web/WEB-INF/glassfish-web.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Keep a copy of the generated servlet class' java code.
+
+
+
diff --git a/build/web/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar b/build/web/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar
new file mode 100644
index 00000000..0170c3e5
Binary files /dev/null and b/build/web/WEB-INF/lib/mysql-connector-java-5.0.8-bin.jar differ
diff --git a/build/web/WEB-INF/web.xml b/build/web/WEB-INF/web.xml
new file mode 100644
index 00000000..ad614a8a
--- /dev/null
+++ b/build/web/WEB-INF/web.xml
@@ -0,0 +1,27 @@
+
+
+
+ javax.faces.FACELETS_VIEW_MAPPINGS
+ *.xhtml
+
+
+
+ Faces Servlet
+ javax.faces.webapp.FacesServlet
+ 1
+
+
+
+
+ Faces Servlet
+ *.xhtml
+
+
+
+ 30
+
+
+
+ index.xhtml
+
+
\ No newline at end of file
diff --git a/build/web/assets/css/screen.css b/build/web/assets/css/screen.css
new file mode 100644
index 00000000..57dd7a32
--- /dev/null
+++ b/build/web/assets/css/screen.css
@@ -0,0 +1,872 @@
+@import url(http://fonts.googleapis.com/css?family=Open+Sans);
+@import url(http://fonts.googleapis.com/css?family=Questrial);
+
+/* Reset & Basics (Inspired by E. Meyers)
+================================================== */
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, address, cite, code, em, img, small, strong, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, embed, figure, figcaption, footer, header, hgroup, menu, nav, section, summary, time, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline; }
+article, aside, details, figcaption, figure, footer, header, hgroup, menu, time, nav, section {
+ display: block; }
+html, body, .wrapper {
+ min-height: 100%;
+}
+
+
+/* Body
+================================================== */
+html, body {
+ height: 100%;
+}
+.wrapper {
+ min-height: 100%;
+}
+body {
+ overflow-x: hidden;
+ font: 17px/28px ff-meta-serif-web-pro, "Georgia", serif;
+ color: #333;
+ background: #fff;
+}
+
+
+/* Typography
+================================================== */
+h1, h2, h3, h4, h5, h6 {
+ font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif;
+ font-weight: normal;
+ text-transform: uppercase;
+ font-weight: 700;
+ color: #000;
+ text-rendering: optimizeLegibility;
+}
+
+h1 {
+ font-size: 50px;
+ padding-bottom: 30px;
+}
+
+h2 {
+ font-size: 45px;
+ padding-bottom: 25px;
+}
+
+h3 {
+ font-size: 40px;
+ padding-bottom: 20px;
+}
+
+h4 {
+ font-size: 35px;
+ padding-bottom: 15px;
+}
+
+h5 {
+ font-size: 30px;
+ padding-bottom: 10px;
+}
+
+p {
+ margin: 0 0 28px 0;
+}
+
+strong {
+ font-weight: bold;
+}
+em {
+ font-style: italic;
+}
+sup {
+ line-height: 0;
+}
+
+small {
+ font-size: 70%;
+}
+
+cite {
+ font-size: 80%;
+ font-style: italic;
+ }
+
+/* Teaser
+================================================== */
+
+header#teaser h1 {
+ text-transform: none !important;
+ color: #333;
+ font-size: 28px !important;
+ font-weight: 300 !important;
+}
+
+
+/* Links
+================================================== */
+a {
+ color: #F40034;
+ text-decoration: none;
+ -webkit-transition: color .2s ease-in-out;
+ -moz-transition: color .2s ease-in-out;
+ transition: color .2s ease-in-out;
+}
+a:hover {
+ color: #F40034;
+}
+
+/* Layout
+================================================== */
+/* White container that is the "page" */
+.wrapper {
+ max-width: 1500px;
+ margin: 0 auto;
+ background: #fff;
+}
+
+/* Containers to keep content to a set width */
+.nav,
+.art-header-inner,
+.footer,
+.art-list,
+.abt,
+.fourohfour {
+ width: 980px;
+}
+.nav,
+.art-body-inner,
+.footer,
+.art-list,
+.abt,
+.fourohfour {
+ position: relative;
+ margin: 0 auto;
+}
+
+/* Nav
+================================================== */
+.nav {
+ position: absolute;
+ top: 0;
+ left: 50%;
+ height: 70px;
+ padding-top: 40px;
+ margin-left: -490px; /* Half width of nav */
+ border-bottom: 1px solid #333;
+ z-index: 2;
+}
+.nav.fixed {
+ position: fixed;
+}
+#logo {
+ float: left;
+}
+.nav-primary {
+ float: right;
+}
+.nav-primary li {
+ display: inline-block;
+ margin-left: 10px;
+ font-weight: 500;
+}
+#logo h1,
+.nav-primary li,
+.nav-primary li a {
+ font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif;
+ font-weight: 700;
+ font-size: 13px;
+ line-height: 30px;
+ color: #000;
+ text-transform: uppercase;
+}
+
+#logo h1 {
+ height: 30px;
+ margin-left: 0px;
+ letter-spacing: 1px;
+ font-family: 'Questrial', sans-serif;
+ font-size: 30px;
+}
+
+#logo h1 span{
+ color: #F40034 !important;
+}
+
+.nav li:first-child {
+ margin-left: 0; /* Remove left margin from the first nav li */
+}
+
+/* Home Page
+================================================== */
+
+div#home {}
+
+#home > div.cover {
+ max-width: 980px;
+ margin: 0px auto;
+ /*padding-top: 110px;*/
+}
+
+div.cover {
+
+}
+
+div.cover > img {
+ width: 100%;
+ height: 100%;
+}
+
+
+/* Article
+================================================== */
+.art {
+ margin-top: -131px;
+}
+/* Header */
+.art-header {
+ height: 900px;
+ /* Background image is defined in the post */
+ background-position: top center;
+ background-attachment: fixed;
+ overflow: hidden;
+}
+/* Contains the time, title and subtitle for an article */
+.art-header-inner {
+ position: fixed;
+ top: 300px;
+ left: 50%;
+ margin-left: -490px;
+}
+.art-time,
+.art-title,
+.art-subtitle {
+ text-align: center;
+ text-transform: uppercase;
+}
+.art-time {
+ font-size: 14px;
+ line-height: 1.8;
+ letter-spacing: 4px;
+}
+.art-title {
+ font-size: 100px;
+ line-height: .9;
+ letter-spacing: -2px;
+ width: 100%;
+}
+.art-subtitle {
+ margin-top: 4px;
+ font-size: 14px;
+ line-height: 1.3;
+ letter-spacing: 4px;
+}
+
+/* If small header, make few adjustments */
+.small .art-title {
+ font-size: 70px;
+ line-height: 65px;
+}
+.small.art-header-inner {
+ top: 320px;
+}
+
+/* Body */
+.art-body {
+ position: relative;
+ width: 100%;
+ background: #fff;
+ z-index: 100;
+ -webkit-box-shadow: 0 -3px 3px rgba(0,0,0,.2);
+ -moz-box-shadow: 0 -3px 3px rgba(0,0,0,.2);
+ box-shadow: 0 -3px 3px rgba(0,0,0,.2);
+}
+.art-body-inner {
+ font-family: Georgia,Cambria,"Times New Roman",Times,serif;
+ max-width: 640px;
+ padding: 80px 0 50px;
+ letter-spacing: 0.01rem;
+ font-weight: 400;
+ font-style: normal;
+ font-size: 21px;
+ line-height: 1.5;
+}
+.art-body-inner a:hover {
+ border-bottom: 1px solid #F40034;
+ padding-bottom:2px;
+}
+.art-body-inner ul,
+.art-body-inner ol { /* For lists in the article body */
+ margin-bottom: 26px;
+}
+.art-body-inner ul li {
+ list-style: disc;
+}
+
+.art-body-inner mark {
+ background-color: #fdffb6;
+ padding: 2px;
+ -webkit-box-shadow: #fdffb6 0 0 5px;
+ -moz-box-shadow: #fdffb6 0 0 5px;
+ box-shadow: #fdffb6 0 0 5px;
+}
+
+.art-body-inner blockquote {
+ font-size: 16px;
+ background: #f9f9f9;
+ border-left: 10px solid #ccc;
+ margin: 1.5em 10px;
+ padding: 0.5em 10px;
+ quotes: "\201C""\201D""\2018""\2019";
+}
+
+.art-body-inner blockquote p:first-child:before {
+ color: #ccc;
+ content: "“";
+ font-size: 4em;
+ line-height: 0.1em;
+ margin-right: 0.25em;
+ vertical-align: -0.4em;
+}
+
+.art-body-inner blockquote p {
+ margin-bottom: 1.5em;
+}
+
+.art-body-inner blockquote p:last-child {
+ margin-bottom: 0;
+}
+
+
+.dropcap { /* First character on articles */
+ float: left;
+ margin: 47px 10px 20px 0;
+ font-size: 100px;
+ line-height: 0;
+}
+.art-subhead { /* Subheads are used to break up sections of an article */
+ margin: 60px 0 15px;
+ font-size: 20px;
+ line-height: 28px;
+ letter-spacing: 3px;
+}
+.callout { /* Callouts are like large pullquotes */
+ font-weight: bold;
+}
+.art-body-inner img {
+ max-width: 100%;
+ max-height: 600px;
+ margin-bottom: 26px;
+}
+.art-body-inner img.center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.art-body-inner .art-reference {
+ font-size: 80%;
+ color: #999;
+ margin-top: 50px;
+}
+
+/* For simple, white background posts */
+.simple .art-body {
+ background: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+}
+
+
+/* List of Articles
+================================================== */
+.art-list {
+ padding: 120px 0 0;
+}
+.art-list-body {
+ position: relative;
+ overflow: hidden;
+}
+.art-list-item {
+ padding: 40px 0;
+ list-style: none;
+ overflow: hidden;
+ border-bottom: 1px solid #ccc;
+}
+.art-list-item:last-child {
+ border-bottom: none;
+}
+.art-list-title {
+ font-size: 26px;
+ line-height: 26px;
+ font-weight: 700;
+}
+.art-list-item-title-and-time {
+ float: left;
+ width: 30%;
+ margin-bottom: 10px;
+}
+.art-list-time {
+ font-size: 12px;
+ line-height: 20px;
+ letter-spacing: 2px;
+ text-transform: uppercase;
+ color: #999;
+}
+.art-list-title a {
+ color: #000;
+}
+.art-list-title a:hover {
+ color: #F40034;
+}
+.art-list-item p {
+ width: 65%;
+ float: left;
+ margin-left: 5%;
+ margin-bottom: 0;
+ font-size: 16px;
+ line-height: 24px;
+}
+
+
+/* Footer
+================================================== */
+.footer {
+ padding: 30px 0 40px;
+ overflow: hidden;
+ border-top: 1px solid #ccc;
+}
+.footer,
+.footer a {
+ font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif;
+ font-size: 13px;
+ text-transform: uppercase;
+ color: #777;
+}
+.footer a:hover {
+ color: #000;
+}
+.back-to-top,
+.footer-nav,
+.offsite-links {
+ width: 45%;
+ float: left;
+}
+.psi {
+ width:10%;
+ float:left;
+ text-align: center;
+}
+.footer-nav {
+ text-align: center;
+}
+.offsite-links {
+ text-align: right;
+}
+.footer .twitter-link:hover {
+ color: #0084B4;
+}
+.footer .instagram-link:hover {
+ color: #3F729B;
+}
+.footer .github-link:hover {
+ color: #c5376d;
+}
+.footer .caffein8-link:hover{
+ color: black;
+}
+.footer .rss-link:hover {
+ color: #e85d24;
+}
+/* Remove prev & next links on loop */
+.art-list + .footer .footer-nav,
+.abt + .footer .footer-nav {
+ text-indent: -9999px;
+ text-align: left;
+}
+
+
+/* White Reverse Theme
+================================================== */
+/* Nav */
+.nav.white {
+ border-bottom-color: #fff;
+ border-bottom-color: rgba(255,255,255,.3);
+}
+.nav.white li a,
+.nav.white li,
+.nav.white #logo h1 {
+ color: #fff;
+ text-shadow: 0 0 8px rgba(0,0,0,.5);
+}
+.nav.white #logo h1 {
+ background-position: top center;
+}
+
+nav.pagination{
+ text-align: right;
+ padding-bottom: 25px;
+}
+/* Art header */
+.art-header.white {
+ background-color: #111;
+}
+.art-header.white .art-time,
+.art-header.white .art-title,
+.art-header.white .art-subtitle {
+ color: #fff;
+ text-shadow: 0 0 8px rgba(0,0,0,.5);
+}
+
+
+/* About page
+================================================== */
+.abt {
+ padding: 200px 0 100px;
+ list-style: none;
+}
+.abt .abt-header {
+ font-size: 140px;
+ line-height: 1;
+ text-transform: none;
+}
+.abt .abt-subheader {
+ font-size: 24px;
+ font-style: italic;
+ text-transform: none;
+ color: #777;
+}
+.abt-body {
+ -moz-column-count: 2;
+ -moz-column-gap: 20px;
+ -webkit-column-count: 2;
+ -webkit-column-gap: 20px;
+ margin-bottom: 28px;
+}
+.abt-signoff {
+ line-height: 1.3;
+ font-style: italic;
+ color: #777;
+}
+
+/* 404 page
+================================================== */
+.fourohfour {
+ padding: 240px 0 100px;
+ text-align: center;
+}
+
+/* Code
+================================================== */
+
+code, tt {
+background: #ededee;
+color: #3C4043;
+font-size: 90%;
+padding: 1px 3px;
+}
+
+pre {
+ width: 92%;
+ overflow: auto;
+ margin: 2rem 0;
+ padding: 1rem 0.8rem 1rem 1.2rem;
+ color: #3f3b36;
+ border: 1px solid #ccc;
+ border-left: 1rem solid #ccc;
+ font: lighter 1.2rem/2rem monospace;
+ background: url(/assets/img/pre.png) repeat 0 -0.9rem;
+ background-size: 1px 4rem;
+}
+
+pre code, tt {
+font-size: inherit;
+white-space: -moz-pre-wrap;
+white-space: pre-wrap;
+background: transparent;
+border: none;
+padding: 0;
+}
+
+
+.gist {
+ font-size: 14px;
+}
+
+
+/* Responsive
+================================================== */
+@media only screen and (max-width: 1080px) {
+ /* Set all of the 980 containers to flexible width */
+ .nav,
+ .art-body-inner,
+ .art-header-inner,
+ .footer,
+ .art-list,
+ .abt,
+ .fourohfour {
+ width: 90%;
+ }
+ .nav,
+ .art-header-inner {
+ margin-left: -45%;
+ }
+}
+
+@media only screen and (max-width: 1024px) {
+ /* Everything becomes scrolling and non-fading */
+ .nav,
+ .nav.fixed {
+ position: relative;
+ opacity: 1 !important; /* Important to override JS values */
+ display: inline-block;
+ }
+ .art-header-inner {
+ position: relative;
+ top: 0 !important; /* Important to override JS values */
+ margin-top: 240px !important; /* Important to override JS values */
+ opacity: 1 !important; /* Important to override JS values */
+ }
+ /* Articles no longer have fixed heights */
+ .art-header {
+ height: auto;
+ padding-bottom: 100px;
+ background-size: cover !important;
+ background-attachment: scroll;
+ }
+ /* Remove bottom space out if articles doesn't have a background */
+ .simple .art-header {
+ padding-bottom: 0;
+ }
+ .art-list {
+ padding-top: 0;
+ }
+ .abt {
+ padding: 40px 0;
+ }
+ .fourohfour {
+ padding: 80px 0 60px;
+ }
+}
+
+@media only screen and (max-width: 780px) {
+ .art-body-inner ul,
+ .art-body-inner ol {
+ margin-left: 20px;
+ }
+ .art-title {
+ letter-spacing: 0;
+ }
+ .art-subtitle,
+ .art-time {
+ font-size: 12px;
+ }
+ .nav {
+ padding-top: 25px;
+ height: 55px;
+ }
+ .art-list-item-title-and-time,
+ .art-list-item p {
+ float: none;
+ width: auto;
+ margin-left: 0;
+ }
+ .abt-body {
+ -moz-column-count: 1;
+ -webkit-column-count: 1;
+ }
+}
+
+@media only screen and (max-width: 500px) {
+ .nav-primary li {
+ margin-left: 10px;
+ }
+ .nav #logo h1 {
+ font-size: 16px;
+ letter-spacing: -1px;
+ }
+ .nav li a {
+ font-size: 12px;
+ }
+ .art-header {
+ padding-bottom: 50px;
+ }
+ .art-header-inner {
+ margin-top: 190px !important;
+ }
+ .art-body-inner {
+ padding-top: 30px;
+ }
+ body {
+ font-size: 15px;
+ line-height: 24px;
+ }
+ p {
+ margin-bottom: 24px;
+ }
+ .footer {
+ padding: 10px 0 20px;
+ }
+ .back-to-top,
+ .footer-nav {
+ width: 50%;
+ }
+ .back-to-top {
+ text-align: left;
+ }
+ .footer-nav {
+ text-align: right;
+ }
+ .offsite-links {
+ float: left;
+ width: 100%;
+ text-align: left;
+ }
+ .offsite-links a {
+ font-size: 12px;
+ }
+ .art-list + .footer .footer-nav {
+ display: none;
+ }
+ .abt .abt-header {
+ font-size: 80px;
+ }
+ .abt .abt-subheader {
+ font-size: 18px;
+ }
+}
+
+
+/* Misc
+================================================== */
+::selection {
+ background: #000;
+ color: #fff;
+}
+::-moz-selection {
+ background: #000;
+ color: #fff;
+}
+img.left {
+ float: left;
+ margin-right: 20px;
+}
+img.right {
+ float: right;
+ margin-left: 20px;
+}
+/* Clearfixing pile */
+.nav:before,
+.art-body-inner:before,
+.footer:before,
+.art-list:before {
+ content:"";
+ display:table;
+}
+.nav:after,
+.art-body-inner:after,
+.footer:after,
+.art-list:after {
+ clear:both;
+}
+.nav,
+.art-body-inner,
+.footer,
+.art-list {
+ zoom:1; /* For IE 6/7 (trigger hasLayout) */
+}
+
+
+@-webkit-keyframes le-fade {
+ 0% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+@-moz-keyframes le-fade {
+ 0% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+
+.art-header-inner {
+ -webkit-animation: le-fade .5s 0 1 ease-out;
+ -moz-animation: le-fade .5s 0 1 ease-out;
+}
+
+.art-list,
+.nav,
+.abt,
+.art-body {
+ -webkit-animation: le-fade .5s 0s 1 ease-out;
+ -moz-animation: le-fade .5s 0s 1 ease-out;
+}
+
+hr.featured-article {
+ padding: 0;
+ border: none;
+ border-top: medium double #bbb;
+ color: #bbb;
+ text-align: center;
+}
+hr.featured-article:after {
+ content: "✭ Featured Article ✭";
+ display: inline-block;
+ position: relative;
+ top: -0.8em;
+ font-size: 1.2em;
+ padding: 0 0.6em;
+ background: white;
+}
+
+/* FORM */
+
+#contact-area {
+ width: 600px;
+ margin-top: 25px;
+}
+
+#contact-area input, #contact-area textarea {
+ padding: 5px;
+ width: 471px;
+ font-family: Helvetica, sans-serif;
+ margin: 0px 0px 10px 0px;
+ border: 2px solid #ccc;
+}
+
+#contact-area textarea {
+ height: 90px;
+}
+
+#contact-area textarea:focus, #contact-area input:focus {
+ border: 2px solid #900;
+}
+
+#contact-area input.submit-button {
+ width: 100px;
+
+}
+
+label {
+ float: left;
+ text-align: right;
+ margin-right: 15px;
+ width: 100px;
+ padding-top: 5px;
+}
+
+.datagrid table { border-collapse: collapse; text-align: left; width: 100%; }
+ .datagrid {font: normal 12px/150% Arial, Helvetica, sans-serif; background: #fff; overflow: hidden; border: 1px solid #8C8C8C; }
+ .datagrid table td, .datagrid table th { padding: 3px 10px; }
+ .datagrid table thead th {background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #8C8C8C), color-stop(1, #7D7D7D) );background:-moz-linear-gradient( center top, #8C8C8C 5%, #7D7D7D 100% );filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8C8C8C', endColorstr='#7D7D7D');background-color:#8C8C8C; color:#FFFFFF; font-size: 15px; font-weight: bold; }
+ .datagrid table thead th:first-child { border: none; }.datagrid table tbody td { color: #7D7D7D; font-size: 12px;font-weight: normal; }
+ .datagrid table tbody .alt td { background: #EBEBEB; color: #7D7D7D; }
+ .datagrid table tbody td:first-child { border-left: none; }
+ .datagrid table tbody tr:last-child td { border-bottom: none; }
+ .datagrid table tfoot td div { border-top: 1px solid #8C8C8C;background: #EBEBEB;}
+ .datagrid table tfoot td { padding: 0; font-size: 12px } .datagrid table tfoot td div{ padding: 2px; }.datagrid table tfoot td ul { margin: 0; padding:0; list-style: none; text-align: right; }.datagrid table tfoot li { display: inline; }.datagrid table tfoot li a { text-decoration: none; display: inline-block; padding: 2px 8px; margin: 1px;color: #F5F5F5;border: 1px solid #8C8C8C;-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #8C8C8C), color-stop(1, #7D7D7D) );background:-moz-linear-gradient( center top, #8C8C8C 5%, #7D7D7D 100% );filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8C8C8C', endColorstr='#7D7D7D');background-color:#8C8C8C; }.datagrid table tfoot ul.active, .datagrid table tfoot ul a:hover { text-decoration: none;border-color: #7D7D7D; color: #F5F5F5; background: none; background-color:#8C8C8C;}div.dhtmlx_window_active, div.dhx_modal_cover_dv { position: fixed !important; }
\ No newline at end of file
diff --git a/build/web/assets/img/favicon.ico b/build/web/assets/img/favicon.ico
new file mode 100644
index 00000000..40b40ed3
Binary files /dev/null and b/build/web/assets/img/favicon.ico differ
diff --git a/build/web/assets/img/pre.png b/build/web/assets/img/pre.png
new file mode 100644
index 00000000..7f48517b
Binary files /dev/null and b/build/web/assets/img/pre.png differ
diff --git a/build/web/delete.jsp b/build/web/delete.jsp
new file mode 100644
index 00000000..1b142cd1
--- /dev/null
+++ b/build/web/delete.jsp
@@ -0,0 +1,16 @@
+<%--
+ Document : delete.jsp
+ Created on : Nov 25, 2014, 11:22:55 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ DELETE FROM `simpleblog-java`.`posts` WHERE id=<%= request.getParameter("post") %> ;
+
+
diff --git a/build/web/deleteNonAdmin.jsp b/build/web/deleteNonAdmin.jsp
new file mode 100644
index 00000000..3f1eb102
--- /dev/null
+++ b/build/web/deleteNonAdmin.jsp
@@ -0,0 +1,15 @@
+<%--
+ Document : deleteNonAdmin
+ Created on : Nov 25, 2014, 11:29:57 PM
+ Author : M. Reza Irvanda
+--%>
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ UPDATE `simpleblog-java`.`posts` SET `deleted` = '1' WHERE `posts`.`id`=<%= request.getParameter("post") %> ;
+
+
diff --git a/build/web/gfv3ee6.dpf b/build/web/gfv3ee6.dpf
new file mode 100644
index 00000000..e69de29b
diff --git a/build/web/index.xhtml b/build/web/index.xhtml
new file mode 100644
index 00000000..ac71b81e
--- /dev/null
+++ b/build/web/index.xhtml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simple Blog
+
+
+
+
+
+
+
+
+ Simple- Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
#{a.date}
+
#{a.author}
+
+ #{a.konten}
+
+ Edit | Delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/web/insert_comment.jsp b/build/web/insert_comment.jsp
new file mode 100644
index 00000000..3a3a64ab
--- /dev/null
+++ b/build/web/insert_comment.jsp
@@ -0,0 +1,20 @@
+<%--
+ Document : insert_comment
+ Created on : Nov 25, 2014, 9:44:42 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ page import="com.mysql.jdbc.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ INSERT INTO komentar(id_post,tanggal,nama,email, konten) VALUES(<%= request.getParameter("post")%>,NOW(),"<%= request.getParameter("Nama")%>","<%= request.getParameter("Email")%>","<%= request.getParameter("Komentar")%>");
+
+
+
+ <%= request.getParameter("nama")%>,<%= request.getParameter("email")%>,<%= request.getParameter("konten")%>
+
\ No newline at end of file
diff --git a/build/web/view_post.jsp b/build/web/view_post.jsp
new file mode 100644
index 00000000..c0f505a1
--- /dev/null
+++ b/build/web/view_post.jsp
@@ -0,0 +1,51 @@
+<%--
+ Document : view_post
+ Created on : Nov 25, 2014, 1:03:30 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+
+View Post
+
+
+
+
+
+
+ SELECT id,judul,konten,tanggal FROM posts;
+
+
+
+
+
+
+
+
+
+
+
+ Edit | ">Hapus |
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/web/view_singular_post.jsp b/build/web/view_singular_post.jsp
new file mode 100644
index 00000000..cbc61038
--- /dev/null
+++ b/build/web/view_singular_post.jsp
@@ -0,0 +1,213 @@
+<%--
+ Document : view_singular_post
+ Created on : Nov 25, 2014, 4:28:40 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+
+
+
+
+
+ View Singular Post
+
+
+
+
+ <%
+ Cookie cookie = null;
+ Cookie[] cookies = null;
+ String nilaiNama ="";
+ String nilaiEmail ="";
+
+ cookies = request.getCookies();
+ if(cookies.length == 0){
+ //do nothing
+ }
+ else{
+// cookie = cookies[0];
+// nilaiNama = cookie.getValue().toString();
+ for(Cookie tmp : cookies){
+ if(tmp.getName().equalsIgnoreCase("username")){
+ nilaiNama = tmp.getValue().toString();
+ break;
+ }
+ }
+ }
+ %>
+
+
+ SELECT * FROM posts WHERE id=<%= request.getParameter("post") %> ;
+
+
+
+ SELECT * FROM komentar WHERE id_post=<%= request.getParameter("post") %> ORDER BY id DESC ;
+
+
+
+ SELECT username,email FROM users WHERE username="<%= nilaiNama %>" LIMIT 1 ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Komentar
+
+
+ Ada kesalahan!
+
+ Submit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/Simple-Blog.war b/dist/Simple-Blog.war
new file mode 100644
index 00000000..a349c2c0
Binary files /dev/null and b/dist/Simple-Blog.war differ
diff --git a/index.html b/index.html
deleted file mode 100644
index 07cff0ba..00000000
--- a/index.html
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Simple Blog
-
-
-
-
-
-
-
-
- Simple- Blog
-
-
-
-
-
-
-
-
-
-
-
15 Juli 2014
-
✭ Featured
-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …
-
- Edit | Hapus
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …
-
- Edit | Hapus
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
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..752431b7
--- /dev/null
+++ b/nbproject/build-impl.xml
@@ -0,0 +1,1444 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+ Must select one file in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
new file mode 100644
index 00000000..5ffda745
--- /dev/null
+++ b/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=fc04f2ea
+build.xml.script.CRC32=36fbb5af
+build.xml.stylesheet.CRC32=651128d4@1.65.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=fc04f2ea
+nbproject/build-impl.xml.script.CRC32=0cb36e86
+nbproject/build-impl.xml.stylesheet.CRC32=d659eb7a@1.65.1.1
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
new file mode 100644
index 00000000..60178056
--- /dev/null
+++ b/nbproject/private/private.properties
@@ -0,0 +1,10 @@
+deploy.ant.properties.file=C:\\Users\\LENOVO\\AppData\\Roaming\\NetBeans\\8.0.1\\config\\GlassFishEE6\\Properties\\gfv3-85917346.properties
+j2ee.platform.is.jsr109=true
+j2ee.server.domain=C:/Users/LENOVO/AppData/Roaming/NetBeans/8.0.1/config/GF_4.1/domain1
+j2ee.server.home=C:/Program Files/glassfish-4.1/glassfish
+j2ee.server.instance=[C:\\Program Files\\glassfish-4.1\\glassfish;C:\\Program Files\\glassfish-4.1\\glassfish\\domains\\domain1]deployer:gfv3ee6:localhost:4848
+j2ee.server.middleware=C:/Program Files/glassfish-4.1
+javac.debug=true
+javadoc.preview=true
+selected.browser=default
+user.properties.file=C:\\Users\\LENOVO\\AppData\\Roaming\\NetBeans\\8.0.1\\build.properties
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
new file mode 100644
index 00000000..fed37158
--- /dev/null
+++ b/nbproject/private/private.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+ file:/C:/Users/M.%20Reza%20Irvanda/Documents/NetBeansProjects/Simple-Blog/web/index.xhtml
+ file:/C:/Users/M.%20Reza%20Irvanda/Documents/NetBeansProjects/Simple-Blog/web/view_post.jsp
+
+
+
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644
index 00000000..d6724aaf
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,91 @@
+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
+auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets
+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
+# Files to be excluded from distribution war
+dist.archive.excludes=
+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=
+file.reference.mysql-connector-java-5.0.8-bin.jar=D:\\MendingNgoding\\Java\\jars\\mysql-connector-java-5.0.8\\mysql-connector-java-5.0.8-bin.jar
+includes=**
+j2ee.compile.on.save=true
+j2ee.copy.static.files.on.save=true
+j2ee.deploy.on.save=true
+j2ee.platform=1.7-web
+j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.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.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.platform.wsit.classpath=
+j2ee.server.type=gfv3ee6
+jar.compress=true
+javac.classpath=\
+ ${file.reference.mysql-connector-java-5.0.8-bin.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.debug=true
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.preview=true
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+lib.dir=${web.docbase.dir}/WEB-INF/lib
+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=Simple-Blog.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..fb8ca6fe
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,23 @@
+
+
+ org.netbeans.modules.web.project
+
+
+ Simple-Blog
+ 1.6.5
+
+
+ ${file.reference.mysql-connector-java-5.0.8-bin.jar}
+ WEB-INF/lib
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/post.html b/post.html
deleted file mode 100644
index c0b6f9e6..00000000
--- a/post.html
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Simple Blog | Apa itu Simple Blog?
-
-
-
-
-
-
-
-
- Simple- Blog
-
-
-
-
-
-
-
-
-
-
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis aliquam minus consequuntur amet nulla eius, neque beatae, nostrum possimus, officiis eaque consectetur. Sequi sunt maiores dolore, illum quidem eos explicabo! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam consequuntur consequatur molestiae saepe sed, incidunt sunt inventore minima voluptatum adipisci hic, est ipsa iste. Nobis, aperiam provident quae. Reprehenderit, iste.
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores animi tenetur nam delectus eveniet iste non culpa laborum provident minima numquam excepturi rem commodi, officia accusamus eos voluptates obcaecati. Possimus?
-
-
-
-
Komentar
-
-
-
- Nama:
-
-
- Email:
-
-
- Komentar:
-
-
-
-
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/readme.md b/readme.md
deleted file mode 100644
index 5e7e48f5..00000000
--- a/readme.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# Simple Blog Java
-
-Tugas 2 IF3110.
-
-
-
-## Deskripsi
-
-Gunakan template ini untuk membuat sebuah blog sederhana dengan menggunakan bahasa pemrograman PHP.
-
-## Spesifikasi
-
-Spesifikasi untuk Tugas II IF3110 dapat diakses pada pranala berikut:
-
-https://www.dropbox.com/sh/ig1hf108ad9fqxi/AAA2PMjPFICSFo3ypdrHl39La?dl=0
-
-## Deliverable
-
-Tiap-tiap Kelompok Membuat Organizationnya masing-masing, dengan langkah:
-
-1. Klik tanda Tambah disamping username pada Github, Pilih Create New Organization
-
-2. Buat Organisasi dengan Nama : IF3110-II-Nomor_Kelompok . Nomor Kelompok dapat diakses [disini](https://docs.google.com/spreadsheets/d/1Y-FGJ_feIVYNRv-o0ycBXyfAiKMFXKA17cvw3Mhjd1A/edit?usp=sharing)
-
-3. Masukkan email address salah satu anggota untuk billing email ( bebas ).
-
-4. Undang anggota kelompok untuk menjadi anggota Organisasi.
-
-5. Lakukan Fork Repository ini ke Organisasi yang baru dibentuk
-
-6. Setelah selesai mengerjakan, lakukan Pull Request.
-
-## Lisensi
-
-© 2014 Asisten IF3110
-
-Yogi | [Sonny](http://github.com/sonnylazuardi) | Fathan | Renusa | Kelvin | Yanuar
-
-Dosen: [Yudistira Dwi Wardhana](http://github.com/yudis)
\ No newline at end of file
diff --git a/sql/simpleblog-java.sql b/sql/simpleblog-java.sql
new file mode 100644
index 00000000..c88886d6
--- /dev/null
+++ b/sql/simpleblog-java.sql
@@ -0,0 +1,121 @@
+-- phpMyAdmin SQL Dump
+-- version 4.2.7.1
+-- http://www.phpmyadmin.net
+--
+-- Host: 127.0.0.1
+-- Generation Time: Dec 01, 2014 at 09:07 PM
+-- Server version: 5.5.40
+-- PHP Version: 5.5.15
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!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: `simpleblog-java`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `komentar`
+--
+
+CREATE TABLE IF NOT EXISTS `komentar` (
+`id` int(11) NOT NULL,
+ `id_post` int(11) NOT NULL,
+ `tanggal` date NOT NULL,
+ `nama` varchar(128) NOT NULL,
+ `email` varchar(128) NOT NULL,
+ `konten` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `posts`
+--
+
+CREATE TABLE IF NOT EXISTS `posts` (
+`id` int(11) NOT NULL,
+ `judul` varchar(256) NOT NULL,
+ `konten` text NOT NULL,
+ `penulis` varchar(128) NOT NULL,
+ `tanggal` date NOT NULL,
+ `deleted` tinyint(1) NOT NULL,
+ `published` tinyint(1) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `users`
+--
+
+CREATE TABLE IF NOT EXISTS `users` (
+`id` int(11) NOT NULL,
+ `username` varchar(20) NOT NULL,
+ `password` varchar(30) NOT NULL,
+ `email` varchar(30) NOT NULL,
+ `role` varchar(12) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
+
+--
+-- Indexes for dumped tables
+--
+
+--
+-- Indexes for table `komentar`
+--
+ALTER TABLE `komentar`
+ ADD PRIMARY KEY (`id`), ADD KEY `id_post` (`id_post`);
+
+--
+-- Indexes for table `posts`
+--
+ALTER TABLE `posts`
+ ADD PRIMARY KEY (`id`);
+
+--
+-- Indexes for table `users`
+--
+ALTER TABLE `users`
+ ADD PRIMARY KEY (`id`);
+
+--
+-- AUTO_INCREMENT for dumped tables
+--
+
+--
+-- AUTO_INCREMENT for table `komentar`
+--
+ALTER TABLE `komentar`
+MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
+--
+-- AUTO_INCREMENT for table `posts`
+--
+ALTER TABLE `posts`
+MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
+--
+-- AUTO_INCREMENT for table `users`
+--
+ALTER TABLE `users`
+MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=15;
+--
+-- Constraints for dumped tables
+--
+
+--
+-- Constraints for table `komentar`
+--
+ALTER TABLE `komentar`
+ADD CONSTRAINT `komentar_ibfk_1` FOREIGN KEY (`id_post`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+/*!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/java/Config.java b/src/java/Config.java
new file mode 100644
index 00000000..0d61d135
--- /dev/null
+++ b/src/java/Config.java
@@ -0,0 +1,15 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+/**
+ *
+ * @author Fahziar
+ */
+public class Config {
+ public static final String dbUsername = "root";
+ public static final String dbPassword = "root";
+ public static final String dbHost = "localhost";
+ public static final String dbName = "simpleblog-java";
+}
diff --git a/src/java/User.java b/src/java/User.java
new file mode 100644
index 00000000..8f9fca44
--- /dev/null
+++ b/src/java/User.java
@@ -0,0 +1,243 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+/**
+ *
+ * @author Fahziar
+ */
+
+import java.io.Closeable;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public class User {
+ private String username;
+ private String password;
+ private String role;
+ private String email;
+
+ public User()
+ {
+ role="guest";
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public String getRole()
+ {
+ return role;
+ }
+
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public void setRole(String role)
+ {
+ this.role = role;
+
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ public boolean loginFromCookie(String username)
+ {
+ boolean out = false;
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("SELECT * FROM users where username=?");
+ preparedStatement.setString(1, username);
+ resultSet = preparedStatement.executeQuery();
+
+ if (resultSet.last())
+ {
+ this.username = username;
+ password = resultSet.getString("password");
+ email = resultSet.getString("email");
+ role = resultSet.getString("role");
+ out = true;
+ System.out.println("Login dari cookie berhasil");
+ }
+ } catch (SQLException e)
+ {
+ System.out.println("Failed to fetch users" + e.getSQLState());
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+
+ }
+ return out;
+ }
+
+ public boolean login(String username, String password)
+ {
+ boolean out = false;
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+
+ Class.forName("com.mysql.jdbc.Driver");
+ System.out.println("Hello");
+ connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("SELECT * FROM users where `username`=? AND `password`=?");
+ preparedStatement.setString(1, username);
+ preparedStatement.setString(2, password);
+ resultSet = preparedStatement.executeQuery();
+
+ if (resultSet.last())
+ {
+ this.username = username;
+ this.password = resultSet.getString("password");
+ email = resultSet.getString("email");
+ role = resultSet.getString("role");
+ out = true;
+ System.out.println("Login berhasil");
+ }
+
+ } catch (SQLException e)
+ {
+ System.out.println("Failed to fetch users" + e.getMessage());
+
+ }catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+ return out;
+ }
+
+
+ public boolean updateUser()
+ {
+ boolean out = false;
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("UPDATE `users` SET `password`=?, `role`=? WHERE `username`=?");
+ preparedStatement.setString(1, password);
+ preparedStatement.setString(2, role);
+ preparedStatement.setString(3, username);
+
+ if (preparedStatement.executeUpdate() > 0)
+ {
+ out = true;
+ System.out.println("Update pengguna berhasil");
+ }
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+
+ return out;
+ }
+
+ public void delete()
+ {
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("DELETE from `users` WHERE `username`=?");
+ preparedStatement.setString(1, this.username);
+
+ if (preparedStatement.executeUpdate() > 0)
+ {
+ username = "";
+ password = "";
+ role = "guest";
+ email = "";
+ System.out.println("Hapus pengguna berhasil");
+ }
+
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+ }
+ private void Close(ResultSet r, PreparedStatement p, Connection c)
+ {
+ if (r != null)
+ {
+ try{
+ r.close();
+ } catch (Exception e)
+ {
+ }
+ }
+
+ if (p != null)
+ {
+ try{
+ p.close();
+ } catch (Exception e)
+ {
+ }
+ }
+ if (c != null)
+ {
+ try{
+ c.close();
+ } catch (Exception e)
+ {
+
+ }
+ }
+ }
+
+}
+
diff --git a/src/java/UserBean.java b/src/java/UserBean.java
new file mode 100644
index 00000000..2c5d6721
--- /dev/null
+++ b/src/java/UserBean.java
@@ -0,0 +1,271 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.RequestScoped;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * @author Fahziar
+ */
+@ManagedBean(eager=true)
+@RequestScoped
+public class UserBean {
+
+
+ @ManagedProperty(value="#{username}")
+ private String username;
+ @ManagedProperty(value="#{password}")
+ private String password;
+ @ManagedProperty(value="#{role}")
+ private String role;
+ @ManagedProperty(value="#{email}")
+ private String email;
+ private boolean lastLoginFailed;
+ private boolean justLoggedIn;
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setRole(String role)
+ {
+ this.role = role;
+ }
+
+ public String getRole()
+ {
+ return role;
+ }
+
+ public UserBean()
+ {
+ System.out.println("UserBean");
+ username = "";
+ password = "";
+ email = "";
+ role = "guest";
+ lastLoginFailed = false;
+ justLoggedIn = false;
+
+ Cookie cookie = loadCookie();
+
+ if (cookie != null)
+ {
+
+ User user = new User();
+ if (user.loginFromCookie(cookie.getValue()))
+ {
+ username = user.getUsername();
+ password = user.getPassword();
+ email = user.getEmail();
+ this.role = user.getRole();
+ System.out.println(role);
+
+
+ } else {
+ cookie.setMaxAge(0);
+ ((HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse()).addCookie(cookie);
+
+ }
+ }
+ }
+
+ private Cookie loadCookie()
+ {
+ System.out.println("Load cookie");
+ Cookie out = null;
+ HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+
+ Cookie[] cookies = request.getCookies();
+
+ int i;
+ if (cookies != null)
+ {
+ for (i=0; i< cookies.length; i++)
+ {
+ if (cookies[i].getName().equalsIgnoreCase("username"))
+ {
+ out = cookies[i];
+ }
+ }
+ }
+
+ return out;
+ }
+
+ private Cookie loadRoleCookie()
+ {
+ System.out.println("Load cookie");
+ Cookie out = null;
+ HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+
+ Cookie[] cookies = request.getCookies();
+
+ int i;
+ for (i=0; i< cookies.length; i++)
+ {
+ if (cookies[i].getName().equalsIgnoreCase("role"))
+ {
+ out = cookies[i];
+ }
+ }
+
+ return out;
+ }
+
+
+ public void login()
+ {
+ System.out.println("Login");
+ User user = new User();
+ System.out.println("Username:" + username);
+ if (user.login(username, password))
+ {
+ role = user.getRole();
+ email = user.getEmail();
+ Cookie cookie = new Cookie("username", username);
+ Cookie roleCookie = new Cookie("role", role);
+ cookie.setMaxAge(36000);
+ roleCookie.setMaxAge(36000);
+ ((HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()).setHeader("Location", "index.xhtml");
+ ((HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()).addCookie(cookie);
+ ((HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()).addCookie(roleCookie);
+ try{
+ FacesContext.getCurrentInstance().getExternalContext().redirect(getAbsoluteContextPath());
+ } catch (Exception e)
+ {
+
+ }
+ } else {
+ username = "";
+ password = "";
+ role = "guest";
+ lastLoginFailed=true;
+ }
+ }
+
+ public void logout()
+ {
+ System.out.println("Logout");
+ Cookie cookie = loadCookie();
+
+ cookie.setMaxAge(0);
+ cookie.setValue("");
+ ((HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()).addCookie(cookie);
+ }
+
+ public boolean isLoggedIn()
+ {
+ System.out.println("isLoggedIn");
+ Cookie cookie = loadCookie();
+ System.out.println(role);
+ if (cookie != null)
+ {
+ User user = new User();
+ user.loginFromCookie(cookie.getValue());
+ if (user.getRole().equalsIgnoreCase("admin") || user.getRole().equalsIgnoreCase("owner") || user.getRole().equalsIgnoreCase("editor"))
+ {
+ return true;
+ } else{
+ return justLoggedIn;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isLastLoginFailed()
+ {
+ return lastLoginFailed;
+ }
+
+ public boolean isAbleToEditPublishedPost()
+ {
+ Cookie role = loadRoleCookie();
+ if (role != null)
+ return role.getValue().equalsIgnoreCase("guest");
+ else
+ return false;
+ }
+
+ public boolean isAdmin()
+ {
+ Cookie role = loadRoleCookie();
+ if (role != null)
+ return role.getValue().equalsIgnoreCase("admin");
+ else
+ return false;
+ }
+
+ public boolean isEditor()
+ {
+ Cookie role = loadRoleCookie();
+ if (role != null)
+ return role.getValue().equalsIgnoreCase("editor");
+ else
+ return false;
+ }
+
+ public boolean isOwner()
+ {
+ Cookie role = loadRoleCookie();
+ if (role != null)
+ return role.getValue().equalsIgnoreCase("owner");
+ else
+ return false;
+ }
+
+ private String getAbsoluteContextPath(){
+ HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(request.getScheme()); //http,https,...
+ buffer.append("://");
+ buffer.append(request.getServerName()); //localhost
+ if (request.getServerPort() != 80){
+ buffer.append(":"); //localhost
+ buffer.append(request.getServerPort()); //8080
+ }
+ if (request.getContextPath() !=""){
+ buffer.append("/");
+ buffer.append(request.getContextPath());
+ }
+ else
+ buffer.append("/");
+ return buffer.toString();
+ }
+
+}
diff --git a/src/java/UserManagementArrayBean.java b/src/java/UserManagementArrayBean.java
new file mode 100644
index 00000000..b7b06961
--- /dev/null
+++ b/src/java/UserManagementArrayBean.java
@@ -0,0 +1,114 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.faces.bean.SessionScoped;
+
+/**
+ *
+ * @author Fahziar
+ */
+@ManagedBean
+@RequestScoped
+public class UserManagementArrayBean {
+
+ /**
+ * Creates a new instance of UserManagementArrayBean
+ */
+
+ private ArrayList users;
+
+ public ArrayList getUsers()
+ {
+ return users;
+ }
+
+ public UserManagementArrayBean() {
+ users = new ArrayList<>();
+ fetchUsers();
+ }
+
+ public void fetchUsers()
+ {
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ users.clear();
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("SELECT * from `users`");
+ resultSet = preparedStatement.executeQuery();
+
+ System.out.println(resultSet.isAfterLast());
+ while (resultSet.next())
+ {
+ UserManagementBean user = new UserManagementBean();
+
+ int id = resultSet.getInt(1);
+ System.out.println("hello");
+ String username = resultSet.getString("username");
+ String password = resultSet.getString("password");
+ String email = resultSet.getString("email");
+ String role = resultSet.getString("role");
+
+
+ user.setId(id);
+ user.setUsername(username);
+ user.setPassword(password);
+ user.setEmail(email);
+ user.setRole(role);
+ users.add(user);
+ System.out.println("Hello");
+ }
+
+
+ } catch (Exception e)
+ {
+ System.out.println("Class UserManagementArrayBean: Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+ }
+
+ private void Close(ResultSet r, PreparedStatement p, Connection c)
+ {
+ if (r != null)
+ {
+ try{
+ r.close();
+ } catch (Exception e)
+ {
+ }
+ }
+
+ if (p != null)
+ {
+ try{
+ p.close();
+ } catch (Exception e)
+ {
+ }
+ }
+ if (c != null)
+ {
+ try{
+ c.close();
+ } catch (Exception e)
+ {
+
+ }
+ }
+ }
+}
diff --git a/src/java/UserManagementBean.java b/src/java/UserManagementBean.java
new file mode 100644
index 00000000..454af148
--- /dev/null
+++ b/src/java/UserManagementBean.java
@@ -0,0 +1,300 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * @author Fahziar
+ */
+@ManagedBean
+@SessionScoped
+public class UserManagementBean {
+
+ /**
+ * Creates a new instance of UserManagementBean
+ */
+
+ public boolean loadBean()
+ {
+ userExist = false;
+ HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ System.out.println("edit mode");
+ if (request.getParameter("user") != null)
+ {
+
+ editMode = loadEditUserPage(request.getParameter("user"));
+
+ }
+ return false;
+ }
+ public UserManagementBean() {
+ userExist = false;
+
+ }
+
+ private int id;
+ private String username;
+ private String password;
+ private String email;
+ private String role;
+ private boolean userExist;
+ private boolean editMode;
+
+ public boolean isEditMode()
+ {
+ return editMode;
+ }
+ public int getId()
+ {
+ return id;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public String getRole()
+ {
+ return role;
+ }
+
+ public boolean isUserExist()
+ {
+ return userExist;
+ }
+
+ public void setId(int id)
+ {
+ this.id = id;
+ }
+
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ public void setRole(String role)
+ {
+ this.role = role;
+ }
+
+ public boolean update()
+ {
+ boolean out = false;
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("UPDATE `users` SET `password`=?, `role`=? WHERE `username`=?");
+ preparedStatement.setString(1, password);
+ preparedStatement.setString(2, role);
+ preparedStatement.setString(3, username);
+
+ if (preparedStatement.executeUpdate() > 0)
+ {
+ out = true;
+ System.out.println("Update pengguna berhasil");
+ }
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+
+ return out;
+ }
+
+
+ public void delete()
+ {
+ System.out.println("Menghapus pengguna: " + username);
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("DELETE from `users` WHERE `username`=?");
+ preparedStatement.setString(1, this.username);
+
+ if (preparedStatement.executeUpdate() > 0)
+ {
+ username = "";
+ password = "";
+ role = "guest";
+ email = "";
+ System.out.println("Hapus pengguna berhasil");
+ FacesContext.getCurrentInstance().getExternalContext().redirect(((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getRequestURI());
+ }
+
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+
+ }
+
+ public void create()
+ {
+ System.out.println("create()");
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("SELECT * FROM `users` WHERE `username`=?");
+ preparedStatement.setString(1, username);
+
+ if (!preparedStatement.executeQuery().last())
+ {
+ preparedStatement = connect.prepareStatement("INSERT INTO `users` (`username`, `password`,`email`, `role`) VALUES (?, ?, ?, ?)");
+ preparedStatement.setString(1, this.username);
+ preparedStatement.setString(2, this.password);
+ preparedStatement.setString(3, this.email);
+ preparedStatement.setString(4, this.role);
+
+ if (preparedStatement.executeUpdate() > 0)
+ {
+ username = "";
+ password = "";
+ role = "guest";
+ email = "";
+ userExist = false;
+ System.out.println("Menambah pengguna berhasil");
+ }
+ } else {
+ userExist = true;
+ }
+
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+ }
+
+ public void processUpdateUser()
+ {
+ if (!editMode)
+ {
+ create();
+ } else {
+ update();
+ }
+ }
+
+ private boolean loadEditUserPage(String username)
+ {
+ boolean out = false;
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("SELECT * FROM `users` WHERE `username`=?");
+ preparedStatement.setString(3, username);
+
+ resultSet = preparedStatement.executeQuery();
+
+ if (resultSet.next())
+ {
+ out = true;
+ this.username = username;
+ this.password = resultSet.getString("password");
+ this.role = resultSet.getString("role");
+ this.email = resultSet.getString("email");
+ System.out.println("Update pengguna berhasil");
+ }
+ } catch (Exception e)
+ {
+ System.out.println("Failed to fetch users");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+
+ return out;
+ }
+ private void Close(ResultSet r, PreparedStatement p, Connection c)
+ {
+ if (r != null)
+ {
+ try{
+ r.close();
+ } catch (Exception e)
+ {
+ }
+ }
+
+ if (p != null)
+ {
+ try{
+ p.close();
+ } catch (Exception e)
+ {
+ }
+ }
+ if (c != null)
+ {
+ try{
+ c.close();
+ } catch (Exception e)
+ {
+
+ }
+ }
+ }
+}
diff --git a/src/java/arrayPostBean.java b/src/java/arrayPostBean.java
new file mode 100644
index 00000000..0d123141
--- /dev/null
+++ b/src/java/arrayPostBean.java
@@ -0,0 +1,120 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+/**
+ *
+ * @author Fahziar
+ */
+@ManagedBean
+@RequestScoped
+public class arrayPostBean {
+
+ /**
+ * Creates a new instance of arrayPostBean
+ */
+
+ private ArrayList posts;
+ public arrayPostBean()
+ {
+ posts = new ArrayList();
+ fetchPosts();
+ }
+
+ public void fetchPosts()
+ {
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+ getPosts().clear();
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("SELECT * from `posts` ORDER BY `tanggal` DESC");
+ resultSet = preparedStatement.executeQuery();
+
+ System.out.println(resultSet.isAfterLast());
+ while (resultSet.next())
+ {
+ postBean post = new postBean();
+
+ int id = resultSet.getInt("id");
+ String judul = resultSet.getString("judul");
+ String konten = resultSet.getString("konten");
+ String author = resultSet.getString("penulis");
+ String tanggal = resultSet.getString("tanggal");
+ boolean published = resultSet.getBoolean("published");
+ boolean deleted = resultSet.getBoolean("deleted");
+
+ System.out.println("Published:" + published);
+ System.out.println("Deleted:" + deleted);
+ post.setId(id);
+ post.setJudul(judul);
+ post.setAuthor(author);
+ post.setKonten(konten);
+ post.setDate(tanggal);
+ post.setPublished(published);
+ post.setDeleted(deleted);
+ System.out.println("Posts published:" + post.isPublished());
+ posts.add(post);
+ }
+
+
+ } catch (Exception e)
+ {
+ System.out.println("Class arrrayPostBean: Failed to fetch posts : " + e.getMessage());
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+ }
+
+ private void Close(ResultSet r, PreparedStatement p, Connection c)
+ {
+ if (r != null)
+ {
+ try{
+ r.close();
+ } catch (Exception e)
+ {
+ }
+ }
+
+ if (p != null)
+ {
+ try{
+ p.close();
+ } catch (Exception e)
+ {
+ }
+ }
+ if (c != null)
+ {
+ try{
+ c.close();
+ } catch (Exception e)
+ {
+
+ }
+ }
+ }
+
+ /**
+ * @return the posts
+ */
+ public ArrayList getPosts() {
+ return posts;
+ }
+
+}
diff --git a/src/java/postBean.java b/src/java/postBean.java
new file mode 100644
index 00000000..a97d6b69
--- /dev/null
+++ b/src/java/postBean.java
@@ -0,0 +1,196 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.faces.bean.SessionScoped;
+
+/**
+ *
+ * @author Fahziar
+ */
+@ManagedBean
+@SessionScoped
+public class postBean {
+
+ /**
+ * Creates a new instance of postBean
+ */
+ public postBean() {
+
+ }
+
+
+ private int id;
+ private String judul;
+ private String konten;
+ private String date;
+ private String author;
+ private boolean deleted;
+ private boolean published;
+
+ /**
+ * @return the judul
+ */
+ public String getJudul() {
+ return judul;
+ }
+
+ /**
+ * @param judul the judul to set
+ */
+ public void setJudul(String judul) {
+ this.judul = judul;
+ }
+
+ /**
+ * @return the konten
+ */
+ public String getKonten() {
+ return konten;
+ }
+
+ /**
+ * @param konten the konten to set
+ */
+ public void setKonten(String konten) {
+ this.konten = konten;
+ }
+
+ /**
+ * @return the date
+ */
+ public String getDate() {
+ return date;
+ }
+
+ /**
+ * @param date the date to set
+ */
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ /**
+ * @return the author
+ */
+ public String getAuthor() {
+ return author;
+ }
+
+ /**
+ * @param author the author to set
+ */
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the deleted
+ */
+ public boolean isDeleted() {
+ return deleted;
+ }
+
+ /**
+ * @param deleted the deleted to set
+ */
+ public void setDeleted(boolean deleted) {
+ this.deleted = deleted;
+ }
+
+ /**
+ * @return the published
+ */
+ public boolean isPublished() {
+ return published;
+ }
+
+ /**
+ * @param published the published to set
+ */
+ public void setPublished(boolean published) {
+ this.published = published;
+ }
+
+ public void delete()
+ {
+ System.out.println("Delete id:" + this.id);
+ Connection connect = null;
+ PreparedStatement preparedStatement = null;
+ ResultSet resultSet = null;
+
+ try
+ {
+ Class.forName("com.mysql.jdbc.Driver");
+
+ connect = DriverManager.getConnection("jdbc:mysql://localhost/" + Config.dbName + "?user=" + Config.dbUsername + "&password=" + Config.dbPassword);
+
+ preparedStatement = connect.prepareStatement("UPDATE `posts` SET `deleted`=1 WHERE id=?");
+
+ if (preparedStatement.executeUpdate() != 0)
+ {
+ this.deleted = true;
+ }
+
+
+ } catch (Exception e)
+ {
+ System.out.println("Class UserManagementArrayBean: Failed to delete post");
+ } finally {
+ Close(resultSet, preparedStatement, connect);
+ }
+ }
+
+ private void Close(ResultSet r, PreparedStatement p, Connection c)
+ {
+ if (r != null)
+ {
+ try{
+ r.close();
+ } catch (Exception e)
+ {
+ }
+ }
+
+ if (p != null)
+ {
+ try{
+ p.close();
+ } catch (Exception e)
+ {
+ }
+ }
+ if (c != null)
+ {
+ try{
+ c.close();
+ } catch (Exception e)
+ {
+
+ }
+ }
+ }
+
+
+}
diff --git a/web/WEB-INF/glassfish-web.xml b/web/WEB-INF/glassfish-web.xml
new file mode 100644
index 00000000..3a44061d
--- /dev/null
+++ b/web/WEB-INF/glassfish-web.xml
@@ -0,0 +1,11 @@
+
+
+
+ /blog
+
+
+
+ Keep a copy of the generated servlet class' java code.
+
+
+
diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml
new file mode 100644
index 00000000..ad614a8a
--- /dev/null
+++ b/web/WEB-INF/web.xml
@@ -0,0 +1,27 @@
+
+
+
+ javax.faces.FACELETS_VIEW_MAPPINGS
+ *.xhtml
+
+
+
+ Faces Servlet
+ javax.faces.webapp.FacesServlet
+ 1
+
+
+
+
+ Faces Servlet
+ *.xhtml
+
+
+
+ 30
+
+
+
+ index.xhtml
+
+
\ No newline at end of file
diff --git a/web/add_user.xhtml b/web/add_user.xhtml
new file mode 100644
index 00000000..eb66472a
--- /dev/null
+++ b/web/add_user.xhtml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+New User - Simple Blog
+
+
+
+
+
+
+
+
+ Simple- Blog
+
+
+
+
+
+ New User
+
+
+ Edit User
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/assets/css/screen.css b/web/assets/css/screen.css
new file mode 100644
index 00000000..57dd7a32
--- /dev/null
+++ b/web/assets/css/screen.css
@@ -0,0 +1,872 @@
+@import url(http://fonts.googleapis.com/css?family=Open+Sans);
+@import url(http://fonts.googleapis.com/css?family=Questrial);
+
+/* Reset & Basics (Inspired by E. Meyers)
+================================================== */
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, address, cite, code, em, img, small, strong, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, embed, figure, figcaption, footer, header, hgroup, menu, nav, section, summary, time, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline; }
+article, aside, details, figcaption, figure, footer, header, hgroup, menu, time, nav, section {
+ display: block; }
+html, body, .wrapper {
+ min-height: 100%;
+}
+
+
+/* Body
+================================================== */
+html, body {
+ height: 100%;
+}
+.wrapper {
+ min-height: 100%;
+}
+body {
+ overflow-x: hidden;
+ font: 17px/28px ff-meta-serif-web-pro, "Georgia", serif;
+ color: #333;
+ background: #fff;
+}
+
+
+/* Typography
+================================================== */
+h1, h2, h3, h4, h5, h6 {
+ font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif;
+ font-weight: normal;
+ text-transform: uppercase;
+ font-weight: 700;
+ color: #000;
+ text-rendering: optimizeLegibility;
+}
+
+h1 {
+ font-size: 50px;
+ padding-bottom: 30px;
+}
+
+h2 {
+ font-size: 45px;
+ padding-bottom: 25px;
+}
+
+h3 {
+ font-size: 40px;
+ padding-bottom: 20px;
+}
+
+h4 {
+ font-size: 35px;
+ padding-bottom: 15px;
+}
+
+h5 {
+ font-size: 30px;
+ padding-bottom: 10px;
+}
+
+p {
+ margin: 0 0 28px 0;
+}
+
+strong {
+ font-weight: bold;
+}
+em {
+ font-style: italic;
+}
+sup {
+ line-height: 0;
+}
+
+small {
+ font-size: 70%;
+}
+
+cite {
+ font-size: 80%;
+ font-style: italic;
+ }
+
+/* Teaser
+================================================== */
+
+header#teaser h1 {
+ text-transform: none !important;
+ color: #333;
+ font-size: 28px !important;
+ font-weight: 300 !important;
+}
+
+
+/* Links
+================================================== */
+a {
+ color: #F40034;
+ text-decoration: none;
+ -webkit-transition: color .2s ease-in-out;
+ -moz-transition: color .2s ease-in-out;
+ transition: color .2s ease-in-out;
+}
+a:hover {
+ color: #F40034;
+}
+
+/* Layout
+================================================== */
+/* White container that is the "page" */
+.wrapper {
+ max-width: 1500px;
+ margin: 0 auto;
+ background: #fff;
+}
+
+/* Containers to keep content to a set width */
+.nav,
+.art-header-inner,
+.footer,
+.art-list,
+.abt,
+.fourohfour {
+ width: 980px;
+}
+.nav,
+.art-body-inner,
+.footer,
+.art-list,
+.abt,
+.fourohfour {
+ position: relative;
+ margin: 0 auto;
+}
+
+/* Nav
+================================================== */
+.nav {
+ position: absolute;
+ top: 0;
+ left: 50%;
+ height: 70px;
+ padding-top: 40px;
+ margin-left: -490px; /* Half width of nav */
+ border-bottom: 1px solid #333;
+ z-index: 2;
+}
+.nav.fixed {
+ position: fixed;
+}
+#logo {
+ float: left;
+}
+.nav-primary {
+ float: right;
+}
+.nav-primary li {
+ display: inline-block;
+ margin-left: 10px;
+ font-weight: 500;
+}
+#logo h1,
+.nav-primary li,
+.nav-primary li a {
+ font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif;
+ font-weight: 700;
+ font-size: 13px;
+ line-height: 30px;
+ color: #000;
+ text-transform: uppercase;
+}
+
+#logo h1 {
+ height: 30px;
+ margin-left: 0px;
+ letter-spacing: 1px;
+ font-family: 'Questrial', sans-serif;
+ font-size: 30px;
+}
+
+#logo h1 span{
+ color: #F40034 !important;
+}
+
+.nav li:first-child {
+ margin-left: 0; /* Remove left margin from the first nav li */
+}
+
+/* Home Page
+================================================== */
+
+div#home {}
+
+#home > div.cover {
+ max-width: 980px;
+ margin: 0px auto;
+ /*padding-top: 110px;*/
+}
+
+div.cover {
+
+}
+
+div.cover > img {
+ width: 100%;
+ height: 100%;
+}
+
+
+/* Article
+================================================== */
+.art {
+ margin-top: -131px;
+}
+/* Header */
+.art-header {
+ height: 900px;
+ /* Background image is defined in the post */
+ background-position: top center;
+ background-attachment: fixed;
+ overflow: hidden;
+}
+/* Contains the time, title and subtitle for an article */
+.art-header-inner {
+ position: fixed;
+ top: 300px;
+ left: 50%;
+ margin-left: -490px;
+}
+.art-time,
+.art-title,
+.art-subtitle {
+ text-align: center;
+ text-transform: uppercase;
+}
+.art-time {
+ font-size: 14px;
+ line-height: 1.8;
+ letter-spacing: 4px;
+}
+.art-title {
+ font-size: 100px;
+ line-height: .9;
+ letter-spacing: -2px;
+ width: 100%;
+}
+.art-subtitle {
+ margin-top: 4px;
+ font-size: 14px;
+ line-height: 1.3;
+ letter-spacing: 4px;
+}
+
+/* If small header, make few adjustments */
+.small .art-title {
+ font-size: 70px;
+ line-height: 65px;
+}
+.small.art-header-inner {
+ top: 320px;
+}
+
+/* Body */
+.art-body {
+ position: relative;
+ width: 100%;
+ background: #fff;
+ z-index: 100;
+ -webkit-box-shadow: 0 -3px 3px rgba(0,0,0,.2);
+ -moz-box-shadow: 0 -3px 3px rgba(0,0,0,.2);
+ box-shadow: 0 -3px 3px rgba(0,0,0,.2);
+}
+.art-body-inner {
+ font-family: Georgia,Cambria,"Times New Roman",Times,serif;
+ max-width: 640px;
+ padding: 80px 0 50px;
+ letter-spacing: 0.01rem;
+ font-weight: 400;
+ font-style: normal;
+ font-size: 21px;
+ line-height: 1.5;
+}
+.art-body-inner a:hover {
+ border-bottom: 1px solid #F40034;
+ padding-bottom:2px;
+}
+.art-body-inner ul,
+.art-body-inner ol { /* For lists in the article body */
+ margin-bottom: 26px;
+}
+.art-body-inner ul li {
+ list-style: disc;
+}
+
+.art-body-inner mark {
+ background-color: #fdffb6;
+ padding: 2px;
+ -webkit-box-shadow: #fdffb6 0 0 5px;
+ -moz-box-shadow: #fdffb6 0 0 5px;
+ box-shadow: #fdffb6 0 0 5px;
+}
+
+.art-body-inner blockquote {
+ font-size: 16px;
+ background: #f9f9f9;
+ border-left: 10px solid #ccc;
+ margin: 1.5em 10px;
+ padding: 0.5em 10px;
+ quotes: "\201C""\201D""\2018""\2019";
+}
+
+.art-body-inner blockquote p:first-child:before {
+ color: #ccc;
+ content: "“";
+ font-size: 4em;
+ line-height: 0.1em;
+ margin-right: 0.25em;
+ vertical-align: -0.4em;
+}
+
+.art-body-inner blockquote p {
+ margin-bottom: 1.5em;
+}
+
+.art-body-inner blockquote p:last-child {
+ margin-bottom: 0;
+}
+
+
+.dropcap { /* First character on articles */
+ float: left;
+ margin: 47px 10px 20px 0;
+ font-size: 100px;
+ line-height: 0;
+}
+.art-subhead { /* Subheads are used to break up sections of an article */
+ margin: 60px 0 15px;
+ font-size: 20px;
+ line-height: 28px;
+ letter-spacing: 3px;
+}
+.callout { /* Callouts are like large pullquotes */
+ font-weight: bold;
+}
+.art-body-inner img {
+ max-width: 100%;
+ max-height: 600px;
+ margin-bottom: 26px;
+}
+.art-body-inner img.center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.art-body-inner .art-reference {
+ font-size: 80%;
+ color: #999;
+ margin-top: 50px;
+}
+
+/* For simple, white background posts */
+.simple .art-body {
+ background: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+}
+
+
+/* List of Articles
+================================================== */
+.art-list {
+ padding: 120px 0 0;
+}
+.art-list-body {
+ position: relative;
+ overflow: hidden;
+}
+.art-list-item {
+ padding: 40px 0;
+ list-style: none;
+ overflow: hidden;
+ border-bottom: 1px solid #ccc;
+}
+.art-list-item:last-child {
+ border-bottom: none;
+}
+.art-list-title {
+ font-size: 26px;
+ line-height: 26px;
+ font-weight: 700;
+}
+.art-list-item-title-and-time {
+ float: left;
+ width: 30%;
+ margin-bottom: 10px;
+}
+.art-list-time {
+ font-size: 12px;
+ line-height: 20px;
+ letter-spacing: 2px;
+ text-transform: uppercase;
+ color: #999;
+}
+.art-list-title a {
+ color: #000;
+}
+.art-list-title a:hover {
+ color: #F40034;
+}
+.art-list-item p {
+ width: 65%;
+ float: left;
+ margin-left: 5%;
+ margin-bottom: 0;
+ font-size: 16px;
+ line-height: 24px;
+}
+
+
+/* Footer
+================================================== */
+.footer {
+ padding: 30px 0 40px;
+ overflow: hidden;
+ border-top: 1px solid #ccc;
+}
+.footer,
+.footer a {
+ font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif;
+ font-size: 13px;
+ text-transform: uppercase;
+ color: #777;
+}
+.footer a:hover {
+ color: #000;
+}
+.back-to-top,
+.footer-nav,
+.offsite-links {
+ width: 45%;
+ float: left;
+}
+.psi {
+ width:10%;
+ float:left;
+ text-align: center;
+}
+.footer-nav {
+ text-align: center;
+}
+.offsite-links {
+ text-align: right;
+}
+.footer .twitter-link:hover {
+ color: #0084B4;
+}
+.footer .instagram-link:hover {
+ color: #3F729B;
+}
+.footer .github-link:hover {
+ color: #c5376d;
+}
+.footer .caffein8-link:hover{
+ color: black;
+}
+.footer .rss-link:hover {
+ color: #e85d24;
+}
+/* Remove prev & next links on loop */
+.art-list + .footer .footer-nav,
+.abt + .footer .footer-nav {
+ text-indent: -9999px;
+ text-align: left;
+}
+
+
+/* White Reverse Theme
+================================================== */
+/* Nav */
+.nav.white {
+ border-bottom-color: #fff;
+ border-bottom-color: rgba(255,255,255,.3);
+}
+.nav.white li a,
+.nav.white li,
+.nav.white #logo h1 {
+ color: #fff;
+ text-shadow: 0 0 8px rgba(0,0,0,.5);
+}
+.nav.white #logo h1 {
+ background-position: top center;
+}
+
+nav.pagination{
+ text-align: right;
+ padding-bottom: 25px;
+}
+/* Art header */
+.art-header.white {
+ background-color: #111;
+}
+.art-header.white .art-time,
+.art-header.white .art-title,
+.art-header.white .art-subtitle {
+ color: #fff;
+ text-shadow: 0 0 8px rgba(0,0,0,.5);
+}
+
+
+/* About page
+================================================== */
+.abt {
+ padding: 200px 0 100px;
+ list-style: none;
+}
+.abt .abt-header {
+ font-size: 140px;
+ line-height: 1;
+ text-transform: none;
+}
+.abt .abt-subheader {
+ font-size: 24px;
+ font-style: italic;
+ text-transform: none;
+ color: #777;
+}
+.abt-body {
+ -moz-column-count: 2;
+ -moz-column-gap: 20px;
+ -webkit-column-count: 2;
+ -webkit-column-gap: 20px;
+ margin-bottom: 28px;
+}
+.abt-signoff {
+ line-height: 1.3;
+ font-style: italic;
+ color: #777;
+}
+
+/* 404 page
+================================================== */
+.fourohfour {
+ padding: 240px 0 100px;
+ text-align: center;
+}
+
+/* Code
+================================================== */
+
+code, tt {
+background: #ededee;
+color: #3C4043;
+font-size: 90%;
+padding: 1px 3px;
+}
+
+pre {
+ width: 92%;
+ overflow: auto;
+ margin: 2rem 0;
+ padding: 1rem 0.8rem 1rem 1.2rem;
+ color: #3f3b36;
+ border: 1px solid #ccc;
+ border-left: 1rem solid #ccc;
+ font: lighter 1.2rem/2rem monospace;
+ background: url(/assets/img/pre.png) repeat 0 -0.9rem;
+ background-size: 1px 4rem;
+}
+
+pre code, tt {
+font-size: inherit;
+white-space: -moz-pre-wrap;
+white-space: pre-wrap;
+background: transparent;
+border: none;
+padding: 0;
+}
+
+
+.gist {
+ font-size: 14px;
+}
+
+
+/* Responsive
+================================================== */
+@media only screen and (max-width: 1080px) {
+ /* Set all of the 980 containers to flexible width */
+ .nav,
+ .art-body-inner,
+ .art-header-inner,
+ .footer,
+ .art-list,
+ .abt,
+ .fourohfour {
+ width: 90%;
+ }
+ .nav,
+ .art-header-inner {
+ margin-left: -45%;
+ }
+}
+
+@media only screen and (max-width: 1024px) {
+ /* Everything becomes scrolling and non-fading */
+ .nav,
+ .nav.fixed {
+ position: relative;
+ opacity: 1 !important; /* Important to override JS values */
+ display: inline-block;
+ }
+ .art-header-inner {
+ position: relative;
+ top: 0 !important; /* Important to override JS values */
+ margin-top: 240px !important; /* Important to override JS values */
+ opacity: 1 !important; /* Important to override JS values */
+ }
+ /* Articles no longer have fixed heights */
+ .art-header {
+ height: auto;
+ padding-bottom: 100px;
+ background-size: cover !important;
+ background-attachment: scroll;
+ }
+ /* Remove bottom space out if articles doesn't have a background */
+ .simple .art-header {
+ padding-bottom: 0;
+ }
+ .art-list {
+ padding-top: 0;
+ }
+ .abt {
+ padding: 40px 0;
+ }
+ .fourohfour {
+ padding: 80px 0 60px;
+ }
+}
+
+@media only screen and (max-width: 780px) {
+ .art-body-inner ul,
+ .art-body-inner ol {
+ margin-left: 20px;
+ }
+ .art-title {
+ letter-spacing: 0;
+ }
+ .art-subtitle,
+ .art-time {
+ font-size: 12px;
+ }
+ .nav {
+ padding-top: 25px;
+ height: 55px;
+ }
+ .art-list-item-title-and-time,
+ .art-list-item p {
+ float: none;
+ width: auto;
+ margin-left: 0;
+ }
+ .abt-body {
+ -moz-column-count: 1;
+ -webkit-column-count: 1;
+ }
+}
+
+@media only screen and (max-width: 500px) {
+ .nav-primary li {
+ margin-left: 10px;
+ }
+ .nav #logo h1 {
+ font-size: 16px;
+ letter-spacing: -1px;
+ }
+ .nav li a {
+ font-size: 12px;
+ }
+ .art-header {
+ padding-bottom: 50px;
+ }
+ .art-header-inner {
+ margin-top: 190px !important;
+ }
+ .art-body-inner {
+ padding-top: 30px;
+ }
+ body {
+ font-size: 15px;
+ line-height: 24px;
+ }
+ p {
+ margin-bottom: 24px;
+ }
+ .footer {
+ padding: 10px 0 20px;
+ }
+ .back-to-top,
+ .footer-nav {
+ width: 50%;
+ }
+ .back-to-top {
+ text-align: left;
+ }
+ .footer-nav {
+ text-align: right;
+ }
+ .offsite-links {
+ float: left;
+ width: 100%;
+ text-align: left;
+ }
+ .offsite-links a {
+ font-size: 12px;
+ }
+ .art-list + .footer .footer-nav {
+ display: none;
+ }
+ .abt .abt-header {
+ font-size: 80px;
+ }
+ .abt .abt-subheader {
+ font-size: 18px;
+ }
+}
+
+
+/* Misc
+================================================== */
+::selection {
+ background: #000;
+ color: #fff;
+}
+::-moz-selection {
+ background: #000;
+ color: #fff;
+}
+img.left {
+ float: left;
+ margin-right: 20px;
+}
+img.right {
+ float: right;
+ margin-left: 20px;
+}
+/* Clearfixing pile */
+.nav:before,
+.art-body-inner:before,
+.footer:before,
+.art-list:before {
+ content:"";
+ display:table;
+}
+.nav:after,
+.art-body-inner:after,
+.footer:after,
+.art-list:after {
+ clear:both;
+}
+.nav,
+.art-body-inner,
+.footer,
+.art-list {
+ zoom:1; /* For IE 6/7 (trigger hasLayout) */
+}
+
+
+@-webkit-keyframes le-fade {
+ 0% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+@-moz-keyframes le-fade {
+ 0% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+
+.art-header-inner {
+ -webkit-animation: le-fade .5s 0 1 ease-out;
+ -moz-animation: le-fade .5s 0 1 ease-out;
+}
+
+.art-list,
+.nav,
+.abt,
+.art-body {
+ -webkit-animation: le-fade .5s 0s 1 ease-out;
+ -moz-animation: le-fade .5s 0s 1 ease-out;
+}
+
+hr.featured-article {
+ padding: 0;
+ border: none;
+ border-top: medium double #bbb;
+ color: #bbb;
+ text-align: center;
+}
+hr.featured-article:after {
+ content: "✭ Featured Article ✭";
+ display: inline-block;
+ position: relative;
+ top: -0.8em;
+ font-size: 1.2em;
+ padding: 0 0.6em;
+ background: white;
+}
+
+/* FORM */
+
+#contact-area {
+ width: 600px;
+ margin-top: 25px;
+}
+
+#contact-area input, #contact-area textarea {
+ padding: 5px;
+ width: 471px;
+ font-family: Helvetica, sans-serif;
+ margin: 0px 0px 10px 0px;
+ border: 2px solid #ccc;
+}
+
+#contact-area textarea {
+ height: 90px;
+}
+
+#contact-area textarea:focus, #contact-area input:focus {
+ border: 2px solid #900;
+}
+
+#contact-area input.submit-button {
+ width: 100px;
+
+}
+
+label {
+ float: left;
+ text-align: right;
+ margin-right: 15px;
+ width: 100px;
+ padding-top: 5px;
+}
+
+.datagrid table { border-collapse: collapse; text-align: left; width: 100%; }
+ .datagrid {font: normal 12px/150% Arial, Helvetica, sans-serif; background: #fff; overflow: hidden; border: 1px solid #8C8C8C; }
+ .datagrid table td, .datagrid table th { padding: 3px 10px; }
+ .datagrid table thead th {background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #8C8C8C), color-stop(1, #7D7D7D) );background:-moz-linear-gradient( center top, #8C8C8C 5%, #7D7D7D 100% );filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8C8C8C', endColorstr='#7D7D7D');background-color:#8C8C8C; color:#FFFFFF; font-size: 15px; font-weight: bold; }
+ .datagrid table thead th:first-child { border: none; }.datagrid table tbody td { color: #7D7D7D; font-size: 12px;font-weight: normal; }
+ .datagrid table tbody .alt td { background: #EBEBEB; color: #7D7D7D; }
+ .datagrid table tbody td:first-child { border-left: none; }
+ .datagrid table tbody tr:last-child td { border-bottom: none; }
+ .datagrid table tfoot td div { border-top: 1px solid #8C8C8C;background: #EBEBEB;}
+ .datagrid table tfoot td { padding: 0; font-size: 12px } .datagrid table tfoot td div{ padding: 2px; }.datagrid table tfoot td ul { margin: 0; padding:0; list-style: none; text-align: right; }.datagrid table tfoot li { display: inline; }.datagrid table tfoot li a { text-decoration: none; display: inline-block; padding: 2px 8px; margin: 1px;color: #F5F5F5;border: 1px solid #8C8C8C;-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #8C8C8C), color-stop(1, #7D7D7D) );background:-moz-linear-gradient( center top, #8C8C8C 5%, #7D7D7D 100% );filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8C8C8C', endColorstr='#7D7D7D');background-color:#8C8C8C; }.datagrid table tfoot ul.active, .datagrid table tfoot ul a:hover { text-decoration: none;border-color: #7D7D7D; color: #F5F5F5; background: none; background-color:#8C8C8C;}div.dhtmlx_window_active, div.dhx_modal_cover_dv { position: fixed !important; }
\ No newline at end of file
diff --git a/web/assets/img/favicon.ico b/web/assets/img/favicon.ico
new file mode 100644
index 00000000..40b40ed3
Binary files /dev/null and b/web/assets/img/favicon.ico differ
diff --git a/web/assets/img/favicon_1.ico b/web/assets/img/favicon_1.ico
new file mode 100644
index 00000000..40b40ed3
Binary files /dev/null and b/web/assets/img/favicon_1.ico differ
diff --git a/web/assets/img/pre.png b/web/assets/img/pre.png
new file mode 100644
index 00000000..7f48517b
Binary files /dev/null and b/web/assets/img/pre.png differ
diff --git a/web/assets/img/pre_1.png b/web/assets/img/pre_1.png
new file mode 100644
index 00000000..7f48517b
Binary files /dev/null and b/web/assets/img/pre_1.png differ
diff --git a/web/delete.jsp b/web/delete.jsp
new file mode 100644
index 00000000..1b142cd1
--- /dev/null
+++ b/web/delete.jsp
@@ -0,0 +1,16 @@
+<%--
+ Document : delete.jsp
+ Created on : Nov 25, 2014, 11:22:55 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ DELETE FROM `simpleblog-java`.`posts` WHERE id=<%= request.getParameter("post") %> ;
+
+
diff --git a/web/deleteNonAdmin.jsp b/web/deleteNonAdmin.jsp
new file mode 100644
index 00000000..f35db804
--- /dev/null
+++ b/web/deleteNonAdmin.jsp
@@ -0,0 +1,15 @@
+<%--
+ Document : deleteNonAdmin
+ Created on : Nov 25, 2014, 11:29:57 PM
+ Author : M. Reza Irvanda
+--%>
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ UPDATE `simpleblog-java`.`posts` SET `deleted` = '1' WHERE `posts`.`id`=<%= request.getParameter("post") %> ;
+
+
diff --git a/new_post.html b/web/edit_post.jsp
similarity index 69%
rename from new_post.html
rename to web/edit_post.jsp
index fc4e18ee..c9fcde8b 100644
--- a/new_post.html
+++ b/web/edit_post.jsp
@@ -1,3 +1,31 @@
+<%--
+ Document : edit_post
+ Created on : Dec 1, 2014, 11:31:44 PM
+ Author : Denny AH
+--%>
+
+
+<%@ page contentType="text/html" pageEncoding="UTF-8"%>
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+<%
+ if (request.getParameter("submit") != null){
+%>
+
+ UPDATE posts SET judul = '<%=request.getParameter("Judul")%>', tanggal = '<%=request.getParameter("Tanggal")%>', konten = '<%=request.getParameter("Konten")%>'
+ WHERE id = <%=request.getParameter("id")%>;
+
+<%
+ }
+%>
+
+ SELECT * from posts WHERE id=<%=request.getParameter("id")%>;
+
+
@@ -7,15 +35,6 @@
-
-
-
-
-
-
-
-
-
@@ -29,21 +48,21 @@
-Simple Blog | Tambah Post
+Edit Post
-
+
-
+
+
- Simple- Blog
+ Simple- Blog
-
+
@@ -51,18 +70,18 @@ -
-
Tambah Post
+
Edit Post
Judul:
-
+
Tanggal:
-
+
Konten:
-
+ ${read.rows[0].konten}
diff --git a/web/edit_post.xhtml b/web/edit_post.xhtml
new file mode 100644
index 00000000..11b65525
--- /dev/null
+++ b/web/edit_post.xhtml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Post
+
+
+
+
+
+
+ Simple- Blog
+
+
+
-
+
+
+
+
Edit Post
+
+
+
+ Judul:
+
+
+ Tanggal:
+
+
+ Konten:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/edit_user.jsp b/web/edit_user.jsp
new file mode 100644
index 00000000..1a639420
--- /dev/null
+++ b/web/edit_user.jsp
@@ -0,0 +1,127 @@
+<%--
+ Document : edit_user
+ Created on : Dec 1, 2014, 9:11:24 PM
+ Author : Fahziar
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
New User - Simple Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/edit_user.xhtml b/web/edit_user.xhtml
new file mode 100644
index 00000000..a1c8f6fc
--- /dev/null
+++ b/web/edit_user.xhtml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
TODO supply a title
+
+
+
+
TODO write content
+
+
diff --git a/web/index.xhtml b/web/index.xhtml
new file mode 100644
index 00000000..7460c29a
--- /dev/null
+++ b/web/index.xhtml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Simple Blog
+
+
+
+
+
+
+
+
+ Simple- Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
#{a.date}
+
#{a.author}
+
+ #{a.konten}
+
+ Edit | Delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/insert_comment.jsp b/web/insert_comment.jsp
new file mode 100644
index 00000000..3a3a64ab
--- /dev/null
+++ b/web/insert_comment.jsp
@@ -0,0 +1,20 @@
+<%--
+ Document : insert_comment
+ Created on : Nov 25, 2014, 9:44:42 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ page import="com.mysql.jdbc.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ INSERT INTO komentar(id_post,tanggal,nama,email, konten) VALUES(<%= request.getParameter("post")%>,NOW(),"<%= request.getParameter("Nama")%>","<%= request.getParameter("Email")%>","<%= request.getParameter("Komentar")%>");
+
+
+
+ <%= request.getParameter("nama")%>,<%= request.getParameter("email")%>,<%= request.getParameter("konten")%>
+
\ No newline at end of file
diff --git a/web/login.xhtml b/web/login.xhtml
new file mode 100644
index 00000000..7f08d203
--- /dev/null
+++ b/web/login.xhtml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Login - Simple Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/logout.jsp b/web/logout.jsp
new file mode 100644
index 00000000..800d3f5f
--- /dev/null
+++ b/web/logout.jsp
@@ -0,0 +1,23 @@
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+<%
+ Cookie username = new Cookie("username", "");
+ if (username != null)
+ {
+ username.setMaxAge(0);
+ response.addCookie(username);
+ }
+
+ Cookie role = new Cookie("role", "");
+ if (role != null)
+ {
+ role.setMaxAge(0);
+ response.addCookie(role);
+ }
+
+%>
+
\ No newline at end of file
diff --git a/web/new_post.jsp b/web/new_post.jsp
new file mode 100644
index 00000000..67d25a97
--- /dev/null
+++ b/web/new_post.jsp
@@ -0,0 +1,168 @@
+<%--
+ Document : new_post
+ Created on : Dec 1, 2014, 10:59:52 PM
+ Author : Denny
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+<%
+ Cookie [] cookies = request.getCookies();
+ String username = "";
+ int i;
+ if (cookies != null)
+ {
+ for(i=0; i< cookies.length; i++)
+ {
+ if (cookies[i].getName().equalsIgnoreCase("username"))
+ {
+ username = cookies[i].getValue();
+ }
+ }
+ }
+
+ if (request.getParameter("submit") != null){
+%>
+
+ INSERT INTO posts (judul,konten,penulis,tanggal,deleted,published) VALUES ('<%= request.getParameter("Judul")%>', '<%= request.getParameter("Konten")%>', '<%=username%>', '<%= request.getParameter("Tanggal")%>', 0,0);
+
+<%
+ }
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Simple Blog | Tambah Post
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/new_post.xhtml b/web/new_post.xhtml
new file mode 100644
index 00000000..157d902f
--- /dev/null
+++ b/web/new_post.xhtml
@@ -0,0 +1,97 @@
+
+
+
+
+ xmlns:f="http://xmlns.jcp.org/jsf/core">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Add New Post
+
+
+
+
+
+
+ Simple- Blog
+
+
+
-
+
+
+
+
Tambah Post
+
+
+ Judul:
+
+
+ Tanggal:
+
+
+ Konten:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/publish.jsp b/web/publish.jsp
new file mode 100644
index 00000000..2c5e38f1
--- /dev/null
+++ b/web/publish.jsp
@@ -0,0 +1,16 @@
+<%--
+ Document : delete.jsp
+ Created on : Nov 25, 2014, 11:22:55 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ UPDATE `simpleblog-java`.`posts` SET `published`=1 WHERE id=<%= request.getParameter("post") %> ;
+
+
diff --git a/web/recycle-bin.jsp b/web/recycle-bin.jsp
new file mode 100644
index 00000000..240dfc36
--- /dev/null
+++ b/web/recycle-bin.jsp
@@ -0,0 +1,77 @@
+<%--
+ Document : view_post
+ Created on : Nov 25, 2014, 1:03:30 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+
+
Recycle Bin
+
+
+
+<%
+ Cookie cookie = null;
+ Cookie[] cookies = request.getCookies();
+
+ if(cookies!=null){
+
+ for(Cookie tmp : cookies){
+ if(tmp.getName().equalsIgnoreCase("role")){
+ if(tmp.getValue().equalsIgnoreCase("admin"))
+ {
+
+%>
+
+
+
+ SELECT id,judul,konten,tanggal FROM posts WHERE deleted=1 ORDER BY tanggal DESC;
+
+
+
+
+
+
+
+
+
+
+
+ Edit | ">Hapus |
+
+
+
+
+
+
+
+
+
+<%
+ break;
+ }
+ else{
+ out.println("Harus login sebagai admin dulu");
+ }
+ }
+ }
+ }
+ else{
+ out.println("Anda harus login sebagai admin terlebih dahulu");
+ }
+
+%>
+
+
+
\ No newline at end of file
diff --git a/web/recycle_bin.xhtml b/web/recycle_bin.xhtml
new file mode 100644
index 00000000..de28fa96
--- /dev/null
+++ b/web/recycle_bin.xhtml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Recycle Bin - Simple Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/restore.jsp b/web/restore.jsp
new file mode 100644
index 00000000..6ed45877
--- /dev/null
+++ b/web/restore.jsp
@@ -0,0 +1,15 @@
+<%--
+ Document : deleteNonAdmin
+ Created on : Nov 25, 2014, 11:29:57 PM
+ Author : M. Reza Irvanda
+--%>
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+ UPDATE `simpleblog-java`.`posts` SET `deleted` = '0' WHERE `posts`.`id`=<%= request.getParameter("post") %> ;
+
+
diff --git a/web/unpublished.xhtml b/web/unpublished.xhtml
new file mode 100644
index 00000000..23eafa30
--- /dev/null
+++ b/web/unpublished.xhtml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Simple Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/user.xhtml b/web/user.xhtml
new file mode 100644
index 00000000..96f6e423
--- /dev/null
+++ b/web/user.xhtml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Users - Simple Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/view_post.jsp b/web/view_post.jsp
new file mode 100644
index 00000000..c0f505a1
--- /dev/null
+++ b/web/view_post.jsp
@@ -0,0 +1,51 @@
+<%--
+ Document : view_post
+ Created on : Nov 25, 2014, 1:03:30 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+
+
View Post
+
+
+
+
+
+
+ SELECT id,judul,konten,tanggal FROM posts;
+
+
+
+
+
+
+
+
+
+
+
+ Edit | ">Hapus |
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/view_singular_post.jsp b/web/view_singular_post.jsp
new file mode 100644
index 00000000..cbc61038
--- /dev/null
+++ b/web/view_singular_post.jsp
@@ -0,0 +1,213 @@
+<%--
+ Document : view_singular_post
+ Created on : Nov 25, 2014, 4:28:40 PM
+ Author : M. Reza Irvanda
+--%>
+
+<%@ page import="java.io.*,java.util.*,java.sql.*"%>
+<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
+
+
+
+
+
+
+
+
+
View Singular Post
+
+
+
+
+ <%
+ Cookie cookie = null;
+ Cookie[] cookies = null;
+ String nilaiNama ="";
+ String nilaiEmail ="";
+
+ cookies = request.getCookies();
+ if(cookies.length == 0){
+ //do nothing
+ }
+ else{
+// cookie = cookies[0];
+// nilaiNama = cookie.getValue().toString();
+ for(Cookie tmp : cookies){
+ if(tmp.getName().equalsIgnoreCase("username")){
+ nilaiNama = tmp.getValue().toString();
+ break;
+ }
+ }
+ }
+ %>
+
+
+ SELECT * FROM posts WHERE id=<%= request.getParameter("post") %> ;
+
+
+
+ SELECT * FROM komentar WHERE id_post=<%= request.getParameter("post") %> ORDER BY id DESC ;
+
+
+
+ SELECT username,email FROM users WHERE username="<%= nilaiNama %>" LIMIT 1 ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Komentar
+
+
+ Ada kesalahan!
+
+ Nama:
+
+ Email:
+ ">
+ Komentar:
+
+
+ Submit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+