diff --git a/Edit_Akun.xhtml b/Edit_Akun.xhtml new file mode 100644 index 00000000..df2e88bf --- /dev/null +++ b/Edit_Akun.xhtml @@ -0,0 +1,95 @@ + + + + + + + + + + + Simple Blog + + +
+ + +
+ +
+
+

Account Edit

+
+
+ +
+
+
+ + + + +

+ + +

+ + + + + + +

+ + +

+ + +

+ +
+
+
+
+
+
+ +
+ diff --git a/META-INF/context.xml b/META-INF/context.xml new file mode 100644 index 00000000..e222d9d3 --- /dev/null +++ b/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/WEB-INF/LoginSuccess.jsp b/WEB-INF/LoginSuccess.jsp new file mode 100644 index 00000000..5bd63741 --- /dev/null +++ b/WEB-INF/LoginSuccess.jsp @@ -0,0 +1,26 @@ +<%@ page language="java" contentType="text/html; charset=US-ASCII" + pageEncoding="US-ASCII"%> + + + + +Login Success Page + + +<% +String userName = null; +Cookie[] cookies = request.getCookies(); +if(cookies !=null){ +for(Cookie cookie : cookies){ + if(cookie.getName().equals("user")) userName = cookie.getValue(); +} +} +if(userName == null) response.sendRedirect("login.html"); +%> +

Hi <%=userName %>, Login successful.

