diff --git a/kegiatan.html b/kegiatan.html deleted file mode 100644 index cb170d417c6f8be2309793c288188bfe63778222..0000000000000000000000000000000000000000 --- a/kegiatan.html +++ /dev/null @@ -1,102 +0,0 @@ -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom"> - <h1 class="h2">Kegiatan</h1> - <div class="btn-toolbar mb-2 mb-md-0"> - - </div> -</div> - -<form method="POST" id="upload_form" enctype="multipart/form-data"> - <div class="form-group"> - <label for="usr">Nama Kegiatan:</label> - <input type="text" class="form-control" id="nama_kegiatan" name="nama_kegiatan"> - </div> - <div class="form-group"> - <label for="usr">Target Peserta:</label> - <input type="text" class="form-control" id="target_peserta" name="target_peserta"> - </div> - <div class="form-group"> - <label for="comment">Deskripsi Acara:</label> - <textarea class="form-control" rows="5" id="deskripsi_acara" name="deskripsi_acara" value="" placeholder="Kosongkan bila tidak ada deskripsi acara"></textarea> - </div> - <div class="form-group"> - <label><input type="checkbox" value="" id="isTanggal">Sudah ada tanggal? </label> - <input type="hidden" class="form-control" id="chx-helper" name="isTanggal" value="0"> - <input type="date" class="form-control" id="tanggal_kegiatan" name="tanggal_kegiatan" disabled> - </div> - <div class="form-group"> - <label><input type="checkbox" value="" id="isTempat">Sudah ada tempat? </label> - <input type="hidden" class="form-control" id="chx2-helper" name="isTempat" value="0"> - <input type="text" class="form-control" id="lokasi_kegiatan" name="lokasi_kegiatan" disabled> - </div> - <button type="submit" class="btn btn-default">Kirim</button> - -</form> - -<script> - var nama_kegiatan = document.getElementById("nama_kegiatan"); - var target_peserta = document.getElementById("target_peserta"); - var deskripsi_acara = document.getElementById("deskripsi_acara"); - var isTanggal = document.getElementById("isTanggal"); - var tanggal_kegiatan = document.getElementById("tanggal_kegiatan"); - var isTempat = document.getElementById("isTempat"); - var lokasi_kegiatan = document.getElementById("lokasi_kegiatan"); - - $('#isTanggal').change(function () { - if (this.checked) { - $("#tanggal_kegiatan").removeAttr("disabled"); - $("#chx-helper").val(1); - } else { - $("#tanggal_kegiatan").attr("disabled", "true"); - $("#chx-helper").val(0); - } - }); - - $('#isTempat').change(function () { - if (this.checked) { - $("#lokasi_kegiatan").removeAttr("disabled"); - $("#chx2-helper").val(1); - } else { - $("#lokasi_kegiatan").attr("disabled", "true"); - $("#chx2-helper").val(0); - } - }); - - $('#upload_form').on('submit', function (e) { - e.preventDefault(); - var teks=""; - if(!nama_kegiatan.value){ - teks+="Nama Kegiatan"; - } - if(!target_peserta.value){ - if(teks!=""){ - teks+=", "; - } - teks+="Target Peserta"; - } - if(isTanggal.checked){ - if(!tanggal_kegiatan.value){ - if(teks!=""){ - teks+=", "; - } - teks+="Tanggal Kegiatan"; - } - } - if(isTempat.checked){ - if(!tanggal_kegiatan.value){ - if(teks!=""){ - teks+=", "; - } - teks+="Lokasi Kegiatan"; - } - } - if(teks!=""){ - alert(teks + " tidak boleh kosong"); - } - else{ - $.post("../addKegiatan.php", $("#upload_form").serialize()).done(function (data) { - alert(data); - $("#upload_form")[0].reset(); - }); - } - }); -</script> \ No newline at end of file diff --git a/materi.html b/materi.html deleted file mode 100644 index f8f526e3bc557ac3161f5e5eb8df2fd4f0defcb7..0000000000000000000000000000000000000000 --- a/materi.html +++ /dev/null @@ -1,154 +0,0 @@ -<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom"> - <h1 class="h2">Materi</h1> - <div class="btn-toolbar mb-2 mb-md-0"> - - </div> -</div> - -<form action="../addMateri.php" method="POST" id="upload_form" enctype="multipart/form-data" onsubmit="return validateForm()"> - <div class="form-group"> - <label for="usr">Topik:</label> - <div class="radio"> - <label><input type="radio" name="optradio" value="new">Tambah Baru</label> - - <input type="text" id="new" name="topik" disabled onchange="return validateTopikTambahBaru()"> - </div> - <div class="radio"> - <label><input type="radio" name="optradio" value="exist">Pilih dari yang sudah ada</label> - <select id="sel1" name="topik" disabled> - - </select> - </div> - </div> - <div class="form-group"> - <label>Judul: </label> - <input type="text" class="form-control" id="judul" name="judul"> - </div> - <div class="form-group"> - <label for="comment">Konten Materi:</label> - <textarea class="form-control" rows="7" id="deskripsi_acara" name="konten" value="" placeholder="Kosongkan bila tidak ada konten materi"></textarea> - </div> - <div class="form-group"> - <label><input type="checkbox" value="" id="isVideo">Upload video? </label> - <input type="hidden" class="form-control" id="chx-helper" name="isVideo" value="0"> - <input class="input-file" id="fileInput" type="file" name="videofile" disabled accept="video/*"> - </div> - <div class="form-group"> - <label><input type="checkbox" value="" id="isPDF">Upload PDF? </label> - <input type="hidden" class="form-control" id="chx2-helper" name="isPDF" value="0"> - <input class="input-file" id="PDFinput" type="file" name="pdffile" disabled accept="application/pdf"> - </div> - <button type="submit" class="btn btn-default">Kirim</button> - -</form> -<div id="progbar" class="d-none"> - <h6>Uploading ...</h6> -<div class="progress"> - <div class="bar progress-bar progress-bar-striped active"></div> -</div> -</div> - -<script> - - function validateTopikTambahBaru() { - var x = document.getElementById("new").value; - if (x == "") { - alert("Topik tidak boleh kosong"); - return false; - } - } - - function validateForm() { - var x = document.getElementById("judul").value; - var y = document.getElementById("new").value; - var z = document.getElementById("sel1").value; - if(y == "" && z == ""){ - alert("Topik tidak boleh kosong"); - return false; - } - if (x == "") { - alert("Judul tidak boleh kosong"); - return false; - } - } - - $.getJSON("../getAllTopik.php",function(data){ - var select = document.getElementById("sel1"); - $.each(data, function(){ - var opt = document.createElement("option"); - opt.innerHTML = this; - select.appendChild(opt); - }); - }); - - $('#isVideo').change(function(){ - if (this.checked) { - $("#fileInput").removeAttr("disabled"); - $("#chx-helper").val(1); - } else { - $("#fileInput").attr("disabled",true); - $("#chx-helper").val(0); - } - }); - - $('#isPDF').change(function(){ - if (this.checked) { - $("#PDFinput").removeAttr("disabled"); - $("#chx2-helper").val(1); - } else { - $("#PDFinput").attr("disabled",true); - $("#chx2-helper").val(0); - } - }); - - $("input:radio[name=optradio]").on("change",function(){ - if (this.value == "exist") { - $("#sel1").removeAttr("disabled"); - $("#new").attr("disabled",true); - } else { - $("#new").removeAttr("disabled"); - $("#sel1").attr("disabled",true); - } - }); - - var bar = $('.bar'); - - $('form').ajaxForm({ - beforeSend: function() { - $('#progbar').removeClass('d-none'); - $('#upload_form').addClass('d-none'); - var percentVal = '0%'; - bar.width(percentVal) - }, - uploadProgress: function(event, position, total, percentComplete) { - var percentVal = percentComplete + '%'; - bar.width(percentVal) - }, - success: function() { - var percentVal = '100%'; - bar.width(percentVal) - }, - complete: function(xhr) { - $('#progbar').addClass('d-none'); - $('#upload_form').removeClass('d-none'); - alert(xhr.responseText); - } - }); - // $("#upload_form").on("submit", function(e){ - // e.preventDefault(); - // $.ajax({ - // url: "../addMateri.php", // Url to which the request is send - // type: "POST", // Type of request to be send, called as method - // data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values) - // contentType: false, // The content type used when sending data to the server. - // cache: false, // To unable request pages to be cached - // 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 - // { - // // lakukan pemanggilan api notifikasi - // alert(data); - // } - // }); - // }); - -</script> \ No newline at end of file