diff --git a/MEMBER.md b/MEMBER.md new file mode 100644 index 00000000..a7e7887e --- /dev/null +++ b/MEMBER.md @@ -0,0 +1,4 @@ +NIM : Nama : GitHub ID : e-mail +13510053 : Fabrian Oktavino : sm2mlg : 13510053@std.stei.itb.ac.id +13510055 : Atika Yusuf : atikayusuf : 13510087@std.stei.itb.ac.id +13510087 : Arief Suharsono : ariefsuharsono : 13510087@std.stei.itb.ac.id \ No newline at end of file diff --git a/README.md b/README.md index 89df0a73..e69de29b 100644 --- a/README.md +++ b/README.md @@ -1,17 +0,0 @@ -IF3038-2013 -=========== - -Repositori ini adalah repositori dasar yang akan dijadikan basis oleh setiap kelompok peserta kuliah IF3038. -Pengumpulan Tugas: -- Sebutkan URL repositori yang akan dinilai - - Repositori ini harus merupakan fork dari repo ini (baik secara langsung atau tidak langsung) -- Sebutkan anggota dari kelompok (NIM NAMA MAIL GITHUB_ID) -- Kontributor dari repositori tersebut HANYA anggota kelompok yang bersangkutan - -Rule dan Konvensi: -- Setiap peserta harus menggunakan akun pribadi, dan bukan shared-account, pada setiap kegiatan/hubungan dengan github -- Proyek yang dikumpulkan harus memuat file berikut: - - INSTALL.md - berisi how-to untuk proses peng-install-an dari aplikasi - - MEMEBER.md - berisi NIM NAMA MAIL GITHUB_ID dari anggota grup ini - - src/ - berisi semua kode sumber dari aplikasi yang akan anda kumplukan - - docs/ - berisi dokumentasi dari aplikasi, jika diperlukan diff --git a/Tubes 1/MEMBER.md b/Tubes 1/MEMBER.md new file mode 100644 index 00000000..649367d3 --- /dev/null +++ b/Tubes 1/MEMBER.md @@ -0,0 +1,3 @@ +13510019 Andreas Bara Timur 13510019@students.if.itb.ac.id +13510039 Felix Terahadi 13510039@students.if.itb.ac.id +13510087 Arief Suharsono 13510087@students.if.itb.ac.id ariefsuharsono \ No newline at end of file diff --git a/Tubes 1/README.md b/Tubes 1/README.md new file mode 100644 index 00000000..89df0a73 --- /dev/null +++ b/Tubes 1/README.md @@ -0,0 +1,17 @@ +IF3038-2013 +=========== + +Repositori ini adalah repositori dasar yang akan dijadikan basis oleh setiap kelompok peserta kuliah IF3038. +Pengumpulan Tugas: +- Sebutkan URL repositori yang akan dinilai + - Repositori ini harus merupakan fork dari repo ini (baik secara langsung atau tidak langsung) +- Sebutkan anggota dari kelompok (NIM NAMA MAIL GITHUB_ID) +- Kontributor dari repositori tersebut HANYA anggota kelompok yang bersangkutan + +Rule dan Konvensi: +- Setiap peserta harus menggunakan akun pribadi, dan bukan shared-account, pada setiap kegiatan/hubungan dengan github +- Proyek yang dikumpulkan harus memuat file berikut: + - INSTALL.md - berisi how-to untuk proses peng-install-an dari aplikasi + - MEMEBER.md - berisi NIM NAMA MAIL GITHUB_ID dari anggota grup ini + - src/ - berisi semua kode sumber dari aplikasi yang akan anda kumplukan + - docs/ - berisi dokumentasi dari aplikasi, jika diperlukan diff --git a/Tubes 1/src/.dropbox b/Tubes 1/src/.dropbox new file mode 100644 index 00000000..d47f44c5 --- /dev/null +++ b/Tubes 1/src/.dropbox @@ -0,0 +1 @@ +233579635 diff --git a/Tubes 1/src/Felix/Dashboard.html b/Tubes 1/src/Felix/Dashboard.html new file mode 100644 index 00000000..1a156151 --- /dev/null +++ b/Tubes 1/src/Felix/Dashboard.html @@ -0,0 +1,36 @@ + + + + + Dashboard + + + + + + + +
+

Dashboard

+
+ +
+ +
+
+ + + \ No newline at end of file diff --git a/Tubes 1/src/Felix/HTML5_Logo_512.png b/Tubes 1/src/Felix/HTML5_Logo_512.png new file mode 100644 index 00000000..81d1fcba Binary files /dev/null and b/Tubes 1/src/Felix/HTML5_Logo_512.png differ diff --git a/Tubes 1/src/Felix/dashboard.css b/Tubes 1/src/Felix/dashboard.css new file mode 100644 index 00000000..9ae843b8 --- /dev/null +++ b/Tubes 1/src/Felix/dashboard.css @@ -0,0 +1,213 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#dashboard-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#dashboard-tugas{ + width:600px; + height:500px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 25px 25px; + overflow:auto; +} + +#dashboard-listcategory{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + overflow:auto; + +} + +h1{color:white;} +h2{color:white;} +h3{color:white;} +h4{color:white;} +h5{color:white;} +h6{color:white;} +h7{color:white;} +#dashboard-title{ + text-align: center; +} + +.dash-category{ + color:yellow; +} +.dash-category:hover{ + color:orange; +} + +.category-content{ + height:auto; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dotted; + border-color: white; + margin-bottom:25px; + padding: 0px 25px 25px; +} + +li{color:white;} +a{color:yellow;} + +a:hover{ + color:orange; +} + +a.tag{ + color:yellow; +} +a.tag:hover{ + color:orange; +} + +button{ + float:right; +} + + +a#login_pop:hover, a#join_pop:hover { + border-color: #eee; +} +.overlay { + background-color: rgba(100, 100, 100, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + background-color: #888; + border: 3px solid #222; + display: inline-block; + left: 50%; + opacity: 100%; + padding: 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 25%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} +.popup p, .popup div { + margin-bottom: 10px; +} +.popup label { + display: inline-block; + text-align: left; + width: 120px; +} +.popup input[type="text"], .popup input[type="password"] { + border: 1px solid; + border-color: #999 #ccc #ccc; + margin: 0; + padding: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.popup input[type="text"]:hover, .popup input[type="password"]:hover { + border-color: #555 #888 #888; +} \ No newline at end of file diff --git a/Tubes 1/src/Felix/dashboard.js b/Tubes 1/src/Felix/dashboard.js new file mode 100644 index 00000000..a2a042ae --- /dev/null +++ b/Tubes 1/src/Felix/dashboard.js @@ -0,0 +1,73 @@ + +var kategori = [ + {ID: "Kategori 0", task: {Name:["task01","task02"],Deadline: ["01-01-2013","01-02-2013"], Deskripsi: ["deskripsi tugas 1","deskripsi tugas 2"]}, tag: ["tag01", "tag02"]}, + {ID: "Kategori 1", task: {Name:["task03","task04"],Deadline: ["02-01-2013","02-02-2013"], Deskripsi: ["deskripsi tugas 3","deskripsi tugas 4"]}, tag: ["tag11", "tag12"]}, + {ID: "Kategori 2", task: {Name:["task05","task06"],Deadline: ["03-01-2013","03-02-2013"], Deskripsi: ["deskripsi tugas 5","deskripsi tugas 6"]}, tag: ["tag21", "tag22"]}, +]; + + +function loadCategory() +{ + var xx = document.getElementById("dashboard-listcategory"); + xx.innerHTML = xx.innerHTML + "all
"; + + for (var b = 0; b < kategori.length; b++) + { + xx.innerHTML = xx.innerHTML + ("" + kategori[b].ID + "
"); + } + + xx.innerHTML = xx.innerHTML + "add category"; +} + +function loadTask(var1){ + var a = Math.floor(var1/10); + var b = var1 % 10; + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

" + kategori[a].task.Name[b] + "


" + kategori[a].task.Deskripsi[b] + "

"; + +} + +function makeTask(var1) +{ + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

halaman pembuatan tugas

"; +} + +function loadContentCategory(var1) +{ + var yy = document.getElementById("dashboard-tugas"); + yy.innerHTML = ""; + + if (var1 != -1){ + var zz = ""; + zz += "

" + kategori[var1].ID + "


Task:

    "; + for (c = 0; c < kategori[var1].task.Name.length; c++){ + zz += "
  1. "+ kategori[var1].task.Name[c] + " deadline: " + kategori[var1].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[var1].tag.length; d++){ + zz+= "" + kategori[var1].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } else { + for (var a = 0; a < kategori.length; a++) + { + var zz = ""; + zz += "

" + kategori[a].ID + "


Task:

    "; + for (c = 0; c < kategori[a].task.Name.length; c++){ + zz += "
  1. "+ kategori[a].task.Name[c] + " deadline: " + kategori[a].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[a].tag.length; d++){ + zz+= "" + kategori[a].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } + } +} diff --git a/Tubes 1/src/Felix/profil.css b/Tubes 1/src/Felix/profil.css new file mode 100644 index 00000000..b32a2777 --- /dev/null +++ b/Tubes 1/src/Felix/profil.css @@ -0,0 +1,55 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#profile-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#profile-tugas{ + width:600px; + height:550px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 0px 25px; +} + +#profile-biodata{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + +} + +h1{color:white;} + +#profile-title{ + text-align: center; +} + +#profile-img{ + +} \ No newline at end of file diff --git a/Tubes 1/src/Felix/profil.html b/Tubes 1/src/Felix/profil.html new file mode 100644 index 00000000..f7369644 --- /dev/null +++ b/Tubes 1/src/Felix/profil.html @@ -0,0 +1,24 @@ + + + + + Biodata + + + +
+

Profile

+
+
+ +

Username : Admin

+

Nama Lengkap : Admin Admin

+

Tanggal lahir : 1 January 1980

+

Email : admin@progin.com

+ +
+
+

tugas

+
+ + \ No newline at end of file diff --git a/Tubes 1/src/HTML5_Logo_512.png b/Tubes 1/src/HTML5_Logo_512.png new file mode 100644 index 00000000..81d1fcba Binary files /dev/null and b/Tubes 1/src/HTML5_Logo_512.png differ diff --git a/Tubes 1/src/New Years Day/buatTugas.html b/Tubes 1/src/New Years Day/buatTugas.html new file mode 100644 index 00000000..493bde04 --- /dev/null +++ b/Tubes 1/src/New Years Day/buatTugas.html @@ -0,0 +1,22 @@ + + + + Rincian Tugas + + + Nama Task : + Attachment : + Deadline : + Assignee : + Komentar : + Tag | change : +
+ First name:
+ Last name:
+ E-mail:
+ +
+ + + + \ No newline at end of file diff --git a/Tubes 1/src/New Years Day/rincianTugas.html b/Tubes 1/src/New Years Day/rincianTugas.html new file mode 100644 index 00000000..1e4c1e14 --- /dev/null +++ b/Tubes 1/src/New Years Day/rincianTugas.html @@ -0,0 +1,20 @@ + + + + Rincian Tugas + + +
Nama Task
+
Tugas Besar Progin
+
Attachment
+
Tugas Besar Progin
+
Deadline | change
+
Tugas Besar Progin
+
Assignee tambah assignee
+
Tugas Besar Progin
+
Komentar
+
Tugas Besar Progin
+
Tag | change
+
Tugas Besar Progin
+ + \ No newline at end of file diff --git a/Tubes 1/src/coba.html b/Tubes 1/src/coba.html new file mode 100644 index 00000000..434b1aae --- /dev/null +++ b/Tubes 1/src/coba.html @@ -0,0 +1,28 @@ + + + + + + + +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/Tubes 1/src/css/loginpage.css b/Tubes 1/src/css/loginpage.css new file mode 100644 index 00000000..3316fc71 --- /dev/null +++ b/Tubes 1/src/css/loginpage.css @@ -0,0 +1,15 @@ +/* + Document : LoginPage + Created on : Feb 19, 2013, 7:09:01 AM + Author : Arief + Description: + CSS for Login Page +*/ + + +#FrontLogo { + width: 75%; + height: 75%; +} + +body {color: grey} \ No newline at end of file diff --git a/Tubes 1/src/dashboard.css b/Tubes 1/src/dashboard.css new file mode 100644 index 00000000..107b859c --- /dev/null +++ b/Tubes 1/src/dashboard.css @@ -0,0 +1,219 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#dashboard-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#dashboard-tugas{ + width:600px; + height:500px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 25px 25px; + overflow:auto; +} + +#dashboard-listcategory{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + overflow:auto; + +} + +h1{color:white;} +h2{color:white;} +h3{color:white;} +h4{color:white;} +h5{color:white;} +h6{color:white;} +h7{color:white;} +#dashboard-title{ + text-align: center; +} + +#dashboard-addCategory{ + text-align:center; + font-size:20px; + font-weight:bold; +} + +.dash-category{ + color:yellow; +} +.dash-category:hover{ + color:orange; +} + +.category-content{ + height:auto; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dotted; + border-color: white; + margin-bottom:25px; + padding: 0px 25px 25px; +} + +li{color:white;} +a{color:yellow;} + +a:hover{ + color:orange; +} + +a.tag{ + color:yellow; +} +a.tag:hover{ + color:orange; +} + +button{ + float:right; +} + + +a#login_pop:hover, a#join_pop:hover { + border-color: #eee; +} +.overlay { + background-color: rgba(100, 100, 100, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + background-color: #888; + border: 3px solid #222; + display: inline-block; + left: 50%; + opacity: 100%; + padding: 0px 15px 15px 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 25%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} +.popup p, .popup div { + margin-bottom: 10px; +} +.popup label { + display: inline-block; + text-align: left; + width: 120px; +} +.popup input[type="text"], .popup input[type="password"] { + border: 1px solid; + border-color: #999 #ccc #ccc; + margin: 0; + padding: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.popup input[type="text"]:hover, .popup input[type="password"]:hover { + border-color: #555 #888 #888; +} \ No newline at end of file diff --git a/Tubes 1/src/dashboard.html b/Tubes 1/src/dashboard.html new file mode 100644 index 00000000..3ae67440 --- /dev/null +++ b/Tubes 1/src/dashboard.html @@ -0,0 +1,36 @@ + + + + + Dashboard + + + + + + + +
+

Dashboard

+
+ +
+ +
+
+ + + \ No newline at end of file diff --git a/Tubes 1/src/dashboard.js b/Tubes 1/src/dashboard.js new file mode 100644 index 00000000..a08d096e --- /dev/null +++ b/Tubes 1/src/dashboard.js @@ -0,0 +1,74 @@ + +var kategori = [ + {ID: "Kategori 0", task: {Name:["task01","task02"],Deadline: ["01-01-2013","01-02-2013"], Deskripsi: ["deskripsi tugas 1","deskripsi tugas 2"]}, tag: ["tag01", "tag02"]}, + {ID: "Kategori 1", task: {Name:["task03","task04"],Deadline: ["02-01-2013","02-02-2013"], Deskripsi: ["deskripsi tugas 3","deskripsi tugas 4"]}, tag: ["tag11", "tag12"]}, + {ID: "Kategori 2", task: {Name:["task05","task06"],Deadline: ["03-01-2013","03-02-2013"], Deskripsi: ["deskripsi tugas 5","deskripsi tugas 6"]}, tag: ["tag21", "tag22"]}, +]; + + +function loadCategory() +{ + var xx = document.getElementById("dashboard-listcategory"); + xx.innerHTML = xx.innerHTML + "all
"; + + for (var b = 0; b < kategori.length; b++) + { + xx.innerHTML = xx.innerHTML + ("" + kategori[b].ID + "
"); + } + + xx.innerHTML = xx.innerHTML + "add category"; +} + +function loadTask(var1){ + var a = Math.floor(var1/10); + var b = var1 % 10; + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

" + kategori[a].task.Name[b] + "


" + kategori[a].task.Deskripsi[b] + "

"; + +} + +function makeTask(var1) +{ + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

halaman pembuatan tugas

"; +} + +function loadContentCategory(var1) +{ + var yy = document.getElementById("dashboard-tugas"); + yy.innerHTML = ""; + + if (var1 != -1){ + var zz = ""; + zz += "

" + kategori[var1].ID + "


Task:

    "; + for (c = 0; c < kategori[var1].task.Name.length; c++){ + zz += "
  1. "+ kategori[var1].task.Name[c] + " deadline: " + kategori[var1].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[var1].tag.length; d++){ + zz+= "" + kategori[var1].tag[d] + " "; + } + //zz += "
"; + zz += "
"; + yy.innerHTML += zz; + } else { + for (var a = 0; a < kategori.length; a++) + { + var zz = ""; + zz += "

" + kategori[a].ID + "


Task:

    "; + for (c = 0; c < kategori[a].task.Name.length; c++){ + zz += "
  1. "+ kategori[a].task.Name[c] + " deadline: " + kategori[a].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[a].tag.length; d++){ + zz+= "" + kategori[a].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } + } +} diff --git a/Tubes 1/src/desktop.ini b/Tubes 1/src/desktop.ini new file mode 100644 index 00000000..7a764475 --- /dev/null +++ b/Tubes 1/src/desktop.ini @@ -0,0 +1,4 @@ +[.ShellClassInfo] +IconFile=C:\Users\Arief\AppData\Roaming\Dropbox\bin\Dropbox.exe +IconIndex=-2301 +InfoTip=A securely backed up place to put your important files. diff --git a/Tubes 1/src/header.html b/Tubes 1/src/header.html new file mode 100644 index 00000000..7a06a3ac --- /dev/null +++ b/Tubes 1/src/header.html @@ -0,0 +1,36 @@ + + + + + S.Y.N. Dashboard + + + + + + + \ No newline at end of file diff --git a/Tubes 1/src/images/syn.jpg b/Tubes 1/src/images/syn.jpg new file mode 100644 index 00000000..b33556c8 Binary files /dev/null and b/Tubes 1/src/images/syn.jpg differ diff --git a/Tubes 1/src/images/syn.psd b/Tubes 1/src/images/syn.psd new file mode 100644 index 00000000..c2596a21 Binary files /dev/null and b/Tubes 1/src/images/syn.psd differ diff --git a/Tubes 1/src/images/syn2.jpg b/Tubes 1/src/images/syn2.jpg new file mode 100644 index 00000000..bd806b2c Binary files /dev/null and b/Tubes 1/src/images/syn2.jpg differ diff --git a/Tubes 1/src/index.html b/Tubes 1/src/index.html new file mode 100644 index 00000000..20c16857 --- /dev/null +++ b/Tubes 1/src/index.html @@ -0,0 +1,182 @@ + + + + + + + S.Y.N Login Page + + + + + + +
+

Login Form :

+
+ + + + + + + + + + + + + + +
+ Username + + : + + +
+ Password + + : + + +
+ +
+
+
+
+
+
+

Registration Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Username + + : + + +
+
+
+ Password + + : + + +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+ e-Mail + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + + \ No newline at end of file diff --git a/Tubes 1/src/loginpage.css b/Tubes 1/src/loginpage.css new file mode 100644 index 00000000..aa607096 --- /dev/null +++ b/Tubes 1/src/loginpage.css @@ -0,0 +1,171 @@ +/* + Document : LoginPage + Created on : Feb 19, 2013, 7:09:01 AM + Author : Arief + Description: + CSS for Login Page +*/ + + +#Front_Logo { + display: block; + width: 600px; + height: 200px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Header { + display: block; + width: 1000px; + height: 130px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; + text-align: center; +} + +#Header hr { + border : 1px dashed; + border-color : #ccc; +} + +#Header a{ + font-family: monospace; + color: white; + text-decoration: none; +} + +#Header a:hover{ + color:antiquewhite; + text-decoration: underline overline; +} + +#Header input[type=text], +#Header input[type="password"]{ + background-color: grey; + border: 1px dashed white; + color:white; +} + +#Header input[type=text]:hover, +#Header input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Header input[type=text]:focus, +#Header input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Header input[type=submit], +#Header input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Header input[type=submit]:hover, +#Header input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Front_Form{ + text-align: center; + display: block; + width: 400px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Front_Form input[type=text]:hover, +#Front_Form input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Front_Form input[type=text]:focus, +#Front_Form input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Front_Form input[type=submit], +#Front_Form input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Front_Form input[type=submit]:hover, +#Front_Form input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +body { + background-color: grey; + font-family: monospace; + color: white; + text-align: center; +} + +iframe { + border:none; +} \ No newline at end of file diff --git a/Tubes 1/src/mainpage.html b/Tubes 1/src/mainpage.html new file mode 100644 index 00000000..e01fb9b7 --- /dev/null +++ b/Tubes 1/src/mainpage.html @@ -0,0 +1,18 @@ + + + + + S.Y.N. Share Your Notes + + + + + + + + diff --git a/Tubes 1/src/menuBar.css b/Tubes 1/src/menuBar.css new file mode 100644 index 00000000..1387b645 --- /dev/null +++ b/Tubes 1/src/menuBar.css @@ -0,0 +1,14 @@ +/* + Document : menuBar + Created on : Feb 20, 2013, 4:14:18 AM + Author : Arief + Description: + Purpose of the stylesheet follows. +*/ + +#menu { + font-size: 14px; + font-family: monospace; + +} + diff --git a/Tubes 1/src/movie.mp4 b/Tubes 1/src/movie.mp4 new file mode 100644 index 00000000..3daaab5a Binary files /dev/null and b/Tubes 1/src/movie.mp4 differ diff --git a/Tubes 1/src/nbproject/private/private.properties b/Tubes 1/src/nbproject/private/private.properties new file mode 100644 index 00000000..ff394336 --- /dev/null +++ b/Tubes 1/src/nbproject/private/private.properties @@ -0,0 +1,5 @@ +copy.src.files=false +copy.src.target=C:\\xampp\\htdocs\\PhpProject1 +index.file=index.php +run.as=LOCAL +url=http://localhost/progin1/ diff --git a/Tubes 1/src/nbproject/private/private.xml b/Tubes 1/src/nbproject/private/private.xml new file mode 100644 index 00000000..c1f155a7 --- /dev/null +++ b/Tubes 1/src/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/Tubes 1/src/nbproject/project.properties b/Tubes 1/src/nbproject/project.properties new file mode 100644 index 00000000..94429c9b --- /dev/null +++ b/Tubes 1/src/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_53 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=true +web.root=. diff --git a/Tubes 1/src/nbproject/project.xml b/Tubes 1/src/nbproject/project.xml new file mode 100644 index 00000000..315b67fb --- /dev/null +++ b/Tubes 1/src/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + Progin1 + + + diff --git a/Tubes 1/src/profil.css b/Tubes 1/src/profil.css new file mode 100644 index 00000000..b32a2777 --- /dev/null +++ b/Tubes 1/src/profil.css @@ -0,0 +1,55 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#profile-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#profile-tugas{ + width:600px; + height:550px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 0px 25px; +} + +#profile-biodata{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + +} + +h1{color:white;} + +#profile-title{ + text-align: center; +} + +#profile-img{ + +} \ No newline at end of file diff --git a/Tubes 1/src/profil.html b/Tubes 1/src/profil.html new file mode 100644 index 00000000..f7369644 --- /dev/null +++ b/Tubes 1/src/profil.html @@ -0,0 +1,24 @@ + + + + + Biodata + + + +
+

Profile

+
+
+ +

Username : Admin

+

Nama Lengkap : Admin Admin

+

Tanggal lahir : 1 January 1980

+

Email : admin@progin.com

+ +
+
+

tugas

+
+ + \ No newline at end of file diff --git a/Tubes 1/src/registrasi.js b/Tubes 1/src/registrasi.js new file mode 100644 index 00000000..3a88f2c6 --- /dev/null +++ b/Tubes 1/src/registrasi.js @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkUsername() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + if(uname=="" || uname==null) + {document.getElementById('usernameWarning').innerHTML="*Username tidak boleh kosong";return false;} + else + if(uname.length<5) + {document.getElementById('usernameWarning').innerHTML="*Username minimal 5 huruf";return false;} + else + {document.getElementById('usernameWarning').innerHTML="";return true;} +} + +function checkPassword() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + var pass=document.forms["RegistrationForm"]["daftar_password"].value; + var email=document.forms["RegistrationForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh kosong";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["RegistrationForm"]["daftar_password"].value; + var pass2=document.forms["RegistrationForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["RegistrationForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak boleh kosong";return false;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + +function checkEmail() { + var email=document.forms["RegistrationForm"]["daftar_email"].value; + var atpos=email.indexOf("@"); + var dotpos=email.lastIndexOf("."); + if(email=="" || email==null) + {document.getElementById('emailWarning').innerHTML="*E-mail tidak boleh kosong";return false;} + else + if(atpos<1 || dotpos=email.length) + {document.getElementById('emailWarning').innerHTML=("*e-mail tidak valid");return false;} + else + {document.getElementById('emailWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["RegistrationForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkUsername() && checkPassword() && checkConfirmPassword() && checkNama() && checkEmail() && check_extension()); +} + +function checkLogin() { + var username=document.forms["LoginForm"]["username"].value; + var password=document.forms["LoginForm"]["password"].value; + if(username!="admin") + { + alert("User Not Found"); + return false; + } + else if(password!="adminadmin") + { + alert("Password incorrect") + return false; + } + else + return true; +} \ No newline at end of file diff --git a/Tubes 1/src/rincian_tugas.css b/Tubes 1/src/rincian_tugas.css new file mode 100644 index 00000000..90967b88 --- /dev/null +++ b/Tubes 1/src/rincian_tugas.css @@ -0,0 +1,103 @@ +/* + Document : tambah_tugas + Created on : Feb 22, 2013, 7:46:57 PM + Author : Toshiba L645 + Description: + Purpose of the stylesheet follows. +*/ + + +form, button{border:0; margin:0; padding:0;} + +.form-rincian-tugas{ + margin:0 auto; + width:400px; + padding:14px; +} + + +#efek{ + border:solid 2px #b7ddf2; + background:#ebf4ab; + margin-bottom: 50px; + padding-bottom: 50px; +} + +#efek label{ + display:block; + font-weight:bold; + text-align:right; + width:140px; + float:left; +} +#efek input{ + float:left; + font-size:12px; + padding:4px 2px; + border:solid 1px #aacfe4; + width:200px; + margin:2px 0 20px 10px; +} +#efek .isi{ + + float:left; + font-size:16px; + padding:0px 0px; + font-weight: bold; + width:200px; + margin:2px 0 20px 10px; +} + +#efek video{ + float:left; + font-size:12px; + padding:0px 0px; + margin:2px 0 2px 10px; +} + +#efek button{ + clear:both; + margin-left:150px; + width:125px; + height:31px; + background:#666666; + text-align:center; + line-height:31px; + color:#FFFFFF; + font-size:11px; + font-weight:bold; +} + +#efek p{ + font-size:11px; + color:#666666; + margin-bottom:20px; + border-bottom:solid 1px #b7ddf2; + padding-bottom:10px; + float:left; +} + +#efek h1 +{ + color: #ebf4ab; + position:absolute; + text-align:left; + color:#FFFFFF; + font-size:43px; + color:#FFF; + left:14px; + top:18px; + float:left; +} + +#efek h2 +{ + color : #ebf4ab; + position:absolute; + text-align:right; + color:#EAEAEA; + left:490px; + top:38px; + width:400px; + float:left; +} \ No newline at end of file diff --git a/Tubes 1/src/rincian_tugas.html b/Tubes 1/src/rincian_tugas.html new file mode 100644 index 00000000..c5ffc952 --- /dev/null +++ b/Tubes 1/src/rincian_tugas.html @@ -0,0 +1,48 @@ + + + + + + + + + +
+ + +
TUBES PROGIN
+ + + + +
11/12/2013
+ + +
AKU KAMU DAN DIA
+ +
+ + + +
+ + +
+ + + +
+ + +
progin,susah
+ +
+ + diff --git a/Tubes 1/src/tambah_tugas.css b/Tubes 1/src/tambah_tugas.css new file mode 100644 index 00000000..23ce63bf --- /dev/null +++ b/Tubes 1/src/tambah_tugas.css @@ -0,0 +1,69 @@ +/* + Document : tambah_tugas + Created on : Feb 22, 2013, 7:46:57 PM + Author : Toshiba L645 + Description: + Purpose of the stylesheet follows. +*/ + + +form, button{border:0; margin:0; padding:0;} + +.form-tambah-tugas{ + margin:0 auto; + width:400px; + padding:14px; +} + + +#efek{ + border:solid 2px #b7ddf2; + background:#ebf4ab; +} + +#efek label{ + display:block; + font-weight:bold; + text-align:right; + width:140px; + float:left; +} +#efek .small{ + color:#666666; + display:block; + font-size:11px; + font-weight:normal; + text-align:right; + width:140px; +} +#efek input{ + float:left; + font-size:12px; + padding:4px 2px; + border:solid 1px #aacfe4; + width:200px; + margin:2px 0 20px 10px; +} + +#efek textarea{ + float:left; + font-size:12px; + padding:4px 2px; + border:solid 1px #aacfe4; + width:200px; + margin:2px 0 20px 10px; +} + +#efek button{ + clear:both; + margin-left:150px; + width:125px; + height:31px; + background:#666666; + text-align:center; + line-height:31px; + color:#FFFFFF; + font-size:11px; + font-weight:bold; +} + diff --git a/Tubes 1/src/tambah_tugas.html b/Tubes 1/src/tambah_tugas.html new file mode 100644 index 00000000..19a5bd1a --- /dev/null +++ b/Tubes 1/src/tambah_tugas.html @@ -0,0 +1,39 @@ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+
+ + diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/src/META-INF/context.xml b/src/META-INF/context.xml new file mode 100644 index 00000000..40f22994 --- /dev/null +++ b/src/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/src/WEB-INF/classes/.netbeans_automatic_build b/src/WEB-INF/classes/.netbeans_automatic_build new file mode 100644 index 00000000..e69de29b diff --git a/src/WEB-INF/classes/.netbeans_update_resources b/src/WEB-INF/classes/.netbeans_update_resources new file mode 100644 index 00000000..e69de29b diff --git a/src/WEB-INF/classes/database/Checker.class b/src/WEB-INF/classes/database/Checker.class new file mode 100644 index 00000000..74c8567f Binary files /dev/null and b/src/WEB-INF/classes/database/Checker.class differ diff --git a/src/WEB-INF/classes/database/MyDatabase.class b/src/WEB-INF/classes/database/MyDatabase.class new file mode 100644 index 00000000..09d7c251 Binary files /dev/null and b/src/WEB-INF/classes/database/MyDatabase.class differ diff --git a/src/WEB-INF/lib/mysql-connector-java-5.1.16-bin.jar b/src/WEB-INF/lib/mysql-connector-java-5.1.16-bin.jar new file mode 100644 index 00000000..e62f2cb7 Binary files /dev/null and b/src/WEB-INF/lib/mysql-connector-java-5.1.16-bin.jar differ diff --git a/src/addtask.js b/src/addtask.js new file mode 100644 index 00000000..207c253d --- /dev/null +++ b/src/addtask.js @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkNamaTask() { + var isalpha = false; + var uname=document.forms["AddTaskForm"]["addtask_namaTask"].value; + for(var i=0;(i47 && cc<58) || (cc>64 && cc<91) || (cc>96 && cc<123))) + { + isalpha = true; + } + } + if(isalpha==true){ + {document.getElementById('namaTaskWarning').innerHTML="*Nama Task tidak boleh alphanumeric";return false;} + } + else + if(uname=="" || uname==null) + {document.getElementById('namaTaskWarning').innerHTML="*Nama Task tidak boleh kosong";return false;} + else + if(uname.length>25) + {document.getElementById('namaTaskWarning').innerHTML="*NamaTask harus <= 25 karakter";return false;} + else + {document.getElementById('namaTaskWarning').innerHTML="";return true;} +} + +function checkValidation() { + return (checkNamaTask()); +} \ No newline at end of file diff --git a/src/addtask.jsp b/src/addtask.jsp new file mode 100644 index 00000000..91f9d615 --- /dev/null +++ b/src/addtask.jsp @@ -0,0 +1,176 @@ +<%-- + Document : addtask + Created on : Apr 12, 2013, 10:48:35 PM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + S.Y.N. Add Task + + + +   +
+   +
+   +
+   +
+