+
+
+ +
+ + diff --git a/WEB-INF/web.xml b/WEB-INF/web.xml new file mode 100644 index 00000000..302fe035 --- /dev/null +++ b/WEB-INF/web.xml @@ -0,0 +1,32 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + AddCommentServlet + AddCommentServlet + + + Faces Servlet + /faces/* + + + AddCommentServlet + /AddCommentServlet + + + + 30 + + + + faces/index.jsp + + diff --git a/about.jsp b/about.jsp new file mode 100644 index 00000000..49694d1a --- /dev/null +++ b/about.jsp @@ -0,0 +1,88 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> + + + + + + + + + + + + The Simplest Blog | About + + +
+ + + +
+ + + +
+ diff --git a/addcomment.jsp b/addcomment.jsp new file mode 100644 index 00000000..f0b30d24 --- /dev/null +++ b/addcomment.jsp @@ -0,0 +1,53 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + +The Simplest Blog | Add Comment + + + + <% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + Connection con; + PreparedStatement ps; + + try { + String nama = request.getParameter("Nama"); + String waktu = request.getParameter("waktu"); + String id_post = request.getParameter("id_post"); + String komentar = request.getParameter("Komentar"); + String email = request.getParameter("Email"); + Class.forName("com.mysql.jdbc.Driver").newInstance(); + int updateQuery = 0; + con = DriverManager.getConnection(host, user, pwd); + if (nama != null && waktu != null && id_post != null && komentar != null && email != null) { + ps = con.prepareStatement("INSERT INTO `comment` (`nama`, `email`, `komentar`, `waktu`, `id_post`) VALUES (?,?,?,?,?)"); + ps.setString(1, nama); + ps.setString(2, email); + ps.setString(3, komentar); + ps.setString(4, waktu); + ps.setString(5, id_post); + updateQuery = ps.executeUpdate(); + } + out.print("
  • \n"+ + "
    \n"+ + "

    "+ nama +"

    \n"+ + "
    "+ waktu +"
    \n"+ + "
    \n"+ + "

    " + komentar + "

    \n"+ + "
  • "); + } catch (Exception e) { + out.println("Error" + e); + } + %> +
    + + + diff --git a/assets/css/screen.css b/assets/css/screen.css deleted file mode 100644 index 1d8fdf3b..00000000 --- a/assets/css/screen.css +++ /dev/null @@ -1,861 +0,0 @@ -@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; -} \ No newline at end of file diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico deleted file mode 100644 index 40b40ed3..00000000 Binary files a/assets/img/favicon.ico and /dev/null differ diff --git a/assets/img/pre.png b/assets/img/pre.png deleted file mode 100644 index 7f48517b..00000000 Binary files a/assets/img/pre.png and /dev/null differ diff --git a/assets/js/validate.js b/assets/js/validate.js new file mode 100644 index 00000000..2db72fc9 --- /dev/null +++ b/assets/js/validate.js @@ -0,0 +1,59 @@ +function postValidation() { + var Judul = document.getElementById("Judul"); + var Tanggal = document.getElementById("Tanggal"); + var Konten = document.getElementById("Konten"); + + if (Judul.value=="") + { + alert('Title has to be filled'); + return false; + } + + if (Tanggal.value=="") + { + alert('Date has to be filled'); + return false; + } + + if (Konten.value=="") + { + alert('Content has to be filled'); + return false; + } + + if (Tanggal.value!="") + { + var arrTanggal = Tanggal.value.split("-"); + + var tanggal = new Date(); + tanggal.setFullYear(arrTanggal[0], parseInt(arrTanggal[1])-1, arrTanggal[2]); + var date = new Date(); + + if (tanggal < date) + { + alert('Date has to be same as or more than today!'); + return false; + } + } + + return true; +} + +function resetForm(FormId){ + document.forms[FormId].reset(); +} + +function makeYear(Tanggal){ + var tahun = Tanggal.charAt(0) + Tanggal.charAt(1) + Tanggal.charAt(2) + Tanggal.charAt(3); + return parseInt(tahun); +} + +function makeMonth(Tanggal){ + var bulan = Tanggal.charAt(5) + Tanggal.charAt(6); + return parseInt(bulan); +} + +function makeDay(Tanggal){ + var hari = Tanggal.charAt(8) + Tanggal.charAt(9); + return parseInt(hari); +} diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 00000000..fd249929 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,512 @@ +@import url(http://fonts.googleapis.com/css?family=Dawning+of+a+New+Day); +@import url(http://fonts.googleapis.com/css?family=Quicksand:300,400,700); + +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, 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%; +} + +html, body { + height: 100%; +} + +.wrapper { + min-height: 100%; +} + +body { + overflow-x: hidden; + font-family: 'Quicksand', sans-serif; + color: #000; + background: #ffffff; +} + +h1 { + font-family: 'Dawning of a New Day', cursive; + font-size: 60px; + color: #000; +} + +h2 { + font: bold 20px 'Quicksand', sans-serif; +} + +a { + color: #000; + 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: #97cdb6; +} + +#login { + text-align: right; + padding-top: 4px; + padding-right: 4px; +} + +#loginsc { + text-align: right; + padding-top: 4px; + padding-right: 4px; +} + +.invalid { + color: red; +} + + +#menu { + padding-left: 150px; + padding-right: 150px; +} + +#nav-logo { + padding-top: 70px; + padding-bottom: 10px; +} + +.nav-primary { + text-align: center; + border-top-style: solid; + border-bottom-style: solid; + border-color: #000; + border-bottom-width: 4px; + border-top-width: 4px; +} + +.nav { + text-align: right; +} + +.nav-primary li { + display: inline; + padding-left: 35px; + padding-right: 35px; + text-align: center; + font-size: 18px; +} + +#logo { + text-align: center; + padding-bottom: 20px; + font-family: 'Dawning of a New Day', cursive; + font-size: 70px; + color: #000; +} + +#footerSlideContainer { + width: 100%; + bottom: 0; + position: fixed; +} + +#footerSlideContent { + width: 100%; + height: 0px; + background: #251b1b; + color: #cccccc; + border: none; + font-family: 'Dawning of a New Day', cursive; + /*-webkit-transition: height 300ms ease-in; + -moz-transition: height 300ms ease-in; + -ms-transition: height 300ms ease-in; + -o-transition: height 300ms ease-in; + transition: height 300ms ease-in;*/ +} + +#footerSlideContainer.open { + //height: 50px; +} + +#footerSlideLink { + position: absolute; + font-family: 'Dawning of a New Day', cursive; + font-size: 20px; + text-align: center; + color: #000; + cursor: pointer; + top: -55; + right:20px; + width: 150px; + height: 30px; +} + +#footerSlideText { + font-family: 'Dawning of a New Day', cursive; + font-size: 20px; + color: #fff; + padding-left: 15px; +} +/* List of Articles +================================================== */ +.postcontainer { + float: left; + width: 70%; +} + +.postcontainer1 { + float: left; + width: 50%; +} + +#rightside { + width: 25%; + height: 400px; + padding-top: 40px; + padding-left: 40px; +} + +#contact-logo { + padding-left: 30px; + padding-top: 10px; +} + +#text-contact { + padding-left: 28px; + padding-bottom: 10px; +} + +#rightside1 { + width: 40%; + height: 400px; + //padding-top: 40px; + padding-left: 20px; +} + +.tabel { + padding: 25px 190px 100px; + text-align: center; +} + +.art-list { + padding: 25px 190px 100px; + height: auto; + margin-left: 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: 65%; + 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: #97cdb6; +} +.art-list-item p { + width: 89%; + float: left; + //margin-left: 5%; + margin-bottom: 0; + font-size: 16px; + line-height: 24px; +} + + +/* tabel manajemen user */ +table { +} + +table.list-user { + width: 100%; + border-collapse: collapse; + text-align: center; +} + +table.list-user th, table.list-user td { + padding: 8px; + text-align: center; + font-size: 16px; +} + +table.list-user th { + font: bold 16px 'Quicksand', sans-serif; +} + +/* Article +================================================== */ +.art { + margin-top: -131px; +} +/* Header */ +.art-header { + background-position: top center; + background-attachment: absolute; + overflow: hidden; + box-sizing: border-box; +} +/* Contains the time, title and subtitle for an article */ +.art-header-inner { + left: 50%; + margin-top: 200px; + margin-left: 190px; + margin-right: 190px; + display: block; +} +.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: 80px; + line-height: .9; + letter-spacing: -2px; + width: 100%; + color: #97cdb6; +} +.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: 150px 190px 100px; + letter-spacing: 0.01rem; + font-weight: 400; + font-style: normal; + //font-size: 21px; + line-height: 1.2; + margin-bottom: 40px; + margin-top: -80px; +} +.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; +} + +.art-body p { + text-align: left; + margin-top: 30px; + margin-bottom: 30px; +} +/* For simple, white background posts */ +.simple .art-body { + background: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +/* FORM */ + +#contact-area { + width: 600px; + padding: 25px 110px 25px; +} + +#contact-area input, #contact-area textarea { + padding: 5px; + width: 471px; + font-family: 'Quicksand', sans-serif; + margin: 0px 0px 10px 0px; + border: 2px solid #acaba9; +} + +.select { + padding: 5px; + width: auto; + font-family: 'Quicksand', sans-serif; + margin: 0px 0px 10px 0px; + border: 2px solid #acaba9; +} + +#contact-area textarea { + height: 90px; +} + +#contact-area textarea:focus, #contact-area input:focus { + border: 1px solid #97cdb6; +} + +#contact-area input.submit-button { + width: 100px; + float: right; + border: none; + background-color: #97cdb6; + color: #fff; + font-weight: 700; + cursor: pointer; +} + +#contact-area label { + float: left; + text-align: right; + margin-right: 15px; + width: 100px; + padding-top: 5px; +} + +/* About dan Contact */ + +.about { + float: left; +} + +#keterangan { + border-right-style: solid; + border-color: #959595; + border-width: 1px; + width: 470px; + height: 400px; +} + +.postcontainer1 img { + margin-left: 100px; +} + +#contact-right { + height: 80px; +} + +#profile-picture { + width: 60px; + height: 60px; +} + +#media { + margin-left: 3px; +} + + diff --git a/contact.jsp b/contact.jsp new file mode 100644 index 00000000..4382c817 --- /dev/null +++ b/contact.jsp @@ -0,0 +1,151 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> + + + + + + + + + + + + The Simplest Blog | Contact + + +
    + + +
    +
    +
    +
    +
    + +
    + +
    +

    Want to ask?

    +

    E-mail us

    +

    simplestblog@mail.com

    +
    +
    + +
    +
    + +
    + +
    +

    Get in touch

    +

    Facebook

    +

    /thesimplestblog

    +
    +
    + +
    +
    + +
    + +
    +

    Follow us

    +

    On Twitter

    +

    @thesimplestblog

    +
    +
    +
    + +
    +
    +
    + +
    + +
    +

    Watching our projects

    +

    On Youtube

    +

    youtube.com/simplestblog

    +
    +
    + +
    +
    + +
    + +
    +

    Follow our projects

    +

    On Pinterest

    +

    thesimplestblog

    +
    +
    + +
    +
    + +
    + +
    +

    Follow our projects

    +

    On Instagram

    +

    @thesimplestblog

    +
    +
    +
    +
    +
    +
    + + + +
    + diff --git a/delete.jsp b/delete.jsp new file mode 100644 index 00000000..267e162f --- /dev/null +++ b/delete.jsp @@ -0,0 +1,45 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + The Simplest Blog | Delete Post + + + + <% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + Connection con; + PreparedStatement ps; + Random random = new Random(); + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + int updateQuery = 0; + con = DriverManager.getConnection(host, user, pwd); + String sql = "DELETE FROM post WHERE id_post = ?"; + ps = con.prepareStatement(sql); + ps.setString(1, String.valueOf(request.getParameter("id_post"))); + updateQuery = ps.executeUpdate(); + } + catch (Exception e){ + out.println("Error" + e); + } + response.sendRedirect("index.jsp"); + %> + + + diff --git a/editpost.jsp b/editpost.jsp new file mode 100644 index 00000000..662d15a0 --- /dev/null +++ b/editpost.jsp @@ -0,0 +1,149 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Simplest Blog | Edit Post + + + +
    + + + +
    + + +
    +
    +

    Edit Post

    + <% + InitialContext itc; + DataSource ds; + Connection con; + Statement st; + ResultSet rs; + int updateQuery = 0; + + try + { + itc = new InitialContext(); + Class.forName("com.mysql.jdbc.Driver"); + con = DriverManager.getConnection("jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull", "root", "asdasd123"); + String sql = "SELECT * FROM post WHERE id_post = " + String.valueOf(request.getParameter("id_post") + ""); + st = con.createStatement(); + rs = st.executeQuery(sql); + rs.next(); + %> +
    +
    + +
    +
    + +
    +
    + + "> + + + "> + +
    + + "> + +
    + <% + } + catch(Exception e){ + out.println(""+e); + } %> +
    +
    +
    +
    +
    + + + +
    diff --git a/img/about.png b/img/about.png new file mode 100644 index 00000000..61d4cd0b Binary files /dev/null and b/img/about.png differ diff --git a/img/fb.png b/img/fb.png new file mode 100644 index 00000000..7249152b Binary files /dev/null and b/img/fb.png differ diff --git a/img/instagram.png b/img/instagram.png new file mode 100644 index 00000000..043d72bd Binary files /dev/null and b/img/instagram.png differ diff --git a/img/mail.png b/img/mail.png new file mode 100644 index 00000000..84fab207 Binary files /dev/null and b/img/mail.png differ diff --git a/img/pinterest.png b/img/pinterest.png new file mode 100644 index 00000000..524cf60b Binary files /dev/null and b/img/pinterest.png differ diff --git a/img/twitter.png b/img/twitter.png new file mode 100644 index 00000000..e6a5d451 Binary files /dev/null and b/img/twitter.png differ diff --git a/img/youtube.png b/img/youtube.png new file mode 100644 index 00000000..fb0259c6 Binary files /dev/null and b/img/youtube.png 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 - - - - - -
    - - - -
    -
    - -
    -
    - - - -
    - - - - - - - - \ No newline at end of file diff --git a/index.jsp b/index.jsp new file mode 100644 index 00000000..a5252507 --- /dev/null +++ b/index.jsp @@ -0,0 +1,159 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The Simplest Blog + + + + + + +<% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + PreparedStatement ps = null; + Connection con = null; + ResultSet rs = null; + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + con = DriverManager.getConnection(host, user, pwd); + String sql = "SELECT * FROM post WHERE status='published' and status_delete='undeleted' ORDER BY tanggal DESC"; + ps = con.prepareStatement(sql); + rs = ps.executeQuery(); +%> + +
    + + + +
    +
    + +
    +
    + +
    + + + + + + +
    diff --git a/new.jsp b/new.jsp new file mode 100644 index 00000000..dc28feb5 --- /dev/null +++ b/new.jsp @@ -0,0 +1,107 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %> +<%@ page import="com.mysql.jdbc.Driver" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Simplest Blog | Create Post + + +
    + + + +
    + + +
    +
    +

    Create Post

    +
    +
    + +
    +
    + +
    +
    + + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    + + + + +
    diff --git a/new_post.html b/new_post.html deleted file mode 100644 index fc4e18ee..00000000 --- a/new_post.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog | Tambah Post - - - - - -
    - - - -
    - - -

    -

    - -
    -
    -

    Tambah Post

    - -
    -
    - - - - - - -
    - - - -
    -
    -
    -
    - -
    - - - -
    - - - - - - - - \ No newline at end of file diff --git a/page2.xhtml b/page2.xhtml new file mode 100644 index 00000000..1170b6b1 --- /dev/null +++ b/page2.xhtml @@ -0,0 +1,126 @@ + + + + + + + + + + + The Simplest Blog | User-Management + + +
    + +
    + +
    +
    +
    + +
    + + +
    + 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? - - - - - -
    - - - -
    - -
    -
    - -

    Apa itu 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

    - -
    -
    - - - - - - -
    - - - -
    -
    - -
      -
    • -
      -

      Jems

      -
      2 menit lalu
      -
      -

      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! …

      -
    • - -
    • -
      -

      Kave

      -
      1 jam lalu
      -
      -

      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/post.jsp b/post.jsp new file mode 100644 index 00000000..40dffff7 --- /dev/null +++ b/post.jsp @@ -0,0 +1,228 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + The Simplest Blog | Post + + + + + + + <% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + InitialContext itc; + Connection con; + Statement st; + ResultSet rsPost; + ResultSet rsComment; + + int updateQuery = 0; + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + con = DriverManager.getConnection(host, user, pwd); + String sql = "SELECT * FROM post WHERE id_post = " + String.valueOf(request.getParameter("id_post") + ""); + st = con.createStatement(); + rsPost = st.executeQuery(sql); + rsPost.next(); + %> + +
    + + +
    + +
    +
    + +

    <% out.print(rsPost.getString("judul")); %>

    +

    +
    +
    + +
    +
    +
    +

    <% out.print(rsPost.getString("content")); %>

    + <% + } catch (Exception e) { + out.print(""+ e ); + } + %> +
    + + <% + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + con = DriverManager.getConnection(host, user, pwd); + String sql = "SELECT * FROM comment WHERE id_post = " + String.valueOf(request.getParameter("id_post") + ""); + st = con.createStatement(); + rsComment = st.executeQuery(sql); + %> + +

    Comment

    + +
    +
    + + + + + + +
    + + + + "> + <% java.util.Date date = new java.util.Date(); + java.sql.Date dateSQL = new java.sql.Date(date.getYear(), date.getMonth(), date.getDate());%> + +
    +
    + + +
    +
    + <% } catch (Exception e) { + out.print("" + e); + } + %> +
    + + + +
    diff --git a/publish.jsp b/publish.jsp new file mode 100644 index 00000000..cb4463ab --- /dev/null +++ b/publish.jsp @@ -0,0 +1,43 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + The Simplest Blog | Send Content + + + + <% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + Connection con; + PreparedStatement ps; + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + con = DriverManager.getConnection(host, user, pwd); + String sql = "UPDATE post SET status='published' WHERE id_post = ?"; + ps = con.prepareStatement(sql); + ps.setString(1, String.valueOf(request.getParameter("id_post"))); + ps.executeUpdate(); + } + catch (Exception e){ + out.println("Error" + e); + } + response.sendRedirect("index.jsp"); + %> + + + diff --git a/register.jsp b/register.jsp new file mode 100644 index 00000000..9edabd0c --- /dev/null +++ b/register.jsp @@ -0,0 +1,117 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> + + + + + + + + + + + + The Simplest Blog | Add User + + + +
    + + +
    + +
    +
    +

    Add User

    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + +

    + + + + + + + +
    +
    + + username does exist +
    +
    +
    +
    + + + +
    + diff --git a/restore.jsp b/restore.jsp new file mode 100644 index 00000000..4021f6ce --- /dev/null +++ b/restore.jsp @@ -0,0 +1,45 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + The Simplest Blog | Restore Post + + + + <% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + Connection con; + PreparedStatement ps; + Random random = new Random(); + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + int updateQuery = 0; + con = DriverManager.getConnection(host, user, pwd); + String sql = "UPDATE post SET status_delete='undeleted' WHERE id_post = ?"; + ps = con.prepareStatement(sql); + ps.setString(1, String.valueOf(request.getParameter("id_post"))); + updateQuery = ps.executeUpdate(); + } + catch (Exception e){ + out.println("Error" + e); + } + response.sendRedirect("unpublished.jsp"); + %> + + + diff --git a/softdelete.jsp b/softdelete.jsp new file mode 100644 index 00000000..317aac29 --- /dev/null +++ b/softdelete.jsp @@ -0,0 +1,44 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + The Simplest Bog | Soft Delete + + + + <% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + Connection con; + PreparedStatement ps; + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + con = DriverManager.getConnection(host, user, pwd); + String sql = "UPDATE post SET status_delete='deleted' WHERE id_post = ?"; + ps = con.prepareStatement(sql); + ps.setString(1, String.valueOf(request.getParameter("id_post"))); + ps.executeUpdate(); + } + catch (Exception e){ + out.println("Error" + e); + } + response.sendRedirect("unpublished.jsp"); + %> + + + + diff --git a/unpublished.jsp b/unpublished.jsp new file mode 100644 index 00000000..805851c3 --- /dev/null +++ b/unpublished.jsp @@ -0,0 +1,199 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%@ page import="java.io.*" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ page import="java.io.*,java.util.*,java.sql.*"%> +<%@ page import="javax.servlet.http.*,javax.servlet.*" %> + + +<%@ page import="java.sql.Connection, javax.sql.*, java.io.*, javax.naming.*" +%> +<%@ page import="com.mysql.jdbc.Driver, java.sql.PreparedStatement, java.sql.DriverManager, java.util.Random" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The Simplest Blog | Draft + + + + + + +<% + String host = "jdbc:mysql://localhost:3305/blog?zeroDateTimeBehavior=convertToNull"; + String user = "root"; + String pwd = "asdasd123"; + PreparedStatement ps = null; + Connection con = null; + ResultSet rs = null; + + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + con = DriverManager.getConnection(host, user, pwd); + String sql = "SELECT * FROM post WHERE status='unpublished' and status_delete='undeleted' ORDER BY tanggal DESC"; + ps = con.prepareStatement(sql); + rs = ps.executeQuery(); +%> + +
    + + + +
    +
    + +
    +
    + +
    + + + + + + + +