From c011f8d19972b76bbe80b235f4f295e4eb82e631 Mon Sep 17 00:00:00 2001
From: Husnulzaki Wibisono Haryadi <zackhardyz@gmail.com>
Date: Wed, 9 May 2018 13:09:26 +0700
Subject: [PATCH] changes from vm

---
 admin/index.html     |  6 ------
 admin/js/main.js     | 14 +-------------
 getAllBerita.php     |  2 +-
 getAllPengumuman.php |  2 +-
 getKmtBerita.php     |  2 +-
 getKmtPengumuman.php |  2 +-
 getinfo.php          |  3 +++
 7 files changed, 8 insertions(+), 23 deletions(-)
 create mode 100644 getinfo.php

diff --git a/admin/index.html b/admin/index.html
index 0dbc888..0e70dec 100755
--- a/admin/index.html
+++ b/admin/index.html
@@ -39,12 +39,6 @@
                   Materi
                 </a>
               </li>
-              <li class="nav-item">
-                <a class="nav-link" href="#" id="notif-click">
-                  <span data-feather="send"></span>
-                  Notifikasi
-                </a>
-              </li>
               <li class="nav-item">
                 <a class="nav-link" href="#" id="pengumuman-click">
                   <span data-feather="clipboard"></span>
diff --git a/admin/js/main.js b/admin/js/main.js
index 6733d52..e59ff8d 100755
--- a/admin/js/main.js
+++ b/admin/js/main.js
@@ -12,19 +12,7 @@ $(document).ready(function(){
         document.cookie = "state=home";
     });
 
-    $("a#notif-click").on("click",function(e){
-        e.preventDefault();
-        $.get("notifikasi.html",function(data){
-            $("main").html(function(){
-                $("a").removeClass("active");
-                $("a#notif-click").addClass("active");
-                return data;
-            });
-        });
-        document.cookie = "state=notif";
-    });
-
-    $("a#pengumuman-click").on("click",function(e){
+   $("a#pengumuman-click").on("click",function(e){
         e.preventDefault();
         $.get("pengumuman.html",function(data){
             $("main").html(function(){
diff --git a/getAllBerita.php b/getAllBerita.php
index 7889047..884506d 100755
--- a/getAllBerita.php
+++ b/getAllBerita.php
@@ -12,7 +12,7 @@
 
 require 'dbConnect.php';
 header('Content-Type: application/json');
-$stmt = $conn->query("SELECT `id`, `judul`, `tgl`, `foto` FROM `berita`");
+$stmt = $conn->query("SELECT `id`, `judul`, `tgl`, `foto` FROM `berita` ORDER BY `tgl` DESC");
 $count = $stmt->num_rows;
 $res = array();
 
diff --git a/getAllPengumuman.php b/getAllPengumuman.php
index 6407ea4..1f2cbb0 100755
--- a/getAllPengumuman.php
+++ b/getAllPengumuman.php
@@ -12,7 +12,7 @@
 
 require 'dbConnect.php';
 
-$stmt = $conn->query("SELECT * FROM `pengumuman`");
+$stmt = $conn->query("SELECT * FROM `pengumuman` ORDER BY `tanggal` DESC");
 $count = $stmt->num_rows;
 $res = array();
 while ($row = $stmt->fetch_assoc()) {
diff --git a/getKmtBerita.php b/getKmtBerita.php
index 684423f..a777166 100755
--- a/getKmtBerita.php
+++ b/getKmtBerita.php
@@ -18,7 +18,7 @@ $berita_id = $_GET["id"];
 $stmt = $conn->query(
     "SELECT kmt_berita.id AS id, tgl, komentar, user_id, berita_id, user.username AS username
     FROM kmt_berita LEFT OUTER JOIN user ON kmt_berita.user_id  = user.id
-    WHERE berita_id = '" . $berita_id . "'"
+    WHERE berita_id = '" . $berita_id . "' ORDER BY tgl ASC "
 );
 
 /* Row Counts */
diff --git a/getKmtPengumuman.php b/getKmtPengumuman.php
index 1659685..9be076d 100755
--- a/getKmtPengumuman.php
+++ b/getKmtPengumuman.php
@@ -18,7 +18,7 @@ $pengumuman_id = $_GET["id"];
 $stmt = $conn->query(
     "SELECT kmt_pengumuman.id AS id, tgl, komentar, user_id, pengumuman_id, user.username AS username
     FROM kmt_pengumuman LEFT OUTER JOIN user ON kmt_pengumuman.user_id  = user.id
-    WHERE pengumuman_id ='" . $pengumuman_id . "'"
+    WHERE pengumuman_id ='" . $pengumuman_id . "' ORDER BY tgl ASC "
 );
 
 /* Row Counts */
diff --git a/getinfo.php b/getinfo.php
new file mode 100644
index 0000000..e2b4c37
--- /dev/null
+++ b/getinfo.php
@@ -0,0 +1,3 @@
+<?php
+    phpinfo();
+?>
-- 
GitLab