Add Task

+
+

Add Task Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Nama Task + + : + + "> + +
+
+
+ Assignee + + : + + +
+
+
+
+
+ Tag + + : + + +
+
+
+
+
+ Tanggal Deadline + + : + + +
+ Attachment + + : + + +
+
+
+ Attachment + + : + + +
+ Attachment + + : + + +
+ Attachment + + : + + +
+ Attachment + + : + + +
+ + + + +
+
+
+ + diff --git a/src/addtaskprocess.jsp b/src/addtaskprocess.jsp new file mode 100644 index 00000000..fc8809e8 --- /dev/null +++ b/src/addtaskprocess.jsp @@ -0,0 +1,64 @@ +<%-- + Document : addtaskprocess + Created on : Apr 12, 2013, 11:32:03 PM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String category = request.getParameter("addtask_category"); + String username = session.getAttribute("sUsername").toString(); + String namaTask = request.getParameter("addtask_namaTask"); + String assigneeBlock = request.getParameter("addtask_assignee"); + String tagBlock = request.getParameter("addtask_tag"); + String tanggal = request.getParameter("addtask_deadline"); + String attachment1 = request.getParameter("addtask_attachment1"); + String attachment2 = request.getParameter("addtask_attachment2"); + String attachment3 = request.getParameter("addtask_attachment3"); + String attachment4 = request.getParameter("addtask_attachment4"); + String attachment5 = request.getParameter("addtask_attachment5"); + String pQuery = "INSERT INTO `sharedtodolist`.`task` (`namaTask`, `deadline`, `status`, `creatorTaskName`, `namaKategori`) VALUES ('" + namaTask + "', '" + tanggal + "', 'undone', '" + username + "', '" + category + "');"; + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if (ti == -1) { + response.sendRedirect("dashboard.jsp?category=" + category); + } else { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask`,`asigneeName`) VALUES ('" + namaTask + "','" + username + "')"; + MyDatabase.getSingleton().queryDB(pQuery); + String[] assignee = assigneeBlock.split(","); + for (int i = 0; i < assignee.length; i++) { + if (assignee[i] != null && !assignee[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask`,`asigneeName`) VALUES ('" + namaTask + "','" + assignee[i] + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + } + String[] tag = tagBlock.split(","); + for (int i = 0; i < tag.length; i++) { + if (tag[i] != null && !tag[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tagging` (`namaTask`,`tag`) VALUES ('" + namaTask + "','" + tag[i] + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + } + if (attachment1 != null && !attachment1.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment1 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment2 != null && !attachment2.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment2 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment3 != null && !attachment3.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment3 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment4 != null && !attachment4.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment4 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment5 != null && !attachment5.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment5 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("viewtask.jsp?namaTask="+namaTask); + } +%> diff --git a/src/attachment/avatar.jpg b/src/attachment/avatar.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/attachment/avatar.jpg differ diff --git a/src/attachment/sql.pdf b/src/attachment/sql.pdf new file mode 100644 index 00000000..0299b95a Binary files /dev/null and b/src/attachment/sql.pdf differ diff --git a/src/avatar2.jpg b/src/avatar2.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/avatar2.jpg differ diff --git a/src/dashboard.css b/src/dashboard.css new file mode 100644 index 00000000..afc04067 --- /dev/null +++ b/src/dashboard.css @@ -0,0 +1,353 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#dashboard-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#dashboard-tugas{ + width:600px; + height:500px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 25px 25px; + overflow:auto; +} + +#dashboard-listcategory{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + overflow:auto; + +} + +h1{color:white;} +h2{color:white;} +h3{color:white;} +h4{color:white;} +h5{color:white;} +h6{color:white;} +h7{color:white;} +#dashboard-title{ + text-align: center; +} + +.dash-category{ + color:yellow; +} +.dash-category:hover{ + color:orange; +} + +.category-content{ + height:auto; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dotted; + border-color: white; + margin-bottom:25px; + padding: 0px 25px 25px; +} + +li{color:white;} +a{color:yellow;} + +a:hover{ + color:orange; +} + +a.tag{ + color:yellow; +} +a.tag:hover{ + color:orange; +} + +button{ + float:right; +} + + +a#login_pop:hover, a#join_pop:hover { + border-color: #eee; +} +.overlay { + background-color: rgba(100, 100, 100, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + background-color: #888; + border: 3px solid #222; + display: inline-block; + left: 50%; + opacity: 100%; + padding: 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 25%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} +.popup p, .popup div { + margin-bottom: 10px; +} +.popup label { + display: inline-block; + text-align: left; + width: 120px; +} +.popup input[type="text"], .popup input[type="password"] { + border: 1px solid; + border-color: #999 #ccc #ccc; + margin: 0; + padding: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.popup input[type="text"]:hover, .popup input[type="password"]:hover { + border-color: #555 #888 #888; +} + + +#Content_Table{ + text-align: center; + display: block; + width : 1000px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Content_Table input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Content_Table input[type=text]:hover, +#Content_Table input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Content_Table input[type=text]:focus, +#Content_Table input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Content_Table input[type=submit], +#Content_Table input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Content_Table input[type=submit]:hover, +#Content_Table input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +/*dari atika*/ + + +#content nav{display:block;overflow:hidden;} +#content nav .nav-previous{float:left;width:50%;} +#content nav .nav-next{float:right;text-align:right;width:50%;} +#content #nav-above{display:none;} +.paged #content #nav-above,.single #content #nav-above{display:block;} +#nav-below{margin:1.2em 0 0;} +.page-link{margin:0 0 1.2em;} + +/* Secondary */ +#secondary .widget{margin:0 0 0 0;} +#secondary h1{font-size:1.4em; border-bottom:1px dotted #aaa;} +#secondary p{margin:0 0 15px 0;} +#secondary ul{list-style:none;margin:0 0 15px 0;padding:0;} +#secondary ul ul{margin:5px 0 5px 20px;font-size:0.9em;} +#secondary ul li{margin:0 0 5px 0;} +#secondary ul li a{font-size:1.2em;font-weight:400;} +#secondary table{width:100%;} + + +/*pop*/ +.modalDialog { + position: fixed; + font-family: Arial, Helvetica, sans-serif; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0,0,0,0.8); + z-index: 99999; + opacity:0; + -webkit-transition: opacity 400ms ease-in; + -moz-transition: opacity 400ms ease-in; + transition: opacity 400ms ease-in; + pointer-events: none; +} + +.modalDialog:target { + opacity:1; + pointer-events: auto; +} + +.modalDialog > div { + width: 400px; + position: relative; + margin: 10% auto; + padding: 5px 20px 13px 20px; + border-radius: 10px; + background: #fff; + background: -moz-linear-gradient(#fff, #999); + background: -webkit-linear-gradient(#fff, #999); + background: -o-linear-gradient(#fff, #999); +} + +.close { + background: #606061; + color: #FFFFFF; + line-height: 25px; + position: absolute; + right: -12px; + text-align: center; + top: -10px; + width: 24px; + text-decoration: none; + font-weight: bold; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + border-radius: 12px; + -moz-box-shadow: 1px 1px 3px #000; + -webkit-box-shadow: 1px 1px 3px #000; + box-shadow: 1px 1px 3px #000; +} + +.close:hover { background: #00d9ff; } diff --git a/src/dashboard.js b/src/dashboard.js new file mode 100644 index 00000000..6ae82e5a --- /dev/null +++ b/src/dashboard.js @@ -0,0 +1,73 @@ + +var kategori = [ + {ID: "Kategori 0", task: {Name:["task01","task02"],Deadline: ["01-01-2013","01-02-2013"], Deskripsi: ["deskripsi tugas 1","deskripsi tugas 2"]}, tag: ["tag01", "tag02"]}, + {ID: "Kategori 1", task: {Name:["task03","task04"],Deadline: ["02-01-2013","02-02-2013"], Deskripsi: ["deskripsi tugas 3","deskripsi tugas 4"]}, tag: ["tag11", "tag12"]}, + {ID: "Kategori 2", task: {Name:["task05","task06"],Deadline: ["03-01-2013","03-02-2013"], Deskripsi: ["deskripsi tugas 5","deskripsi tugas 6"]}, tag: ["tag21", "tag22"]}, +]; + + +function loadCategory() +{ + var xx = document.getElementById("dashboard-listcategory"); + xx.innerHTML = xx.innerHTML + "all
"; + + for (var b = 0; b < kategori.length; b++) + { + xx.innerHTML = xx.innerHTML + ("" + kategori[b].ID + "
"); + } + + xx.innerHTML = xx.innerHTML + "add category"; +} + +function loadTask(var1){ + var a = Math.floor(var1/10); + var b = var1 % 10; + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

" + kategori[a].task.Name[b] + "


" + kategori[a].task.Deskripsi[b] + "

"; + +} + +function makeTask(var1) +{ + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

halaman pembuatan tugas

"; +} + +function loadContentCategory(var1) +{ + var yy = document.getElementById("dashboard-tugas"); + yy.innerHTML = ""; + + if (var1 != -1){ + var zz = ""; + zz += "

" + kategori[var1].ID + "


Task:

    "; + for (c = 0; c < kategori[var1].task.Name.length; c++){ + zz += "
  1. "+ kategori[var1].task.Name[c] + " deadline: " + kategori[var1].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[var1].tag.length; d++){ + zz+= "" + kategori[var1].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } else { + for (var a = 0; a < kategori.length; a++) + { + var zz = ""; + zz += "

" + kategori[a].ID + "


Task:

    "; + for (c = 0; c < kategori[a].task.Name.length; c++){ + zz += "
  1. "+ kategori[a].task.Name[c] + " deadline: " + kategori[a].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[a].tag.length; d++){ + zz+= "" + kategori[a].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } + } +} diff --git a/src/dashboard.jsp b/src/dashboard.jsp new file mode 100644 index 00000000..d7858ece --- /dev/null +++ b/src/dashboard.jsp @@ -0,0 +1,161 @@ + +<%@page import="database.Checker"%> + +<%@page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + if(session.getAttribute("sUsername")==null) + response.sendRedirect("index.jsp"); +%> + + + S.Y.N. Dashboard + + + + + + + + + + +   +
+   +
+   +
+   +
+ + + + + +
+

Select Category :

+ +
+ +
+
+ <% + if (request.getParameter("category") != null && !request.getParameter("category").toString().equals("all")) { + String catcreator = Checker.getCategoryCreator(request.getParameter("category")); + out.println("Category Creator : " + catcreator + "

"); + if (catcreator.equals(session.getAttribute("sUsername"))) { + out.println(""); + } + if (Checker.isContributor(session.getAttribute("sUsername").toString(), request.getParameter("category").toString())) { + out.println(""); + } + } + %> +
+
+
+ ! Only Category Creator can delete category +
+
+
+ <% + String categ; + if (request.getParameter("category") == null || request.getParameter("category").equals("all")) { + categ = "1"; + } else { + categ = "namaKategori = \"" + request.getParameter("category") + "\""; + } + String tQuery = "Select * from task where " + categ + ";"; + %> +

+ Dashboard +
+ category : + <% + if (request.getParameter("category") == null || request.getParameter("category").equals("all")) { + out.println("all"); + } else { + out.println(request.getParameter("category")); + } + %> +

+ <% + MyDatabase myDB = new MyDatabase(); + ResultSet tResult = myDB.selectDB(tQuery); + while (tResult.next()) { + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println("

"); + out.println(""); + out.println(tResult.getString("namaTask") + "

"); + out.println("Deadline : " + tResult.getDate("deadline")); + out.println("
Tag : "); + String tQuery2 = "select * from tagging where namaTask=\"" + tResult.getString("namaTask") + "\";"; + MyDatabase myDB2 = new MyDatabase(); + ResultSet tResult2 = myDB2.selectDB(tQuery2); + while (tResult2.next()) { + out.println(tResult2.getString("tag") + ", "); + } + out.println("
"); + out.println("Status : " + tResult.getString("status") + "
"); + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println(""); + } + if (Checker.isCreator(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println(""); + } + out.println("
"); + out.println("===========
"); + } + } + %> + +
+ + diff --git a/src/deletecategory.jsp b/src/deletecategory.jsp new file mode 100644 index 00000000..03c6ae52 --- /dev/null +++ b/src/deletecategory.jsp @@ -0,0 +1,28 @@ +<%@page import="database.Checker"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaKategori = request.getParameter("namaKategori"); + if (Checker.getCategoryCreator(namaKategori).equals(session.getAttribute("sUsername").toString())) { + String pQuery = "select * from task where namaKategori=\"" + namaKategori + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + while (tResult.next()) { + String namaTask = tResult.getString("namaTask"); + String tQuery; + MyDatabase mydb1 = new MyDatabase(); + tQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`namaTask`= \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tagging` WHERE `tagging`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tasktoasignee` WHERE `tasktoasignee`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`attach` WHERE `attach`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`task` WHERE `task`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + } + pQuery = "DELETE FROM `sharedtodolist`.`kategori` WHERE `kategori`.`namaKategori`=\"" + request.getParameter("namaKategori") +"\""; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("dashboard.jsp"); +%> diff --git a/src/deletetask.jsp b/src/deletetask.jsp new file mode 100644 index 00000000..87fadab9 --- /dev/null +++ b/src/deletetask.jsp @@ -0,0 +1,19 @@ +<%@page import="database.Checker"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaTask = request.getParameter("namaTask"); + if (Checker.isCreator(session.getAttribute("sUsername").toString(), namaTask)) { + String tQuery; + tQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`namaTask`= \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tagging` WHERE `tagging`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tasktoasignee` WHERE `tasktoasignee`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`attach` WHERE `attach`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`task` WHERE `task`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + } + response.sendRedirect("dashboard.jsp"); +%> diff --git a/src/editprofil.js b/src/editprofil.js new file mode 100644 index 00000000..5f386db1 --- /dev/null +++ b/src/editprofil.js @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkPassword() { + var uname=document.forms["EditForm"]["daftar_username"].value; + var pass=document.forms["EditForm"]["daftar_password"].value; + var email=document.forms["EditForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password Tidak Berubah";return true;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["EditForm"]["daftar_password"].value; + var pass2=document.forms["EditForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["EditForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak berubah";return true;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["EditForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(filename=="") + {document.getElementById('avatarWarning').innerHTML="avatar tidak berubah";return true} + else if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkPassword() && checkConfirmPassword() && checkNama() && check_extension()); +} diff --git a/src/editprofil.jsp b/src/editprofil.jsp new file mode 100644 index 00000000..2c2e49e4 --- /dev/null +++ b/src/editprofil.jsp @@ -0,0 +1,128 @@ +<%-- + Document : editprofile + Created on : Apr 12, 2013, 8:30:05 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> + + + + + + + Edit Profile + + + +   +
+   +
+   +
+   +
+

Edit Profile

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Password + + : + + + "> + "> +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + diff --git a/src/editprofile.js b/src/editprofile.js new file mode 100644 index 00000000..47c5a493 --- /dev/null +++ b/src/editprofile.js @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkPassword() { + var uname=document.forms["EditForm"]["daftar_username"].value; + var pass=document.forms["EditForm"]["daftar_password"].value; + var email=document.forms["EditForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password Tidak Berubah";return true;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["EditForm"]["daftar_password"].value; + var pass2=document.forms["EditForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["EditForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak berubah";return true;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["EditForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(filename=="") + {document.getElementById('avatarWarning').innerHTML="avatar tidak berubah";return true} + else if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkPassword() && checkConfirmPassword() && checkNama() && check_extension()); +} \ No newline at end of file diff --git a/src/editprofile.jsp b/src/editprofile.jsp new file mode 100644 index 00000000..2c2e49e4 --- /dev/null +++ b/src/editprofile.jsp @@ -0,0 +1,128 @@ +<%-- + Document : editprofile + Created on : Apr 12, 2013, 8:30:05 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> + + + + + + + Edit Profile + + + +   +
+   +
+   +
+   +
+

Edit Profile

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Password + + : + + + "> + "> +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + diff --git a/src/editprofileprocess.jsp b/src/editprofileprocess.jsp new file mode 100644 index 00000000..618e5d22 --- /dev/null +++ b/src/editprofileprocess.jsp @@ -0,0 +1,34 @@ +<%-- + Document : editprofileprocess + Created on : Apr 12, 2013, 9:09:01 AM + Author : Arief +--%> + +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="database.Checker"%> +<% + String uname = request.getParameter("daftar_username"); + String fullname = request.getParameter("daftar_namalengkap"); + String password = request.getParameter("daftar_password"); + String email = request.getParameter("daftar_email"); + String tanggal = request.getParameter("daftar_tanggallahir"); + String avatar = request.getParameter("daftar_avatar"); + if (avatar != null) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `avatar` = '" + avatar + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (!(tanggal == null || tanggal == "")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `tanggalLahir` = '" + tanggal + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (fullname != null && !fullname.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `fullname` = '" + fullname + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (password != null && !password.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `password` = '" + password + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("profil.jsp"); +%> \ No newline at end of file diff --git a/src/editprofilprocess.jsp b/src/editprofilprocess.jsp new file mode 100644 index 00000000..f3a4fce0 --- /dev/null +++ b/src/editprofilprocess.jsp @@ -0,0 +1,28 @@ +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="database.Checker"%> +<% + String uname = request.getParameter("daftar_username"); + String fullname = request.getParameter("daftar_namalengkap"); + String password = request.getParameter("daftar_password"); + String email = request.getParameter("daftar_email"); + String tanggal = request.getParameter("daftar_tanggallahir"); + String avatar = request.getParameter("daftar_avatar"); + if (avatar != null) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `avatar` = '" + avatar + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (!(tanggal == null || tanggal == "")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `tanggalLahir` = '" + tanggal + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (fullname != null && !fullname.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `fullname` = '" + fullname + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (password != null && !password.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `password` = '" + password + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("profil.jsp"); +%> diff --git a/src/edittask.js b/src/edittask.js new file mode 100644 index 00000000..6a39688f --- /dev/null +++ b/src/edittask.js @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkTag() { + var tag=document.forms["editTaskForm"]["edittask_tag"].value; + if(tag=="" || tag==null) + {document.getElementById('tagwarning').innerHTML="*Warning! Seluruh task akan dihapus";} + else + {document.getElementById('tagwarning').innerHTML="";} +} + +function checkAssignee() { + var tag=document.forms["editTaskForm"]["edittask_assignee"].value; + if(tag=="" || tag==null) + {document.getElementById('assigneewarning').innerHTML="*Warning! Seluruh assignee akan dihapus, kecuali task creator";} + else + {document.getElementById('assigneewarning').innerHTML="";} +} + + + +function checkValidation() { + checkTag(); + checkAssignee(); +} \ No newline at end of file diff --git a/src/edittask.jsp b/src/edittask.jsp new file mode 100644 index 00000000..cc93915e --- /dev/null +++ b/src/edittask.jsp @@ -0,0 +1,96 @@ +<%-- + Document : edittask + Created on : Apr 13, 2013, 2:32:07 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page import="java.sql.Date"%> +<%@page import="database.MyDatabase"%> +<%@page import="java.sql.ResultSet"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + Edit Task + + + +   +
+   +
+   +
+   +
+ <% + String namaTask = request.getParameter("namaTask"); + String pQuery = "select distinct * from tasktoasignee where namaTask =\"" + namaTask + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + String assigneeList = ""; + while (tResult.next()) { + assigneeList = assigneeList + tResult.getString("asigneeName") + ","; + } + pQuery = "select distinct * from tagging where namaTask=\"" + namaTask + "\""; + tResult = MyDatabase.getSingleton().selectDB(pQuery); + String tagList = ""; + while (tResult.next()) { + tagList = tagList + tResult.getString("tag") + ","; + } + pQuery = "select * from task where namaTask=\"" + namaTask + "\""; + tResult = MyDatabase.getSingleton().selectDB(pQuery); + Date deadline = new Date(2012, 4, 3); + while (tResult.next()) { + deadline = tResult.getDate("deadline"); + } + %> +

Edit Task

+ <% + if (Checker.isCreator(session.getAttribute("sUsername").toString(), namaTask)) { + out.println(""); + } + %> +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Assignee: + + +
Tag: + +
Deadline: + +
+ +
+
+ + diff --git a/src/edittaskprocess.jsp b/src/edittaskprocess.jsp new file mode 100644 index 00000000..3a9ea676 --- /dev/null +++ b/src/edittaskprocess.jsp @@ -0,0 +1,48 @@ +<%-- + Document : edittaskprocess + Created on : Apr 13, 2013, 3:08:13 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaTask = request.getParameter("edittask_namaTask"); + String assigneeList = request.getParameter("edittask_assignee"); + String tagList = request.getParameter("edittask_tag"); + String deadline = request.getParameter("edittask_date"); + String pQuery = "UPDATE `sharedtodolist`.`task` SET `deadline`='" + deadline + "' where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + String creatorName = ""; + pQuery = "select * from task where namaTask=\"" + namaTask + "\""; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + while (resultSet.next()) { + creatorName = resultSet.getString("creatorTaskName"); + } + + pQuery = "delete from tasktoasignee where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask` ,`asigneeName`)VALUES ('" + namaTask + "', '" + creatorName + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + if (assigneeList != null && !assigneeList.equals("")) { + String[] assignee = assigneeList.split(","); + for (int i = 0; i < assignee.length; i++) { + if (assignee[i] != null && !assignee[i].equals("") && !assignee[i].equals(creatorName)) { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask` ,`asigneeName`)VALUES ('" + namaTask + "', '" + assignee[i] + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + } + } + } + + pQuery = "delete from tagging where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + if (tagList != null && !tagList.equals("")) { + String[] tag = tagList.split(","); + for (int i = 0; i < tag.length; i++) { + if (tag[i] != null && !tag[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tagging` (`namaTask` ,`tag`)VALUES ('" + namaTask + "', '" + tag[i] + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + } + } + } + response.sendRedirect("viewtask.jsp?namaTask="+namaTask); +%> diff --git a/src/hapuskomentar.jsp b/src/hapuskomentar.jsp new file mode 100644 index 00000000..61ec98f6 --- /dev/null +++ b/src/hapuskomentar.jsp @@ -0,0 +1,18 @@ +<%-- + Document : ubahstatus + Created on : Apr 12, 2013, 1:39:37 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + int target = Integer.parseInt(request.getParameter("target").toString()); + String namaTask = request.getParameter("namaTask").toString(); + int idk = Integer.parseInt(request.getParameter("idkomentar").toString()); + out.println(target); + out.println(namaTask); + out.println(idk); + String pQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`idKomentar` = "+idk; + MyDatabase.getSingleton().queryDB(pQuery); + response.sendRedirect("viewtask.jsp?namaTask="+namaTask+"&target="+target); +%> diff --git a/src/header.css b/src/header.css new file mode 100644 index 00000000..58a8f671 --- /dev/null +++ b/src/header.css @@ -0,0 +1,82 @@ +/* + Document : header.css + Created on : Apr 12, 2013, 6:41:42 AM + Author : Arief + Description: + Purpose of the stylesheet follows. +*/ + +#Header { + display: block; + width: 1000px; + height: 130px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; + text-align: center; +} + +#Header hr { + border : 1px dashed; + border-color : #ccc; +} + +#Header a{ + font-family: monospace; + color: white; + text-decoration: none; +} + +#Header a:hover{ + color:antiquewhite; + text-decoration: underline overline; +} + +#Header input[type=text], +#Header input[type="password"]{ + background-color: grey; + border: 1px dashed white; + color:white; +} + +#Header input[type=text]:hover, +#Header input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Header input[type=text]:focus, +#Header input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Header input[type=submit], +#Header input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Header input[type=submit]:hover, +#Header input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} \ No newline at end of file diff --git a/src/header.jsp b/src/header.jsp new file mode 100644 index 00000000..dbb2e7ef --- /dev/null +++ b/src/header.jsp @@ -0,0 +1,47 @@ +<%@page import="database.Checker"%> +<% + if(session.getAttribute("sUsername")==null) + response.sendRedirect("index.jsp"); +%> + + + + + S.Y.N. Dashboard + + + + + + + \ No newline at end of file diff --git a/src/images/avatar.jpg b/src/images/avatar.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/images/avatar.jpg differ diff --git a/src/images/syn.jpg b/src/images/syn.jpg new file mode 100644 index 00000000..b33556c8 Binary files /dev/null and b/src/images/syn.jpg differ diff --git a/src/images/syn.psd b/src/images/syn.psd new file mode 100644 index 00000000..61504fcc Binary files /dev/null and b/src/images/syn.psd differ diff --git a/src/images/syn2.jpg b/src/images/syn2.jpg new file mode 100644 index 00000000..79e2381a Binary files /dev/null and b/src/images/syn2.jpg differ diff --git a/src/index.jsp b/src/index.jsp new file mode 100644 index 00000000..654d9cb1 --- /dev/null +++ b/src/index.jsp @@ -0,0 +1,190 @@ +<%-- + Document : index + Created on : Apr 11, 2013, 10:55:56 AM + Author : Arief +--%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + if(session.getAttribute("sUsername")!=null) + response.sendRedirect("dashboard.jsp"); +%> + + + + S.Y.N Login Page + + + + + + +
+

Login Form :

+
+ + + + + + + + + + + + + + +
+ Username + + : + + +
+ Password + + : + + +
+ +
+
+
+
+ <% + if(request.getParameter("error")!=null) + out.println("

"+request.getParameter("error")+"

"); + %> +
+
+

Registration Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Username + + : + + +
+
+
+ Password + + : + + +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+ e-Mail + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + + diff --git a/src/loginpage.css b/src/loginpage.css new file mode 100644 index 00000000..72da27b0 --- /dev/null +++ b/src/loginpage.css @@ -0,0 +1,96 @@ +/* + Document : LoginPage + Created on : Feb 19, 2013, 7:09:01 AM + Author : Arief + Description: + CSS for Login Page +*/ + + +#Front_Logo { + display: block; + width: 600px; + height: 200px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form{ + text-align: center; + display: block; + width: 400px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Front_Form input[type=text]:hover, +#Front_Form input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Front_Form input[type=text]:focus, +#Front_Form input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Front_Form input[type=submit], +#Front_Form input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Front_Form input[type=submit]:hover, +#Front_Form input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +body { + background-color: grey; + font-family: monospace; + color: white; + text-align: center; +} + +iframe { + border:none; +} \ No newline at end of file diff --git a/src/loginprocess.jsp b/src/loginprocess.jsp new file mode 100644 index 00000000..79278c6b --- /dev/null +++ b/src/loginprocess.jsp @@ -0,0 +1,25 @@ +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> + +<% + String username = request.getParameter("username"); + String password = request.getParameter("password"); + + String tQuery = "SELECT * FROM user WHERE username='" + username + "' AND password='" + password + "';"; + try { + ResultSet tResult = MyDatabase.getSingleton().selectDB(tQuery); + if (tResult.next()) { + session.setMaxInactiveInterval(2592000); + session.setAttribute("isActive",true); + session.setAttribute("sUsername", tResult.getString("username")); + session.setAttribute("sAvatar", tResult.getString("avatar")); + session.setAttribute("sNama", tResult.getString("fullname")); + response.sendRedirect("dashboard.jsp"); + } else { + String message = "No user or password matched"; + response.sendRedirect("index.jsp?error=" + message); + } + } catch (Exception e) { + e.printStackTrace(); + } + +%> diff --git a/src/logoutprocess.jsp b/src/logoutprocess.jsp new file mode 100644 index 00000000..e554e566 --- /dev/null +++ b/src/logoutprocess.jsp @@ -0,0 +1,10 @@ +<%-- + Document : logoutprocess + Created on : Apr 12, 2013, 6:11:12 AM + Author : Arief +--%> + +<% + session.invalidate(); + response.sendRedirect("index.jsp?error=user logout success"); +%> diff --git a/src/movie.mp4 b/src/movie.mp4 new file mode 100644 index 00000000..3daaab5a Binary files /dev/null and b/src/movie.mp4 differ diff --git a/src/myscript.js b/src/myscript.js new file mode 100644 index 00000000..49fcdf63 --- /dev/null +++ b/src/myscript.js @@ -0,0 +1,136 @@ +function myfunc(categ,i){ + return categ.task[i]; +} + +function myfunc2(categ){ + return categ.assignee; +} + +function myfunc3(categ){ + return categ.deadline; +} + +function myfunc4(categ){ + return categ.comment; +} + +function myfunc5(categ){ + return categ.tag; +} + + +function addtask(task, deadline, assignee, comment, tag){ + this.task = task; + //this.att = att; + this.deadline = deadline; + this.assignee = assignee; + this.comment = comment; + this.tag = tag; +} + +function createcateg(){ + var d1 = new Date("October 13, 2013 10:13:00") + var d2 = new Date("July 12, 2014 07:13:00") + var d3 = new Date("September 29, 1955 11:13:00") + //categ={cat:cat, task:task, deadline:deadline, assignee:assignee, comment:comment, tag:tag};//var task1 = new Array("Buy a Ferrari","Rent an apartment","Build a startup","Fail in life"); + categ1={task:["Buy a Ferrari","Rent an apartment","Build a startup","Buy some milk"], deadline:d1, assignee:"Cow", comment:"hurry", tag:"#misc #food"}; + + //var task2 = new Array("Buy a Lexus","Rent an apartment","Build a startup","Fail in life"); + categ2={task:["Buy a Lexus","Sleep beside a hobo","Fail in life","Build a startup"], deadline:d2, assignee:"Atika", comment:"start small", tag:"#work #money"}; + + //var task3 = new Array("Buy a Volkswagen","Rent an apartment","Build a startup","Fail in life"); + categ3={task:["Buy a Volkswagen","Buy a house","Build a startup","Go back to the future"], deadline:d3, assignee:"Marty", comment:"urgent matters", tag:"#project #time"}; +} + +var categ1, categ2, categ3; + +function mOver1(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + + + +} + +function mOver2(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + +} + +function mOver3(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + +} + +function mOut(obj) +{ + //document.getElementById("tasklist").innerHTML=mclk(tasklist); +} + +function SearchDatabase() +{ + document.forms['formsearch'].submit(); +} + +function register_check() { + + var regex_username = /^[A-Za-z0-9_]{5,}$/; + var regex_password = /^[A-Za-z0-9!@()$%^&*#_]{8,}$/; + var regex_email = /^[A-Za-z][A-Za-z0-9_.]*\@[A-Za-z0-9_.-]+\.[A-Za-z][A-Za-z]+$/; + var regex_fullname = /^[A-Za-z]+ [A-Za-z \.]+$/; + var regex_birthdate = /^\d{4}\-\d{2}\-\d{2}$/; + var avatar_ext = $id("registerform-avatar").value.split('.').pop(); + + var ok = true; + + window.registerform_validation['username'] = regex_username.test($id("registerform-username").value); + window.registerform_validation['password'] = regex_password.test($id("registerform-password").value); + window.registerform_validation['equalsUPE'] = ($id("registerform-password").value != $id("registerform-username").value) && ($id("registerform-password").value != $id("registerform-email").value); + window.registerform_validation['password2'] = ($id("registerform-password").value == $id("registerform-password2").value); + window.registerform_validation['fullname'] = regex_fullname.test($id("registerform-fullname").value); + window.registerform_validation['birthdate'] = (regex_birthdate.test($id("registerform-birthdate").value)) && (parseInt($id("registerform-birthdate").value.split('-')[0]) >= 1955); + window.registerform_validation['email'] = regex_email.test($id("registerform-email").value); + window.registerform_validation['avatar'] = (avatar_ext == "jpg") || (avatar_ext == "jpeg"); + + for(key in registerform_validation) { + if(!registerform_validation[key]) { + $id("registerform-submit").disabled = true; + ok = false; + } + } + if(ok) { + $id("registerform-submit").disabled = false; + } +} + +function addcateg() +{ + xmlhttp.open("POST","newcategory,jsp?q=afuu",true); + xmlhttp.send(); +} \ No newline at end of file diff --git a/src/netbeans-project/build.xml b/src/netbeans-project/build.xml new file mode 100644 index 00000000..eb06c6fc --- /dev/null +++ b/src/netbeans-project/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project progin3. + + + diff --git a/src/netbeans-project/build/web/META-INF/MANIFEST.MF b/src/netbeans-project/build/web/META-INF/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/src/netbeans-project/build/web/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/src/netbeans-project/build/web/META-INF/context.xml b/src/netbeans-project/build/web/META-INF/context.xml new file mode 100644 index 00000000..40f22994 --- /dev/null +++ b/src/netbeans-project/build/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/src/netbeans-project/build/web/WEB-INF/classes/database/Checker.class b/src/netbeans-project/build/web/WEB-INF/classes/database/Checker.class new file mode 100644 index 00000000..74c8567f Binary files /dev/null and b/src/netbeans-project/build/web/WEB-INF/classes/database/Checker.class differ diff --git a/src/netbeans-project/build/web/WEB-INF/classes/database/MyDatabase.class b/src/netbeans-project/build/web/WEB-INF/classes/database/MyDatabase.class new file mode 100644 index 00000000..c7bb1061 Binary files /dev/null and b/src/netbeans-project/build/web/WEB-INF/classes/database/MyDatabase.class differ diff --git a/src/netbeans-project/build/web/WEB-INF/lib/mysql-connector-java-5.1.16-bin.jar b/src/netbeans-project/build/web/WEB-INF/lib/mysql-connector-java-5.1.16-bin.jar new file mode 100644 index 00000000..e62f2cb7 Binary files /dev/null and b/src/netbeans-project/build/web/WEB-INF/lib/mysql-connector-java-5.1.16-bin.jar differ diff --git a/src/netbeans-project/build/web/addtask.js b/src/netbeans-project/build/web/addtask.js new file mode 100644 index 00000000..207c253d --- /dev/null +++ b/src/netbeans-project/build/web/addtask.js @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkNamaTask() { + var isalpha = false; + var uname=document.forms["AddTaskForm"]["addtask_namaTask"].value; + for(var i=0;(i47 && cc<58) || (cc>64 && cc<91) || (cc>96 && cc<123))) + { + isalpha = true; + } + } + if(isalpha==true){ + {document.getElementById('namaTaskWarning').innerHTML="*Nama Task tidak boleh alphanumeric";return false;} + } + else + if(uname=="" || uname==null) + {document.getElementById('namaTaskWarning').innerHTML="*Nama Task tidak boleh kosong";return false;} + else + if(uname.length>25) + {document.getElementById('namaTaskWarning').innerHTML="*NamaTask harus <= 25 karakter";return false;} + else + {document.getElementById('namaTaskWarning').innerHTML="";return true;} +} + +function checkValidation() { + return (checkNamaTask()); +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/addtask.jsp b/src/netbeans-project/build/web/addtask.jsp new file mode 100644 index 00000000..91f9d615 --- /dev/null +++ b/src/netbeans-project/build/web/addtask.jsp @@ -0,0 +1,176 @@ +<%-- + Document : addtask + Created on : Apr 12, 2013, 10:48:35 PM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + S.Y.N. Add Task + + + +   +
+   +
+   +
+   +
+

Add Task

+
+

Add Task Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Nama Task + + : + + "> + +
+
+
+ Assignee + + : + + +
+
+
+
+
+ Tag + + : + + +
+
+
+
+
+ Tanggal Deadline + + : + + +
+ Attachment + + : + + +
+
+
+ Attachment + + : + + +
+ Attachment + + : + + +
+ Attachment + + : + + +
+ Attachment + + : + + +
+ + + + +
+
+
+ + diff --git a/src/netbeans-project/build/web/addtaskprocess.jsp b/src/netbeans-project/build/web/addtaskprocess.jsp new file mode 100644 index 00000000..fc8809e8 --- /dev/null +++ b/src/netbeans-project/build/web/addtaskprocess.jsp @@ -0,0 +1,64 @@ +<%-- + Document : addtaskprocess + Created on : Apr 12, 2013, 11:32:03 PM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String category = request.getParameter("addtask_category"); + String username = session.getAttribute("sUsername").toString(); + String namaTask = request.getParameter("addtask_namaTask"); + String assigneeBlock = request.getParameter("addtask_assignee"); + String tagBlock = request.getParameter("addtask_tag"); + String tanggal = request.getParameter("addtask_deadline"); + String attachment1 = request.getParameter("addtask_attachment1"); + String attachment2 = request.getParameter("addtask_attachment2"); + String attachment3 = request.getParameter("addtask_attachment3"); + String attachment4 = request.getParameter("addtask_attachment4"); + String attachment5 = request.getParameter("addtask_attachment5"); + String pQuery = "INSERT INTO `sharedtodolist`.`task` (`namaTask`, `deadline`, `status`, `creatorTaskName`, `namaKategori`) VALUES ('" + namaTask + "', '" + tanggal + "', 'undone', '" + username + "', '" + category + "');"; + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if (ti == -1) { + response.sendRedirect("dashboard.jsp?category=" + category); + } else { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask`,`asigneeName`) VALUES ('" + namaTask + "','" + username + "')"; + MyDatabase.getSingleton().queryDB(pQuery); + String[] assignee = assigneeBlock.split(","); + for (int i = 0; i < assignee.length; i++) { + if (assignee[i] != null && !assignee[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask`,`asigneeName`) VALUES ('" + namaTask + "','" + assignee[i] + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + } + String[] tag = tagBlock.split(","); + for (int i = 0; i < tag.length; i++) { + if (tag[i] != null && !tag[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tagging` (`namaTask`,`tag`) VALUES ('" + namaTask + "','" + tag[i] + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + } + if (attachment1 != null && !attachment1.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment1 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment2 != null && !attachment2.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment2 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment3 != null && !attachment3.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment3 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment4 != null && !attachment4.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment4 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment5 != null && !attachment5.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment5 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("viewtask.jsp?namaTask="+namaTask); + } +%> diff --git a/src/netbeans-project/build/web/attachment/avatar.jpg b/src/netbeans-project/build/web/attachment/avatar.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/netbeans-project/build/web/attachment/avatar.jpg differ diff --git a/src/netbeans-project/build/web/attachment/sql.pdf b/src/netbeans-project/build/web/attachment/sql.pdf new file mode 100644 index 00000000..0299b95a Binary files /dev/null and b/src/netbeans-project/build/web/attachment/sql.pdf differ diff --git a/src/netbeans-project/build/web/avatar2.jpg b/src/netbeans-project/build/web/avatar2.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/netbeans-project/build/web/avatar2.jpg differ diff --git a/src/netbeans-project/build/web/dashboard.css b/src/netbeans-project/build/web/dashboard.css new file mode 100644 index 00000000..f15e1448 --- /dev/null +++ b/src/netbeans-project/build/web/dashboard.css @@ -0,0 +1,353 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#dashboard-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#dashboard-tugas{ + width:600px; + height:500px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 25px 25px; + overflow:auto; +} + +#dashboard-listcategory{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + overflow:auto; + +} + +h1{color:white;} +h2{color:white;} +h3{color:white;} +h4{color:white;} +h5{color:white;} +h6{color:white;} +h7{color:white;} +#dashboard-title{ + text-align: center; +} + +.dash-category{ + color:yellow; +} +.dash-category:hover{ + color:orange; +} + +.category-content{ + height:auto; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dotted; + border-color: white; + margin-bottom:25px; + padding: 0px 25px 25px; +} + +li{color:white;} +a{color:yellow;} + +a:hover{ + color:orange; +} + +a.tag{ + color:yellow; +} +a.tag:hover{ + color:orange; +} + +button{ + float:right; +} + + +a#login_pop:hover, a#join_pop:hover { + border-color: #eee; +} +.overlay { + background-color: rgba(100, 100, 100, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + background-color: #888; + border: 3px solid #222; + display: inline-block; + left: 50%; + opacity: 100%; + padding: 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 25%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} +.popup p, .popup div { + margin-bottom: 10px; +} +.popup label { + display: inline-block; + text-align: left; + width: 120px; +} +.popup input[type="text"], .popup input[type="password"] { + border: 1px solid; + border-color: #999 #ccc #ccc; + margin: 0; + padding: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.popup input[type="text"]:hover, .popup input[type="password"]:hover { + border-color: #555 #888 #888; +} + + +#Content_Table{ + text-align: center; + display: block; + width : 1000px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Content_Table input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Content_Table input[type=text]:hover, +#Content_Table input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Content_Table input[type=text]:focus, +#Content_Table input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Content_Table input[type=submit], +#Content_Table input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Content_Table input[type=submit]:hover, +#Content_Table input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +/*dari atika*/ + + +#content nav{display:block;overflow:hidden;} +#content nav .nav-previous{float:left;width:50%;} +#content nav .nav-next{float:right;text-align:right;width:50%;} +#content #nav-above{display:none;} +.paged #content #nav-above,.single #content #nav-above{display:block;} +#nav-below{margin:1.2em 0 0;} +.page-link{margin:0 0 1.2em;} + +/* Secondary */ +#secondary .widget{margin:0 0 0 0;} +#secondary h1{font-size:1.4em; border-bottom:1px dotted #aaa;} +#secondary p{margin:0 0 15px 0;} +#secondary ul{list-style:none;margin:0 0 15px 0;padding:0;} +#secondary ul ul{margin:5px 0 5px 20px;font-size:0.9em;} +#secondary ul li{margin:0 0 5px 0;} +#secondary ul li a{font-size:1.2em;font-weight:400;} +#secondary table{width:100%;} + + +/*pop*/ +.modalDialog { + position: fixed; + font-family: Arial, Helvetica, sans-serif; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0,0,0,0.8); + z-index: 99999; + opacity:0; + -webkit-transition: opacity 400ms ease-in; + -moz-transition: opacity 400ms ease-in; + transition: opacity 400ms ease-in; + pointer-events: none; +} + +.modalDialog:target { + opacity:1; + pointer-events: auto; +} + +.modalDialog > div { + width: 400px; + position: relative; + margin: 10% auto; + padding: 5px 20px 13px 20px; + border-radius: 10px; + background: #fff; + background: -moz-linear-gradient(#fff, #999); + background: -webkit-linear-gradient(#fff, #999); + background: -o-linear-gradient(#fff, #999); +} + +.close { + background: #606061; + color: #FFFFFF; + line-height: 25px; + position: absolute; + right: -12px; + text-align: center; + top: -10px; + width: 24px; + text-decoration: none; + font-weight: bold; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + border-radius: 12px; + -moz-box-shadow: 1px 1px 3px #000; + -webkit-box-shadow: 1px 1px 3px #000; + box-shadow: 1px 1px 3px #000; +} + +.close:hover { background: #00d9ff; } \ No newline at end of file diff --git a/src/netbeans-project/build/web/dashboard.js b/src/netbeans-project/build/web/dashboard.js new file mode 100644 index 00000000..a2a042ae --- /dev/null +++ b/src/netbeans-project/build/web/dashboard.js @@ -0,0 +1,73 @@ + +var kategori = [ + {ID: "Kategori 0", task: {Name:["task01","task02"],Deadline: ["01-01-2013","01-02-2013"], Deskripsi: ["deskripsi tugas 1","deskripsi tugas 2"]}, tag: ["tag01", "tag02"]}, + {ID: "Kategori 1", task: {Name:["task03","task04"],Deadline: ["02-01-2013","02-02-2013"], Deskripsi: ["deskripsi tugas 3","deskripsi tugas 4"]}, tag: ["tag11", "tag12"]}, + {ID: "Kategori 2", task: {Name:["task05","task06"],Deadline: ["03-01-2013","03-02-2013"], Deskripsi: ["deskripsi tugas 5","deskripsi tugas 6"]}, tag: ["tag21", "tag22"]}, +]; + + +function loadCategory() +{ + var xx = document.getElementById("dashboard-listcategory"); + xx.innerHTML = xx.innerHTML + "all
"; + + for (var b = 0; b < kategori.length; b++) + { + xx.innerHTML = xx.innerHTML + ("" + kategori[b].ID + "
"); + } + + xx.innerHTML = xx.innerHTML + "add category"; +} + +function loadTask(var1){ + var a = Math.floor(var1/10); + var b = var1 % 10; + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

" + kategori[a].task.Name[b] + "


" + kategori[a].task.Deskripsi[b] + "

"; + +} + +function makeTask(var1) +{ + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

halaman pembuatan tugas

"; +} + +function loadContentCategory(var1) +{ + var yy = document.getElementById("dashboard-tugas"); + yy.innerHTML = ""; + + if (var1 != -1){ + var zz = ""; + zz += "

" + kategori[var1].ID + "


Task:

    "; + for (c = 0; c < kategori[var1].task.Name.length; c++){ + zz += "
  1. "+ kategori[var1].task.Name[c] + " deadline: " + kategori[var1].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[var1].tag.length; d++){ + zz+= "" + kategori[var1].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } else { + for (var a = 0; a < kategori.length; a++) + { + var zz = ""; + zz += "

" + kategori[a].ID + "


Task:

    "; + for (c = 0; c < kategori[a].task.Name.length; c++){ + zz += "
  1. "+ kategori[a].task.Name[c] + " deadline: " + kategori[a].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[a].tag.length; d++){ + zz+= "" + kategori[a].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } + } +} diff --git a/src/netbeans-project/build/web/dashboard.jsp b/src/netbeans-project/build/web/dashboard.jsp new file mode 100644 index 00000000..49f9afb9 --- /dev/null +++ b/src/netbeans-project/build/web/dashboard.jsp @@ -0,0 +1,161 @@ + +<%@page import="database.Checker"%> + +<%@page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + if(session.getAttribute("sUsername")==null) + response.sendRedirect("index.jsp"); +%> + + + S.Y.N. Dashboard + + + + + + + + + + +   +
+   +
+   +
+   +
+ + + + + +
+

Select Category :

+ +
+ +
+
+ <% + if (request.getParameter("category") != null && !request.getParameter("category").toString().equals("all")) { + String catcreator = Checker.getCategoryCreator(request.getParameter("category")); + out.println("Category Creator : " + catcreator + "

"); + if (catcreator.equals(session.getAttribute("sUsername"))) { + out.println(""); + } + if (Checker.isContributor(session.getAttribute("sUsername").toString(), request.getParameter("category").toString())) { + out.println(""); + } + } + %> +
+
+
+ ! Only Category Creator can delete category +
+
+
+ <% + String categ; + if (request.getParameter("category") == null || request.getParameter("category").equals("all")) { + categ = "1"; + } else { + categ = "namaKategori = \"" + request.getParameter("category") + "\""; + } + String tQuery = "Select * from task where " + categ + ";"; + %> +

+ Dashboard +
+ category : + <% + if (request.getParameter("category") == null || request.getParameter("category").equals("all")) { + out.println("all"); + } else { + out.println(request.getParameter("category")); + } + %> +

+ <% + MyDatabase myDB = new MyDatabase(); + ResultSet tResult = myDB.selectDB(tQuery); + while (tResult.next()) { + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println("

"); + out.println(""); + out.println(tResult.getString("namaTask") + "

"); + out.println("Deadline : " + tResult.getDate("deadline")); + out.println("
Tag : "); + String tQuery2 = "select * from tagging where namaTask=\"" + tResult.getString("namaTask") + "\";"; + MyDatabase myDB2 = new MyDatabase(); + ResultSet tResult2 = myDB2.selectDB(tQuery2); + while (tResult2.next()) { + out.println(tResult2.getString("tag") + ", "); + } + out.println("
"); + out.println("Status : " + tResult.getString("status") + "
"); + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println(""); + } + if (Checker.isCreator(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println(""); + } + out.println("
"); + out.println("===========
"); + } + } + %> + +
+ + \ No newline at end of file diff --git a/src/netbeans-project/build/web/deletecategory.jsp b/src/netbeans-project/build/web/deletecategory.jsp new file mode 100644 index 00000000..232dbc14 --- /dev/null +++ b/src/netbeans-project/build/web/deletecategory.jsp @@ -0,0 +1,34 @@ +<%-- + Document : deletecategory + Created on : Apr 12, 2013, 5:10:46 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaKategori = request.getParameter("namaKategori"); + if (Checker.getCategoryCreator(namaKategori).equals(session.getAttribute("sUsername").toString())) { + String pQuery = "select * from task where namaKategori=\"" + namaKategori + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + while (tResult.next()) { + String namaTask = tResult.getString("namaTask"); + String tQuery; + MyDatabase mydb1 = new MyDatabase(); + tQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`namaTask`= \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tagging` WHERE `tagging`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tasktoasignee` WHERE `tasktoasignee`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`attach` WHERE `attach`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`task` WHERE `task`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + } + pQuery = "DELETE FROM `sharedtodolist`.`kategori` WHERE `kategori`.`namaKategori`=\"" + request.getParameter("namaKategori") +"\""; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("dashboard.jsp"); +%> \ No newline at end of file diff --git a/src/netbeans-project/build/web/deletetask.jsp b/src/netbeans-project/build/web/deletetask.jsp new file mode 100644 index 00000000..7eea3601 --- /dev/null +++ b/src/netbeans-project/build/web/deletetask.jsp @@ -0,0 +1,24 @@ +<%-- + Document : deletetask + Created on : Apr 12, 2013, 2:13:51 AM + Author : Arief +--%> +<%@page import="database.Checker"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaTask = request.getParameter("namaTask"); + if (Checker.isCreator(session.getAttribute("sUsername").toString(), namaTask)) { + String tQuery; + tQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`namaTask`= \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tagging` WHERE `tagging`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tasktoasignee` WHERE `tasktoasignee`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`attach` WHERE `attach`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`task` WHERE `task`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + } + response.sendRedirect("dashboard.jsp"); +%> \ No newline at end of file diff --git a/src/netbeans-project/build/web/editprofile.js b/src/netbeans-project/build/web/editprofile.js new file mode 100644 index 00000000..47c5a493 --- /dev/null +++ b/src/netbeans-project/build/web/editprofile.js @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkPassword() { + var uname=document.forms["EditForm"]["daftar_username"].value; + var pass=document.forms["EditForm"]["daftar_password"].value; + var email=document.forms["EditForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password Tidak Berubah";return true;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["EditForm"]["daftar_password"].value; + var pass2=document.forms["EditForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["EditForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak berubah";return true;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["EditForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(filename=="") + {document.getElementById('avatarWarning').innerHTML="avatar tidak berubah";return true} + else if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkPassword() && checkConfirmPassword() && checkNama() && check_extension()); +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/editprofile.jsp b/src/netbeans-project/build/web/editprofile.jsp new file mode 100644 index 00000000..2c2e49e4 --- /dev/null +++ b/src/netbeans-project/build/web/editprofile.jsp @@ -0,0 +1,128 @@ +<%-- + Document : editprofile + Created on : Apr 12, 2013, 8:30:05 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> + + + + + + + Edit Profile + + + +   +
+   +
+   +
+   +
+

Edit Profile

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Password + + : + + + "> + "> +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + diff --git a/src/netbeans-project/build/web/editprofileprocess.jsp b/src/netbeans-project/build/web/editprofileprocess.jsp new file mode 100644 index 00000000..618e5d22 --- /dev/null +++ b/src/netbeans-project/build/web/editprofileprocess.jsp @@ -0,0 +1,34 @@ +<%-- + Document : editprofileprocess + Created on : Apr 12, 2013, 9:09:01 AM + Author : Arief +--%> + +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="database.Checker"%> +<% + String uname = request.getParameter("daftar_username"); + String fullname = request.getParameter("daftar_namalengkap"); + String password = request.getParameter("daftar_password"); + String email = request.getParameter("daftar_email"); + String tanggal = request.getParameter("daftar_tanggallahir"); + String avatar = request.getParameter("daftar_avatar"); + if (avatar != null) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `avatar` = '" + avatar + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (!(tanggal == null || tanggal == "")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `tanggalLahir` = '" + tanggal + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (fullname != null && !fullname.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `fullname` = '" + fullname + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (password != null && !password.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `password` = '" + password + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("profil.jsp"); +%> \ No newline at end of file diff --git a/src/netbeans-project/build/web/edittask.js b/src/netbeans-project/build/web/edittask.js new file mode 100644 index 00000000..6a39688f --- /dev/null +++ b/src/netbeans-project/build/web/edittask.js @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkTag() { + var tag=document.forms["editTaskForm"]["edittask_tag"].value; + if(tag=="" || tag==null) + {document.getElementById('tagwarning').innerHTML="*Warning! Seluruh task akan dihapus";} + else + {document.getElementById('tagwarning').innerHTML="";} +} + +function checkAssignee() { + var tag=document.forms["editTaskForm"]["edittask_assignee"].value; + if(tag=="" || tag==null) + {document.getElementById('assigneewarning').innerHTML="*Warning! Seluruh assignee akan dihapus, kecuali task creator";} + else + {document.getElementById('assigneewarning').innerHTML="";} +} + + + +function checkValidation() { + checkTag(); + checkAssignee(); +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/edittask.jsp b/src/netbeans-project/build/web/edittask.jsp new file mode 100644 index 00000000..cc93915e --- /dev/null +++ b/src/netbeans-project/build/web/edittask.jsp @@ -0,0 +1,96 @@ +<%-- + Document : edittask + Created on : Apr 13, 2013, 2:32:07 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page import="java.sql.Date"%> +<%@page import="database.MyDatabase"%> +<%@page import="java.sql.ResultSet"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + Edit Task + + + +   +
+   +
+   +
+   +
+ <% + String namaTask = request.getParameter("namaTask"); + String pQuery = "select distinct * from tasktoasignee where namaTask =\"" + namaTask + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + String assigneeList = ""; + while (tResult.next()) { + assigneeList = assigneeList + tResult.getString("asigneeName") + ","; + } + pQuery = "select distinct * from tagging where namaTask=\"" + namaTask + "\""; + tResult = MyDatabase.getSingleton().selectDB(pQuery); + String tagList = ""; + while (tResult.next()) { + tagList = tagList + tResult.getString("tag") + ","; + } + pQuery = "select * from task where namaTask=\"" + namaTask + "\""; + tResult = MyDatabase.getSingleton().selectDB(pQuery); + Date deadline = new Date(2012, 4, 3); + while (tResult.next()) { + deadline = tResult.getDate("deadline"); + } + %> +

Edit Task

+ <% + if (Checker.isCreator(session.getAttribute("sUsername").toString(), namaTask)) { + out.println(""); + } + %> +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Assignee: + + +
Tag: + +
Deadline: + +
+ +
+
+ + diff --git a/src/netbeans-project/build/web/edittaskprocess.jsp b/src/netbeans-project/build/web/edittaskprocess.jsp new file mode 100644 index 00000000..3a9ea676 --- /dev/null +++ b/src/netbeans-project/build/web/edittaskprocess.jsp @@ -0,0 +1,48 @@ +<%-- + Document : edittaskprocess + Created on : Apr 13, 2013, 3:08:13 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaTask = request.getParameter("edittask_namaTask"); + String assigneeList = request.getParameter("edittask_assignee"); + String tagList = request.getParameter("edittask_tag"); + String deadline = request.getParameter("edittask_date"); + String pQuery = "UPDATE `sharedtodolist`.`task` SET `deadline`='" + deadline + "' where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + String creatorName = ""; + pQuery = "select * from task where namaTask=\"" + namaTask + "\""; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + while (resultSet.next()) { + creatorName = resultSet.getString("creatorTaskName"); + } + + pQuery = "delete from tasktoasignee where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask` ,`asigneeName`)VALUES ('" + namaTask + "', '" + creatorName + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + if (assigneeList != null && !assigneeList.equals("")) { + String[] assignee = assigneeList.split(","); + for (int i = 0; i < assignee.length; i++) { + if (assignee[i] != null && !assignee[i].equals("") && !assignee[i].equals(creatorName)) { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask` ,`asigneeName`)VALUES ('" + namaTask + "', '" + assignee[i] + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + } + } + } + + pQuery = "delete from tagging where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + if (tagList != null && !tagList.equals("")) { + String[] tag = tagList.split(","); + for (int i = 0; i < tag.length; i++) { + if (tag[i] != null && !tag[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tagging` (`namaTask` ,`tag`)VALUES ('" + namaTask + "', '" + tag[i] + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + } + } + } + response.sendRedirect("viewtask.jsp?namaTask="+namaTask); +%> diff --git a/src/netbeans-project/build/web/hapuskomentar.jsp b/src/netbeans-project/build/web/hapuskomentar.jsp new file mode 100644 index 00000000..61ec98f6 --- /dev/null +++ b/src/netbeans-project/build/web/hapuskomentar.jsp @@ -0,0 +1,18 @@ +<%-- + Document : ubahstatus + Created on : Apr 12, 2013, 1:39:37 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + int target = Integer.parseInt(request.getParameter("target").toString()); + String namaTask = request.getParameter("namaTask").toString(); + int idk = Integer.parseInt(request.getParameter("idkomentar").toString()); + out.println(target); + out.println(namaTask); + out.println(idk); + String pQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`idKomentar` = "+idk; + MyDatabase.getSingleton().queryDB(pQuery); + response.sendRedirect("viewtask.jsp?namaTask="+namaTask+"&target="+target); +%> diff --git a/src/netbeans-project/build/web/header.css b/src/netbeans-project/build/web/header.css new file mode 100644 index 00000000..58a8f671 --- /dev/null +++ b/src/netbeans-project/build/web/header.css @@ -0,0 +1,82 @@ +/* + Document : header.css + Created on : Apr 12, 2013, 6:41:42 AM + Author : Arief + Description: + Purpose of the stylesheet follows. +*/ + +#Header { + display: block; + width: 1000px; + height: 130px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; + text-align: center; +} + +#Header hr { + border : 1px dashed; + border-color : #ccc; +} + +#Header a{ + font-family: monospace; + color: white; + text-decoration: none; +} + +#Header a:hover{ + color:antiquewhite; + text-decoration: underline overline; +} + +#Header input[type=text], +#Header input[type="password"]{ + background-color: grey; + border: 1px dashed white; + color:white; +} + +#Header input[type=text]:hover, +#Header input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Header input[type=text]:focus, +#Header input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Header input[type=submit], +#Header input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Header input[type=submit]:hover, +#Header input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/header.jsp b/src/netbeans-project/build/web/header.jsp new file mode 100644 index 00000000..dbb2e7ef --- /dev/null +++ b/src/netbeans-project/build/web/header.jsp @@ -0,0 +1,47 @@ +<%@page import="database.Checker"%> +<% + if(session.getAttribute("sUsername")==null) + response.sendRedirect("index.jsp"); +%> + + + + + S.Y.N. Dashboard + + + + + + + \ No newline at end of file diff --git a/src/netbeans-project/build/web/images/avatar.jpg b/src/netbeans-project/build/web/images/avatar.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/netbeans-project/build/web/images/avatar.jpg differ diff --git a/src/netbeans-project/build/web/images/syn.jpg b/src/netbeans-project/build/web/images/syn.jpg new file mode 100644 index 00000000..b33556c8 Binary files /dev/null and b/src/netbeans-project/build/web/images/syn.jpg differ diff --git a/src/netbeans-project/build/web/images/syn.psd b/src/netbeans-project/build/web/images/syn.psd new file mode 100644 index 00000000..61504fcc Binary files /dev/null and b/src/netbeans-project/build/web/images/syn.psd differ diff --git a/src/netbeans-project/build/web/images/syn2.jpg b/src/netbeans-project/build/web/images/syn2.jpg new file mode 100644 index 00000000..79e2381a Binary files /dev/null and b/src/netbeans-project/build/web/images/syn2.jpg differ diff --git a/src/netbeans-project/build/web/index.jsp b/src/netbeans-project/build/web/index.jsp new file mode 100644 index 00000000..654d9cb1 --- /dev/null +++ b/src/netbeans-project/build/web/index.jsp @@ -0,0 +1,190 @@ +<%-- + Document : index + Created on : Apr 11, 2013, 10:55:56 AM + Author : Arief +--%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + if(session.getAttribute("sUsername")!=null) + response.sendRedirect("dashboard.jsp"); +%> + + + + S.Y.N Login Page + + + + + + +
+

Login Form :

+
+ + + + + + + + + + + + + + +
+ Username + + : + + +
+ Password + + : + + +
+ +
+
+
+
+ <% + if(request.getParameter("error")!=null) + out.println("

"+request.getParameter("error")+"

"); + %> +
+
+

Registration Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Username + + : + + +
+
+
+ Password + + : + + +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+ e-Mail + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + + diff --git a/src/netbeans-project/build/web/loginpage.css b/src/netbeans-project/build/web/loginpage.css new file mode 100644 index 00000000..72da27b0 --- /dev/null +++ b/src/netbeans-project/build/web/loginpage.css @@ -0,0 +1,96 @@ +/* + Document : LoginPage + Created on : Feb 19, 2013, 7:09:01 AM + Author : Arief + Description: + CSS for Login Page +*/ + + +#Front_Logo { + display: block; + width: 600px; + height: 200px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form{ + text-align: center; + display: block; + width: 400px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Front_Form input[type=text]:hover, +#Front_Form input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Front_Form input[type=text]:focus, +#Front_Form input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Front_Form input[type=submit], +#Front_Form input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Front_Form input[type=submit]:hover, +#Front_Form input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +body { + background-color: grey; + font-family: monospace; + color: white; + text-align: center; +} + +iframe { + border:none; +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/loginprocess.jsp b/src/netbeans-project/build/web/loginprocess.jsp new file mode 100644 index 00000000..79278c6b --- /dev/null +++ b/src/netbeans-project/build/web/loginprocess.jsp @@ -0,0 +1,25 @@ +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> + +<% + String username = request.getParameter("username"); + String password = request.getParameter("password"); + + String tQuery = "SELECT * FROM user WHERE username='" + username + "' AND password='" + password + "';"; + try { + ResultSet tResult = MyDatabase.getSingleton().selectDB(tQuery); + if (tResult.next()) { + session.setMaxInactiveInterval(2592000); + session.setAttribute("isActive",true); + session.setAttribute("sUsername", tResult.getString("username")); + session.setAttribute("sAvatar", tResult.getString("avatar")); + session.setAttribute("sNama", tResult.getString("fullname")); + response.sendRedirect("dashboard.jsp"); + } else { + String message = "No user or password matched"; + response.sendRedirect("index.jsp?error=" + message); + } + } catch (Exception e) { + e.printStackTrace(); + } + +%> diff --git a/src/netbeans-project/build/web/logoutprocess.jsp b/src/netbeans-project/build/web/logoutprocess.jsp new file mode 100644 index 00000000..e554e566 --- /dev/null +++ b/src/netbeans-project/build/web/logoutprocess.jsp @@ -0,0 +1,10 @@ +<%-- + Document : logoutprocess + Created on : Apr 12, 2013, 6:11:12 AM + Author : Arief +--%> + +<% + session.invalidate(); + response.sendRedirect("index.jsp?error=user logout success"); +%> diff --git a/src/netbeans-project/build/web/movie.mp4 b/src/netbeans-project/build/web/movie.mp4 new file mode 100644 index 00000000..3daaab5a Binary files /dev/null and b/src/netbeans-project/build/web/movie.mp4 differ diff --git a/src/netbeans-project/build/web/myscript.js b/src/netbeans-project/build/web/myscript.js new file mode 100644 index 00000000..49fcdf63 --- /dev/null +++ b/src/netbeans-project/build/web/myscript.js @@ -0,0 +1,136 @@ +function myfunc(categ,i){ + return categ.task[i]; +} + +function myfunc2(categ){ + return categ.assignee; +} + +function myfunc3(categ){ + return categ.deadline; +} + +function myfunc4(categ){ + return categ.comment; +} + +function myfunc5(categ){ + return categ.tag; +} + + +function addtask(task, deadline, assignee, comment, tag){ + this.task = task; + //this.att = att; + this.deadline = deadline; + this.assignee = assignee; + this.comment = comment; + this.tag = tag; +} + +function createcateg(){ + var d1 = new Date("October 13, 2013 10:13:00") + var d2 = new Date("July 12, 2014 07:13:00") + var d3 = new Date("September 29, 1955 11:13:00") + //categ={cat:cat, task:task, deadline:deadline, assignee:assignee, comment:comment, tag:tag};//var task1 = new Array("Buy a Ferrari","Rent an apartment","Build a startup","Fail in life"); + categ1={task:["Buy a Ferrari","Rent an apartment","Build a startup","Buy some milk"], deadline:d1, assignee:"Cow", comment:"hurry", tag:"#misc #food"}; + + //var task2 = new Array("Buy a Lexus","Rent an apartment","Build a startup","Fail in life"); + categ2={task:["Buy a Lexus","Sleep beside a hobo","Fail in life","Build a startup"], deadline:d2, assignee:"Atika", comment:"start small", tag:"#work #money"}; + + //var task3 = new Array("Buy a Volkswagen","Rent an apartment","Build a startup","Fail in life"); + categ3={task:["Buy a Volkswagen","Buy a house","Build a startup","Go back to the future"], deadline:d3, assignee:"Marty", comment:"urgent matters", tag:"#project #time"}; +} + +var categ1, categ2, categ3; + +function mOver1(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + + + +} + +function mOver2(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + +} + +function mOver3(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + +} + +function mOut(obj) +{ + //document.getElementById("tasklist").innerHTML=mclk(tasklist); +} + +function SearchDatabase() +{ + document.forms['formsearch'].submit(); +} + +function register_check() { + + var regex_username = /^[A-Za-z0-9_]{5,}$/; + var regex_password = /^[A-Za-z0-9!@()$%^&*#_]{8,}$/; + var regex_email = /^[A-Za-z][A-Za-z0-9_.]*\@[A-Za-z0-9_.-]+\.[A-Za-z][A-Za-z]+$/; + var regex_fullname = /^[A-Za-z]+ [A-Za-z \.]+$/; + var regex_birthdate = /^\d{4}\-\d{2}\-\d{2}$/; + var avatar_ext = $id("registerform-avatar").value.split('.').pop(); + + var ok = true; + + window.registerform_validation['username'] = regex_username.test($id("registerform-username").value); + window.registerform_validation['password'] = regex_password.test($id("registerform-password").value); + window.registerform_validation['equalsUPE'] = ($id("registerform-password").value != $id("registerform-username").value) && ($id("registerform-password").value != $id("registerform-email").value); + window.registerform_validation['password2'] = ($id("registerform-password").value == $id("registerform-password2").value); + window.registerform_validation['fullname'] = regex_fullname.test($id("registerform-fullname").value); + window.registerform_validation['birthdate'] = (regex_birthdate.test($id("registerform-birthdate").value)) && (parseInt($id("registerform-birthdate").value.split('-')[0]) >= 1955); + window.registerform_validation['email'] = regex_email.test($id("registerform-email").value); + window.registerform_validation['avatar'] = (avatar_ext == "jpg") || (avatar_ext == "jpeg"); + + for(key in registerform_validation) { + if(!registerform_validation[key]) { + $id("registerform-submit").disabled = true; + ok = false; + } + } + if(ok) { + $id("registerform-submit").disabled = false; + } +} + +function addcateg() +{ + xmlhttp.open("POST","newcategory,jsp?q=afuu",true); + xmlhttp.send(); +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/newcategory.jsp b/src/netbeans-project/build/web/newcategory.jsp new file mode 100644 index 00000000..567b9647 --- /dev/null +++ b/src/netbeans-project/build/web/newcategory.jsp @@ -0,0 +1,27 @@ +<%-- + Document : newcategory + Created on : Apr 12, 2013, 2:58:28 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String tQuery = "INSERT INTO `sharedtodolist`.`kategori` (`namaKategori`,`creatorKategoriName`) VALUES('" + request.getParameter("newcateg") + "','" + session.getAttribute("sUsername") + "');"; + int result = MyDatabase.getSingleton().queryDB(tQuery); + if (result != -1) { + tQuery = "INSERT INTO `sharedtodolist`.`usertocategory` (`namaKategori`,`username`) VALUES('" + request.getParameter("newcateg") + "','" + session.getAttribute("sUsername") + "');"; + MyDatabase.getSingleton().queryDB(tQuery); + String namelist = request.getParameter("userlist"); + String[] name = namelist.split(","); + for (int i = 0; i < name.length; i++) { + if (!name[i].equals(session.getAttribute("sUsername").toString())) { + tQuery = "INSERT INTO `sharedtodolist`.`usertocategory` (`namaKategori`,`username`) VALUES('" + request.getParameter("newcateg") + "','" + name[i] + "');"; + MyDatabase.getSingleton().queryDB(tQuery); + } + } + response.sendRedirect("dashboard.jsp?category=" + request.getParameter("newcateg")); + } + else + response.sendRedirect("dashboard.jsp"); +%> diff --git a/src/netbeans-project/build/web/profil.css b/src/netbeans-project/build/web/profil.css new file mode 100644 index 00000000..b32a2777 --- /dev/null +++ b/src/netbeans-project/build/web/profil.css @@ -0,0 +1,55 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#profile-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#profile-tugas{ + width:600px; + height:550px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 0px 25px; +} + +#profile-biodata{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + +} + +h1{color:white;} + +#profile-title{ + text-align: center; +} + +#profile-img{ + +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/profil.jsp b/src/netbeans-project/build/web/profil.jsp new file mode 100644 index 00000000..da95c777 --- /dev/null +++ b/src/netbeans-project/build/web/profil.jsp @@ -0,0 +1,84 @@ +<%-- + Document : profil + Created on : Apr 12, 2013, 7:54:12 AM + Author : Arief +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + S.Y.N. Profile + + + +   +
+   +
+   +
+   +
+ <% + String username; + MyDatabase myDBProfile = new MyDatabase(); + if(request.getParameter("username")==null) + username = session.getAttribute("sUsername").toString(); + else + username = request.getParameter("username"); + ResultSet resultSet = myDBProfile.selectDB("select * from user where username=\""+username+"\""); + while(resultSet.next()){ + %> +

User Profile

+ + + + + +
+ "> + + Username : <%= resultSet.getString("username") %>
+ Nama Lengkap : <%= resultSet.getString("fullname") %>
+ Tanggal Lahir : <%= resultSet.getString("tanggalLahir") %>
+ E-mail : <%= resultSet.getString("email") %>
+ Done Task List :
+ <% + MyDatabase myDBProfile2 = new MyDatabase(); + String pQuery = "select * from tasktoasignee JOIN task on tasktoasignee.namaTask=task.namaTask where asigneeName=\""+resultSet.getString("username")+"\" and status=\"done\""; + ResultSet resultSet2 = myDBProfile2.selectDB(pQuery); + while(resultSet2.next()){ + out.println(""+resultSet2.getString("namaTask")+"
"); + } + %> + UnDone Task List :
+ <% + pQuery = "select * from tasktoasignee JOIN task on tasktoasignee.namaTask=task.namaTask where asigneeName=\""+resultSet.getString("username")+"\" and status=\"undone\""; + resultSet2 = myDBProfile2.selectDB(pQuery); + while(resultSet2.next()){ + out.println(""+resultSet2.getString("namaTask")+"
"); + } + %> +
+ <% } + %> +
+ <% + if(request.getParameter("username")==null){ + %> +
+ "> + +
+ <% + } + %> +
+ + diff --git a/src/netbeans-project/build/web/registerprocess.jsp b/src/netbeans-project/build/web/registerprocess.jsp new file mode 100644 index 00000000..d0f3008a --- /dev/null +++ b/src/netbeans-project/build/web/registerprocess.jsp @@ -0,0 +1,31 @@ +<%-- + Document : registerprocess + Created on : Apr 12, 2013, 5:42:03 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String username = request.getParameter("daftar_username"); + String password = request.getParameter("daftar_password"); + String namalengkap = request.getParameter("daftar_namalengkap"); + String tanggallahir = request.getParameter("daftar_tanggallahir"); + String mail = request.getParameter("daftar_e-mail"); + String avatar = request.getParameter("daftar_avatar").toString(); + String pQuery = "INSERT INTO `sharedtodolist`.`user` (`username` ,`email` ,`fullname` ,`avatar` ,`tanggalLahir` ,`password`) VALUES('" + username + "','" + mail + "','" + namalengkap + "','" + avatar + "','" + tanggallahir + "','" + password + "')"; + out.println(pQuery); + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if (ti != -1) { + session.setAttribute("isActive", false); + request.getSession(true); + session.setMaxInactiveInterval(2592000); + session.setAttribute("isActive", true); + session.setAttribute("sUsername", username); + session.setAttribute("sNama", namalengkap); + session.setAttribute("sAvatar", avatar); + response.sendRedirect("dashboard.jsp"); + } else { + response.sendRedirect("index.jsp?error=registration failed"); + } +%> diff --git a/src/netbeans-project/build/web/registrasi.js b/src/netbeans-project/build/web/registrasi.js new file mode 100644 index 00000000..3a88f2c6 --- /dev/null +++ b/src/netbeans-project/build/web/registrasi.js @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkUsername() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + if(uname=="" || uname==null) + {document.getElementById('usernameWarning').innerHTML="*Username tidak boleh kosong";return false;} + else + if(uname.length<5) + {document.getElementById('usernameWarning').innerHTML="*Username minimal 5 huruf";return false;} + else + {document.getElementById('usernameWarning').innerHTML="";return true;} +} + +function checkPassword() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + var pass=document.forms["RegistrationForm"]["daftar_password"].value; + var email=document.forms["RegistrationForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh kosong";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["RegistrationForm"]["daftar_password"].value; + var pass2=document.forms["RegistrationForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["RegistrationForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak boleh kosong";return false;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + +function checkEmail() { + var email=document.forms["RegistrationForm"]["daftar_email"].value; + var atpos=email.indexOf("@"); + var dotpos=email.lastIndexOf("."); + if(email=="" || email==null) + {document.getElementById('emailWarning').innerHTML="*E-mail tidak boleh kosong";return false;} + else + if(atpos<1 || dotpos=email.length) + {document.getElementById('emailWarning').innerHTML=("*e-mail tidak valid");return false;} + else + {document.getElementById('emailWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["RegistrationForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkUsername() && checkPassword() && checkConfirmPassword() && checkNama() && checkEmail() && check_extension()); +} + +function checkLogin() { + var username=document.forms["LoginForm"]["username"].value; + var password=document.forms["LoginForm"]["password"].value; + if(username!="admin") + { + alert("User Not Found"); + return false; + } + else if(password!="adminadmin") + { + alert("Password incorrect") + return false; + } + else + return true; +} \ No newline at end of file diff --git a/src/netbeans-project/build/web/searchresult.jsp b/src/netbeans-project/build/web/searchresult.jsp new file mode 100644 index 00000000..bfbb5f4a --- /dev/null +++ b/src/netbeans-project/build/web/searchresult.jsp @@ -0,0 +1,104 @@ +<%-- + Document : searchresult + Created on : Apr 12, 2013, 9:44:18 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page import="database.MyDatabase"%> +<%@page import="java.sql.ResultSet"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + S.Y.N. Search Result + + + +   +
+   +
+   +
+   +
+ <% + String query = request.getParameter("query"); + int filter = Integer.parseInt(request.getParameter("filter")); + int pagenum; + if (request.getParameter("page") != null) { + pagenum = Integer.parseInt(request.getParameter("page")); + } else { + pagenum = 0; + } + + %> +

Search Result

+ + <% + if (filter == 1 || filter == 0) { + String pQuery = "select * from user where username LIKE '%" + query + "%' OR email LIKE '%" + query + "%' OR tanggalLahir LIKE '%" + query + "%' or fullname LIKE '%" + query + "%'"; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + out.println("

User search result

"); + while (resultSet.next()) { + out.println("Username : "); + out.println(""); + out.println(resultSet.getString("username").toString() + "
"); + out.println("Nama Lengkap : " + resultSet.getString("fullname") + "
"); + out.println("Tanggal Lahir : " + resultSet.getDate("tanggalLahir") + "
"); + out.println("e-mail : " + resultSet.getString("email") + "
"); + out.println(""); + out.println("

"); + } + out.println("==========================================
"); + } + if (filter == 2 || filter == 0) { + String pQuery = "select * from kategori where namaKategori LIKE '%" + query + "%'"; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + out.println("

Category search result

"); + while (resultSet.next()) { + out.println("Kategori : "); + out.println(""); + out.println(resultSet.getString("namaKategori").toString() + "
"); + out.println("Pembuat Kategori : " + resultSet.getString("creatorKategoriName") + "

"); + } + out.println("==========================================
"); + } + if (filter == 3 || filter == 0) { + String pQuery = "SELECT DISTINCT task.namaTask AS namaTask, status, deadline FROM task LEFT OUTER JOIN komentar ON task.namaTask = komentar.namaTask WHERE task.namaTask LIKE '%"+query+"%' OR komentar.isikomentar LIKE '%"+query+"%'"; + MyDatabase searchDB = new MyDatabase(); + ResultSet resultSet = searchDB.selectDB(pQuery); + out.println("

Task Search Result

"); + while (resultSet.next()){ + out.println("Nama Task : "); + out.println(""); + out.println(resultSet.getString("namaTask").toString() + "
"); + out.println("Tanggal Deadline : " + resultSet.getDate("deadline") + "
"); + out.println("Status : " + resultSet.getString("status") + "
"); + out.println("Tag : "); + String pQuery2 = "SELECT DISTINCT * from tagging where namaTask=\"" + resultSet.getString("namaTask") + "\""; + MyDatabase searchDB2 = new MyDatabase(); + ResultSet resultSet2 = searchDB2.selectDB(pQuery2); + while(resultSet2.next()){ + out.println(resultSet2.getString("tag")); + } + out.println("
"); + if(Checker.isAssignee(session.getAttribute("sUsername").toString(), resultSet.getString("namaTask"))){ + out.println(""); + out.println("

"); + } + } + out.println("==========================================
"); + } + %> + + +
+ + diff --git a/src/netbeans-project/build/web/submitkomentar.jsp b/src/netbeans-project/build/web/submitkomentar.jsp new file mode 100644 index 00000000..0018c8c4 --- /dev/null +++ b/src/netbeans-project/build/web/submitkomentar.jsp @@ -0,0 +1,20 @@ +<%-- + Document : submitkomentar + Created on : Apr 12, 2013, 7:26:27 PM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet,java.sql.Timestamp,java.util.Date;" errorPage="" %> +<% + String nama = request.getParameter("namaTask").toString(); + String username = session.getAttribute("sUsername").toString(); + int target = Integer.parseInt(request.getParameter("target").toString()); + String isikomentar = request.getParameter("isiKomentar").toString(); + java.util.Date date = new java.util.Date(); + String pQuery = "INSERT INTO `sharedtodolist`.`komentar` (`idKomentar` ,`komentator` ,`isikomentar` ,`namaTask` ,`timestamp`) VALUES (NULL,'"+username+"','"+isikomentar+"','"+nama+"','"+new Timestamp(date.getTime())+"')"; + //out.println(pQuery); + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if(ti!=-1){ + response.sendRedirect("viewtask.jsp?namaTask="+nama+"&page="+target); + } +%> \ No newline at end of file diff --git a/src/netbeans-project/build/web/ubahstatus.jsp b/src/netbeans-project/build/web/ubahstatus.jsp new file mode 100644 index 00000000..0be40e8a --- /dev/null +++ b/src/netbeans-project/build/web/ubahstatus.jsp @@ -0,0 +1,33 @@ +<%-- + Document : ubahstatus + Created on : Apr 12, 2013, 1:39:37 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + MyDatabase ubahstatusDB = new MyDatabase(); + MyDatabase ubahstatusDB2 = new MyDatabase(); + String curstatus = ""; + String tQuery = "select * from task where namaTask = \"" + request.getParameter("namaTask") + "\""; + ResultSet tResult = ubahstatusDB.selectDB(tQuery); + while (tResult.next()) { + curstatus = tResult.getString("status"); + } + if (curstatus.equals("done")) { + tQuery = "UPDATE `sharedtodolist`.`task` SET `status` = 'undone' WHERE `task`.`namaTask` = \"" + request.getParameter("namaTask") + "\""; + } else { + tQuery = "UPDATE `sharedtodolist`.`task` SET `status` = 'done' WHERE `task`.`namaTask` = \"" + request.getParameter("namaTask") + "\""; + } + out.println(tQuery); + ubahstatusDB2.queryDB(tQuery); + if (request.getParameter("target").toString().equals("dashboard")) { + response.sendRedirect("dashboard.jsp"); + } + else if(request.getParameter("target").toString().equals("search")) { + response.sendRedirect("searchresult.jsp?query="+request.getParameter("query")+"&filter="+request.getParameter("filter")+"&page="+request.getParameter("page")); + } + else if(request.getParameter("target").toString().equals("viewtask")) { + response.sendRedirect("viewtask.jsp?namaTask="+request.getParameter("namaTask")); + } +%> diff --git a/src/netbeans-project/build/web/viewtask.jsp b/src/netbeans-project/build/web/viewtask.jsp new file mode 100644 index 00000000..c4195914 --- /dev/null +++ b/src/netbeans-project/build/web/viewtask.jsp @@ -0,0 +1,196 @@ +<%-- + Document : viewtask + Created on : Apr 12, 2013, 4:57:12 PM + Author : Arief +--%> + +<%@page import="javax.print.attribute.standard.MediaSize.Other"%> +<%@page import="database.Checker"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + S.Y.N. View Task + + + +   +
+   +
+   +
+   +
+

Task Detail

+ + + + + +
+ <% + String nama = request.getParameter("namaTask"); + String pQuery = "select * from task where namaTask=\"" + nama + "\""; + MyDatabase viewTaskDB = new MyDatabase(); + ResultSet resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + out.println("

Nama Task : " + resultSet.getString("namaTask") + "


"); + out.println("Deadline : " + resultSet.getDate("deadline") + "
"); + out.println("Status Task : " + resultSet.getString("status") + "
"); + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), resultSet.getString("namaTask"))) { + out.println(""); + out.println("
"); + } + out.println("tag : "); + MyDatabase viewTaskDB2 = new MyDatabase(); + String pQuery2 = "select distinct * from tagging where namaTask=\"" + nama + "\""; + ResultSet resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + out.println(resultSet2.getString("tag") + ", "); + } + out.println("
"); + pQuery2 = "select distinct * from tasktoasignee where namaTask=\"" + nama + "\""; + resultSet2 = viewTaskDB2.selectDB(pQuery2); + out.println("assignee : "); + while (resultSet2.next()) { + out.println("" + resultSet2.getString("asigneeName") + ", "); + } + out.println("

Attachment :

"); + pQuery2 = "select * from attach where namaTask=\"" + nama + "\""; + resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + String filename = resultSet2.getString("attachment"); + int dotplace = filename.lastIndexOf("."); + String extension = filename.substring(dotplace + 1, filename.length()); + if (extension.equals("png") || extension.equals("jpg") || extension.equals("jpeg") || extension.equals("bmp") || extension.equals("gif")) { + out.println("attachment type : picture
"); + out.println("
"); + } else if (extension.equals("mpg") || extension.equals("avi") || extension.equals("flv") || extension.equals("mp4") || extension.equals("mpeg") || extension.equals("ogg")) { + out.println("attachment type : video
"); + out.println(""); + } else { + out.println("attachment type : other file
"); + out.println(filename + "
"); + out.println("Download "); + } + out.println("
===============================

"); + } + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), nama)) { + out.println(""); + out.println("
"); + } + } + %> +
+ <% + int hasil = 0; + pQuery = "select count(*) as hasil FROM `komentar` where namaTask=\"" + nama + "\""; + resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + hasil = resultSet.getInt("hasil"); + out.println("

Jumlah Komentar = " + hasil + "

Tambah Komentar :

"); + } + out.println("

Komentar :
====================

"); + int pagenum; + if (request.getParameter("page") != null) { + pagenum = Integer.parseInt(request.getParameter("page")); + } else { + pagenum = 0; + } + if (pagenum > hasil / 10) { + pagenum = hasil / 10; + } + if (pagenum < (hasil / 10)) { + %> +
+ + + +
+ <% + } + if (pagenum > 0) { + %> +
+ + + +
+ <% + } + out.println("

"); + int currentcomment = 0; + pQuery = "select * from komentar where namaTask=\"" + nama + "\" ORDER BY komentar.timestamp ASC"; + resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + if (currentcomment >= (pagenum * 10) && currentcomment < ((pagenum + 1) * 10)) { + out.println(resultSet.getString("komentator") + "
"); + out.println("
"); + String pQuery2 = "select count(*) as hasil FROM `komentar` where komentator=\"" + resultSet.getString("komentator") + "\" AND namaTask=\"" + nama + "\""; + MyDatabase viewTaskDB2 = new MyDatabase(); + ResultSet resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + out.println(resultSet2.getInt("hasil") + " Komentar
"); + } + out.println("on : " + resultSet.getTimestamp("timestamp") + "
"); + out.println("Komentar :
"); + out.println(resultSet.getString("isikomentar") + "
"); + if (resultSet.getString("komentator").equals(session.getAttribute("sUsername"))) { + %> +
+ "> + + + +
+ <% + }; + out.println("

"); + } + currentcomment++; + } + out.println("

Jumlah Komentar = " + hasil + "

Tambah Komentar :

"); + if (pagenum < (hasil / 10)) { + %> +
+ + + +
+ <% + } + if (pagenum > 0) { + %> +
+ + + +
+ <% + } + %> +
+ + +
+ + +
+
+ + diff --git a/src/netbeans-project/dist/progin3.war b/src/netbeans-project/dist/progin3.war new file mode 100644 index 00000000..113ac1f7 Binary files /dev/null and b/src/netbeans-project/dist/progin3.war differ diff --git a/src/netbeans-project/lib/mysql-connector-java-5.1.16-bin.jar b/src/netbeans-project/lib/mysql-connector-java-5.1.16-bin.jar new file mode 100644 index 00000000..e62f2cb7 Binary files /dev/null and b/src/netbeans-project/lib/mysql-connector-java-5.1.16-bin.jar differ diff --git a/src/netbeans-project/nbproject/ant-deploy.xml b/src/netbeans-project/nbproject/ant-deploy.xml new file mode 100644 index 00000000..9bc5adf7 --- /dev/null +++ b/src/netbeans-project/nbproject/ant-deploy.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/netbeans-project/nbproject/build-impl.xml b/src/netbeans-project/nbproject/build-impl.xml new file mode 100644 index 00000000..45c1e08d --- /dev/null +++ b/src/netbeans-project/nbproject/build-impl.xml @@ -0,0 +1,1071 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/netbeans-project/nbproject/genfiles.properties b/src/netbeans-project/nbproject/genfiles.properties new file mode 100644 index 00000000..bdf6ef73 --- /dev/null +++ b/src/netbeans-project/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d30db811 +build.xml.script.CRC32=311680b1 +build.xml.stylesheet.CRC32=651128d4@1.36.1.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=d30db811 +nbproject/build-impl.xml.script.CRC32=62eab574 +nbproject/build-impl.xml.stylesheet.CRC32=b7883b1f@1.36.1.1 diff --git a/src/netbeans-project/nbproject/private/private.properties b/src/netbeans-project/nbproject/private/private.properties new file mode 100644 index 00000000..4542f55d --- /dev/null +++ b/src/netbeans-project/nbproject/private/private.properties @@ -0,0 +1,4 @@ +deploy.ant.properties.file=C:\\Users\\Arief\\.netbeans\\7.1.1\\tomcat70.properties +j2ee.server.home=C:/xampp/tomcat +j2ee.server.instance=tomcat70:home=C:\\xampp\\tomcat +user.properties.file=C:\\Users\\Arief\\.netbeans\\7.1.1\\build.properties diff --git a/src/netbeans-project/nbproject/private/private.xml b/src/netbeans-project/nbproject/private/private.xml new file mode 100644 index 00000000..c1f155a7 --- /dev/null +++ b/src/netbeans-project/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/netbeans-project/nbproject/project.properties b/src/netbeans-project/nbproject/project.properties new file mode 100644 index 00000000..b3512488 --- /dev/null +++ b/src/netbeans-project/nbproject/project.properties @@ -0,0 +1,83 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-6.0.classpath} +excludes= +file.reference.mysql-connector-java-5.1.16-bin.jar=lib\\mysql-connector-java-5.1.16-bin.jar +includes=** +j2ee.compile.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.6-web +j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-3.7.2.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-util.jar +j2ee.server.type=Tomcat +jar.compress=false +javac.classpath=\ + ${file.reference.mysql-connector-java-5.1.16-bin.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +no.dependencies=false +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=progin3.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/src/netbeans-project/nbproject/project.xml b/src/netbeans-project/nbproject/project.xml new file mode 100644 index 00000000..30215c55 --- /dev/null +++ b/src/netbeans-project/nbproject/project.xml @@ -0,0 +1,23 @@ + + + org.netbeans.modules.web.project + + + progin3 + 1.6.5 + + + ${file.reference.mysql-connector-java-5.1.16-bin.jar} + WEB-INF/lib + + + + + + + + + + + + diff --git a/src/netbeans-project/src/conf/MANIFEST.MF b/src/netbeans-project/src/conf/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/src/netbeans-project/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/src/netbeans-project/src/java/database/Checker.java b/src/netbeans-project/src/java/database/Checker.java new file mode 100644 index 00000000..a6cbff02 --- /dev/null +++ b/src/netbeans-project/src/java/database/Checker.java @@ -0,0 +1,115 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package database; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Arief + */ +public class Checker { + + public static boolean isAssignee(String username, String namaTask) { + try { + boolean found = false; + String tQuery = "select * from tasktoasignee where namaTask = \"" + namaTask + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(tQuery); + while (tResult.next() && found == false) { + if (tResult.getString("asigneeName").equals(username)) { + found = true; + } + } + return found; + } catch (SQLException ex) { + Logger.getLogger(Checker.class.getName()).log(Level.SEVERE, null, ex); + return false; + } + } + + public static boolean isCreator(String username, String namaTask) { + try { + boolean found = false; + String tQuery = "select * from task where namaTask = \"" + namaTask + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(tQuery); + while (tResult.next() && found == false) { + if (tResult.getString("creatorTaskName").equals(username)) { + found = true; + } + } + return found; + } catch (SQLException ex) { + Logger.getLogger(Checker.class.getName()).log(Level.SEVERE, null, ex); + return false; + } + } + + public static String getCategoryCreator(String namaKategori) { + String output = ""; + try { + String tQuery = "select * from kategori where namaKategori=\"" + namaKategori + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(tQuery); + while (tResult.next()) { + output = tResult.getString("creatorKategoriName"); + } + return output; + } catch (SQLException ex) { + Logger.getLogger(Checker.class.getName()).log(Level.SEVERE, null, ex); + return output; + } + } + + public static boolean isContributor(String username, String namaKategori) { + boolean outp = false; + try { + String pQuery = "select * from usertocategory where namaKategori=\"" + namaKategori + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + while (tResult.next() && outp == false) { + if (tResult.getString("username").equals(username)) { + outp = true; + } + } + } catch (SQLException ex) { + Logger.getLogger(Checker.class.getName()).log(Level.SEVERE, null, ex); + } + return outp; + } + + public static String getAvatar(String username) { + + String outp = ""; + try { + String pQuery = "select * from user where username=\"" + username + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + while (tResult.next()) { + outp = tResult.getString("avatar"); + } + } catch (SQLException ex) { + Logger.getLogger(Checker.class.getName()).log(Level.SEVERE, null, ex); + } + return outp; + } + + public static String getEmail(String username){ + String outp = ""; + try { + String pQuery = "select * from user where username=\"" + username + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + while (tResult.next()) { + outp = tResult.getString("email"); + } + } catch (SQLException ex) { + Logger.getLogger(Checker.class.getName()).log(Level.SEVERE, null, ex); + } + return outp; + } + + public static void main(String[] args) { + System.out.println(isContributor("arief", "categ1")); + } +} diff --git a/src/netbeans-project/src/java/database/MyDatabase.java b/src/netbeans-project/src/java/database/MyDatabase.java new file mode 100644 index 00000000..b16286cb --- /dev/null +++ b/src/netbeans-project/src/java/database/MyDatabase.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package database; + +import java.sql.*; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Bona + */ +public class MyDatabase { + + private static MyDatabase mSingleton = new MyDatabase(); + + public static MyDatabase getSingleton() { + if (mSingleton == null) { + mSingleton = new MyDatabase(); + } + return mSingleton; + } + + private String mDBName = "jdbc:mysql://localhost/progin_417_13510087"; + private String mDBUser = "progin"; + private String mDBPass = "progin"; + private Connection mConn; + private Statement mStatement; + + public MyDatabase() { + try { + Class.forName("com.mysql.jdbc.Driver"); + mConn = DriverManager.getConnection(mDBName, mDBUser, mDBPass); + mStatement = mConn.createStatement(); + } catch (ClassNotFoundException ex) { + Logger.getLogger(MyDatabase.class.getName()).log(Level.SEVERE, null, ex); + } catch (SQLException ex) { + Logger.getLogger(MyDatabase.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public ResultSet selectDB(String pQuery) { + ResultSet tReturn = null; + try { + tReturn = mStatement.executeQuery(pQuery); + } catch (SQLException ex) { + Logger.getLogger(MyDatabase.class.getName()).log(Level.SEVERE, null, ex); + } + return tReturn; + } + + public int queryDB(String pQuery) { + int tReturn = -1; + try { + tReturn = mStatement.executeUpdate(pQuery); + } catch (SQLException ex) { + Logger.getLogger(MyDatabase.class.getName()).log(Level.SEVERE, null, ex); + } + return tReturn; + } +} diff --git a/src/netbeans-project/web/META-INF/context.xml b/src/netbeans-project/web/META-INF/context.xml new file mode 100644 index 00000000..40f22994 --- /dev/null +++ b/src/netbeans-project/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/src/netbeans-project/web/addtask.js b/src/netbeans-project/web/addtask.js new file mode 100644 index 00000000..207c253d --- /dev/null +++ b/src/netbeans-project/web/addtask.js @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkNamaTask() { + var isalpha = false; + var uname=document.forms["AddTaskForm"]["addtask_namaTask"].value; + for(var i=0;(i47 && cc<58) || (cc>64 && cc<91) || (cc>96 && cc<123))) + { + isalpha = true; + } + } + if(isalpha==true){ + {document.getElementById('namaTaskWarning').innerHTML="*Nama Task tidak boleh alphanumeric";return false;} + } + else + if(uname=="" || uname==null) + {document.getElementById('namaTaskWarning').innerHTML="*Nama Task tidak boleh kosong";return false;} + else + if(uname.length>25) + {document.getElementById('namaTaskWarning').innerHTML="*NamaTask harus <= 25 karakter";return false;} + else + {document.getElementById('namaTaskWarning').innerHTML="";return true;} +} + +function checkValidation() { + return (checkNamaTask()); +} \ No newline at end of file diff --git a/src/netbeans-project/web/addtask.jsp b/src/netbeans-project/web/addtask.jsp new file mode 100644 index 00000000..91f9d615 --- /dev/null +++ b/src/netbeans-project/web/addtask.jsp @@ -0,0 +1,176 @@ +<%-- + Document : addtask + Created on : Apr 12, 2013, 10:48:35 PM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + S.Y.N. Add Task + + + +   +
+   +
+   +
+   +
+

Add Task

+
+

Add Task Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Nama Task + + : + + "> + +
+
+
+ Assignee + + : + + +
+
+
+
+
+ Tag + + : + + +
+
+
+
+
+ Tanggal Deadline + + : + + +
+ Attachment + + : + + +
+
+
+ Attachment + + : + + +
+ Attachment + + : + + +
+ Attachment + + : + + +
+ Attachment + + : + + +
+ + + + +
+
+
+ + diff --git a/src/netbeans-project/web/addtaskprocess.jsp b/src/netbeans-project/web/addtaskprocess.jsp new file mode 100644 index 00000000..fc8809e8 --- /dev/null +++ b/src/netbeans-project/web/addtaskprocess.jsp @@ -0,0 +1,64 @@ +<%-- + Document : addtaskprocess + Created on : Apr 12, 2013, 11:32:03 PM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String category = request.getParameter("addtask_category"); + String username = session.getAttribute("sUsername").toString(); + String namaTask = request.getParameter("addtask_namaTask"); + String assigneeBlock = request.getParameter("addtask_assignee"); + String tagBlock = request.getParameter("addtask_tag"); + String tanggal = request.getParameter("addtask_deadline"); + String attachment1 = request.getParameter("addtask_attachment1"); + String attachment2 = request.getParameter("addtask_attachment2"); + String attachment3 = request.getParameter("addtask_attachment3"); + String attachment4 = request.getParameter("addtask_attachment4"); + String attachment5 = request.getParameter("addtask_attachment5"); + String pQuery = "INSERT INTO `sharedtodolist`.`task` (`namaTask`, `deadline`, `status`, `creatorTaskName`, `namaKategori`) VALUES ('" + namaTask + "', '" + tanggal + "', 'undone', '" + username + "', '" + category + "');"; + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if (ti == -1) { + response.sendRedirect("dashboard.jsp?category=" + category); + } else { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask`,`asigneeName`) VALUES ('" + namaTask + "','" + username + "')"; + MyDatabase.getSingleton().queryDB(pQuery); + String[] assignee = assigneeBlock.split(","); + for (int i = 0; i < assignee.length; i++) { + if (assignee[i] != null && !assignee[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask`,`asigneeName`) VALUES ('" + namaTask + "','" + assignee[i] + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + } + String[] tag = tagBlock.split(","); + for (int i = 0; i < tag.length; i++) { + if (tag[i] != null && !tag[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tagging` (`namaTask`,`tag`) VALUES ('" + namaTask + "','" + tag[i] + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + } + if (attachment1 != null && !attachment1.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment1 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment2 != null && !attachment2.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment2 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment3 != null && !attachment3.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment3 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment4 != null && !attachment4.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment4 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + if (attachment5 != null && !attachment5.equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`attach` (`namaTask`,`attachment`) VALUES ('" + namaTask + "','" + attachment5 + "')"; + int ta = MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("viewtask.jsp?namaTask="+namaTask); + } +%> diff --git a/src/netbeans-project/web/attachment/avatar.jpg b/src/netbeans-project/web/attachment/avatar.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/netbeans-project/web/attachment/avatar.jpg differ diff --git a/src/netbeans-project/web/attachment/sql.pdf b/src/netbeans-project/web/attachment/sql.pdf new file mode 100644 index 00000000..0299b95a Binary files /dev/null and b/src/netbeans-project/web/attachment/sql.pdf differ diff --git a/src/netbeans-project/web/avatar2.jpg b/src/netbeans-project/web/avatar2.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/netbeans-project/web/avatar2.jpg differ diff --git a/src/netbeans-project/web/dashboard.css b/src/netbeans-project/web/dashboard.css new file mode 100644 index 00000000..f15e1448 --- /dev/null +++ b/src/netbeans-project/web/dashboard.css @@ -0,0 +1,353 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#dashboard-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#dashboard-tugas{ + width:600px; + height:500px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 25px 25px; + overflow:auto; +} + +#dashboard-listcategory{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + overflow:auto; + +} + +h1{color:white;} +h2{color:white;} +h3{color:white;} +h4{color:white;} +h5{color:white;} +h6{color:white;} +h7{color:white;} +#dashboard-title{ + text-align: center; +} + +.dash-category{ + color:yellow; +} +.dash-category:hover{ + color:orange; +} + +.category-content{ + height:auto; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dotted; + border-color: white; + margin-bottom:25px; + padding: 0px 25px 25px; +} + +li{color:white;} +a{color:yellow;} + +a:hover{ + color:orange; +} + +a.tag{ + color:yellow; +} +a.tag:hover{ + color:orange; +} + +button{ + float:right; +} + + +a#login_pop:hover, a#join_pop:hover { + border-color: #eee; +} +.overlay { + background-color: rgba(100, 100, 100, 0.6); + bottom: 0; + cursor: default; + left: 0; + opacity: 0; + position: fixed; + right: 0; + top: 0; + visibility: hidden; + z-index: 1; + + -webkit-transition: opacity .5s; + -moz-transition: opacity .5s; + -ms-transition: opacity .5s; + -o-transition: opacity .5s; + transition: opacity .5s; +} +.overlay:target { + visibility: visible; + opacity: 1; +} +.popup { + background-color: #888; + border: 3px solid #222; + display: inline-block; + left: 50%; + opacity: 100%; + padding: 15px; + position: fixed; + text-align: justify; + top: 40%; + visibility: hidden; + z-index: 10; + + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + -ms-border-radius: 10px; + -o-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -moz-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -ms-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + -o-box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + box-shadow: 0 1px 1px 2px rgba(255, 255, 0, 0.4) inset; + + -webkit-transition: opacity .5s, top .5s; + -moz-transition: opacity .5s, top .5s; + -ms-transition: opacity .5s, top .5s; + -o-transition: opacity .5s, top .5s; + transition: opacity .5s, top .5s; +} +.overlay:target+.popup { + top: 25%; + opacity: 1; + visibility: visible; +} +.close { + background-color: rgba(0, 0, 0, 0.8); + height: 30px; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + text-decoration: none; + top: -15px; + width: 30px; + + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + -ms-border-radius: 15px; + -o-border-radius: 15px; + border-radius: 15px; +} +.close:before { + color: rgba(255, 255, 255, 0.9); + content: "X"; + font-size: 24px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.9); +} +.close:hover { + background-color: rgba(64, 128, 128, 0.8); +} +.popup p, .popup div { + margin-bottom: 10px; +} +.popup label { + display: inline-block; + text-align: left; + width: 120px; +} +.popup input[type="text"], .popup input[type="password"] { + border: 1px solid; + border-color: #999 #ccc #ccc; + margin: 0; + padding: 2px; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.popup input[type="text"]:hover, .popup input[type="password"]:hover { + border-color: #555 #888 #888; +} + + +#Content_Table{ + text-align: center; + display: block; + width : 1000px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Content_Table input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Content_Table input[type=text]:hover, +#Content_Table input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Content_Table input[type=text]:focus, +#Content_Table input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Content_Table input[type=submit], +#Content_Table input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Content_Table input[type=submit]:hover, +#Content_Table input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +/*dari atika*/ + + +#content nav{display:block;overflow:hidden;} +#content nav .nav-previous{float:left;width:50%;} +#content nav .nav-next{float:right;text-align:right;width:50%;} +#content #nav-above{display:none;} +.paged #content #nav-above,.single #content #nav-above{display:block;} +#nav-below{margin:1.2em 0 0;} +.page-link{margin:0 0 1.2em;} + +/* Secondary */ +#secondary .widget{margin:0 0 0 0;} +#secondary h1{font-size:1.4em; border-bottom:1px dotted #aaa;} +#secondary p{margin:0 0 15px 0;} +#secondary ul{list-style:none;margin:0 0 15px 0;padding:0;} +#secondary ul ul{margin:5px 0 5px 20px;font-size:0.9em;} +#secondary ul li{margin:0 0 5px 0;} +#secondary ul li a{font-size:1.2em;font-weight:400;} +#secondary table{width:100%;} + + +/*pop*/ +.modalDialog { + position: fixed; + font-family: Arial, Helvetica, sans-serif; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0,0,0,0.8); + z-index: 99999; + opacity:0; + -webkit-transition: opacity 400ms ease-in; + -moz-transition: opacity 400ms ease-in; + transition: opacity 400ms ease-in; + pointer-events: none; +} + +.modalDialog:target { + opacity:1; + pointer-events: auto; +} + +.modalDialog > div { + width: 400px; + position: relative; + margin: 10% auto; + padding: 5px 20px 13px 20px; + border-radius: 10px; + background: #fff; + background: -moz-linear-gradient(#fff, #999); + background: -webkit-linear-gradient(#fff, #999); + background: -o-linear-gradient(#fff, #999); +} + +.close { + background: #606061; + color: #FFFFFF; + line-height: 25px; + position: absolute; + right: -12px; + text-align: center; + top: -10px; + width: 24px; + text-decoration: none; + font-weight: bold; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + border-radius: 12px; + -moz-box-shadow: 1px 1px 3px #000; + -webkit-box-shadow: 1px 1px 3px #000; + box-shadow: 1px 1px 3px #000; +} + +.close:hover { background: #00d9ff; } \ No newline at end of file diff --git a/src/netbeans-project/web/dashboard.js b/src/netbeans-project/web/dashboard.js new file mode 100644 index 00000000..a2a042ae --- /dev/null +++ b/src/netbeans-project/web/dashboard.js @@ -0,0 +1,73 @@ + +var kategori = [ + {ID: "Kategori 0", task: {Name:["task01","task02"],Deadline: ["01-01-2013","01-02-2013"], Deskripsi: ["deskripsi tugas 1","deskripsi tugas 2"]}, tag: ["tag01", "tag02"]}, + {ID: "Kategori 1", task: {Name:["task03","task04"],Deadline: ["02-01-2013","02-02-2013"], Deskripsi: ["deskripsi tugas 3","deskripsi tugas 4"]}, tag: ["tag11", "tag12"]}, + {ID: "Kategori 2", task: {Name:["task05","task06"],Deadline: ["03-01-2013","03-02-2013"], Deskripsi: ["deskripsi tugas 5","deskripsi tugas 6"]}, tag: ["tag21", "tag22"]}, +]; + + +function loadCategory() +{ + var xx = document.getElementById("dashboard-listcategory"); + xx.innerHTML = xx.innerHTML + "all
"; + + for (var b = 0; b < kategori.length; b++) + { + xx.innerHTML = xx.innerHTML + ("" + kategori[b].ID + "
"); + } + + xx.innerHTML = xx.innerHTML + "add category"; +} + +function loadTask(var1){ + var a = Math.floor(var1/10); + var b = var1 % 10; + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

" + kategori[a].task.Name[b] + "


" + kategori[a].task.Deskripsi[b] + "

"; + +} + +function makeTask(var1) +{ + var xx = document.getElementById("dashboard-tugas"); + xx.innerHTML = ""; + xx.innerHTML += "

halaman pembuatan tugas

"; +} + +function loadContentCategory(var1) +{ + var yy = document.getElementById("dashboard-tugas"); + yy.innerHTML = ""; + + if (var1 != -1){ + var zz = ""; + zz += "

" + kategori[var1].ID + "


Task:

    "; + for (c = 0; c < kategori[var1].task.Name.length; c++){ + zz += "
  1. "+ kategori[var1].task.Name[c] + " deadline: " + kategori[var1].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[var1].tag.length; d++){ + zz+= "" + kategori[var1].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } else { + for (var a = 0; a < kategori.length; a++) + { + var zz = ""; + zz += "

" + kategori[a].ID + "


Task:

    "; + for (c = 0; c < kategori[a].task.Name.length; c++){ + zz += "
  1. "+ kategori[a].task.Name[c] + " deadline: " + kategori[a].task.Deadline[c] + "
  2. "; + } + zz += "

tag :

"; + + for (d = 0; d < kategori[a].tag.length; d++){ + zz+= "" + kategori[a].tag[d] + " "; + } + zz += "
"; + yy.innerHTML += zz; + } + } +} diff --git a/src/netbeans-project/web/dashboard.jsp b/src/netbeans-project/web/dashboard.jsp new file mode 100644 index 00000000..49f9afb9 --- /dev/null +++ b/src/netbeans-project/web/dashboard.jsp @@ -0,0 +1,161 @@ + +<%@page import="database.Checker"%> + +<%@page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + if(session.getAttribute("sUsername")==null) + response.sendRedirect("index.jsp"); +%> + + + S.Y.N. Dashboard + + + + + + + + + + +   +
+   +
+   +
+   +
+ + + + + +
+

Select Category :

+ +
+ +
+
+ <% + if (request.getParameter("category") != null && !request.getParameter("category").toString().equals("all")) { + String catcreator = Checker.getCategoryCreator(request.getParameter("category")); + out.println("Category Creator : " + catcreator + "

"); + if (catcreator.equals(session.getAttribute("sUsername"))) { + out.println(""); + } + if (Checker.isContributor(session.getAttribute("sUsername").toString(), request.getParameter("category").toString())) { + out.println(""); + } + } + %> +
+
+
+ ! Only Category Creator can delete category +
+
+
+ <% + String categ; + if (request.getParameter("category") == null || request.getParameter("category").equals("all")) { + categ = "1"; + } else { + categ = "namaKategori = \"" + request.getParameter("category") + "\""; + } + String tQuery = "Select * from task where " + categ + ";"; + %> +

+ Dashboard +
+ category : + <% + if (request.getParameter("category") == null || request.getParameter("category").equals("all")) { + out.println("all"); + } else { + out.println(request.getParameter("category")); + } + %> +

+ <% + MyDatabase myDB = new MyDatabase(); + ResultSet tResult = myDB.selectDB(tQuery); + while (tResult.next()) { + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println("

"); + out.println(""); + out.println(tResult.getString("namaTask") + "

"); + out.println("Deadline : " + tResult.getDate("deadline")); + out.println("
Tag : "); + String tQuery2 = "select * from tagging where namaTask=\"" + tResult.getString("namaTask") + "\";"; + MyDatabase myDB2 = new MyDatabase(); + ResultSet tResult2 = myDB2.selectDB(tQuery2); + while (tResult2.next()) { + out.println(tResult2.getString("tag") + ", "); + } + out.println("
"); + out.println("Status : " + tResult.getString("status") + "
"); + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println(""); + } + if (Checker.isCreator(session.getAttribute("sUsername").toString(), tResult.getString("namaTask"))) { + out.println(""); + } + out.println("
"); + out.println("===========
"); + } + } + %> + +
+ + \ No newline at end of file diff --git a/src/netbeans-project/web/deletecategory.jsp b/src/netbeans-project/web/deletecategory.jsp new file mode 100644 index 00000000..232dbc14 --- /dev/null +++ b/src/netbeans-project/web/deletecategory.jsp @@ -0,0 +1,34 @@ +<%-- + Document : deletecategory + Created on : Apr 12, 2013, 5:10:46 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaKategori = request.getParameter("namaKategori"); + if (Checker.getCategoryCreator(namaKategori).equals(session.getAttribute("sUsername").toString())) { + String pQuery = "select * from task where namaKategori=\"" + namaKategori + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + while (tResult.next()) { + String namaTask = tResult.getString("namaTask"); + String tQuery; + MyDatabase mydb1 = new MyDatabase(); + tQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`namaTask`= \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tagging` WHERE `tagging`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tasktoasignee` WHERE `tasktoasignee`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`attach` WHERE `attach`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`task` WHERE `task`.`namaTask` = \"" + namaTask + "\""; + mydb1.queryDB(tQuery); + } + pQuery = "DELETE FROM `sharedtodolist`.`kategori` WHERE `kategori`.`namaKategori`=\"" + request.getParameter("namaKategori") +"\""; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("dashboard.jsp"); +%> \ No newline at end of file diff --git a/src/netbeans-project/web/deletetask.jsp b/src/netbeans-project/web/deletetask.jsp new file mode 100644 index 00000000..7eea3601 --- /dev/null +++ b/src/netbeans-project/web/deletetask.jsp @@ -0,0 +1,24 @@ +<%-- + Document : deletetask + Created on : Apr 12, 2013, 2:13:51 AM + Author : Arief +--%> +<%@page import="database.Checker"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaTask = request.getParameter("namaTask"); + if (Checker.isCreator(session.getAttribute("sUsername").toString(), namaTask)) { + String tQuery; + tQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`namaTask`= \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tagging` WHERE `tagging`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`tasktoasignee` WHERE `tasktoasignee`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`attach` WHERE `attach`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + tQuery = "DELETE FROM `sharedtodolist`.`task` WHERE `task`.`namaTask` = \"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(tQuery); + } + response.sendRedirect("dashboard.jsp"); +%> \ No newline at end of file diff --git a/src/netbeans-project/web/editprofile.js b/src/netbeans-project/web/editprofile.js new file mode 100644 index 00000000..47c5a493 --- /dev/null +++ b/src/netbeans-project/web/editprofile.js @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkPassword() { + var uname=document.forms["EditForm"]["daftar_username"].value; + var pass=document.forms["EditForm"]["daftar_password"].value; + var email=document.forms["EditForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password Tidak Berubah";return true;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["EditForm"]["daftar_password"].value; + var pass2=document.forms["EditForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["EditForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak berubah";return true;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["EditForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(filename=="") + {document.getElementById('avatarWarning').innerHTML="avatar tidak berubah";return true} + else if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkPassword() && checkConfirmPassword() && checkNama() && check_extension()); +} \ No newline at end of file diff --git a/src/netbeans-project/web/editprofile.jsp b/src/netbeans-project/web/editprofile.jsp new file mode 100644 index 00000000..2c2e49e4 --- /dev/null +++ b/src/netbeans-project/web/editprofile.jsp @@ -0,0 +1,128 @@ +<%-- + Document : editprofile + Created on : Apr 12, 2013, 8:30:05 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> + + + + + + + Edit Profile + + + +   +
+   +
+   +
+   +
+

Edit Profile

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Password + + : + + + "> + "> +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + diff --git a/src/netbeans-project/web/editprofileprocess.jsp b/src/netbeans-project/web/editprofileprocess.jsp new file mode 100644 index 00000000..618e5d22 --- /dev/null +++ b/src/netbeans-project/web/editprofileprocess.jsp @@ -0,0 +1,34 @@ +<%-- + Document : editprofileprocess + Created on : Apr 12, 2013, 9:09:01 AM + Author : Arief +--%> + +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@page import="database.Checker"%> +<% + String uname = request.getParameter("daftar_username"); + String fullname = request.getParameter("daftar_namalengkap"); + String password = request.getParameter("daftar_password"); + String email = request.getParameter("daftar_email"); + String tanggal = request.getParameter("daftar_tanggallahir"); + String avatar = request.getParameter("daftar_avatar"); + if (avatar != null) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `avatar` = '" + avatar + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (!(tanggal == null || tanggal == "")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `tanggalLahir` = '" + tanggal + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (fullname != null && !fullname.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `fullname` = '" + fullname + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + if (password != null && !password.equals("")) { + String pQuery = "UPDATE `sharedtodolist`.`user` SET `password` = '" + password + "' WHERE `user`.`username` = '" + uname + "'"; + MyDatabase.getSingleton().queryDB(pQuery); + } + response.sendRedirect("profil.jsp"); +%> \ No newline at end of file diff --git a/src/netbeans-project/web/edittask.js b/src/netbeans-project/web/edittask.js new file mode 100644 index 00000000..6a39688f --- /dev/null +++ b/src/netbeans-project/web/edittask.js @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkTag() { + var tag=document.forms["editTaskForm"]["edittask_tag"].value; + if(tag=="" || tag==null) + {document.getElementById('tagwarning').innerHTML="*Warning! Seluruh task akan dihapus";} + else + {document.getElementById('tagwarning').innerHTML="";} +} + +function checkAssignee() { + var tag=document.forms["editTaskForm"]["edittask_assignee"].value; + if(tag=="" || tag==null) + {document.getElementById('assigneewarning').innerHTML="*Warning! Seluruh assignee akan dihapus, kecuali task creator";} + else + {document.getElementById('assigneewarning').innerHTML="";} +} + + + +function checkValidation() { + checkTag(); + checkAssignee(); +} \ No newline at end of file diff --git a/src/netbeans-project/web/edittask.jsp b/src/netbeans-project/web/edittask.jsp new file mode 100644 index 00000000..cc93915e --- /dev/null +++ b/src/netbeans-project/web/edittask.jsp @@ -0,0 +1,96 @@ +<%-- + Document : edittask + Created on : Apr 13, 2013, 2:32:07 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page import="java.sql.Date"%> +<%@page import="database.MyDatabase"%> +<%@page import="java.sql.ResultSet"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + Edit Task + + + +   +
+   +
+   +
+   +
+ <% + String namaTask = request.getParameter("namaTask"); + String pQuery = "select distinct * from tasktoasignee where namaTask =\"" + namaTask + "\""; + ResultSet tResult = MyDatabase.getSingleton().selectDB(pQuery); + String assigneeList = ""; + while (tResult.next()) { + assigneeList = assigneeList + tResult.getString("asigneeName") + ","; + } + pQuery = "select distinct * from tagging where namaTask=\"" + namaTask + "\""; + tResult = MyDatabase.getSingleton().selectDB(pQuery); + String tagList = ""; + while (tResult.next()) { + tagList = tagList + tResult.getString("tag") + ","; + } + pQuery = "select * from task where namaTask=\"" + namaTask + "\""; + tResult = MyDatabase.getSingleton().selectDB(pQuery); + Date deadline = new Date(2012, 4, 3); + while (tResult.next()) { + deadline = tResult.getDate("deadline"); + } + %> +

Edit Task

+ <% + if (Checker.isCreator(session.getAttribute("sUsername").toString(), namaTask)) { + out.println(""); + } + %> +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Assignee: + + +
Tag: + +
Deadline: + +
+ +
+
+ + diff --git a/src/netbeans-project/web/edittaskprocess.jsp b/src/netbeans-project/web/edittaskprocess.jsp new file mode 100644 index 00000000..3a9ea676 --- /dev/null +++ b/src/netbeans-project/web/edittaskprocess.jsp @@ -0,0 +1,48 @@ +<%-- + Document : edittaskprocess + Created on : Apr 13, 2013, 3:08:13 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String namaTask = request.getParameter("edittask_namaTask"); + String assigneeList = request.getParameter("edittask_assignee"); + String tagList = request.getParameter("edittask_tag"); + String deadline = request.getParameter("edittask_date"); + String pQuery = "UPDATE `sharedtodolist`.`task` SET `deadline`='" + deadline + "' where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + String creatorName = ""; + pQuery = "select * from task where namaTask=\"" + namaTask + "\""; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + while (resultSet.next()) { + creatorName = resultSet.getString("creatorTaskName"); + } + + pQuery = "delete from tasktoasignee where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask` ,`asigneeName`)VALUES ('" + namaTask + "', '" + creatorName + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + if (assigneeList != null && !assigneeList.equals("")) { + String[] assignee = assigneeList.split(","); + for (int i = 0; i < assignee.length; i++) { + if (assignee[i] != null && !assignee[i].equals("") && !assignee[i].equals(creatorName)) { + pQuery = "INSERT INTO `sharedtodolist`.`tasktoasignee` (`namaTask` ,`asigneeName`)VALUES ('" + namaTask + "', '" + assignee[i] + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + } + } + } + + pQuery = "delete from tagging where namaTask=\"" + namaTask + "\""; + MyDatabase.getSingleton().queryDB(pQuery); + if (tagList != null && !tagList.equals("")) { + String[] tag = tagList.split(","); + for (int i = 0; i < tag.length; i++) { + if (tag[i] != null && !tag[i].equals("")) { + pQuery = "INSERT INTO `sharedtodolist`.`tagging` (`namaTask` ,`tag`)VALUES ('" + namaTask + "', '" + tag[i] + "');"; + MyDatabase.getSingleton().queryDB(pQuery); + } + } + } + response.sendRedirect("viewtask.jsp?namaTask="+namaTask); +%> diff --git a/src/netbeans-project/web/hapuskomentar.jsp b/src/netbeans-project/web/hapuskomentar.jsp new file mode 100644 index 00000000..61ec98f6 --- /dev/null +++ b/src/netbeans-project/web/hapuskomentar.jsp @@ -0,0 +1,18 @@ +<%-- + Document : ubahstatus + Created on : Apr 12, 2013, 1:39:37 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + int target = Integer.parseInt(request.getParameter("target").toString()); + String namaTask = request.getParameter("namaTask").toString(); + int idk = Integer.parseInt(request.getParameter("idkomentar").toString()); + out.println(target); + out.println(namaTask); + out.println(idk); + String pQuery = "DELETE FROM `sharedtodolist`.`komentar` WHERE `komentar`.`idKomentar` = "+idk; + MyDatabase.getSingleton().queryDB(pQuery); + response.sendRedirect("viewtask.jsp?namaTask="+namaTask+"&target="+target); +%> diff --git a/src/netbeans-project/web/header.css b/src/netbeans-project/web/header.css new file mode 100644 index 00000000..58a8f671 --- /dev/null +++ b/src/netbeans-project/web/header.css @@ -0,0 +1,82 @@ +/* + Document : header.css + Created on : Apr 12, 2013, 6:41:42 AM + Author : Arief + Description: + Purpose of the stylesheet follows. +*/ + +#Header { + display: block; + width: 1000px; + height: 130px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; + text-align: center; +} + +#Header hr { + border : 1px dashed; + border-color : #ccc; +} + +#Header a{ + font-family: monospace; + color: white; + text-decoration: none; +} + +#Header a:hover{ + color:antiquewhite; + text-decoration: underline overline; +} + +#Header input[type=text], +#Header input[type="password"]{ + background-color: grey; + border: 1px dashed white; + color:white; +} + +#Header input[type=text]:hover, +#Header input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Header input[type=text]:focus, +#Header input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Header input[type=submit], +#Header input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Header input[type=submit]:hover, +#Header input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} \ No newline at end of file diff --git a/src/netbeans-project/web/header.jsp b/src/netbeans-project/web/header.jsp new file mode 100644 index 00000000..dbb2e7ef --- /dev/null +++ b/src/netbeans-project/web/header.jsp @@ -0,0 +1,47 @@ +<%@page import="database.Checker"%> +<% + if(session.getAttribute("sUsername")==null) + response.sendRedirect("index.jsp"); +%> + + + + + S.Y.N. Dashboard + + + + + + + \ No newline at end of file diff --git a/src/netbeans-project/web/images/avatar.jpg b/src/netbeans-project/web/images/avatar.jpg new file mode 100644 index 00000000..30dd137f Binary files /dev/null and b/src/netbeans-project/web/images/avatar.jpg differ diff --git a/src/netbeans-project/web/images/syn.jpg b/src/netbeans-project/web/images/syn.jpg new file mode 100644 index 00000000..b33556c8 Binary files /dev/null and b/src/netbeans-project/web/images/syn.jpg differ diff --git a/src/netbeans-project/web/images/syn.psd b/src/netbeans-project/web/images/syn.psd new file mode 100644 index 00000000..61504fcc Binary files /dev/null and b/src/netbeans-project/web/images/syn.psd differ diff --git a/src/netbeans-project/web/images/syn2.jpg b/src/netbeans-project/web/images/syn2.jpg new file mode 100644 index 00000000..79e2381a Binary files /dev/null and b/src/netbeans-project/web/images/syn2.jpg differ diff --git a/src/netbeans-project/web/index.jsp b/src/netbeans-project/web/index.jsp new file mode 100644 index 00000000..654d9cb1 --- /dev/null +++ b/src/netbeans-project/web/index.jsp @@ -0,0 +1,190 @@ +<%-- + Document : index + Created on : Apr 11, 2013, 10:55:56 AM + Author : Arief +--%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<% + if(session.getAttribute("sUsername")!=null) + response.sendRedirect("dashboard.jsp"); +%> + + + + S.Y.N Login Page + + + + + + +
+

Login Form :

+
+ + + + + + + + + + + + + + +
+ Username + + : + + +
+ Password + + : + + +
+ +
+
+
+
+ <% + if(request.getParameter("error")!=null) + out.println("

"+request.getParameter("error")+"

"); + %> +
+
+

Registration Form :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Username + + : + + +
+
+
+ Password + + : + + +
+
+
+ Confirm Pasword + + : + + +
+
+
+ Nama Lengkap + + : + + +
+
+
+ Tanggal Lahir + + : + + +
+ e-Mail + + : + + +
+
+
+ Avatar + + : + + +
+
+
+ + + + +
+
+
+ + + diff --git a/src/netbeans-project/web/loginpage.css b/src/netbeans-project/web/loginpage.css new file mode 100644 index 00000000..72da27b0 --- /dev/null +++ b/src/netbeans-project/web/loginpage.css @@ -0,0 +1,96 @@ +/* + Document : LoginPage + Created on : Feb 19, 2013, 7:09:01 AM + Author : Arief + Description: + CSS for Login Page +*/ + + +#Front_Logo { + display: block; + width: 600px; + height: 200px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form{ + text-align: center; + display: block; + width: 400px; + margin: 0 auto; + margin-top: 25px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 3px; +} + +#Front_Form input[type=text],#Front_Form input[type="password"]{ + border-color: #ccccff; + background-color: grey; + border-width: 1px; + border-style: dashed; + float : left; + color: white; + padding-left: 5px; + width: 190px; +} + +#Front_Form input[type=text]:hover, +#Front_Form input[type="password"]:hover{ + background-color: #666666; + border-color: #ddddff; +} + +#Front_Form input[type=text]:focus, +#Front_Form input[type="password"]:focus{ + background-color: #333333; + border-color: #ddddff; +} + +#Front_Form input[type=submit], +#Front_Form input[type=reset]{ + color: white; + font-family: monospace; + background-color: #666666; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +#Front_Form input[type=submit]:hover, +#Front_Form input[type=reset]:hover{ + color: white; + font-family: monospace; + background-color: #333333; + margin-top: 10px; + border-color: whitesmoke; + border-width: 1px; + border-style: dashed; + border-radius : 3px; +} + +body { + background-color: grey; + font-family: monospace; + color: white; + text-align: center; +} + +iframe { + border:none; +} \ No newline at end of file diff --git a/src/netbeans-project/web/loginprocess.jsp b/src/netbeans-project/web/loginprocess.jsp new file mode 100644 index 00000000..79278c6b --- /dev/null +++ b/src/netbeans-project/web/loginprocess.jsp @@ -0,0 +1,25 @@ +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> + +<% + String username = request.getParameter("username"); + String password = request.getParameter("password"); + + String tQuery = "SELECT * FROM user WHERE username='" + username + "' AND password='" + password + "';"; + try { + ResultSet tResult = MyDatabase.getSingleton().selectDB(tQuery); + if (tResult.next()) { + session.setMaxInactiveInterval(2592000); + session.setAttribute("isActive",true); + session.setAttribute("sUsername", tResult.getString("username")); + session.setAttribute("sAvatar", tResult.getString("avatar")); + session.setAttribute("sNama", tResult.getString("fullname")); + response.sendRedirect("dashboard.jsp"); + } else { + String message = "No user or password matched"; + response.sendRedirect("index.jsp?error=" + message); + } + } catch (Exception e) { + e.printStackTrace(); + } + +%> diff --git a/src/netbeans-project/web/logoutprocess.jsp b/src/netbeans-project/web/logoutprocess.jsp new file mode 100644 index 00000000..e554e566 --- /dev/null +++ b/src/netbeans-project/web/logoutprocess.jsp @@ -0,0 +1,10 @@ +<%-- + Document : logoutprocess + Created on : Apr 12, 2013, 6:11:12 AM + Author : Arief +--%> + +<% + session.invalidate(); + response.sendRedirect("index.jsp?error=user logout success"); +%> diff --git a/src/netbeans-project/web/movie.mp4 b/src/netbeans-project/web/movie.mp4 new file mode 100644 index 00000000..3daaab5a Binary files /dev/null and b/src/netbeans-project/web/movie.mp4 differ diff --git a/src/netbeans-project/web/myscript.js b/src/netbeans-project/web/myscript.js new file mode 100644 index 00000000..49fcdf63 --- /dev/null +++ b/src/netbeans-project/web/myscript.js @@ -0,0 +1,136 @@ +function myfunc(categ,i){ + return categ.task[i]; +} + +function myfunc2(categ){ + return categ.assignee; +} + +function myfunc3(categ){ + return categ.deadline; +} + +function myfunc4(categ){ + return categ.comment; +} + +function myfunc5(categ){ + return categ.tag; +} + + +function addtask(task, deadline, assignee, comment, tag){ + this.task = task; + //this.att = att; + this.deadline = deadline; + this.assignee = assignee; + this.comment = comment; + this.tag = tag; +} + +function createcateg(){ + var d1 = new Date("October 13, 2013 10:13:00") + var d2 = new Date("July 12, 2014 07:13:00") + var d3 = new Date("September 29, 1955 11:13:00") + //categ={cat:cat, task:task, deadline:deadline, assignee:assignee, comment:comment, tag:tag};//var task1 = new Array("Buy a Ferrari","Rent an apartment","Build a startup","Fail in life"); + categ1={task:["Buy a Ferrari","Rent an apartment","Build a startup","Buy some milk"], deadline:d1, assignee:"Cow", comment:"hurry", tag:"#misc #food"}; + + //var task2 = new Array("Buy a Lexus","Rent an apartment","Build a startup","Fail in life"); + categ2={task:["Buy a Lexus","Sleep beside a hobo","Fail in life","Build a startup"], deadline:d2, assignee:"Atika", comment:"start small", tag:"#work #money"}; + + //var task3 = new Array("Buy a Volkswagen","Rent an apartment","Build a startup","Fail in life"); + categ3={task:["Buy a Volkswagen","Buy a house","Build a startup","Go back to the future"], deadline:d3, assignee:"Marty", comment:"urgent matters", tag:"#project #time"}; +} + +var categ1, categ2, categ3; + +function mOver1(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + + + +} + +function mOver2(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + +} + +function mOver3(categ) +{ + + createcateg(); + + for (var i in categ.task) + { + + document.getElementById("tasklist").innerHTML=''+myfunc(categ,i)+'
'+myfunc3(categ).toUTCString()+'
'+'
'+'
'+myfunc4(categ)+'
'+'
'+myfunc2(categ)+'
'+'
'+myfunc5(categ)+'
'+'

« Add more tasks..
'; + + } + +} + +function mOut(obj) +{ + //document.getElementById("tasklist").innerHTML=mclk(tasklist); +} + +function SearchDatabase() +{ + document.forms['formsearch'].submit(); +} + +function register_check() { + + var regex_username = /^[A-Za-z0-9_]{5,}$/; + var regex_password = /^[A-Za-z0-9!@()$%^&*#_]{8,}$/; + var regex_email = /^[A-Za-z][A-Za-z0-9_.]*\@[A-Za-z0-9_.-]+\.[A-Za-z][A-Za-z]+$/; + var regex_fullname = /^[A-Za-z]+ [A-Za-z \.]+$/; + var regex_birthdate = /^\d{4}\-\d{2}\-\d{2}$/; + var avatar_ext = $id("registerform-avatar").value.split('.').pop(); + + var ok = true; + + window.registerform_validation['username'] = regex_username.test($id("registerform-username").value); + window.registerform_validation['password'] = regex_password.test($id("registerform-password").value); + window.registerform_validation['equalsUPE'] = ($id("registerform-password").value != $id("registerform-username").value) && ($id("registerform-password").value != $id("registerform-email").value); + window.registerform_validation['password2'] = ($id("registerform-password").value == $id("registerform-password2").value); + window.registerform_validation['fullname'] = regex_fullname.test($id("registerform-fullname").value); + window.registerform_validation['birthdate'] = (regex_birthdate.test($id("registerform-birthdate").value)) && (parseInt($id("registerform-birthdate").value.split('-')[0]) >= 1955); + window.registerform_validation['email'] = regex_email.test($id("registerform-email").value); + window.registerform_validation['avatar'] = (avatar_ext == "jpg") || (avatar_ext == "jpeg"); + + for(key in registerform_validation) { + if(!registerform_validation[key]) { + $id("registerform-submit").disabled = true; + ok = false; + } + } + if(ok) { + $id("registerform-submit").disabled = false; + } +} + +function addcateg() +{ + xmlhttp.open("POST","newcategory,jsp?q=afuu",true); + xmlhttp.send(); +} \ No newline at end of file diff --git a/src/netbeans-project/web/newcategory.jsp b/src/netbeans-project/web/newcategory.jsp new file mode 100644 index 00000000..567b9647 --- /dev/null +++ b/src/netbeans-project/web/newcategory.jsp @@ -0,0 +1,27 @@ +<%-- + Document : newcategory + Created on : Apr 12, 2013, 2:58:28 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String tQuery = "INSERT INTO `sharedtodolist`.`kategori` (`namaKategori`,`creatorKategoriName`) VALUES('" + request.getParameter("newcateg") + "','" + session.getAttribute("sUsername") + "');"; + int result = MyDatabase.getSingleton().queryDB(tQuery); + if (result != -1) { + tQuery = "INSERT INTO `sharedtodolist`.`usertocategory` (`namaKategori`,`username`) VALUES('" + request.getParameter("newcateg") + "','" + session.getAttribute("sUsername") + "');"; + MyDatabase.getSingleton().queryDB(tQuery); + String namelist = request.getParameter("userlist"); + String[] name = namelist.split(","); + for (int i = 0; i < name.length; i++) { + if (!name[i].equals(session.getAttribute("sUsername").toString())) { + tQuery = "INSERT INTO `sharedtodolist`.`usertocategory` (`namaKategori`,`username`) VALUES('" + request.getParameter("newcateg") + "','" + name[i] + "');"; + MyDatabase.getSingleton().queryDB(tQuery); + } + } + response.sendRedirect("dashboard.jsp?category=" + request.getParameter("newcateg")); + } + else + response.sendRedirect("dashboard.jsp"); +%> diff --git a/src/netbeans-project/web/profil.css b/src/netbeans-project/web/profil.css new file mode 100644 index 00000000..b32a2777 --- /dev/null +++ b/src/netbeans-project/web/profil.css @@ -0,0 +1,55 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#profile-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#profile-tugas{ + width:600px; + height:550px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 0px 25px; +} + +#profile-biodata{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + +} + +h1{color:white;} + +#profile-title{ + text-align: center; +} + +#profile-img{ + +} \ No newline at end of file diff --git a/src/netbeans-project/web/profil.jsp b/src/netbeans-project/web/profil.jsp new file mode 100644 index 00000000..da95c777 --- /dev/null +++ b/src/netbeans-project/web/profil.jsp @@ -0,0 +1,84 @@ +<%-- + Document : profil + Created on : Apr 12, 2013, 7:54:12 AM + Author : Arief +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + S.Y.N. Profile + + + +   +
+   +
+   +
+   +
+ <% + String username; + MyDatabase myDBProfile = new MyDatabase(); + if(request.getParameter("username")==null) + username = session.getAttribute("sUsername").toString(); + else + username = request.getParameter("username"); + ResultSet resultSet = myDBProfile.selectDB("select * from user where username=\""+username+"\""); + while(resultSet.next()){ + %> +

User Profile

+ + + + + +
+ "> + + Username : <%= resultSet.getString("username") %>
+ Nama Lengkap : <%= resultSet.getString("fullname") %>
+ Tanggal Lahir : <%= resultSet.getString("tanggalLahir") %>
+ E-mail : <%= resultSet.getString("email") %>
+ Done Task List :
+ <% + MyDatabase myDBProfile2 = new MyDatabase(); + String pQuery = "select * from tasktoasignee JOIN task on tasktoasignee.namaTask=task.namaTask where asigneeName=\""+resultSet.getString("username")+"\" and status=\"done\""; + ResultSet resultSet2 = myDBProfile2.selectDB(pQuery); + while(resultSet2.next()){ + out.println(""+resultSet2.getString("namaTask")+"
"); + } + %> + UnDone Task List :
+ <% + pQuery = "select * from tasktoasignee JOIN task on tasktoasignee.namaTask=task.namaTask where asigneeName=\""+resultSet.getString("username")+"\" and status=\"undone\""; + resultSet2 = myDBProfile2.selectDB(pQuery); + while(resultSet2.next()){ + out.println(""+resultSet2.getString("namaTask")+"
"); + } + %> +
+ <% } + %> +
+ <% + if(request.getParameter("username")==null){ + %> +
+ "> + +
+ <% + } + %> +
+ + diff --git a/src/netbeans-project/web/registerprocess.jsp b/src/netbeans-project/web/registerprocess.jsp new file mode 100644 index 00000000..d0f3008a --- /dev/null +++ b/src/netbeans-project/web/registerprocess.jsp @@ -0,0 +1,31 @@ +<%-- + Document : registerprocess + Created on : Apr 12, 2013, 5:42:03 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String username = request.getParameter("daftar_username"); + String password = request.getParameter("daftar_password"); + String namalengkap = request.getParameter("daftar_namalengkap"); + String tanggallahir = request.getParameter("daftar_tanggallahir"); + String mail = request.getParameter("daftar_e-mail"); + String avatar = request.getParameter("daftar_avatar").toString(); + String pQuery = "INSERT INTO `sharedtodolist`.`user` (`username` ,`email` ,`fullname` ,`avatar` ,`tanggalLahir` ,`password`) VALUES('" + username + "','" + mail + "','" + namalengkap + "','" + avatar + "','" + tanggallahir + "','" + password + "')"; + out.println(pQuery); + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if (ti != -1) { + session.setAttribute("isActive", false); + request.getSession(true); + session.setMaxInactiveInterval(2592000); + session.setAttribute("isActive", true); + session.setAttribute("sUsername", username); + session.setAttribute("sNama", namalengkap); + session.setAttribute("sAvatar", avatar); + response.sendRedirect("dashboard.jsp"); + } else { + response.sendRedirect("index.jsp?error=registration failed"); + } +%> diff --git a/src/netbeans-project/web/registrasi.js b/src/netbeans-project/web/registrasi.js new file mode 100644 index 00000000..3a88f2c6 --- /dev/null +++ b/src/netbeans-project/web/registrasi.js @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkUsername() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + if(uname=="" || uname==null) + {document.getElementById('usernameWarning').innerHTML="*Username tidak boleh kosong";return false;} + else + if(uname.length<5) + {document.getElementById('usernameWarning').innerHTML="*Username minimal 5 huruf";return false;} + else + {document.getElementById('usernameWarning').innerHTML="";return true;} +} + +function checkPassword() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + var pass=document.forms["RegistrationForm"]["daftar_password"].value; + var email=document.forms["RegistrationForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh kosong";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["RegistrationForm"]["daftar_password"].value; + var pass2=document.forms["RegistrationForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["RegistrationForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak boleh kosong";return false;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + +function checkEmail() { + var email=document.forms["RegistrationForm"]["daftar_email"].value; + var atpos=email.indexOf("@"); + var dotpos=email.lastIndexOf("."); + if(email=="" || email==null) + {document.getElementById('emailWarning').innerHTML="*E-mail tidak boleh kosong";return false;} + else + if(atpos<1 || dotpos=email.length) + {document.getElementById('emailWarning').innerHTML=("*e-mail tidak valid");return false;} + else + {document.getElementById('emailWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["RegistrationForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkUsername() && checkPassword() && checkConfirmPassword() && checkNama() && checkEmail() && check_extension()); +} + +function checkLogin() { + var username=document.forms["LoginForm"]["username"].value; + var password=document.forms["LoginForm"]["password"].value; + if(username!="admin") + { + alert("User Not Found"); + return false; + } + else if(password!="adminadmin") + { + alert("Password incorrect") + return false; + } + else + return true; +} \ No newline at end of file diff --git a/src/netbeans-project/web/searchresult.jsp b/src/netbeans-project/web/searchresult.jsp new file mode 100644 index 00000000..bfbb5f4a --- /dev/null +++ b/src/netbeans-project/web/searchresult.jsp @@ -0,0 +1,104 @@ +<%-- + Document : searchresult + Created on : Apr 12, 2013, 9:44:18 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page import="database.MyDatabase"%> +<%@page import="java.sql.ResultSet"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + S.Y.N. Search Result + + + +   +
+   +
+   +
+   +
+ <% + String query = request.getParameter("query"); + int filter = Integer.parseInt(request.getParameter("filter")); + int pagenum; + if (request.getParameter("page") != null) { + pagenum = Integer.parseInt(request.getParameter("page")); + } else { + pagenum = 0; + } + + %> +

Search Result

+ + <% + if (filter == 1 || filter == 0) { + String pQuery = "select * from user where username LIKE '%" + query + "%' OR email LIKE '%" + query + "%' OR tanggalLahir LIKE '%" + query + "%' or fullname LIKE '%" + query + "%'"; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + out.println("

User search result

"); + while (resultSet.next()) { + out.println("Username : "); + out.println(""); + out.println(resultSet.getString("username").toString() + "
"); + out.println("Nama Lengkap : " + resultSet.getString("fullname") + "
"); + out.println("Tanggal Lahir : " + resultSet.getDate("tanggalLahir") + "
"); + out.println("e-mail : " + resultSet.getString("email") + "
"); + out.println(""); + out.println("

"); + } + out.println("==========================================
"); + } + if (filter == 2 || filter == 0) { + String pQuery = "select * from kategori where namaKategori LIKE '%" + query + "%'"; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + out.println("

Category search result

"); + while (resultSet.next()) { + out.println("Kategori : "); + out.println(""); + out.println(resultSet.getString("namaKategori").toString() + "
"); + out.println("Pembuat Kategori : " + resultSet.getString("creatorKategoriName") + "

"); + } + out.println("==========================================
"); + } + if (filter == 3 || filter == 0) { + String pQuery = "SELECT DISTINCT task.namaTask AS namaTask, status, deadline FROM task LEFT OUTER JOIN komentar ON task.namaTask = komentar.namaTask WHERE task.namaTask LIKE '%"+query+"%' OR komentar.isikomentar LIKE '%"+query+"%'"; + MyDatabase searchDB = new MyDatabase(); + ResultSet resultSet = searchDB.selectDB(pQuery); + out.println("

Task Search Result

"); + while (resultSet.next()){ + out.println("Nama Task : "); + out.println(""); + out.println(resultSet.getString("namaTask").toString() + "
"); + out.println("Tanggal Deadline : " + resultSet.getDate("deadline") + "
"); + out.println("Status : " + resultSet.getString("status") + "
"); + out.println("Tag : "); + String pQuery2 = "SELECT DISTINCT * from tagging where namaTask=\"" + resultSet.getString("namaTask") + "\""; + MyDatabase searchDB2 = new MyDatabase(); + ResultSet resultSet2 = searchDB2.selectDB(pQuery2); + while(resultSet2.next()){ + out.println(resultSet2.getString("tag")); + } + out.println("
"); + if(Checker.isAssignee(session.getAttribute("sUsername").toString(), resultSet.getString("namaTask"))){ + out.println(""); + out.println("

"); + } + } + out.println("==========================================
"); + } + %> + + +
+ + diff --git a/src/netbeans-project/web/submitkomentar.jsp b/src/netbeans-project/web/submitkomentar.jsp new file mode 100644 index 00000000..0018c8c4 --- /dev/null +++ b/src/netbeans-project/web/submitkomentar.jsp @@ -0,0 +1,20 @@ +<%-- + Document : submitkomentar + Created on : Apr 12, 2013, 7:26:27 PM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet,java.sql.Timestamp,java.util.Date;" errorPage="" %> +<% + String nama = request.getParameter("namaTask").toString(); + String username = session.getAttribute("sUsername").toString(); + int target = Integer.parseInt(request.getParameter("target").toString()); + String isikomentar = request.getParameter("isiKomentar").toString(); + java.util.Date date = new java.util.Date(); + String pQuery = "INSERT INTO `sharedtodolist`.`komentar` (`idKomentar` ,`komentator` ,`isikomentar` ,`namaTask` ,`timestamp`) VALUES (NULL,'"+username+"','"+isikomentar+"','"+nama+"','"+new Timestamp(date.getTime())+"')"; + //out.println(pQuery); + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if(ti!=-1){ + response.sendRedirect("viewtask.jsp?namaTask="+nama+"&page="+target); + } +%> \ No newline at end of file diff --git a/src/netbeans-project/web/ubahstatus.jsp b/src/netbeans-project/web/ubahstatus.jsp new file mode 100644 index 00000000..0be40e8a --- /dev/null +++ b/src/netbeans-project/web/ubahstatus.jsp @@ -0,0 +1,33 @@ +<%-- + Document : ubahstatus + Created on : Apr 12, 2013, 1:39:37 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + MyDatabase ubahstatusDB = new MyDatabase(); + MyDatabase ubahstatusDB2 = new MyDatabase(); + String curstatus = ""; + String tQuery = "select * from task where namaTask = \"" + request.getParameter("namaTask") + "\""; + ResultSet tResult = ubahstatusDB.selectDB(tQuery); + while (tResult.next()) { + curstatus = tResult.getString("status"); + } + if (curstatus.equals("done")) { + tQuery = "UPDATE `sharedtodolist`.`task` SET `status` = 'undone' WHERE `task`.`namaTask` = \"" + request.getParameter("namaTask") + "\""; + } else { + tQuery = "UPDATE `sharedtodolist`.`task` SET `status` = 'done' WHERE `task`.`namaTask` = \"" + request.getParameter("namaTask") + "\""; + } + out.println(tQuery); + ubahstatusDB2.queryDB(tQuery); + if (request.getParameter("target").toString().equals("dashboard")) { + response.sendRedirect("dashboard.jsp"); + } + else if(request.getParameter("target").toString().equals("search")) { + response.sendRedirect("searchresult.jsp?query="+request.getParameter("query")+"&filter="+request.getParameter("filter")+"&page="+request.getParameter("page")); + } + else if(request.getParameter("target").toString().equals("viewtask")) { + response.sendRedirect("viewtask.jsp?namaTask="+request.getParameter("namaTask")); + } +%> diff --git a/src/netbeans-project/web/viewtask.jsp b/src/netbeans-project/web/viewtask.jsp new file mode 100644 index 00000000..c4195914 --- /dev/null +++ b/src/netbeans-project/web/viewtask.jsp @@ -0,0 +1,196 @@ +<%-- + Document : viewtask + Created on : Apr 12, 2013, 4:57:12 PM + Author : Arief +--%> + +<%@page import="javax.print.attribute.standard.MediaSize.Other"%> +<%@page import="database.Checker"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + S.Y.N. View Task + + + +   +
+   +
+   +
+   +
+

Task Detail

+ + + + + +
+ <% + String nama = request.getParameter("namaTask"); + String pQuery = "select * from task where namaTask=\"" + nama + "\""; + MyDatabase viewTaskDB = new MyDatabase(); + ResultSet resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + out.println("

Nama Task : " + resultSet.getString("namaTask") + "


"); + out.println("Deadline : " + resultSet.getDate("deadline") + "
"); + out.println("Status Task : " + resultSet.getString("status") + "
"); + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), resultSet.getString("namaTask"))) { + out.println(""); + out.println("
"); + } + out.println("tag : "); + MyDatabase viewTaskDB2 = new MyDatabase(); + String pQuery2 = "select distinct * from tagging where namaTask=\"" + nama + "\""; + ResultSet resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + out.println(resultSet2.getString("tag") + ", "); + } + out.println("
"); + pQuery2 = "select distinct * from tasktoasignee where namaTask=\"" + nama + "\""; + resultSet2 = viewTaskDB2.selectDB(pQuery2); + out.println("assignee : "); + while (resultSet2.next()) { + out.println("" + resultSet2.getString("asigneeName") + ", "); + } + out.println("

Attachment :

"); + pQuery2 = "select * from attach where namaTask=\"" + nama + "\""; + resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + String filename = resultSet2.getString("attachment"); + int dotplace = filename.lastIndexOf("."); + String extension = filename.substring(dotplace + 1, filename.length()); + if (extension.equals("png") || extension.equals("jpg") || extension.equals("jpeg") || extension.equals("bmp") || extension.equals("gif")) { + out.println("attachment type : picture
"); + out.println("
"); + } else if (extension.equals("mpg") || extension.equals("avi") || extension.equals("flv") || extension.equals("mp4") || extension.equals("mpeg") || extension.equals("ogg")) { + out.println("attachment type : video
"); + out.println(""); + } else { + out.println("attachment type : other file
"); + out.println(filename + "
"); + out.println("Download "); + } + out.println("
===============================

"); + } + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), nama)) { + out.println(""); + out.println("
"); + } + } + %> +
+ <% + int hasil = 0; + pQuery = "select count(*) as hasil FROM `komentar` where namaTask=\"" + nama + "\""; + resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + hasil = resultSet.getInt("hasil"); + out.println("

Jumlah Komentar = " + hasil + "

Tambah Komentar :

"); + } + out.println("

Komentar :
====================

"); + int pagenum; + if (request.getParameter("page") != null) { + pagenum = Integer.parseInt(request.getParameter("page")); + } else { + pagenum = 0; + } + if (pagenum > hasil / 10) { + pagenum = hasil / 10; + } + if (pagenum < (hasil / 10)) { + %> +
+ + + +
+ <% + } + if (pagenum > 0) { + %> +
+ + + +
+ <% + } + out.println("

"); + int currentcomment = 0; + pQuery = "select * from komentar where namaTask=\"" + nama + "\" ORDER BY komentar.timestamp ASC"; + resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + if (currentcomment >= (pagenum * 10) && currentcomment < ((pagenum + 1) * 10)) { + out.println(resultSet.getString("komentator") + "
"); + out.println("
"); + String pQuery2 = "select count(*) as hasil FROM `komentar` where komentator=\"" + resultSet.getString("komentator") + "\" AND namaTask=\"" + nama + "\""; + MyDatabase viewTaskDB2 = new MyDatabase(); + ResultSet resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + out.println(resultSet2.getInt("hasil") + " Komentar
"); + } + out.println("on : " + resultSet.getTimestamp("timestamp") + "
"); + out.println("Komentar :
"); + out.println(resultSet.getString("isikomentar") + "
"); + if (resultSet.getString("komentator").equals(session.getAttribute("sUsername"))) { + %> +
+ "> + + + +
+ <% + }; + out.println("

"); + } + currentcomment++; + } + out.println("

Jumlah Komentar = " + hasil + "

Tambah Komentar :

"); + if (pagenum < (hasil / 10)) { + %> +
+ + + +
+ <% + } + if (pagenum > 0) { + %> +
+ + + +
+ <% + } + %> +
+ + +
+ + +
+
+ + diff --git a/src/newcategory.jsp b/src/newcategory.jsp new file mode 100644 index 00000000..6c17bbf4 --- /dev/null +++ b/src/newcategory.jsp @@ -0,0 +1,21 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String tQuery = "INSERT INTO `sharedtodolist`.`kategori` (`namaKategori`,`creatorKategoriName`) VALUES('" + request.getParameter("newcateg") + "','" + session.getAttribute("sUsername") + "');"; + int result = MyDatabase.getSingleton().queryDB(tQuery); + if (result != -1) { + tQuery = "INSERT INTO `sharedtodolist`.`usertocategory` (`namaKategori`,`username`) VALUES('" + request.getParameter("newcateg") + "','" + session.getAttribute("sUsername") + "');"; + MyDatabase.getSingleton().queryDB(tQuery); + String namelist = request.getParameter("userlist"); + String[] name = namelist.split(","); + for (int i = 0; i < name.length; i++) { + if (!name[i].equals(session.getAttribute("sUsername").toString())) { + tQuery = "INSERT INTO `sharedtodolist`.`usertocategory` (`namaKategori`,`username`) VALUES('" + request.getParameter("newcateg") + "','" + name[i] + "');"; + MyDatabase.getSingleton().queryDB(tQuery); + } + } + response.sendRedirect("dashboard.jsp?category=" + request.getParameter("newcateg")); + } + else + response.sendRedirect("dashboard.jsp"); +%> diff --git a/src/profil.css b/src/profil.css new file mode 100644 index 00000000..6b44b583 --- /dev/null +++ b/src/profil.css @@ -0,0 +1,55 @@ +.label-biodata{ + font-family:"Times New Roman", Times, serif; + color:white; + font-size:15px; + +} + +#profile-header{ + width:980px; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin: 10px 0px; +} + +#profile-tugas{ + width:600px; + height:550px; + float:right; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + padding: 0px 25px; +} + +#profile-biodata{ + width:250px; + height:500px; + float:left; + border : 1px solid #ccc; + border-radius : 5px; + -mox-border-radius : 5px; + -webkit-border-radius : 5px; + -o-border-radius : 5px; + border-style: dashed; + margin-right:10px; + padding : 25px; + +} + +h1{color:white;} + +#profile-title{ + text-align: center; +} + +#profile-img{ + +} diff --git a/src/profil.jsp b/src/profil.jsp new file mode 100644 index 00000000..da95c777 --- /dev/null +++ b/src/profil.jsp @@ -0,0 +1,84 @@ +<%-- + Document : profil + Created on : Apr 12, 2013, 7:54:12 AM + Author : Arief +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="database.*"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + S.Y.N. Profile + + + +   +
+   +
+   +
+   +
+ <% + String username; + MyDatabase myDBProfile = new MyDatabase(); + if(request.getParameter("username")==null) + username = session.getAttribute("sUsername").toString(); + else + username = request.getParameter("username"); + ResultSet resultSet = myDBProfile.selectDB("select * from user where username=\""+username+"\""); + while(resultSet.next()){ + %> +

User Profile

+ + + + + +
+ "> + + Username : <%= resultSet.getString("username") %>
+ Nama Lengkap : <%= resultSet.getString("fullname") %>
+ Tanggal Lahir : <%= resultSet.getString("tanggalLahir") %>
+ E-mail : <%= resultSet.getString("email") %>
+ Done Task List :
+ <% + MyDatabase myDBProfile2 = new MyDatabase(); + String pQuery = "select * from tasktoasignee JOIN task on tasktoasignee.namaTask=task.namaTask where asigneeName=\""+resultSet.getString("username")+"\" and status=\"done\""; + ResultSet resultSet2 = myDBProfile2.selectDB(pQuery); + while(resultSet2.next()){ + out.println(""+resultSet2.getString("namaTask")+"
"); + } + %> + UnDone Task List :
+ <% + pQuery = "select * from tasktoasignee JOIN task on tasktoasignee.namaTask=task.namaTask where asigneeName=\""+resultSet.getString("username")+"\" and status=\"undone\""; + resultSet2 = myDBProfile2.selectDB(pQuery); + while(resultSet2.next()){ + out.println(""+resultSet2.getString("namaTask")+"
"); + } + %> +
+ <% } + %> +
+ <% + if(request.getParameter("username")==null){ + %> +
+ "> + +
+ <% + } + %> +
+ + diff --git a/src/progin_471_13510087.sql b/src/progin_471_13510087.sql new file mode 100644 index 00000000..9ed53412 --- /dev/null +++ b/src/progin_471_13510087.sql @@ -0,0 +1,301 @@ +-- phpMyAdmin SQL Dump +-- version 3.5.2.2 +-- http://www.phpmyadmin.net +-- +-- Host: 127.0.0.1 +-- Generation Time: Apr 13, 2013 at 06:54 AM +-- Server version: 5.5.27 +-- PHP Version: 5.4.7 + +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: `progin_471_13510087` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `attach` +-- + +CREATE TABLE IF NOT EXISTS `attach` ( + `namaTask` varchar(50) NOT NULL, + `attachment` varchar(100) NOT NULL, + KEY `namaTask` (`namaTask`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `attach` +-- + +INSERT INTO `attach` (`namaTask`, `attachment`) VALUES +('task 1', 'attachment/avatar.jpg'), +('task 1', 'movie.mp4'), +('task 1', 'attachment/sql.pdf'), +('coba task 1', 'avatar.jpg'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `kategori` +-- + +CREATE TABLE IF NOT EXISTS `kategori` ( + `namaKategori` varchar(50) NOT NULL, + `creatorKategoriName` varchar(30) NOT NULL, + PRIMARY KEY (`namaKategori`), + KEY `creatorKategoriName` (`creatorKategoriName`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `kategori` +-- + +INSERT INTO `kategori` (`namaKategori`, `creatorKategoriName`) VALUES +('categ1', 'arief'), +('categcoba', 'arief'), +('newcategory', 'arief'), +('categ2', 'arief2'), +('categ3', 'arief3'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `komentar` +-- + +CREATE TABLE IF NOT EXISTS `komentar` ( + `idKomentar` int(11) NOT NULL AUTO_INCREMENT, + `komentator` varchar(30) NOT NULL, + `isikomentar` text NOT NULL, + `namaTask` varchar(50) NOT NULL, + `timestamp` datetime NOT NULL, + PRIMARY KEY (`idKomentar`), + KEY `komentator` (`komentator`), + KEY `namaTask` (`namaTask`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ; + +-- +-- Dumping data for table `komentar` +-- + +INSERT INTO `komentar` (`idKomentar`, `komentator`, `isikomentar`, `namaTask`, `timestamp`) VALUES +(1, 'arief', 'alohaa~', 'task 1', '2013-04-09 00:00:00'), +(2, 'arief2', 'halo juga', 'task 1', '2013-03-03 00:00:00'), +(3, 'coba', 'nyobain nih', 'task 1', '2013-03-12 00:00:00'), +(4, 'arief', 'coba komentar', 'task 1', '2013-03-05 10:32:38'), +(5, 'arief', 'coba juga', 'task 1', '2013-03-22 08:28:39'), +(6, 'ariefs2', 'afufufuuff', 'task 1', '2013-03-12 12:34:43'), +(7, 'arief', 'asdfasdf', 'task 1', '2013-03-13 19:39:11'), +(8, 'arief', 'komentar baruu~', 'task 1', '2013-04-12 19:40:15'), +(9, 'arief', 'ehehehe', 'task 1', '2013-04-12 19:40:54'), +(10, 'arief', 'tambah', 'task 1', '2013-04-12 19:40:59'), +(11, 'arief', 'tambah lagi', 'task 1', '2013-04-12 19:41:05'), +(12, 'arief', 'lagi dan lagi', 'task 1', '2013-04-12 19:41:10'), +(13, 'arief', 'testing 1', 'task 1', '2013-04-12 19:55:57'), +(14, 'arief', 'testing 2', 'task 1', '2013-04-12 19:56:01'), +(15, 'arief', 'testing 3', 'task 1', '2013-04-12 19:56:06'), +(16, 'arief', 'testing 4', 'task 1', '2013-04-12 19:56:10'), +(17, 'arief', 'testing 5', 'task 1', '2013-04-12 19:56:14'), +(18, 'arief', 'testing 6', 'task 1', '2013-04-12 19:56:18'), +(19, 'arief', 'testing 7', 'task 1', '2013-04-12 19:56:22'), +(20, 'arief', 'testing 8', 'task 1', '2013-04-12 19:56:27'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tagging` +-- + +CREATE TABLE IF NOT EXISTS `tagging` ( + `namaTask` varchar(50) NOT NULL, + `tag` varchar(50) NOT NULL, + KEY `namaTask` (`namaTask`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `tagging` +-- + +INSERT INTO `tagging` (`namaTask`, `tag`) VALUES +('task 2', 'progin'), +('task 2', 'tubes'), +('task 2', 'gampang'), +('coba task 1', 'progin'), +('coba task 1', 'susah'), +('coba task 1', 'banget'), +('coba task 1', 'asem'), +('task 1', 'progin'), +('task 1', 'tubes'), +('task 1', 'susah'), +('task 1', 'banget'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `task` +-- + +CREATE TABLE IF NOT EXISTS `task` ( + `namaTask` varchar(50) NOT NULL, + `deadline` date NOT NULL, + `status` varchar(20) NOT NULL, + `creatorTaskName` varchar(30) NOT NULL, + `namaKategori` varchar(50) NOT NULL, + PRIMARY KEY (`namaTask`), + KEY `namaKategori` (`namaKategori`), + KEY `creatorTaskName` (`creatorTaskName`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `task` +-- + +INSERT INTO `task` (`namaTask`, `deadline`, `status`, `creatorTaskName`, `namaKategori`) VALUES +('coba task 1', '2013-04-13', 'undone', 'arief', 'categ1'), +('task 1', '2013-03-05', 'undone', 'arief', 'categ1'), +('task 2', '2013-03-08', 'undone', 'arief2', 'categ2'), +('task 3', '2013-03-06', 'undone', 'arief3', 'categ2'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tasktoasignee` +-- + +CREATE TABLE IF NOT EXISTS `tasktoasignee` ( + `namaTask` varchar(50) NOT NULL, + `asigneeName` varchar(30) NOT NULL, + KEY `namaTask` (`namaTask`), + KEY `asigneeName` (`asigneeName`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `tasktoasignee` +-- + +INSERT INTO `tasktoasignee` (`namaTask`, `asigneeName`) VALUES +('task 2', 'arief2'), +('task 2', 'arief'), +('coba task 1', 'arief'), +('coba task 1', 'arief2'), +('coba task 1', 'arief3'), +('coba task 1', 'coba'), +('task 1', 'arief'), +('task 1', 'arief2'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `username` varchar(30) NOT NULL, + `email` varchar(40) NOT NULL, + `fullname` varchar(50) NOT NULL, + `avatar` varchar(30) NOT NULL, + `tanggalLahir` date NOT NULL, + `password` varchar(20) NOT NULL, + PRIMARY KEY (`username`), + UNIQUE KEY `email` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `user` +-- + +INSERT INTO `user` (`username`, `email`, `fullname`, `avatar`, `tanggalLahir`, `password`) VALUES +('arief', 'arief@arief.arief59', 'arief suharsono', 'avatar2.jpg', '2013-04-30', 'arief12345'), +('arief2', 'arief@arief.arief2', 'arief', 'images/avatar.jpg', '2013-03-07', 'arief'), +('arief3', 'arief@arief.arief3', 'arief', 'images/avatar.jpg', '2013-03-07', 'arief'), +('ariefs', 'arief@arief.arief', 'arief suharsono', 'kartunngampus.jpg', '2013-04-24', 'ariefsuharsono'), +('ariefs2', 'arief@arief.arief12345', 'arief suharsono', 'kartunngampus.jpg', '2013-04-24', 'arief12345'), +('coba', 'coba@coba.coba', 'coba coba', 'back.png', '2013-04-04', 'coba saja'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `usertocategory` +-- + +CREATE TABLE IF NOT EXISTS `usertocategory` ( + `username` varchar(20) NOT NULL, + `namaKategori` varchar(20) NOT NULL, + KEY `username` (`username`), + KEY `namaKategori` (`namaKategori`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `usertocategory` +-- + +INSERT INTO `usertocategory` (`username`, `namaKategori`) VALUES +('arief', 'categ1'), +('arief2', 'categ2'), +('arief3', 'categ3'), +('arief', 'newcategory'), +('arief', 'categcoba'), +('arief', 'categ2'); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `attach` +-- +ALTER TABLE `attach` + ADD CONSTRAINT `attach_ibfk_1` FOREIGN KEY (`namaTask`) REFERENCES `task` (`namaTask`); + +-- +-- Constraints for table `kategori` +-- +ALTER TABLE `kategori` + ADD CONSTRAINT `kategori_ibfk_1` FOREIGN KEY (`creatorKategoriName`) REFERENCES `user` (`username`); + +-- +-- Constraints for table `komentar` +-- +ALTER TABLE `komentar` + ADD CONSTRAINT `komentar_ibfk_1` FOREIGN KEY (`komentator`) REFERENCES `user` (`username`), + ADD CONSTRAINT `komentar_ibfk_2` FOREIGN KEY (`namaTask`) REFERENCES `task` (`namaTask`); + +-- +-- Constraints for table `tagging` +-- +ALTER TABLE `tagging` + ADD CONSTRAINT `tagging_ibfk_1` FOREIGN KEY (`namaTask`) REFERENCES `task` (`namaTask`); + +-- +-- Constraints for table `task` +-- +ALTER TABLE `task` + ADD CONSTRAINT `task_ibfk_1` FOREIGN KEY (`namaKategori`) REFERENCES `kategori` (`namaKategori`), + ADD CONSTRAINT `task_ibfk_2` FOREIGN KEY (`creatorTaskName`) REFERENCES `user` (`username`); + +-- +-- Constraints for table `tasktoasignee` +-- +ALTER TABLE `tasktoasignee` + ADD CONSTRAINT `tasktoasignee_ibfk_1` FOREIGN KEY (`namaTask`) REFERENCES `task` (`namaTask`), + ADD CONSTRAINT `tasktoasignee_ibfk_2` FOREIGN KEY (`asigneeName`) REFERENCES `user` (`username`); + +-- +-- Constraints for table `usertocategory` +-- +ALTER TABLE `usertocategory` + ADD CONSTRAINT `usertocategory_ibfk_2` FOREIGN KEY (`namaKategori`) REFERENCES `kategori` (`namaKategori`), + ADD CONSTRAINT `usertocategory_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`); + +/*!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/registerprocess.jsp b/src/registerprocess.jsp new file mode 100644 index 00000000..d0f3008a --- /dev/null +++ b/src/registerprocess.jsp @@ -0,0 +1,31 @@ +<%-- + Document : registerprocess + Created on : Apr 12, 2013, 5:42:03 AM + Author : Arief +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + String username = request.getParameter("daftar_username"); + String password = request.getParameter("daftar_password"); + String namalengkap = request.getParameter("daftar_namalengkap"); + String tanggallahir = request.getParameter("daftar_tanggallahir"); + String mail = request.getParameter("daftar_e-mail"); + String avatar = request.getParameter("daftar_avatar").toString(); + String pQuery = "INSERT INTO `sharedtodolist`.`user` (`username` ,`email` ,`fullname` ,`avatar` ,`tanggalLahir` ,`password`) VALUES('" + username + "','" + mail + "','" + namalengkap + "','" + avatar + "','" + tanggallahir + "','" + password + "')"; + out.println(pQuery); + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if (ti != -1) { + session.setAttribute("isActive", false); + request.getSession(true); + session.setMaxInactiveInterval(2592000); + session.setAttribute("isActive", true); + session.setAttribute("sUsername", username); + session.setAttribute("sNama", namalengkap); + session.setAttribute("sAvatar", avatar); + response.sendRedirect("dashboard.jsp"); + } else { + response.sendRedirect("index.jsp?error=registration failed"); + } +%> diff --git a/src/registrasi.js b/src/registrasi.js new file mode 100644 index 00000000..3a88f2c6 --- /dev/null +++ b/src/registrasi.js @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +function checkUsername() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + if(uname=="" || uname==null) + {document.getElementById('usernameWarning').innerHTML="*Username tidak boleh kosong";return false;} + else + if(uname.length<5) + {document.getElementById('usernameWarning').innerHTML="*Username minimal 5 huruf";return false;} + else + {document.getElementById('usernameWarning').innerHTML="";return true;} +} + +function checkPassword() { + var uname=document.forms["RegistrationForm"]["daftar_username"].value; + var pass=document.forms["RegistrationForm"]["daftar_password"].value; + var email=document.forms["RegistrationForm"]["daftar_email"].value; + if(pass=="" || pass==null) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh kosong";return false;} + else + if(pass.length<8) + {document.getElementById('passwordWarning').innerHTML="*Password minimal 8 karakter";return false;} + else + if(pass==uname) + {document.getElementById('passwordWarning').innerHTML="*Password tidak boleh sama dengan username";return false;} + else + if(pass==email) + {document.getElementById('passwordWarning').innerHTML="*Password tidak sama dengan e-mail";return false;} + else + {document.getElementById('passwordWarning').innerHTML="";return true;} +} + +function checkConfirmPassword() { + var pass1=document.forms["RegistrationForm"]["daftar_password"].value; + var pass2=document.forms["RegistrationForm"]["daftar_confirmpassword"].value; + if(pass1!=pass2) + {document.getElementById('confirmPasswordWarning').innerHTML="*Password tidak cocok";return false;} + else + {document.getElementById('confirmPasswordWarning').innerHTML="";return true;} +} + +function checkNama() { + var nama=document.forms["RegistrationForm"]["daftar_namalengkap"].value; + var spacepos=nama.indexOf(" "); + if(nama=="" || nama==null) + {document.getElementById('namaWarning').innerHTML="*Nama tidak boleh kosong";return false;} + else + if(spacepos<0) + {document.getElementById('namaWarning').innerHTML="*Nama minimal 2 kata";return false;} + else + {document.getElementById('namaWarning').innerHTML="";return true;} +} + +function checkEmail() { + var email=document.forms["RegistrationForm"]["daftar_email"].value; + var atpos=email.indexOf("@"); + var dotpos=email.lastIndexOf("."); + if(email=="" || email==null) + {document.getElementById('emailWarning').innerHTML="*E-mail tidak boleh kosong";return false;} + else + if(atpos<1 || dotpos=email.length) + {document.getElementById('emailWarning').innerHTML=("*e-mail tidak valid");return false;} + else + {document.getElementById('emailWarning').innerHTML="";return true;} +} + + +function check_extension() { + var filename=document.forms["RegistrationForm"]["daftar_avatar"].value; + var re = /\..+$/; + var ext = filename.match(re); + if(!(ext==".jpg" || ext==".jpeg")) + {document.getElementById('avatarWarning').innerHTML="ekstensi file tidak diterima";return false;} + else + {document.getElementById('avatarWarning').innerHTML="";return true;} +} + + +function checkValidation() { + return (checkUsername() && checkPassword() && checkConfirmPassword() && checkNama() && checkEmail() && check_extension()); +} + +function checkLogin() { + var username=document.forms["LoginForm"]["username"].value; + var password=document.forms["LoginForm"]["password"].value; + if(username!="admin") + { + alert("User Not Found"); + return false; + } + else if(password!="adminadmin") + { + alert("Password incorrect") + return false; + } + else + return true; +} \ No newline at end of file diff --git a/src/searchresult.jsp b/src/searchresult.jsp new file mode 100644 index 00000000..bfbb5f4a --- /dev/null +++ b/src/searchresult.jsp @@ -0,0 +1,104 @@ +<%-- + Document : searchresult + Created on : Apr 12, 2013, 9:44:18 AM + Author : Arief +--%> + +<%@page import="database.Checker"%> +<%@page import="database.MyDatabase"%> +<%@page import="java.sql.ResultSet"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + S.Y.N. Search Result + + + +   +
+   +
+   +
+   +
+ <% + String query = request.getParameter("query"); + int filter = Integer.parseInt(request.getParameter("filter")); + int pagenum; + if (request.getParameter("page") != null) { + pagenum = Integer.parseInt(request.getParameter("page")); + } else { + pagenum = 0; + } + + %> +

Search Result

+ + <% + if (filter == 1 || filter == 0) { + String pQuery = "select * from user where username LIKE '%" + query + "%' OR email LIKE '%" + query + "%' OR tanggalLahir LIKE '%" + query + "%' or fullname LIKE '%" + query + "%'"; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + out.println("

User search result

"); + while (resultSet.next()) { + out.println("Username : "); + out.println(""); + out.println(resultSet.getString("username").toString() + "
"); + out.println("Nama Lengkap : " + resultSet.getString("fullname") + "
"); + out.println("Tanggal Lahir : " + resultSet.getDate("tanggalLahir") + "
"); + out.println("e-mail : " + resultSet.getString("email") + "
"); + out.println(""); + out.println("

"); + } + out.println("==========================================
"); + } + if (filter == 2 || filter == 0) { + String pQuery = "select * from kategori where namaKategori LIKE '%" + query + "%'"; + ResultSet resultSet = MyDatabase.getSingleton().selectDB(pQuery); + out.println("

Category search result

"); + while (resultSet.next()) { + out.println("Kategori : "); + out.println(""); + out.println(resultSet.getString("namaKategori").toString() + "
"); + out.println("Pembuat Kategori : " + resultSet.getString("creatorKategoriName") + "

"); + } + out.println("==========================================
"); + } + if (filter == 3 || filter == 0) { + String pQuery = "SELECT DISTINCT task.namaTask AS namaTask, status, deadline FROM task LEFT OUTER JOIN komentar ON task.namaTask = komentar.namaTask WHERE task.namaTask LIKE '%"+query+"%' OR komentar.isikomentar LIKE '%"+query+"%'"; + MyDatabase searchDB = new MyDatabase(); + ResultSet resultSet = searchDB.selectDB(pQuery); + out.println("

Task Search Result

"); + while (resultSet.next()){ + out.println("Nama Task : "); + out.println(""); + out.println(resultSet.getString("namaTask").toString() + "
"); + out.println("Tanggal Deadline : " + resultSet.getDate("deadline") + "
"); + out.println("Status : " + resultSet.getString("status") + "
"); + out.println("Tag : "); + String pQuery2 = "SELECT DISTINCT * from tagging where namaTask=\"" + resultSet.getString("namaTask") + "\""; + MyDatabase searchDB2 = new MyDatabase(); + ResultSet resultSet2 = searchDB2.selectDB(pQuery2); + while(resultSet2.next()){ + out.println(resultSet2.getString("tag")); + } + out.println("
"); + if(Checker.isAssignee(session.getAttribute("sUsername").toString(), resultSet.getString("namaTask"))){ + out.println(""); + out.println("

"); + } + } + out.println("==========================================
"); + } + %> + + +
+ + diff --git a/src/submitkomentar.jsp b/src/submitkomentar.jsp new file mode 100644 index 00000000..0018c8c4 --- /dev/null +++ b/src/submitkomentar.jsp @@ -0,0 +1,20 @@ +<%-- + Document : submitkomentar + Created on : Apr 12, 2013, 7:26:27 PM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet,java.sql.Timestamp,java.util.Date;" errorPage="" %> +<% + String nama = request.getParameter("namaTask").toString(); + String username = session.getAttribute("sUsername").toString(); + int target = Integer.parseInt(request.getParameter("target").toString()); + String isikomentar = request.getParameter("isiKomentar").toString(); + java.util.Date date = new java.util.Date(); + String pQuery = "INSERT INTO `sharedtodolist`.`komentar` (`idKomentar` ,`komentator` ,`isikomentar` ,`namaTask` ,`timestamp`) VALUES (NULL,'"+username+"','"+isikomentar+"','"+nama+"','"+new Timestamp(date.getTime())+"')"; + //out.println(pQuery); + int ti = MyDatabase.getSingleton().queryDB(pQuery); + if(ti!=-1){ + response.sendRedirect("viewtask.jsp?namaTask="+nama+"&page="+target); + } +%> \ No newline at end of file diff --git a/src/ubahstatus.jsp b/src/ubahstatus.jsp new file mode 100644 index 00000000..0be40e8a --- /dev/null +++ b/src/ubahstatus.jsp @@ -0,0 +1,33 @@ +<%-- + Document : ubahstatus + Created on : Apr 12, 2013, 1:39:37 AM + Author : Arief +--%> + +<%@ page language="java" import="database.MyDatabase,java.sql.ResultSet;" errorPage="" %> +<% + MyDatabase ubahstatusDB = new MyDatabase(); + MyDatabase ubahstatusDB2 = new MyDatabase(); + String curstatus = ""; + String tQuery = "select * from task where namaTask = \"" + request.getParameter("namaTask") + "\""; + ResultSet tResult = ubahstatusDB.selectDB(tQuery); + while (tResult.next()) { + curstatus = tResult.getString("status"); + } + if (curstatus.equals("done")) { + tQuery = "UPDATE `sharedtodolist`.`task` SET `status` = 'undone' WHERE `task`.`namaTask` = \"" + request.getParameter("namaTask") + "\""; + } else { + tQuery = "UPDATE `sharedtodolist`.`task` SET `status` = 'done' WHERE `task`.`namaTask` = \"" + request.getParameter("namaTask") + "\""; + } + out.println(tQuery); + ubahstatusDB2.queryDB(tQuery); + if (request.getParameter("target").toString().equals("dashboard")) { + response.sendRedirect("dashboard.jsp"); + } + else if(request.getParameter("target").toString().equals("search")) { + response.sendRedirect("searchresult.jsp?query="+request.getParameter("query")+"&filter="+request.getParameter("filter")+"&page="+request.getParameter("page")); + } + else if(request.getParameter("target").toString().equals("viewtask")) { + response.sendRedirect("viewtask.jsp?namaTask="+request.getParameter("namaTask")); + } +%> diff --git a/src/viewtask.jsp b/src/viewtask.jsp new file mode 100644 index 00000000..c4195914 --- /dev/null +++ b/src/viewtask.jsp @@ -0,0 +1,196 @@ +<%-- + Document : viewtask + Created on : Apr 12, 2013, 4:57:12 PM + Author : Arief +--%> + +<%@page import="javax.print.attribute.standard.MediaSize.Other"%> +<%@page import="database.Checker"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="database.MyDatabase"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + + S.Y.N. View Task + + + +   +
+   +
+   +
+   +
+

Task Detail

+ + + + + +
+ <% + String nama = request.getParameter("namaTask"); + String pQuery = "select * from task where namaTask=\"" + nama + "\""; + MyDatabase viewTaskDB = new MyDatabase(); + ResultSet resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + out.println("

Nama Task : " + resultSet.getString("namaTask") + "


"); + out.println("Deadline : " + resultSet.getDate("deadline") + "
"); + out.println("Status Task : " + resultSet.getString("status") + "
"); + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), resultSet.getString("namaTask"))) { + out.println(""); + out.println("
"); + } + out.println("tag : "); + MyDatabase viewTaskDB2 = new MyDatabase(); + String pQuery2 = "select distinct * from tagging where namaTask=\"" + nama + "\""; + ResultSet resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + out.println(resultSet2.getString("tag") + ", "); + } + out.println("
"); + pQuery2 = "select distinct * from tasktoasignee where namaTask=\"" + nama + "\""; + resultSet2 = viewTaskDB2.selectDB(pQuery2); + out.println("assignee : "); + while (resultSet2.next()) { + out.println("" + resultSet2.getString("asigneeName") + ", "); + } + out.println("

Attachment :

"); + pQuery2 = "select * from attach where namaTask=\"" + nama + "\""; + resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + String filename = resultSet2.getString("attachment"); + int dotplace = filename.lastIndexOf("."); + String extension = filename.substring(dotplace + 1, filename.length()); + if (extension.equals("png") || extension.equals("jpg") || extension.equals("jpeg") || extension.equals("bmp") || extension.equals("gif")) { + out.println("attachment type : picture
"); + out.println("
"); + } else if (extension.equals("mpg") || extension.equals("avi") || extension.equals("flv") || extension.equals("mp4") || extension.equals("mpeg") || extension.equals("ogg")) { + out.println("attachment type : video
"); + out.println(""); + } else { + out.println("attachment type : other file
"); + out.println(filename + "
"); + out.println("Download "); + } + out.println("
===============================

"); + } + if (Checker.isAssignee(session.getAttribute("sUsername").toString(), nama)) { + out.println(""); + out.println("
"); + } + } + %> +
+ <% + int hasil = 0; + pQuery = "select count(*) as hasil FROM `komentar` where namaTask=\"" + nama + "\""; + resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + hasil = resultSet.getInt("hasil"); + out.println("

Jumlah Komentar = " + hasil + "

Tambah Komentar :

"); + } + out.println("

Komentar :
====================

"); + int pagenum; + if (request.getParameter("page") != null) { + pagenum = Integer.parseInt(request.getParameter("page")); + } else { + pagenum = 0; + } + if (pagenum > hasil / 10) { + pagenum = hasil / 10; + } + if (pagenum < (hasil / 10)) { + %> +
+ + + +
+ <% + } + if (pagenum > 0) { + %> +
+ + + +
+ <% + } + out.println("

"); + int currentcomment = 0; + pQuery = "select * from komentar where namaTask=\"" + nama + "\" ORDER BY komentar.timestamp ASC"; + resultSet = viewTaskDB.selectDB(pQuery); + while (resultSet.next()) { + if (currentcomment >= (pagenum * 10) && currentcomment < ((pagenum + 1) * 10)) { + out.println(resultSet.getString("komentator") + "
"); + out.println("
"); + String pQuery2 = "select count(*) as hasil FROM `komentar` where komentator=\"" + resultSet.getString("komentator") + "\" AND namaTask=\"" + nama + "\""; + MyDatabase viewTaskDB2 = new MyDatabase(); + ResultSet resultSet2 = viewTaskDB2.selectDB(pQuery2); + while (resultSet2.next()) { + out.println(resultSet2.getInt("hasil") + " Komentar
"); + } + out.println("on : " + resultSet.getTimestamp("timestamp") + "
"); + out.println("Komentar :
"); + out.println(resultSet.getString("isikomentar") + "
"); + if (resultSet.getString("komentator").equals(session.getAttribute("sUsername"))) { + %> +
+ "> + + + +
+ <% + }; + out.println("

"); + } + currentcomment++; + } + out.println("

Jumlah Komentar = " + hasil + "

Tambah Komentar :

"); + if (pagenum < (hasil / 10)) { + %> +
+ + + +
+ <% + } + if (pagenum > 0) { + %> +
+ + + +
+ <% + } + %> +
+ + +
+ + +
+
+ +