Add frontend assets and plugin bundles
Add the legacy frontend themes, scripts, and plugin assets required by the main SPOTA interfaces.
This commit is contained in:
69
assets/js/mhs/_dashboard.php
Normal file
69
assets/js/mhs/_dashboard.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<link rel="stylesheet" href="../assets/plugins/fullcalendar/fullcalendar/fullcalendar.css" />
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
|
||||
|
||||
<script src="../assets/plugins/fullcalendar/fullcalendar/fullcalendar.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modal.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js"></script>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
/*Index.init();*/
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth();
|
||||
var y = date.getFullYear();
|
||||
$('#calendar').fullCalendar({
|
||||
editable: true,
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month'
|
||||
},
|
||||
events: "page/dashboard/json.kalender.php",
|
||||
// Convert the allDay from string to boolean
|
||||
eventRender: function(event, element, view) {
|
||||
if (event.allDay === 'true') {
|
||||
event.allDay = true;
|
||||
} else {
|
||||
event.allDay = false;
|
||||
}
|
||||
},
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
eventClick: function (calEvent, jsEvent, view) {
|
||||
//alert(calEvent.id);
|
||||
$("#JadwalDetail").modal('show');
|
||||
$.ajax({
|
||||
url:'page/dashboard/act.dashboard.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:'act=detailjadwal&id='+calEvent.id,
|
||||
beforeSend:function(){
|
||||
$("#tbjadwal").hide();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#tbjadwal").show();
|
||||
$("#nama").html(json.nama+" ("+json.nim+")");
|
||||
$("#jenis").html(json.jenis);
|
||||
$("#judul").html(json.judul);
|
||||
$("#tgl").html(json.tgl+" "+json.wkt);
|
||||
$("#ruangan").html(json.ruangan);
|
||||
$("#pembimbing1").html(json.pemb1);
|
||||
$("#pembimbing2").html(json.pemb2);
|
||||
$("#penguji1").html(json.peng1);
|
||||
$("#penguji2").html(json.peng2);
|
||||
$("#JadwalDetail").modal('show');
|
||||
}else{
|
||||
alert(json.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('#modalPengumuman').modal('show');
|
||||
});
|
||||
</script>
|
||||
446
assets/js/mhs/_outline.php
Normal file
446
assets/js/mhs/_outline.php
Normal file
@@ -0,0 +1,446 @@
|
||||
<link rel="stylesheet" href="../assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css">
|
||||
<link rel="stylesheet" href="../assets/plugins/gritter/css/jquery.gritter.css">
|
||||
<script src="../assets/plugins/bootstrap-daterangepicker/moment.min.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<script src="../assets/js/form-elements.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script src="../assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="../assets/plugins/gritter/js/jquery.gritter.min.js"></script>
|
||||
<script>
|
||||
let jadwalSidang = false;
|
||||
<?php
|
||||
if (isset($_GET['menu'])) {
|
||||
$getMenu = $_GET['menu'];
|
||||
if ($getMenu == 'jadwal_sidang') {
|
||||
echo 'jadwalSidang = true;';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
|
||||
//function to initiate daterangepicker
|
||||
$('.date-range').daterangepicker();
|
||||
|
||||
$("#tambah_diskusi").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
pemb:{
|
||||
required:true
|
||||
},
|
||||
stta:{
|
||||
required:true
|
||||
},
|
||||
bab:{
|
||||
required:true
|
||||
},
|
||||
sub:{
|
||||
required:true
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
pemb:{
|
||||
required:"Silakan Pilih Dosen Pembimbing."
|
||||
},
|
||||
stta:{
|
||||
required:"Silakan Pilih Status Tugas Akhir."
|
||||
},
|
||||
bab:{
|
||||
required:"Silakan Pilih BAB Bahasan."
|
||||
},
|
||||
sub:{
|
||||
required:"Silakan Inputkan Sub Bahasan."
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/outline/act.outline.php',
|
||||
dataType:'json',
|
||||
type:'POST',
|
||||
data:$("#tambah_diskusi").serialize(),
|
||||
cache:false,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
location.href="?page=outline&menu=list";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#post_review").validate({ //
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
for ( instance in CKEDITOR.instances )
|
||||
{
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
if(window.FormData !== undefined) // for HTML5 browsers
|
||||
{
|
||||
var formData = new FormData(document.getElementById("post_review"));
|
||||
$.ajax({
|
||||
url:'page/outline/act.outline.php',
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
// location.href="?page=outline&menu=list";
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else{ //for olden browsers
|
||||
|
||||
var iframeId = "unique" + (new Date().getTime());
|
||||
var iframe = $('<iframe src="javascript:false;" name="'+iframeId+'" />');
|
||||
iframe.hide();
|
||||
form.attr("target",iframeId);
|
||||
iframe.appendTo("body");
|
||||
iframe.load(function(e){
|
||||
var doc = getDoc(iframe[0]);
|
||||
var docRoot = doc.body ? doc.body : doc.documentElement;
|
||||
var data = docRoot.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#post_jadwal").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
pemb1:{
|
||||
required:true
|
||||
},
|
||||
pemb2:{
|
||||
required:true
|
||||
},
|
||||
peng1:{
|
||||
required:true
|
||||
},
|
||||
peng2:{
|
||||
required:true
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
pemb1:{
|
||||
required:"Silakan Inputkan Nama Pembimbing 1."
|
||||
},
|
||||
pemb2:{
|
||||
required:"Silakan Inputkan Nama Pembimbing 2."
|
||||
},
|
||||
peng1:{
|
||||
required:"Silakan Inputkan Nama Penguji 1."
|
||||
},
|
||||
peng2:{
|
||||
required:"Silakan Inputkan Nama Penguji 2."
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/outline/act.outline.php',
|
||||
dataType:'json',
|
||||
type:'POST',
|
||||
data:$("#post_jadwal").serialize(),
|
||||
cache:false,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
CKEDITOR.disableAutoInline = true;
|
||||
$('textarea.ckeditor').ckeditor({
|
||||
height:240
|
||||
});
|
||||
|
||||
function refreshTabelBerkas(){
|
||||
let url = `../steven/API/getBerkasSidangMahasiswa.php?idRekapHasil=${currentIdRekap}&jenis=Sidang`;
|
||||
|
||||
$('#isiTabelBerkas').html('<tr><td colspan="4" style="text-align:center">Mengambil Data . . .</td></tr>');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type:'GET',
|
||||
dataType:'json',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
// $("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
const data = json.data;
|
||||
|
||||
let isiTabel = ``;
|
||||
let no = 1;
|
||||
for (var key in data) {
|
||||
if (data.hasOwnProperty(key)){
|
||||
const berkas = data[key];
|
||||
const judul = berkas.judul;
|
||||
const dataBerkas = berkas.data;
|
||||
|
||||
let adaBerkas = true;
|
||||
if(dataBerkas == undefined || dataBerkas == null){
|
||||
adaBerkas= false;
|
||||
}else{
|
||||
if(dataBerkas.file == null || dataBerkas.file == ""){
|
||||
adaBerkas = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(adaBerkas){
|
||||
const verifikasiAdmin = Number(dataBerkas.status);
|
||||
if(verifikasiAdmin == 1){
|
||||
isiTabel += `<tr><td>${no}</td><td>${judul}</td><td></td><td>${getLabelStatusBerkas(dataBerkas.status)}</td><td><a href="${dataBerkas.file}" target="_blank"><button class="btn btn-primary">Lihat File</button></a></td></tr>`;
|
||||
}else{
|
||||
isiTabel += `<tr><td>${no}</td><td>${judul}</td><td><input type="file" class="fileBerkas" data-nama="${key}"></td><td>${getLabelStatusBerkas(dataBerkas.status)}</td><td><a href="${dataBerkas.file}" target="_blank"><button class="btn btn-primary">Lihat File</button></a></td></tr>`;
|
||||
}
|
||||
}else{
|
||||
isiTabel += `<tr><td>${no}</td><td>${judul}</td><td><input type="file" class="fileBerkas" data-nama="${key}"></td><td><span class="label label-default">Belum Diupload</span></td><td></td></tr>`;
|
||||
}
|
||||
no++;
|
||||
}
|
||||
}
|
||||
|
||||
$('#isiTabelBerkas').html(isiTabel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getLabelStatusBerkas(verifikasiAdmin){
|
||||
verifikasiAdmin = Number(verifikasiAdmin);
|
||||
switch(verifikasiAdmin){
|
||||
case 0 : return `<span class="label label-warning">Belum diverifikasi</span>`;
|
||||
case 1 : return `<span class="label label-success">OK</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
function uploadBerkasSidangOld(){
|
||||
let formData = new FormData();
|
||||
let listKeyFile = [];
|
||||
$(`.fileBerkas`).each(function(i, obj) {
|
||||
const file = $(this)[0].files[0];
|
||||
if(file != undefined && file != null){
|
||||
const nama = $(this).attr("data-nama");
|
||||
formData.append(nama, file);
|
||||
listKeyFile.push(nama);
|
||||
}
|
||||
});
|
||||
|
||||
formData.append("listKey", JSON.stringify(listKeyFile));
|
||||
|
||||
$.ajax({
|
||||
url:`../steven/API/postBerkasSidangMahasiswa.php?idRekapHasil=${currentIdRekap}`,
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.status){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
refreshTabelBerkas();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function uploadBerkasSidang(){
|
||||
$('#btnUploadBerkas').hide();
|
||||
$('#loaderBerkas').html(`Tunggu sebentar`);
|
||||
|
||||
let listKeyFile = [];
|
||||
let listFormData = [];
|
||||
$(`.fileBerkas`).each(function(i, obj) {
|
||||
const file = $(this)[0].files[0];
|
||||
if(file != undefined && file != null){
|
||||
const nama = $(this).attr("data-nama");
|
||||
let formData = new FormData();
|
||||
formData.append("file_gdrive", file);
|
||||
formData.append("nim", nimMhs);
|
||||
formData.append("folderMhs", "Sidang Akhir");
|
||||
formData.append("nama", nama);
|
||||
|
||||
listFormData.push(formData);
|
||||
}
|
||||
});
|
||||
|
||||
for(let i = 0; i < listFormData.length; i++){
|
||||
const res = await uploadKeDrive(listFormData[i]);
|
||||
const nama = listFormData[i].get("nama");
|
||||
const no = i + 1;
|
||||
$('#loaderBerkas').html(`Mengupload ${no} dari ${listFormData.length} berkas`);
|
||||
|
||||
try{
|
||||
if(res.status == 1){
|
||||
listKeyFile.push({
|
||||
'nama' : nama,
|
||||
'file' : res.fileId,
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}catch(err){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let formDataNew = new FormData();
|
||||
formDataNew.append("data", JSON.stringify(listKeyFile));
|
||||
|
||||
$('#loaderBerkas').html(`Menyimpan data`);
|
||||
|
||||
$.ajax({
|
||||
url:`../steven/API/postBerkasSidangMahasiswaNew.php?idRekapHasil=${currentIdRekap}&jenis=Sidang`,
|
||||
type:'POST',
|
||||
data:formDataNew,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
//$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.status){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
refreshTabelBerkas();
|
||||
}
|
||||
});
|
||||
$('#btnUploadBerkas').show();
|
||||
$('#loaderBerkas').html(``);
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
|
||||
$('#btnUploadBerkas').show();
|
||||
$('#loaderBerkas').html(``);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
$('#btnUploadBerkas').show();
|
||||
$('#loaderBerkas').html(``);
|
||||
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: jqXHR.responseText
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function uploadKeDrive(formData){
|
||||
const resAjax = await $.ajax({
|
||||
url:`http://203.24.50.140:8080`,
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false
|
||||
});
|
||||
|
||||
return resAjax;
|
||||
}
|
||||
|
||||
|
||||
if(jadwalSidang){
|
||||
refreshTabelBerkas();
|
||||
}
|
||||
|
||||
</script>
|
||||
247
assets/js/mhs/_penawaran.php
Normal file
247
assets/js/mhs/_penawaran.php
Normal file
@@ -0,0 +1,247 @@
|
||||
<link rel="stylesheet" type="text/css" href="../assets/plugins/select2/select2.css" />
|
||||
<link rel="stylesheet" href="../assets/plugins/DataTables/media/css/DT_bootstrap.css" />
|
||||
<!-- <link rel="stylesheet" href="../assets/plugins/ckeditor/contents.css"> -->
|
||||
<!-- <link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/> -->
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" href="../assets/plugins/gritter/css/jquery.gritter.css">
|
||||
<link rel="stylesheet" href="../assets/plugins/jQuery-Tags-Input/jquery.tagsinput.css">
|
||||
|
||||
<script type="text/javascript" src="../assets/plugins/select2/select2.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/DT_bootstrap.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script src="../assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modal.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js"></script>
|
||||
<script src="../assets/plugins/gritter/js/jquery.gritter.min.js"></script>
|
||||
<script src="../assets/plugins/jQuery-Tags-Input/jquery.tagsinput.min.js"></script>
|
||||
|
||||
<script>
|
||||
let listDataPenawaran = [];
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
|
||||
$('#list-judul_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#list-judul_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#list-judul_wrapper .dataTables_length select').select2();
|
||||
|
||||
// $('#kep-draft-praoutline').dataTable({
|
||||
// "iDisplayLength": 10,
|
||||
// "aLengthMenu": [
|
||||
// [10, 15, 20, 50, 100, -1],
|
||||
// [10, 15, 20, 50, 100, "All"] // change per page values here
|
||||
// ],
|
||||
// "bProcessing": true,
|
||||
// "bServerSide": true,
|
||||
// "bSort": false,
|
||||
// "sAjaxSource": "page/praoutline/list.kep.draft.praoutline.php",
|
||||
// "oLanguage": {
|
||||
// "sLengthMenu": "Menampilkan _MENU_ Data per halaman",
|
||||
// "sZeroRecords": "Maaf, Data tidak ada",
|
||||
// "sInfo": "Menampilkan _START_ s/d _END_ dari _TOTAL_ data",
|
||||
// "sInfoEmpty": "Menampilakan 0 s/d 0 dari 0 data",
|
||||
// "sSearch": "",
|
||||
// "sInfoFiltered": "",
|
||||
// "oPaginate": {
|
||||
// "sPrevious": "",
|
||||
// "sNext": ""
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('#kep-draft-praoutline_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
// $('#kep-draft-praoutline_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
// $('#kep-draft-praoutline_wrapper .dataTables_length select').select2();
|
||||
|
||||
refreshTabelPenawaranJudul(true);
|
||||
|
||||
});
|
||||
|
||||
|
||||
function refreshTabelPenawaranJudul(first = false){
|
||||
const status = $('#statusPenawaranJudul').val();
|
||||
const kk = $('#kkPenawaranJudul').val();
|
||||
|
||||
document.getElementById('contentTabel').innerHTML = buatTabelPenawaranJudulSaya(`<tr><td colspan="9" style="text-align:center">Mengambil Data . . .</td></tr>`);
|
||||
|
||||
const url = `API/list.data.judul.php?status=${status}&kk=${kk}`;
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type:'GET',
|
||||
dataType:'json',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
// $("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
const data = json;
|
||||
if(data.length == 0){
|
||||
document.getElementById('contentTabel').innerHTML = buatTabelPenawaranJudulSaya(`<tr><td colspan="9" style="text-align:center">Tidak ada data.</td></tr>`);
|
||||
}else{
|
||||
|
||||
let isiTabel = ``;
|
||||
let no = 1;
|
||||
|
||||
for(let i = 0; i < data.length; i++){
|
||||
const d = data[i];
|
||||
listDataPenawaran[d.id] = d;
|
||||
|
||||
let identitasMahasiswa = '-';
|
||||
if(d.nama != null){
|
||||
identitasMahasiswa = `${d.nama} / ${d.nim}`;
|
||||
}
|
||||
|
||||
let sudahDiambil = true;
|
||||
let tglHangus = d.hangus;
|
||||
let ditolak = false;
|
||||
|
||||
if(d.status == null || d.status == 2){
|
||||
sudahDiambil = false;
|
||||
tglHangus = '';
|
||||
|
||||
if(d.status == 2){
|
||||
ditolak = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(d.status == 1){
|
||||
tglHangus = '';
|
||||
}
|
||||
|
||||
let btnVerif = `<a role="menuitem" tabindex="-1" href="?page=penawaran&act=ambil&id=${d.id}" >
|
||||
<button class="btn btn-success">Booking</button>
|
||||
</a>`;
|
||||
let labelStatus = `<label class="btn btn-primary">Belum Diambil</label>`;
|
||||
|
||||
if(sudahDiambil){
|
||||
labelStatus = `<label class="btn btn-success">Sudah Diambil</label>`;
|
||||
btnVerif = `<a role="menuitem" tabindex="-1" href="?page=penawaran&act=lihat&id=${d.id}" >
|
||||
<button class="btn btn-primary">Lihat</button>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
/**
|
||||
if(ditolak){
|
||||
labelStatus = `<label class="btn btn-danger">Ditolak Oleh Dosen</label>`;
|
||||
}
|
||||
*/
|
||||
|
||||
isiTabel += `<tr>
|
||||
<td>${no}</td>
|
||||
<td>${d.judul}</td>
|
||||
<td>${d.deskripsi}</td>
|
||||
<td>${d.kk}</td>
|
||||
<td>${d.dosen}</td>
|
||||
<td>${labelStatus}</td>
|
||||
<td>${identitasMahasiswa}</td>
|
||||
<td>${tglHangus}</td>
|
||||
<td>
|
||||
${btnVerif}
|
||||
</td>
|
||||
</tr>`;
|
||||
no++;
|
||||
}
|
||||
|
||||
document.getElementById('contentTabel').innerHTML = buatTabelPenawaranJudulSaya(isiTabel);
|
||||
$('#tabelData').DataTable({
|
||||
"iDisplayLength": -1,
|
||||
"aLengthMenu": [
|
||||
[10, 15, 20, 50, 100, -1],
|
||||
[10, 15, 20, 50, 100, "All"] // change per page values here
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buatTabelPenawaranJudulSaya(isiTabel){
|
||||
return `
|
||||
<table class="table table-striped table-bordered table-hover table-full-width" id="tabelData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:5%;text-align:center">No.</th>
|
||||
<th style="width:25%;text-align:center">Judul</th>
|
||||
<th style="width:25%;text-align:center">Deskripsi</th>
|
||||
<th style="width:10%;text-align:center">KK</th>
|
||||
<th style="width:10%;text-align:center">Dari Dosen</th>
|
||||
<th style="width:5%;text-align:center">Status</th>
|
||||
<th style="width:10%;text-align:center">Diambil Oleh</th>
|
||||
<th style="width:10%;text-align:center">Hangus Otomatis Pada</th>
|
||||
<th style="width:5%;text-align:center">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${isiTabel}
|
||||
</tbody>
|
||||
</table>
|
||||
`;
|
||||
}
|
||||
|
||||
$("#ambil_penawaran").validate({
|
||||
errorPlacement:function(error,element){
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
if(window.FormData !== undefined) // for HTML5 browsers
|
||||
{
|
||||
var formData = new FormData(document.getElementById("ambil_penawaran"));
|
||||
$.ajax({
|
||||
url:'page/penawaran/act.data-penawaran.php',
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
location.href="?page=penawaran";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else{ //for olden browsers
|
||||
|
||||
var iframeId = "unique" + (new Date().getTime());
|
||||
var iframe = $('<iframe src="javascript:false;" name="'+iframeId+'" />');
|
||||
iframe.hide();
|
||||
form.attr("target",iframeId);
|
||||
iframe.appendTo("body");
|
||||
iframe.load(function(e){
|
||||
var doc = getDoc(iframe[0]);
|
||||
var docRoot = doc.body ? doc.body : doc.documentElement;
|
||||
var data = docRoot.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
56
assets/js/mhs/_pengumuman.php
Normal file
56
assets/js/mhs/_pengumuman.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<link rel="stylesheet" type="text/css" href="../assets/plugins/select2/select2.css" />
|
||||
<link rel="stylesheet" href="../assets/plugins/DataTables/media/css/DT_bootstrap.css" />
|
||||
<link rel="stylesheet" href="../assets/plugins/ckeditor/contents.css">
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" href="../assets/plugins/gritter/css/jquery.gritter.css">
|
||||
|
||||
<script type="text/javascript" src="../assets/plugins/select2/select2.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/DT_bootstrap.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script src="../assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modal.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js"></script>
|
||||
<script src="../assets/plugins/gritter/js/jquery.gritter.min.js"></script>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
|
||||
$('#list-pengumuman').dataTable({
|
||||
"iDisplayLength": 10,
|
||||
"aLengthMenu": [
|
||||
[10, 15, 20, 50, 100, -1],
|
||||
[10, 15, 20, 50, 100, "All"] // change per page values here
|
||||
],
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"bSort": false,
|
||||
"sAjaxSource": "page/pengumuman/list.pengumuman.php",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "Menampilkan _MENU_ Data per halaman",
|
||||
"sZeroRecords": "Maaf, Data tidak ada",
|
||||
"sInfo": "Menampilkan _START_ s/d _END_ dari _TOTAL_ data",
|
||||
"sInfoEmpty": "Menampilakan 0 s/d 0 dari 0 data",
|
||||
"sSearch": "",
|
||||
"sInfoFiltered": "",
|
||||
"oPaginate": {
|
||||
"sPrevious": "",
|
||||
"sNext": ""
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#list-pengumuman_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#list-pengumuman_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#list-pengumuman_wrapper .dataTables_length select').select2();
|
||||
|
||||
});
|
||||
|
||||
function LihatPengumuman(id){
|
||||
location.href="?page=pengumuman&menu=edit-pengumuman&pengumuman="+id;
|
||||
}
|
||||
|
||||
</script>
|
||||
184
assets/js/mhs/_praoutline.php
Normal file
184
assets/js/mhs/_praoutline.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<link rel="stylesheet" type="text/css" href="../assets/plugins/select2/select2.css" />
|
||||
<link rel="stylesheet" href="../assets/plugins/DataTables/media/css/DT_bootstrap.css" />
|
||||
<!-- <link rel="stylesheet" href="../assets/plugins/ckeditor/contents.css"> -->
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" href="../assets/plugins/gritter/css/jquery.gritter.css">
|
||||
<link rel="stylesheet" href="../assets/plugins/jQuery-Tags-Input/jquery.tagsinput.css">
|
||||
|
||||
<script type="text/javascript" src="../assets/plugins/select2/select2.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/DT_bootstrap.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script src="../assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modal.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js"></script>
|
||||
<script src="../assets/plugins/gritter/js/jquery.gritter.min.js"></script>
|
||||
<script src="../assets/plugins/jQuery-Tags-Input/jquery.tagsinput.min.js"></script>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
$(".search-select").select2({
|
||||
placeholder: "Pilih Dosen",
|
||||
allowClear: true
|
||||
});
|
||||
//daftar berita
|
||||
$("#upload_usulan").validate({ // aksi tulis dan edit berita
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
for ( instance in CKEDITOR.instances )
|
||||
{
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
if(window.FormData !== undefined) // for HTML5 browsers
|
||||
{
|
||||
const deskripsi = $('#deskripsi').val().trim();
|
||||
const pilpemb1 = $('#pilpemb1').val().trim();
|
||||
const pilpemb2 = $('#pilpemb2').val().trim();
|
||||
const pilpemb3 = $('#pilpemb3').val().trim();
|
||||
const pilpemb4 = $('#pilpemb4').val().trim();
|
||||
|
||||
if(deskripsi === ""){
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: "Deskripsi tugas akhir harus diisi."
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if(pilpemb1 === "" || pilpemb2 === "" || pilpemb3 === "" || pilpemb4 === ""){
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: "Dosen Pembimbing harus di isi ke 4 4 nya."
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var formData = new FormData(document.getElementById("upload_usulan"));
|
||||
$.ajax({
|
||||
url:'page/praoutline/act.praoutline.php',
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
location.href="?page=praoutline&menu=review";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else{ //for olden browsers
|
||||
|
||||
var iframeId = "unique" + (new Date().getTime());
|
||||
var iframe = $('<iframe src="javascript:false;" name="'+iframeId+'" />');
|
||||
iframe.hide();
|
||||
form.attr("target",iframeId);
|
||||
iframe.appendTo("body");
|
||||
iframe.load(function(e){
|
||||
var doc = getDoc(iframe[0]);
|
||||
var docRoot = doc.body ? doc.body : doc.documentElement;
|
||||
var data = docRoot.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#cari").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/praoutline/act.praoutline.php',
|
||||
dataType:'html',
|
||||
type:'POST',
|
||||
data:$("#cari").serialize(),
|
||||
cache:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(html){
|
||||
$("#loading").fadeOut('fast');
|
||||
$("#result-cari").html(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#post_review").submit(function() {
|
||||
$.ajax({
|
||||
url:'page/praoutline/act.praoutline.php',
|
||||
dataType:'json',
|
||||
type:'POST',
|
||||
data:$("#post_review").serialize(),
|
||||
cache:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
location.href="?page=praoutline&menu=review";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
CKEDITOR.disableAutoInline = true;
|
||||
$('textarea.ckeditor').ckeditor({
|
||||
height:240
|
||||
});
|
||||
|
||||
function doquote(id){
|
||||
//$("#balas_review").append('Some text');
|
||||
//CKEDITOR.instances.balas_review.insertHtml( '<blockquote><small>Someone famous </small><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p></blockquote>' );
|
||||
}
|
||||
|
||||
</script>
|
||||
94
assets/js/mhs/_user.php
Normal file
94
assets/js/mhs/_user.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<link rel="stylesheet" type="text/css" href="../assets/plugins/select2/select2.css" />
|
||||
<link rel="stylesheet" href="../assets/plugins/DataTables/media/css/DT_bootstrap.css" />
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" href="../assets/plugins/gritter/css/jquery.gritter.css">
|
||||
|
||||
<script type="text/javascript" src="../assets/plugins/select2/select2.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/plugins/DataTables/media/js/DT_bootstrap.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modal.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js"></script>
|
||||
<script src="../assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="../assets/plugins/gritter/js/jquery.gritter.min.js"></script>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
$("#updateprofil").validate({
|
||||
errorPlacement:function(error,element){
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
nmLengkap:{
|
||||
required:true,
|
||||
minlength:3
|
||||
},
|
||||
email:{
|
||||
required:true
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
nmLengkap:{
|
||||
required:"Nama Lengkap tidak boleh kosong",
|
||||
minlength:"Minimal 3 karakter"
|
||||
},
|
||||
email:{
|
||||
required:"Email harus diisi"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
if(window.FormData !== undefined) // for HTML5 browsers
|
||||
{
|
||||
var formData = new FormData(document.getElementById("updateprofil"));
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
location.href="?page=user&menu=my-profile";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else{ //for olden browsers
|
||||
|
||||
var iframeId = "unique" + (new Date().getTime());
|
||||
var iframe = $('<iframe src="javascript:false;" name="'+iframeId+'" />');
|
||||
iframe.hide();
|
||||
form.attr("target",iframeId);
|
||||
iframe.appendTo("body");
|
||||
iframe.load(function(e){
|
||||
var doc = getDoc(iframe[0]);
|
||||
var docRoot = doc.body ? doc.body : doc.documentElement;
|
||||
var data = docRoot.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
460
assets/js/mhs/index.js
Normal file
460
assets/js/mhs/index.js
Normal file
@@ -0,0 +1,460 @@
|
||||
var Index = function () {
|
||||
// function to initiate Chart 1
|
||||
/*var runChart1 = function () {
|
||||
function randValue() {
|
||||
return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
|
||||
};
|
||||
var pageviews = [
|
||||
[1, randValue()],
|
||||
[2, randValue()],
|
||||
[3, 2 + randValue()],
|
||||
[4, 3 + randValue()],
|
||||
[5, 5 + randValue()],
|
||||
[6, 10 + randValue()],
|
||||
[7, 15 + randValue()],
|
||||
[8, 20 + randValue()],
|
||||
[9, 25 + randValue()],
|
||||
[10, 30 + randValue()],
|
||||
[11, 35 + randValue()],
|
||||
[12, 25 + randValue()],
|
||||
[13, 15 + randValue()],
|
||||
[14, 20 + randValue()],
|
||||
[15, 45 + randValue()],
|
||||
[16, 50 + randValue()],
|
||||
[17, 65 + randValue()],
|
||||
[18, 70 + randValue()],
|
||||
[19, 85 + randValue()],
|
||||
[20, 80 + randValue()],
|
||||
[21, 75 + randValue()],
|
||||
[22, 80 + randValue()],
|
||||
[23, 75 + randValue()],
|
||||
[24, 70 + randValue()],
|
||||
[25, 65 + randValue()],
|
||||
[26, 75 + randValue()],
|
||||
[27, 80 + randValue()],
|
||||
[28, 85 + randValue()],
|
||||
[29, 90 + randValue()],
|
||||
[30, 95 + randValue()]
|
||||
];
|
||||
var visitors = [
|
||||
[1, randValue() - 5],
|
||||
[2, randValue() - 5],
|
||||
[3, randValue() - 5],
|
||||
[4, 6 + randValue()],
|
||||
[5, 5 + randValue()],
|
||||
[6, 20 + randValue()],
|
||||
[7, 25 + randValue()],
|
||||
[8, 36 + randValue()],
|
||||
[9, 26 + randValue()],
|
||||
[10, 38 + randValue()],
|
||||
[11, 39 + randValue()],
|
||||
[12, 50 + randValue()],
|
||||
[13, 51 + randValue()],
|
||||
[14, 12 + randValue()],
|
||||
[15, 13 + randValue()],
|
||||
[16, 14 + randValue()],
|
||||
[17, 15 + randValue()],
|
||||
[18, 15 + randValue()],
|
||||
[19, 16 + randValue()],
|
||||
[20, 17 + randValue()],
|
||||
[21, 18 + randValue()],
|
||||
[22, 19 + randValue()],
|
||||
[23, 20 + randValue()],
|
||||
[24, 21 + randValue()],
|
||||
[25, 14 + randValue()],
|
||||
[26, 24 + randValue()],
|
||||
[27, 25 + randValue()],
|
||||
[28, 26 + randValue()],
|
||||
[29, 27 + randValue()],
|
||||
[30, 31 + randValue()]
|
||||
];
|
||||
var plot = $.plot($("#placeholder-h1"), [{
|
||||
data: pageviews,
|
||||
label: "Unique Visits"
|
||||
}, {
|
||||
data: visitors,
|
||||
label: "Page Views"
|
||||
}], {
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
lineWidth: 2,
|
||||
fill: true,
|
||||
fillColor: {
|
||||
colors: [{
|
||||
opacity: 0.05
|
||||
}, {
|
||||
opacity: 0.01
|
||||
}]
|
||||
}
|
||||
},
|
||||
points: {
|
||||
show: false
|
||||
},
|
||||
shadowSize: 2
|
||||
},
|
||||
grid: {
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
tickColor: "#eee",
|
||||
borderWidth: 0
|
||||
},
|
||||
colors: ["#d12610", "#37b7f3", "#52e136"],
|
||||
xaxis: {
|
||||
ticks: 11,
|
||||
tickDecimals: 0
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 11,
|
||||
tickDecimals: 0
|
||||
}
|
||||
});
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 15,
|
||||
border: '1px solid #333',
|
||||
padding: '4px',
|
||||
color: '#fff',
|
||||
'border-radius': '3px',
|
||||
'background-color': '#333',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
}
|
||||
var previousPoint = null;
|
||||
$("#placeholder-h1").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(2),
|
||||
y = item.datapoint[1].toFixed(2);
|
||||
showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y);
|
||||
}
|
||||
} else {
|
||||
$("#tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
};
|
||||
// function to initiate Chart 2
|
||||
var runChart2 = function () {
|
||||
var data_pie = [],
|
||||
series = Math.floor(Math.random() * 6) + 3;
|
||||
for (var i = 0; i < series; i++) {
|
||||
data_pie[i] = {
|
||||
label: "Series" + (i + 1),
|
||||
data: Math.floor(Math.random() * 100) + 1
|
||||
};
|
||||
}
|
||||
$.plot('#placeholder-h2', data_pie, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
tilt: 0.5,
|
||||
label: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
formatter: labelFormatter,
|
||||
background: {
|
||||
opacity: 0.8
|
||||
}
|
||||
},
|
||||
combine: {
|
||||
color: '#999',
|
||||
threshold: 0.1
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
|
||||
function labelFormatter(label, series) {
|
||||
return "<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>" + label + "<br/>" + Math.round(series.percent) + "%</div>";
|
||||
}
|
||||
};
|
||||
// function to initiate Chart 3
|
||||
var runChart3 = function () {
|
||||
var data = [],
|
||||
totalPoints = 300;
|
||||
|
||||
function getRandomData() {
|
||||
if (data.length > 0)
|
||||
data = data.slice(1);
|
||||
// Do a random walk
|
||||
while (data.length < totalPoints) {
|
||||
var prev = data.length > 0 ? data[data.length - 1] : 50,
|
||||
y = prev + Math.random() * 10 - 5;
|
||||
if (y < 0) {
|
||||
y = 0;
|
||||
} else if (y > 100) {
|
||||
y = 100;
|
||||
}
|
||||
data.push(y);
|
||||
}
|
||||
// Zip the generated y values with the x values
|
||||
var res = [];
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
res.push([i, data[i]]);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
// Set up the control widget
|
||||
var updateInterval = 30;
|
||||
$("#updateInterval").val(updateInterval).change(function () {
|
||||
var v = $(this).val();
|
||||
if (v && !isNaN(+v)) {
|
||||
updateInterval = +v;
|
||||
if (updateInterval < 1) {
|
||||
updateInterval = 1;
|
||||
} else if (updateInterval > 2000) {
|
||||
updateInterval = 2000;
|
||||
}
|
||||
$(this).val("" + updateInterval);
|
||||
}
|
||||
});
|
||||
var plot = $.plot("#placeholder-h3", [getRandomData()], {
|
||||
grid: {
|
||||
borderWidth: 1,
|
||||
borderColor: '#eeeeee'
|
||||
},
|
||||
series: {
|
||||
shadowSize: 0 // Drawing is faster without shadows
|
||||
},
|
||||
yaxis: {
|
||||
min: 0,
|
||||
max: 100
|
||||
},
|
||||
xaxis: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
|
||||
function update() {
|
||||
plot.setData([getRandomData()]);
|
||||
// Since the axes don't change, we don't need to call plot.setupGrid()
|
||||
plot.draw();
|
||||
setTimeout(update, updateInterval);
|
||||
}
|
||||
update();
|
||||
};
|
||||
// function to initiate Sparkline
|
||||
var runSparkline = function () {
|
||||
$(".sparkline_line_good span").sparkline("html", {
|
||||
type: "line",
|
||||
fillColor: "#B1FFA9",
|
||||
lineColor: "#459D1C",
|
||||
width: "50",
|
||||
height: "24"
|
||||
});
|
||||
$(".sparkline_line_bad span").sparkline("html", {
|
||||
type: "line",
|
||||
fillColor: "#FFC4C7",
|
||||
lineColor: "#BA1E20",
|
||||
width: "50",
|
||||
height: "24"
|
||||
});
|
||||
$(".sparkline_line_neutral span").sparkline("html", {
|
||||
type: "line",
|
||||
fillColor: "#CCCCCC",
|
||||
lineColor: "#757575",
|
||||
width: "50",
|
||||
height: "24"
|
||||
});
|
||||
$(".sparkline_bar_good span").sparkline('html', {
|
||||
type: "bar",
|
||||
barColor: "#459D1C",
|
||||
barWidth: "5",
|
||||
height: "24"
|
||||
});
|
||||
$(".sparkline_bar_bad span").sparkline('html', {
|
||||
type: "bar",
|
||||
barColor: "#BA1E20",
|
||||
barWidth: "5",
|
||||
height: "24"
|
||||
});
|
||||
$(".sparkline_bar_neutral span").sparkline('html', {
|
||||
type: "bar",
|
||||
barColor: "#757575",
|
||||
barWidth: "5",
|
||||
height: "24"
|
||||
});
|
||||
};
|
||||
// function to initiate EasyPieChart
|
||||
var runEasyPieChart = function () {
|
||||
if (isIE8 || isIE9) {
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function (oThis) {
|
||||
if (typeof this !== "function") {
|
||||
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||
}
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||
fToBind = this,
|
||||
fNOP = function () {}, fBound = function () {
|
||||
return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
fNOP.prototype = this.prototype;
|
||||
fBound.prototype = new fNOP();
|
||||
return fBound;
|
||||
};
|
||||
}
|
||||
}
|
||||
$('.easy-pie-chart .bounce').easyPieChart({
|
||||
animate: 1000,
|
||||
size: 70
|
||||
});
|
||||
$('.easy-pie-chart .cpu').easyPieChart({
|
||||
animate: 1000,
|
||||
lineWidth: 3,
|
||||
barColor: '#35aa47',
|
||||
size: 70
|
||||
|
||||
});
|
||||
};*/
|
||||
// function to initiate Full Calendar
|
||||
var runFullCalendar = function () {
|
||||
//calendar
|
||||
/* initialize the calendar
|
||||
-----------------------------------------------------------------*/
|
||||
var $modal = $('#event-management');
|
||||
$('#event-categories div.event-category').each(function () {
|
||||
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
|
||||
// it doesn't need to have a start or end
|
||||
var eventObject = {
|
||||
title: $.trim($(this).text()) // use the element's text as the event title
|
||||
};
|
||||
// store the Event Object in the DOM element so we can get to it later
|
||||
$(this).data('eventObject', eventObject);
|
||||
// make the event draggable using jQuery UI
|
||||
$(this).draggable({
|
||||
zIndex: 999,
|
||||
revert: true, // will cause the event to go back to its
|
||||
revertDuration: 50 // original position after the drag
|
||||
});
|
||||
});
|
||||
/* initialize the calendar
|
||||
-----------------------------------------------------------------*/
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth();
|
||||
var y = date.getFullYear();
|
||||
var form = '';
|
||||
var calendar = $('#calendar').fullCalendar({
|
||||
buttonText: {
|
||||
prev: '<i class="icon-chevron-left"></i>',
|
||||
next: '<i class="icon-chevron-right"></i>'
|
||||
},
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
events: [{
|
||||
title: 'Meeting with Boss',
|
||||
start: new Date(y, m, 1),
|
||||
className: 'label-default'
|
||||
}, {
|
||||
title: 'Bootstrap Seminar',
|
||||
start: new Date(y, m, d - 5),
|
||||
end: new Date(y, m, d - 2),
|
||||
className: 'label-teal'
|
||||
}, {
|
||||
title: 'Lunch with Nicole',
|
||||
start: new Date(y, m, d - 3, 12, 0),
|
||||
className: 'label-green',
|
||||
allDay: false
|
||||
}],
|
||||
editable: true,
|
||||
droppable: true, // this allows things to be dropped onto the calendar !!!
|
||||
drop: function (date, allDay) { // this function is called when something is dropped
|
||||
// retrieve the dropped element's stored Event Object
|
||||
var originalEventObject = $(this).data('eventObject');
|
||||
var $categoryClass = $(this).attr('data-class');
|
||||
// we need to copy it, so that multiple events don't have a reference to the same object
|
||||
var copiedEventObject = $.extend({}, originalEventObject);
|
||||
// assign it the date that was reported
|
||||
copiedEventObject.start = date;
|
||||
copiedEventObject.allDay = allDay;
|
||||
if ($categoryClass)
|
||||
copiedEventObject['className'] = [$categoryClass];
|
||||
// render the event on the calendar
|
||||
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
|
||||
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
|
||||
// is the "remove after drop" checkbox checked?
|
||||
if ($('#drop-remove').is(':checked')) {
|
||||
// if so, remove the element from the "Draggable Events" list
|
||||
$(this).remove();
|
||||
}
|
||||
},
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
select: function (start, end, allDay) {
|
||||
$modal.modal({
|
||||
backdrop: 'static'
|
||||
});
|
||||
form = $("<form></form>");
|
||||
form.append("<div class='row'></div>");
|
||||
form.find(".row").append("<div class='col-md-6'><div class='form-group'><label class='control-label'>New Event Name</label><input class='form-control' placeholder='Insert Event Name' type=text name='title'/></div></div>").append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Category</label><select class='form-control' name='category'></select></div></div>").find("select[name='category']").append("<option value='label-default'>Work</option>").append("<option value='label-green'>Home</option>").append("<option value='label-purple'>Holidays</option>").append("<option value='label-orange'>Party</option>").append("<option value='label-yellow'>Birthday</option>").append("<option value='label-teal'>Generic</option>").append("<option value='label-beige'>To Do</option>");
|
||||
$modal.find('.remove-event').hide().end().find('.save-event').show().end().find('.modal-body').empty().prepend(form).end().find('.save-event').unbind('click').click(function () {
|
||||
form.submit();
|
||||
});
|
||||
$modal.find('form').on('submit', function () {
|
||||
title = form.find("input[name='title']").val();
|
||||
$categoryClass = form.find("select[name='category'] option:checked").val();
|
||||
if (title !== null) {
|
||||
calendar.fullCalendar('renderEvent', {
|
||||
title: title,
|
||||
start: start,
|
||||
end: end,
|
||||
allDay: allDay,
|
||||
className: $categoryClass
|
||||
}, true // make the event "stick"
|
||||
);
|
||||
}
|
||||
$modal.modal('hide');
|
||||
return false;
|
||||
});
|
||||
calendar.fullCalendar('unselect');
|
||||
},
|
||||
eventClick: function (calEvent, jsEvent, view) {
|
||||
var form = $("<form></form>");
|
||||
form.append("<label>Change event name</label>");
|
||||
form.append("<div class='input-group'><input class='form-control' type=text value='" + calEvent.title + "' /><span class='input-group-btn'><button type='submit' class='btn btn-success'><i class='icon-ok'></i> Save</button></span></div>");
|
||||
$modal.modal({
|
||||
backdrop: 'static'
|
||||
});
|
||||
$modal.find('.remove-event').show().end().find('.save-event').hide().end().find('.modal-body').empty().prepend(form).end().find('.remove-event').unbind('click').click(function () {
|
||||
calendar.fullCalendar('removeEvents', function (ev) {
|
||||
return (ev._id == calEvent._id);
|
||||
});
|
||||
$modal.modal('hide');
|
||||
});
|
||||
$modal.find('form').on('submit', function () {
|
||||
calEvent.title = form.find("input[type=text]").val();
|
||||
calendar.fullCalendar('updateEvent', calEvent);
|
||||
$modal.modal('hide');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
return {
|
||||
init: function () {
|
||||
/*runChart1();
|
||||
runChart2();
|
||||
runChart3();
|
||||
runSparkline();
|
||||
runEasyPieChart();*/
|
||||
runFullCalendar();
|
||||
}
|
||||
};
|
||||
}();
|
||||
210
assets/js/mhs/login.js
Normal file
210
assets/js/mhs/login.js
Normal file
@@ -0,0 +1,210 @@
|
||||
var Login = function () {
|
||||
var runLoginButtons = function () {
|
||||
$('.forgot').bind('click', function () {
|
||||
$('.box-login').hide();
|
||||
$('.box-forgot').show();
|
||||
});
|
||||
$('.register').bind('click', function () {
|
||||
$('.box-login').hide();
|
||||
//$('.box-register').show();
|
||||
});
|
||||
$('.go-back').click(function () {
|
||||
$('.box-login').show();
|
||||
$('.box-forgot').hide();
|
||||
//$('.box-register').hide();
|
||||
});
|
||||
};
|
||||
var runSetDefaultValidation = function () {
|
||||
$.validator.setDefaults({
|
||||
errorElement: "span", // contain the error msg in a small tag
|
||||
errorClass: 'help-block',
|
||||
errorPlacement: function (error, element) { // render error placement for each input type
|
||||
if (element.attr("type") == "radio" || element.attr("type") == "checkbox") { // for chosen elements, need to insert the error after the chosen container
|
||||
error.insertAfter($(element).closest('.form-group').children('div').children().last());
|
||||
} else if (element.attr("name") == "card_expiry_mm" || element.attr("name") == "card_expiry_yyyy") {
|
||||
error.appendTo($(element).closest('.form-group').children('div'));
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
// for other inputs, just perform default behavior
|
||||
}
|
||||
},
|
||||
ignore: ':hidden',
|
||||
highlight: function (element) {
|
||||
$(element).closest('.help-block').removeClass('valid');
|
||||
// display OK icon
|
||||
$(element).closest('.form-group').removeClass('has-success').addClass('has-error').find('.symbol').removeClass('ok').addClass('required');
|
||||
// add the Bootstrap error class to the control group
|
||||
},
|
||||
unhighlight: function (element) { // revert the change done by hightlight
|
||||
$(element).closest('.form-group').removeClass('has-error');
|
||||
// set error class to the control group
|
||||
},
|
||||
success: function (label, element) {
|
||||
label.addClass('help-block valid');
|
||||
// mark the current input as valid and display OK icon
|
||||
$(element).closest('.form-group').removeClass('has-error');
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).closest('.help-block').removeClass('valid');
|
||||
// display OK icon
|
||||
$(element).closest('.form-group').addClass('has-error');
|
||||
// add the Bootstrap error class to the control group
|
||||
},
|
||||
unhighlight: function (element) { // revert the change done by hightlight
|
||||
$(element).closest('.form-group').removeClass('has-error');
|
||||
// set error class to the control group
|
||||
}
|
||||
});
|
||||
};
|
||||
var runLoginValidator = function () {
|
||||
var form = $('.form-login');
|
||||
var errorHandler = $('.errorHandler', form);
|
||||
form.validate({
|
||||
rules: {
|
||||
username: {
|
||||
minlength: 2,
|
||||
required: true
|
||||
},
|
||||
password: {
|
||||
minlength: 4,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
username :{
|
||||
minlength:"Karakter minimal {0} Karakter",
|
||||
required:"Silakan masukkan username anda"
|
||||
},
|
||||
password:{
|
||||
minlength:"Karakter minimal {0} Karakter",
|
||||
required:"Silakan masukkan password anda"
|
||||
}
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
errorHandler.hide();
|
||||
//form.submit();
|
||||
$.ajax({
|
||||
url:'act.auth.php',
|
||||
data:$('.form-login').serialize(),
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
beforeSend:function(){
|
||||
$("#logintext").html("Silakan Tunggu..");
|
||||
form.click(function(event) {
|
||||
return false;
|
||||
alert('Please Wait...');
|
||||
});
|
||||
},
|
||||
success:function(json){
|
||||
if (json.result){
|
||||
location.href='./'
|
||||
}else{
|
||||
//alert(json.msg);
|
||||
$("#logintext").html("Login");
|
||||
errorHandler.html(json.msg);
|
||||
errorHandler.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
invalidHandler: function (event, validator) { //display error alert on form submit
|
||||
errorHandler.show();
|
||||
}
|
||||
});
|
||||
};
|
||||
var runForgotValidator = function () {
|
||||
var form2 = $('.form-forgot');
|
||||
var errorHandler2 = $('.errorHandler', form2);
|
||||
form2.validate({
|
||||
rules: {
|
||||
email: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
email: "Silakan masukkan alamat email anda"
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
errorHandler2.hide();
|
||||
$.ajax({
|
||||
url:'act.auth.php',
|
||||
data:$('.form-forgot').serialize(),
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
/*beforeSend:function(){
|
||||
$("#statusLogin").html("Silakan Tunggu..");
|
||||
},*/
|
||||
success:function(json){
|
||||
if (json.result){
|
||||
alert(json.msg);
|
||||
//location.href='./'
|
||||
}else{
|
||||
errorHandler2.html(json.msg);
|
||||
errorHandler2.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
invalidHandler: function (event, validator) { //display error alert on form submit
|
||||
errorHandler2.show();
|
||||
}
|
||||
});
|
||||
};
|
||||
/*var runRegisterValidator = function () {
|
||||
var form3 = $('.form-register');
|
||||
var errorHandler3 = $('.errorHandler', form3);
|
||||
form3.validate({
|
||||
rules: {
|
||||
full_name: {
|
||||
minlength: 2,
|
||||
required: true
|
||||
},
|
||||
address: {
|
||||
minlength: 2,
|
||||
required: true
|
||||
},
|
||||
city: {
|
||||
minlength: 2,
|
||||
required: true
|
||||
},
|
||||
gender: {
|
||||
required: true
|
||||
},
|
||||
email: {
|
||||
required: true
|
||||
},
|
||||
password: {
|
||||
minlength: 6,
|
||||
required: true
|
||||
},
|
||||
password_again: {
|
||||
required: true,
|
||||
minlength: 5,
|
||||
equalTo: "#password"
|
||||
},
|
||||
agree: {
|
||||
minlength: 1,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
errorHandler3.hide();
|
||||
},
|
||||
invalidHandler: function (event, validator) { //display error alert on form submit
|
||||
errorHandler3.show();
|
||||
}
|
||||
});
|
||||
};*/
|
||||
return {
|
||||
//main function to initiate template pages
|
||||
init: function () {
|
||||
runLoginButtons();
|
||||
runSetDefaultValidation();
|
||||
runLoginValidator();
|
||||
runForgotValidator();
|
||||
// runRegisterValidator();
|
||||
}
|
||||
};
|
||||
}();
|
||||
Reference in New Issue
Block a user