diff --git a/addMateri.php b/addMateri.php index ce46a175b0ef6864341ed14ba8cb1b9437d1a001..2c7d6b68d0da01f37a4fe13950e6e186b90fc3c7 100755 --- a/addMateri.php +++ b/addMateri.php @@ -124,6 +124,7 @@ if ($judul == "") { if ($topik == "") { echo 'Field Topik tidak boleh kosong'; + exit(); } $stmt->bind_param("sssss", $topik, $judul, $konten_text, $videoAddr, $pdfAddr); diff --git a/addQuote.php b/addQuote.php index ad1691e142f59d4b13536bfeea9dc8b4cc75e823..73e1875915d3ce030263a7dfb9938efeb5a2de0c 100755 --- a/addQuote.php +++ b/addQuote.php @@ -39,7 +39,7 @@ if ($konten == "") { date_default_timezone_set(date_default_timezone_get()); $date = date('Y/m/d H:i:s', time()); $temp_tanggal = implode("", $res[0]); -print($temp_tanggal); +// print($temp_tanggal); $date = date_create($temp_tanggal); date_add($date, date_interval_create_from_date_string('7 days')); diff --git a/admin/css/alert.css b/admin/css/alert.css new file mode 100644 index 0000000000000000000000000000000000000000..1ebb420bf0d24903979d7cf8347669d90c1f6eca --- /dev/null +++ b/admin/css/alert.css @@ -0,0 +1,23 @@ +.auth-info-message-container { + position: fixed; + width: fit-content; + height: 36px; + padding: 0px 18px; + top: 7%; + left: 50%; + transform: translate(-50%, 0%); + display: flex; + justify-content: center; + align-items: center; + border-radius: 20px; + box-shadow: 0 0px 10px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + background-color: #54c0ff; + color: white; + opacity: 0; + -webkit-transition-duration: 0.25s; + transition-duration: 0.25s; + } + + .auth-info-message-container.visible { + opacity: 1; + } \ No newline at end of file diff --git a/admin/home.html b/admin/home.html index 5059e755c2f14e5148b9671f45ee177f83f0361b..12b1939021e289dbbc1c5bd72c742f5be6f32269 100755 --- a/admin/home.html +++ b/admin/home.html @@ -101,7 +101,7 @@ if (confirm("Yakin ingin menghapus pengumuman " + judul.innerHTML + " ?")){ var id = this.id.split('-'); $.get("../deletePengumuman.php",{"id" : id[1]}, function(data) { - alert(data); + showAlert(data); location.reload(); }); } @@ -221,7 +221,7 @@ if (confirm("Yakin ingin menghapus materi " + judul.innerHTML + " ?")){ var id = this.id.split('-'); $.get("../deleteMateri.php",{"id" : id[1]}, function(data) { - alert(data); + showAlert(data); location.reload(); }); } diff --git a/admin/index.html b/admin/index.html index 17911a6e7656f88bd4c2aab046508b5edd4cb7b1..a11cb61913e0837606c17f1eb6787a72a5d1f4b8 100755 --- a/admin/index.html +++ b/admin/index.html @@ -15,6 +15,7 @@ <!-- Custom styles for this template --> <link href="css/dashboard.css" rel="stylesheet"> + <link href="css/alert.css" rel="stylesheet"> </head> <body> @@ -70,6 +71,8 @@ </nav> <div class="col-2 col-sm-4 col-md-3 col-lg-2"></div> + <div id='alertMessage' class='auth-info-message-container'> + </div> <main role="main" class="col-10 col-sm-8 col-md-9 col-lg-10 pt-4 pr-4"> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom"> <h1 class="h2">Selamat datang, Admin</h1> @@ -103,6 +106,7 @@ }); </script> <script src="js/main.js"></script> + <script src="js/alert.js"></script> <!-- Icons --> diff --git a/admin/js/alert.js b/admin/js/alert.js new file mode 100644 index 0000000000000000000000000000000000000000..82972b8475e52bd7a984105253b683c34294380f --- /dev/null +++ b/admin/js/alert.js @@ -0,0 +1,12 @@ +function showAlert(data) { + setTimeout(() => { + const alertMessage = $('#alertMessage')[0]; + alertMessage.innerHTML = data + alertMessage.classList.add('visible'); + }, 250); + + setTimeout(() => { + const alertMessage = $('#alertMessage')[0]; + alertMessage.classList.remove('visible'); + }, 5000); + } \ No newline at end of file diff --git a/admin/kalender.html b/admin/kalender.html index 7bb5581fd0ea3c63689ff38cfe14eb8bf06a9b5d..0915fd857691ec8463cac7e8bb8e8d491ec0c162 100755 --- a/admin/kalender.html +++ b/admin/kalender.html @@ -22,7 +22,7 @@ $('#upload_form').on('submit', function(e){ e.preventDefault(); $.post("../addKalender.php", $("#upload_form").serialize() ).done(function (data) { - alert(data); + showAlert(data); $("#upload_form")[0].reset(); }); }); diff --git a/admin/kegiatan.html b/admin/kegiatan.html index bcbd976a897fca8de5d4e52e1773f6f7c60f0ede..a9a04135ff79dbbbb32ed79e549888dc84789482 100755 --- a/admin/kegiatan.html +++ b/admin/kegiatan.html @@ -61,7 +61,7 @@ e.preventDefault(); att = $("upload_form").attr("action") ; $.post("../addKegiatan.php", $("#upload_form").serialize() ).done(function (data) { - alert(data); + showAlert(data); }); }); </script> diff --git a/admin/materi.html b/admin/materi.html index db55b2c799beefe57872bbdb601ca15ff0bfd267..f7efeb31b9217e0a405a1a9159710ea206d22b1a 100755 --- a/admin/materi.html +++ b/admin/materi.html @@ -116,7 +116,7 @@ complete: function(xhr) { $('#progbar').addClass('d-none'); $('#upload_form').removeClass('d-none'); - alert(xhr.responseText); + showAlert(xhr.responseText); } }); // $("#upload_form").on("submit", function(e){ diff --git a/admin/notifikasi.html b/admin/notifikasi.html index 26ddf02c5937491d9b4db80d68a83fbca0cb7267..8128a53c0e13f0d787d17aed2cb630460c7274f6 100755 --- a/admin/notifikasi.html +++ b/admin/notifikasi.html @@ -82,7 +82,7 @@ processData:false, // To send DOMDocument or non processed data file it is set to false success: function(data) // A function to be called if request succeeds { - alert(data); + showAlert(data); } }); }); diff --git a/admin/peng-tambah.html b/admin/peng-tambah.html index e1458d580f05b5cb2a6f158ecefc38d5a8df8582..71c49bf8f12f6592e321c749d00f8c181de0eb52 100755 --- a/admin/peng-tambah.html +++ b/admin/peng-tambah.html @@ -58,7 +58,7 @@ success: function(data) // A function to be called if request succeeds { // lakukan pemanggilan api notifikasi - alert(data); + showAlert(data); } }); }); diff --git a/admin/quotes.html b/admin/quotes.html index 7d392528303199dcd342eebf350ed3da74ffd075..04d57590b251ce4bb88f94a71b4976c501843905 100755 --- a/admin/quotes.html +++ b/admin/quotes.html @@ -23,7 +23,7 @@ $('#upload_form').on('submit', function(e){ e.preventDefault(); $.post("../addQuote.php", $("#upload_form").serialize() ).done(function (data) { - alert(data); + showAlert(data); $("#upload_form")[0].reset(); }); }); diff --git a/sendNotif.php b/sendNotif.php index 7c520d9355432dce5942a4211d88bb52b108105d..be0121aecc8ec2d8cdf04db4147de3912ac31b33 100755 --- a/sendNotif.php +++ b/sendNotif.php @@ -43,7 +43,7 @@ class FirebaseNotif "id" => $id ] ]; - echo json_encode($vars, JSON_UNESCAPED_SLASHES); + // echo json_encode($vars, JSON_UNESCAPED_SLASHES); // $cat = $_POST["kategori"]; // if ($cat == "pengumuman" ) {