diff --git a/addKegiatan.php b/addKegiatan.php index d5dce781eac1c69b0351edb5825ecde32d3faebe..ef2db4450c1737262ee6bc720761feca6fe7b522 100755 --- a/addKegiatan.php +++ b/addKegiatan.php @@ -33,5 +33,6 @@ $stmt = $conn->prepare( $stmt->bind_param("sssss", $nama_kegiatan, $target_peserta, $deskripsi_acara, $tanggal_kegiatan, $lokasi_kegiatan); $stmt->execute(); $stmt->close(); +$conn->close(); echo 'Sukses, kegiatan ' . $nama_kegiatan . ' berhasil ditambahkan.'; diff --git a/addMateri.php b/addMateri.php index 53e88d45654fd8875973f08cfcf6a5c83186fe3b..1fade7c88091860c3b5b1b2e3d02fd399a8941b1 100755 --- a/addMateri.php +++ b/addMateri.php @@ -50,12 +50,11 @@ if ($_POST["isVideo"] == 1) { $target = $target_dir . uniqid() . "." .$imageFileType; if (move_uploaded_file($_FILES["videofile"]["tmp_name"], $target)) { // proses file - echo "The file ". basename($_FILES["videofile"]["name"]). - " has been uploaded.\n"; + echo "File video ". basename($_FILES["videofile"]["name"]). + " berhasil diupload.\n"; $videoAddr = "http://pplk2a.if.itb.ac.id/ppl/" . $target; - echo $videoAddr; } else { - echo "Sorry, there was an error PDF uploading your file because " .$_FILES["file"]["error"] ; + echo "Sorry, there was an error PDF uploading your file "; exit(); } } @@ -89,20 +88,22 @@ if ($_POST["isPDF"] == 1) { // do upload logic here } else { echo 'Upload directory is not writable, or does not exist.'; + exit(); } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; + exit(); // if everything is ok, try to upload file } else { $target = $target_dir . uniqid() . "." .$imageFileType; if (move_uploaded_file($_FILES["pdffile"]["tmp_name"], $target)) { // proses file - echo "The file ". basename($_FILES["pdffile"]["name"]). " has been uploaded.\n"; + echo "File PDF ". basename($_FILES["pdffile"]["name"]). " berhasil diupload.\n"; $pdfAddr = "http://pplk2a.if.itb.ac.id/ppl/" . $target; echo $pdfAddr; } else { - echo "Sorry, there was an error PDF uploading your file because " .$_FILES["file"]["error"] ; + echo "Sorry, there was an error PDF uploading your file because" ; exit(); } } diff --git a/addPengumuman.php b/addPengumuman.php index 9f73601fce27e8c48db8db431aaf9163584b3ee9..d545f54f93e239a226d3fd9ac1ecb9d5cf497fe1 100755 --- a/addPengumuman.php +++ b/addPengumuman.php @@ -62,12 +62,11 @@ if ($_POST["isUpload"] == 1) { $target = $target_dir . uniqid() . "." .$imageFileType; if (move_uploaded_file($_FILES["file"]["tmp_name"], $target)) { // proses file - echo "The file ". basename($_FILES["file"]["name"]). - " has been uploaded.\n"; + echo "File gambar ". basename($_FILES["file"]["name"]). + " berhasil diupload.\n"; $fileAddr = "http://pplk2a.if.itb.ac.id/ppl/" . $target; - echo $fileAddr; } else { - echo "Sorry, there was an error PDF uploading your file because " .$_FILES["file"]["error"] ; + echo "Sorry, there was an error PDF uploading your file "; exit(); } } @@ -98,4 +97,4 @@ $row = $stmt->fetch_assoc(); $conn->close(); \pmotraining\FirebaseNotif::sendNotif("Ada pengumuman baru", $judul, 0, $row["max"]); -echo 'Sukses, pengumuman ' . $judul . ' berhasil ditambahkan.' . $row["max"]; +echo 'Sukses, pengumuman ' . $judul . ' berhasil ditambahkan.'; diff --git a/getAllQuotes.php b/getAllQuotes.php index 69debcb11deec4603299bb2472322d7e1402fba2..7330a8d735d1362c4f7e764fb4a08433c92359ae 100755 --- a/getAllQuotes.php +++ b/getAllQuotes.php @@ -10,7 +10,6 @@ * @link http://pear.php.net/package/komunitas-pmo */ -ini_set('display_errors', 'on'); require 'dbConnect.php'; // Manage data diff --git a/getAllTopik.php b/getAllTopik.php index caf1d18d2bef5fc23aae6884daa01d67996348f3..00bc7c98ca61720ea7f3c585925526263268a28e 100755 --- a/getAllTopik.php +++ b/getAllTopik.php @@ -11,6 +11,7 @@ */ require 'dbConnect.php'; +header('Content-Type: application/json'); $stmt = $conn->query("SELECT DISTINCT `topik` FROM `materi`"); $count = $stmt->num_rows; @@ -19,5 +20,5 @@ while ($row = $stmt->fetch_assoc()) { $res[] = $row["topik"]; } echo json_encode($res); -header('Content-Type: application/json'); + $conn->close(); diff --git a/parse.php b/parse.php index 1bf60a94926f3f19ecfb472894429581ddfd5710..650e85aa6f37d1b9ce153ebf3769002a87a6841c 100755 --- a/parse.php +++ b/parse.php @@ -34,7 +34,6 @@ if (strtotime($lastBuild) < strtotime($rssLastBuild)) { $sql = "SELECT * FROM `berita` WHERE `judul` like '%" . $judul . "%'"; $stmt = $conn->query($sql); $numRows = $stmt->num_rows; - echo ($sql); $stmt->close(); if ($numRows == 0) { $stmt2 = $conn->prepare( @@ -87,7 +86,7 @@ if (strtotime($lastBuild) < strtotime($rssLastBuild)) { } // update file_put_contents("lastNewsUpdate.txt", $rssLastBuild); - sendNotif("Ada berita baru", "Klik untuk membuka"); + \pmotraining\FirebaseNotif::sendNotif("Ada berita baru", "Klik untuk membuka", 1, 0); } // closing $conn->close();