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:
68
assets/js/admin/_dashboard.php
Normal file
68
assets/js/admin/_dashboard.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<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;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
1580
assets/js/admin/_data.php
Normal file
1580
assets/js/admin/_data.php
Normal file
File diff suppressed because it is too large
Load Diff
428
assets/js/admin/_jadwal.php
Normal file
428
assets/js/admin/_jadwal.php
Normal file
@@ -0,0 +1,428 @@
|
||||
<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/datepicker/css/datepicker.css">
|
||||
<link rel="stylesheet" href="../assets/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css">
|
||||
<link rel="stylesheet" href="../assets/plugins/fullcalendar/fullcalendar/fullcalendar.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 type="text/javascript" src="../assets/plugins/fullcalendar/fullcalendar/fullcalendar.js"></script>
|
||||
<script src="../assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="../assets/plugins/datepicker/js/bootstrap-datepicker.js"></script>
|
||||
<script src="../assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.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>
|
||||
let currentIdRekapJadwal = 0;
|
||||
let currentJenisSidangRekapJadwal = '';
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth();
|
||||
var y = date.getFullYear();
|
||||
|
||||
$('.date-picker').datepicker({
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$(".search-select").select2({
|
||||
placeholder: "Pilih Mahasiswa",
|
||||
allowClear: true
|
||||
});
|
||||
|
||||
$('.time-picker').timepicker({
|
||||
minuteStep: 5,
|
||||
showInputs: true,
|
||||
disableFocus: true,
|
||||
showMeridian:false
|
||||
});
|
||||
|
||||
$('#list-jadwal').dataTable({
|
||||
"iDisplayLength": 5,
|
||||
"aLengthMenu": [
|
||||
[5, 10, 15, 20, 50, 100, -1],
|
||||
[5, 10, 15, 20, 50, 100, "All"] // change per page values here
|
||||
],
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"bSort": false,
|
||||
"sAjaxSource": "page/jadwal/list.jadwal.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-jadwal_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#list-jadwal_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#list-jadwal_wrapper .dataTables_length select').select2();
|
||||
|
||||
$("#form_jadwal").validate({
|
||||
errorPlacement:function(error,element){
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/jadwal/act.jadwal.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:$("#form_jadwal").serialize(),
|
||||
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=jadwal";
|
||||
$("#list-jadwal").dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('#calendar').fullCalendar({
|
||||
editable: true,
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month'
|
||||
},
|
||||
events: "page/jadwal/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/jadwal/act.jadwal.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;
|
||||
/*var form = $("<form></form>");
|
||||
form.append("<label>Detail</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='fa fa-check'></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;
|
||||
});*/
|
||||
}
|
||||
});
|
||||
|
||||
$("#idmhs").change(function(event) {
|
||||
if($("#idmhs").val()>0){
|
||||
$.ajax({
|
||||
url:'page/jadwal/act.jadwal.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:{act:"getinfo",idmhs:$("#idmhs").val()},
|
||||
beforeSend:function(){
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#judul").html(json.data.judul);
|
||||
$("#pemb1").val(json.data.pemb1);
|
||||
$("#pemb2").val(json.data.pemb2);
|
||||
$("#peng1").val(json.data.peng1);
|
||||
$("#peng2").val(json.data.peng2);
|
||||
}else{
|
||||
$("#judul").html("");
|
||||
$("#pemb1").val("");
|
||||
$("#pemb2").val("");
|
||||
$("#peng1").val("");
|
||||
$("#peng2").val("");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
function EditJadwal(id){
|
||||
location.href="?page=jadwal&act=edit&id="+id;
|
||||
}
|
||||
|
||||
function HapusJadwal(id){
|
||||
if(confirm("Hapus Jadwal ini")){
|
||||
$.ajax({
|
||||
url:'page/jadwal/act.jadwal.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=hapusjadwal&jadwal='+id,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$('#list-jadwal').dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function PublishJadwal(id){
|
||||
if(confirm('Terbitkan Jadwal ini ??')){
|
||||
$.ajax({
|
||||
url:'page/jadwal/act.jadwal.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=publish&idjadwal='+id,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$('#list-jadwal').dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function LihatBerkasSidang(idRekap){
|
||||
$('#berkasModal').modal('show');
|
||||
currentIdRekapJadwal = idRekap;
|
||||
currentJenisSidangRekapJadwal = 'Sidang';
|
||||
refreshTabelBerkas();
|
||||
}
|
||||
|
||||
function LihatBerkasSeminarHasil(idRekap){
|
||||
$('#berkasModal').modal('show');
|
||||
currentIdRekapJadwal = idRekap;
|
||||
currentJenisSidangRekapJadwal = 'SidHas';
|
||||
refreshTabelBerkas();
|
||||
}
|
||||
|
||||
function LihatBerkasOutline(idRekap){
|
||||
$('#berkasModal').modal('show');
|
||||
currentIdRekapJadwal = idRekap;
|
||||
currentJenisSidangRekapJadwal = 'Outline';
|
||||
refreshTabelBerkas();
|
||||
}
|
||||
|
||||
function refreshTabelBerkas(){
|
||||
let url = `../steven/API/getBerkasSidangMahasiswa.php?bypassSaya&idRekapHasil=${currentIdRekapJadwal}&jenis=${currentJenisSidangRekapJadwal}`;
|
||||
$('#isiTabelBerkas').html(`<tr><td colspan="4" style="text-align:center">Mengambil data</td></tr>`);
|
||||
$('#catatanBerkasDosen').val('');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type:'GET',
|
||||
dataType:'json',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
// $("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
const data = json.data;
|
||||
const catatan = json.catatanAdmin;
|
||||
|
||||
$('#catatanBerkasDosen').val(catatan);
|
||||
|
||||
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);
|
||||
let checkbox = `<input type="checkbox" class="cbVerifBerkas" data-id="${dataBerkas.id}">`;
|
||||
if(verifikasiAdmin == 1){
|
||||
checkbox = `<input type="checkbox" class="cbVerifBerkas" data-id="${dataBerkas.id}" checked="checked">`;
|
||||
}
|
||||
|
||||
isiTabel += `<tr><td>${no}</td><td>${judul}</td><td><a href="${dataBerkas.file}" target="_blank"><button class="btn btn-primary">Lihat File</button></a></td><td>${checkbox}</td></tr>`;
|
||||
}else{
|
||||
isiTabel += `<tr><td>${no}</td><td>${judul}</td><td colspan="2">Belum diupload</td></tr>`;
|
||||
}
|
||||
|
||||
no++;
|
||||
}
|
||||
}
|
||||
|
||||
$('#isiTabelBerkas').html(isiTabel);
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
$('#isiTabelBerkas').html(`<tr><td colspan="4" style="text-align:center">Gagal mengambil data ${jqXHR.responseText} <br><button class="btn btn-primary" onClick="refreshTabelBerkas()">Coba Lagi</button></td></tr>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function simpanVerifBerkas(){
|
||||
let listVerif = [];
|
||||
$(`.cbVerifBerkas`).each(function(i, obj) {
|
||||
let verif = 0;
|
||||
if($(this).is(":checked")){
|
||||
verif = 1;
|
||||
}
|
||||
const id = $(this).attr("data-id");
|
||||
|
||||
listVerif.push({
|
||||
'id' : id,
|
||||
'verif' : verif,
|
||||
});
|
||||
});
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("dataVerif", JSON.stringify(listVerif));
|
||||
formData.append("idRekap", currentIdRekapJadwal);
|
||||
formData.append("jenis", currentJenisSidangRekapJadwal);
|
||||
formData.append("catatan", $('#catatanBerkasDosen').val());
|
||||
|
||||
$.ajax({
|
||||
url:`../steven/API/verifBerkasAdmin.php`,
|
||||
type:'POST',
|
||||
data:formData,
|
||||
dataType:'json',
|
||||
mimeType:'multipart/form-data',
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend:function(){
|
||||
|
||||
},
|
||||
success:function(json){
|
||||
if(json.status){
|
||||
$('#berkasModal').modal('hide');
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
|
||||
});
|
||||
}else{
|
||||
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: jqXHR.responseText
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
78
assets/js/admin/_pengaturan.php
Normal file
78
assets/js/admin/_pengaturan.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<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/datepicker/css/datepicker.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-datepicker/js/bootstrap-datepicker.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();
|
||||
|
||||
$("#pengaturan").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
smt:{
|
||||
required:true
|
||||
},
|
||||
thn_ajaran:{
|
||||
required:true
|
||||
},
|
||||
min_setuju:{
|
||||
required:true
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
smt:{
|
||||
required:"Silakan Pilih Semester Yang Aktif Sekarang"
|
||||
},
|
||||
thn_ajaran:{
|
||||
required:"Tahun Ajaran Tidak Boleh Kosong"
|
||||
},
|
||||
min_setuju:{
|
||||
required:"Syarat Minimal Close Draft Praoutline Harus dipilih"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/pengaturan/act.pengaturan.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:$("#pengaturan").serialize(),
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
354
assets/js/admin/_pengumuman.php
Normal file
354
assets/js/admin/_pengumuman.php
Normal file
@@ -0,0 +1,354 @@
|
||||
<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": 5,
|
||||
"aLengthMenu": [
|
||||
[5, 10, 15, 20, 50, 100, -1],
|
||||
[5, 10, 15, 20, 50, 100, "All"] // change per page values here
|
||||
],
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"bSort": false,
|
||||
"sAjaxSource": "page/pengumuman/list.daftar-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();
|
||||
|
||||
$("#tulis_pengumuman").validate({ // aksi tulis dan edit pengumuman
|
||||
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("tulis_pengumuman"));
|
||||
$.ajax({
|
||||
url:'page/pengumuman/act.pengumuman.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=pengumuman&menu=daftar-pengumuman";
|
||||
}
|
||||
});
|
||||
|
||||
}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;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/*$('#list-daftarkategori').dataTable({
|
||||
"iDisplayLength": 5,
|
||||
"aLengthMenu": [
|
||||
[5, 10, 15, 20, 50, -1],
|
||||
[5, 10, 15, 20, 50, "All"] // change per page values here
|
||||
],
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"bSort": false,
|
||||
"bFilter": false,
|
||||
"sAjaxSource": "page/pengumuman/list.kategori-pengumuman.php",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "Menampilkan _MENU_ Data per halaman",
|
||||
"sZeroRecords": "Maaf, Data tidak ditemukan",
|
||||
"sInfo": "Menampilkan _START_ s/d _END_ dari _TOTAL_ data",
|
||||
"sInfoEmpty": "Menampilakan 0 s/d 0 dari 0 data",
|
||||
"sSearch": "",
|
||||
"sInfoFiltered": "",
|
||||
"oPaginate": {
|
||||
"sPrevious": "",
|
||||
"sNext": ""
|
||||
}
|
||||
},
|
||||
"aoColumnDefs": [
|
||||
{ "sClass": "text-center", "aTargets": [ 1 ] }
|
||||
]
|
||||
});
|
||||
$('#Btntambahkategori').click(function(){
|
||||
$("#nama_kategori").val("");
|
||||
$("#tambahkategori").modal('show');
|
||||
});
|
||||
$("#form-kategori").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
//alert($("#form-kategori").serialize());
|
||||
$.ajax({
|
||||
url:'page/pengumuman/act.pengumuman.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=tambahkat&'+$("#form-kategori").serialize(),
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#tambahkategori").modal('hide');
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$('#list-daftarkategori').dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#eform-kategori").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
//alert($("#form-kategori").serialize());
|
||||
$.ajax({
|
||||
url:'page/pengumuman/act.pengumuman.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=updatekat&'+$("#eform-kategori").serialize(),
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#editkategori").modal('hide');
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$('#list-daftarkategori').dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#list-daftarkategori_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#list-daftarkategori_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#list-daftarkategori_wrapper .dataTables_length select').select2();
|
||||
|
||||
$("#kategori-pengumuman").change(function(){
|
||||
if($("#kategori-pengumuman").val()=="addnew"){
|
||||
$("#nama_kategori").val("");
|
||||
$("#addkategori").modal('show');
|
||||
}
|
||||
});
|
||||
|
||||
$("#form-addkategori").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
submitHandler:function(form){
|
||||
//alert($("#form-kategori").serialize());
|
||||
$.ajax({
|
||||
url:'page/pengumuman/act.pengumuman.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=tambahkat&'+$("#form-addkategori").serialize(),
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#addkategori").modal('hide');
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$("#kategori-pengumuman").append("<option selected value='"+json.idkat+"'>"+json.namekat+"</option>");
|
||||
$("#kategori-pengumuman").focus();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});*/
|
||||
|
||||
});
|
||||
function getDoc(frame) {
|
||||
var doc = null;
|
||||
try {
|
||||
if (frame.contentWindow) {
|
||||
doc = frame.contentWindow.document;
|
||||
}
|
||||
} catch(err) {
|
||||
}
|
||||
|
||||
if (doc) {
|
||||
return doc;
|
||||
}
|
||||
try {
|
||||
doc = frame.contentDocument ? frame.contentDocument : frame.document;
|
||||
} catch(err) {
|
||||
doc = frame.document;
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
|
||||
function EditPengumuman(id){
|
||||
location.href="?page=pengumuman&menu=edit-pengumuman&pengumuman="+id;
|
||||
}
|
||||
|
||||
function HapusPengumuman(id){
|
||||
if(confirm("Hapus Pengumuman ini")){
|
||||
$.ajax({
|
||||
url:'page/pengumuman/act.pengumuman.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=hapuspengumuman&pengumuman='+id,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$('#list-pengumuman').dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function PublishPengumuman(id){
|
||||
if(confirm('Terbitkan Pengumuman ini ??')){
|
||||
$.ajax({
|
||||
url:'page/pengumuman/act.pengumuman.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
cache:false,
|
||||
data:'act=publish&idpengumuman='+id,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$('#list-pengumuman').dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
349
assets/js/admin/_praoutline.php
Normal file
349
assets/js/admin/_praoutline.php
Normal file
@@ -0,0 +1,349 @@
|
||||
<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();
|
||||
|
||||
$(".search-select").select2({
|
||||
placeholder: "Pilih Dosen",
|
||||
allowClear: true
|
||||
});
|
||||
|
||||
|
||||
$('#list-judul').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.judul.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-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();
|
||||
|
||||
$('#list-judulditerima').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.judulditerima.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-judulditerima_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#list-judulditerima_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#list-judulditerima_wrapper .dataTables_length select').select2();
|
||||
|
||||
$('#list-myreview').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.myreview.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-myreview_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#list-myreview_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#list-myreview_wrapper .dataTables_length select').select2();
|
||||
//daftar berita
|
||||
|
||||
$("#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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#reupload").validate({
|
||||
rules:{
|
||||
berkas:{
|
||||
required:true
|
||||
}
|
||||
},
|
||||
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)
|
||||
{
|
||||
var formData = new FormData(document.getElementById("reupload"));
|
||||
$.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();
|
||||
$("#btn_reupload").val('Uploading...');
|
||||
},
|
||||
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&prid="+$("#prid").val();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
$("#btn_reupload").val('Upload');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}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_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";
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#putusan_judul").submit(function() {
|
||||
$.ajax({
|
||||
url:'page/praoutline/act.praoutline.php',
|
||||
dataType:'json',
|
||||
type:'POST',
|
||||
data:$("#putusan_judul").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=kep-draft-praoutline";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
|
||||
});{
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
CKEDITOR.config.autoParagraph = false;
|
||||
CKEDITOR.disableAutoInline = true;
|
||||
$('textarea.ckeditor').ckeditor({
|
||||
height:240
|
||||
});
|
||||
|
||||
function openrev(idpr){
|
||||
if(confirm("Aksi Ini Akan Membuka Kembali Review Pada Draft Praoutline ini. Lanjutkan ??")){
|
||||
$.ajax({
|
||||
url:'page/praoutline/act.praoutline.php',
|
||||
dataType:'json',
|
||||
type:'POST',
|
||||
data:"act=open_judul&idpr="+idpr,
|
||||
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=kep-draft-praoutline";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
41
assets/js/admin/_profil.php
Normal file
41
assets/js/admin/_profil.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<link rel="stylesheet" href="../assets/plugins/gritter/css/jquery.gritter.css">
|
||||
<script src="../assets/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script src="../assets/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script src="../assets/plugins/gritter/js/jquery.gritter.min.js"></script>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
Main.init();
|
||||
|
||||
CKEDITOR.disableAutoInline = true;
|
||||
$('textarea.ckeditor').ckeditor({
|
||||
height:400
|
||||
});
|
||||
|
||||
$("#ProfilBtnSimpan").click(function(){
|
||||
$.ajax({
|
||||
url:'page/profil/act.profil.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:$("#profil").serialize(),
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 5000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
363
assets/js/admin/_user.php
Normal file
363
assets/js/admin/_user.php
Normal file
@@ -0,0 +1,363 @@
|
||||
<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();
|
||||
$("#daftar-user").dataTable({
|
||||
"iDisplayLength": 5,
|
||||
"aLengthMenu": [
|
||||
[5, 10, 20, 50, -1],
|
||||
[5, 10, 20, 50, "All"] // change per page values here
|
||||
],
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"bSort": false,
|
||||
"bFilter": false,
|
||||
"sAjaxSource": "page/user/list.daftar-user.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": ""
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#daftar-user_wrapper .dataTables_filter input').addClass("form-control input-sm").attr("placeholder", "Search");
|
||||
$('#daftar-user_wrapper .dataTables_length select').addClass("m-wrap small");
|
||||
$('#daftar-user_wrapper .dataTables_length select').select2();
|
||||
|
||||
$("#btnTambahUser").click(function(){
|
||||
|
||||
});
|
||||
|
||||
$("#myprofile").validate({
|
||||
errorPlacement:function(error,element){
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
pwd_lama: {
|
||||
required: function(element) {
|
||||
return $("#pwd").val()!="";
|
||||
},
|
||||
minlength: 6
|
||||
},
|
||||
emailuser:{
|
||||
email: true
|
||||
},
|
||||
pwd:{
|
||||
minlength: 6
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
pwd:{
|
||||
minlength:"Password Minimal 6 karakter"
|
||||
},
|
||||
pwd_lama:{
|
||||
minlength:"Password Minimal 6 karakter"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:$("#myprofile").serialize(),
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg
|
||||
});
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#tambahuserbaru").validate({
|
||||
errorPlacement:function(error,element){
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
nama_lengkap:{
|
||||
required:true
|
||||
},
|
||||
emailuser:{
|
||||
email: true
|
||||
},
|
||||
pwd:{
|
||||
required:true,
|
||||
minlength: 6
|
||||
},
|
||||
prodi:{
|
||||
required:true
|
||||
},
|
||||
username:{
|
||||
required:true,
|
||||
minlength: 5,
|
||||
remote:{
|
||||
url: "page/user/checkuser.php",
|
||||
type: "post"
|
||||
}
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
pwd:{
|
||||
required:"Password tidak boleh kosong.",
|
||||
minlength:"Password Minimal 6 karakter"
|
||||
},
|
||||
emailuser:{
|
||||
email:"Silakan masukkan email yang valid."
|
||||
},
|
||||
prodi:{
|
||||
required:"Silakan Pilih Program Studi"
|
||||
},
|
||||
username:{
|
||||
required:"Username tidak boleh kosong.",
|
||||
minlength:"Username minimal 5 karakter",
|
||||
remote:"Username sudah ada."
|
||||
},
|
||||
nama_lengkap:{
|
||||
required:"Nama Lengkap harus diisi"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:$("#tambahuserbaru").serialize(),
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$("#tambahuser").modal('hide');
|
||||
$("#daftar-user").dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#editdatauser").validate({
|
||||
errorPlacement:function(error,element){
|
||||
error.appendTo( element.parent("div"));
|
||||
},
|
||||
rules:{
|
||||
nama_lengkap:{
|
||||
required:true
|
||||
},
|
||||
emailuser:{
|
||||
email: true
|
||||
},
|
||||
username:{
|
||||
required:true,
|
||||
minlength: 5
|
||||
}
|
||||
},
|
||||
messages:{
|
||||
emailuser:{
|
||||
email:"Silakan masukkan email yang valid."
|
||||
},
|
||||
username:{
|
||||
required:"Username tidak boleh kosong.",
|
||||
minlength:"Username minimal 5 karakter."
|
||||
},
|
||||
nama_lengkap:{
|
||||
required:"Nama Lengkap harus diisi"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
dataType:'json',
|
||||
type:'post',
|
||||
cache:false,
|
||||
data:$("#editdatauser").serialize(),
|
||||
beforeSend:function(){
|
||||
$("#loading").show();
|
||||
},
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$("#edituser").modal('hide');
|
||||
$("#daftar-user").dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$("#loading").hide();
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function EditUser(id){
|
||||
$("#edituser").modal({
|
||||
keyboard:false,
|
||||
show:true,
|
||||
remote:'page/user/form-edituser.php?user='+id
|
||||
});
|
||||
}
|
||||
|
||||
function HapusUser(id){
|
||||
if(confirm("Hapus Admin??")){
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
data:'act=hapususer&id='+id,
|
||||
cache:false,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$("#daftar-user").dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function NonaktifkanUser(id){
|
||||
if(confirm("Nonaktifkan status Admin??")){
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
data:'act=nonaktifkanuser&id='+id,
|
||||
cache:false,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$("#daftar-user").dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function AktifkanUser(id){
|
||||
if(confirm("Aktifkan status Admin??")){
|
||||
$.ajax({
|
||||
url:'page/user/act.user.php',
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
data:'act=aktifkanuser&id='+id,
|
||||
cache:false,
|
||||
success:function(json){
|
||||
if(json.result){
|
||||
$.gritter.add({
|
||||
title:'Sukses',
|
||||
time: 1000,
|
||||
text: json.msg,
|
||||
after_close: function(){
|
||||
$("#daftar-user").dataTable().fnDraw();
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$.gritter.add({
|
||||
title:'Kesalahan',
|
||||
time: 4000,
|
||||
text: json.msg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
460
assets/js/admin/index.js
Normal file
460
assets/js/admin/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();
|
||||
}
|
||||
};
|
||||
}();
|
||||
206
assets/js/admin/login.js
Normal file
206
assets/js/admin/login.js
Normal file
@@ -0,0 +1,206 @@
|
||||
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(){
|
||||
$("#textLogin").html("Silakan Tunggu..");
|
||||
},
|
||||
success:function(json){
|
||||
if (json.result){
|
||||
location.href='./'
|
||||
}else{
|
||||
//alert(json.msg);
|
||||
$("#textLogin").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