chess/resources/views/content/dashboard/action.blade.php
Ramadhon Ikhsan Prasetya bed287ba35 task_name only word
2024-12-10 16:40:10 +07:00

384 lines
14 KiB
PHP

<!--begin::Page Scripts(used by this page)-->
{{-- <script src="{{ asset('assets/js/pages/widgets.js') }}"></script> --}}
<script>
/* "use strict";
{{-- var progress = '{{ $progress }}'?parseInt('{{ $progress }}'):0; --}}
// Class definition
var KTWidgets = function() {
var _initMixedWidget18 = function() {
var element = document.getElementById("kt_mixed_widget_18_chart");
var height = parseInt(KTUtil.css(element, 'height'));
if (!element) {
return;
}
var options = {
series: [progress],
chart: {
height: height,
type: 'radialBar',
offsetY: 0
},
plotOptions: {
radialBar: {
startAngle: -90,
endAngle: 90,
hollow: {
margin: 0,
size: "70%"
},
dataLabels: {
showOn: "always",
name: {
show: true,
fontSize: "13px",
fontWeight: "700",
offsetY: -5,
color: KTApp.getSettings()['colors']['gray']['gray-500']
},
value: {
color: KTApp.getSettings()['colors']['gray']['gray-700'],
fontSize: "30px",
fontWeight: "700",
offsetY: -40,
show: true
}
},
track: {
background: KTApp.getSettings()['colors']['theme']['light']['primary'],
strokeWidth: '100%'
}
}
},
colors: [KTApp.getSettings()['colors']['theme']['base']['primary']],
stroke: {
lineCap: "round",
},
labels: ["Progress"]
};
var chart = new ApexCharts(element, options);
chart.render();
}
return {
init: function() {
_initMixedWidget18();
}
}
}();
// Webpack support
if (typeof module !== 'undefined') {
module.exports = KTWidgets;
}
jQuery(document).ready(function() {
KTWidgets.init();
});
function changeYearsStatistik(tahun) {
$.ajax({
type: 'GET',
url: base_url + 'changeYearsStatistik?tahun=' + tahun,
beforeSend: function () {
znLoadingPage()
},
success: function (response) {
znLoadingPageEnd()
if(response) {
$('#header_statistik').html(`Total ${response.data.project_done} Project selesai dari ${response.data.all_project} Project tahun ${tahun}`);
$('#dropdown_years_statistik').html(tahun);
$('#tahun_project_done').html(tahun);
$('#tot_project_done').html(response.data.project_done);
$('#tahun_all_project').html(tahun);
$('#tot_all_project').html(response.data.all_project);
$('#tahun_task_done').html(tahun);
$('#tot_task_done').html(response.data.task_done);
$('#tahun_all_task').html(tahun);
$('#tot_all_task').html(response.data.all_task);
} else {
znNotif('warning', 'Data Tidak Ditemukan');
$('#header_statistik').html(`Total 0 Project selesai dari 0 Project tahun ${tahun}`);
$('#dropdown_years_statistik').html(tahun);
$('#tahun_project_done').html(tahun);
$('#tot_project_done').html(0);
$('#tahun_all_project').html(tahun);
$('#tot_all_project').html(0);
$('#tahun_task_done').html(tahun);
$('#tot_task_done').html(0);
$('#tahun_all_task').html(tahun);
$('#tot_all_task').html(0);
}
},
}).done(function (msg) {
}).fail(function (msg) {
znLoadingPageEnd()
znNotif('error', 'Terjadi Kesalahan');
});
}
function newProject(role) {
if(role==6) {
loadContent('tambahProject', this, event);
} else {
znNotif('warning', 'Anda Tidak Berwenang untuk menambahkan project baru');
}
}
function lihatSemuaProject(role) {
if(role==6) {
loadContent('laporanProject', this, event)
} else {
loadContent('laporanProject', this, event)
}
}
function lihatProjectA(role) {
if(role==6) {
loadContent('projects?percent=lbh70', this, event)
} else {
loadContent('laporanProject?percent=lbh70', this, event)
}
}
function lihatProjectB(role) {
if(role==6) {
loadContent('projects?percent=btwn5070', this, event)
} else {
loadContent('laporanProject?percent=btwn5070', this, event)
}
}
function lihatProjectC(role) {
if(role==6) {
loadContent('projects?percent=krg50', this, event)
} else {
loadContent('laporanProject?percent=krg50', this, event)
}
}
function newTask(idUser) {
znModal('mNewTask');
} */
/* function goToTask() {
var id_project = $('#pilih_project').val();
var team_role_id = $('#pilih_project').find(':selected').data('teamrole');
if(team_role_id) {
if(team_role_id==1) {
$('.modal-backdrop').remove()
loadContent('detailProjects?id='+id_project+'&team_role_id='+team_role_id, this, event)
} else {
znNotif('warning', 'Anda Tidak Berwenang untuk menambahkan task baru');
}
} else {
$('.modal-backdrop').remove()
loadContent('detailProjects?id='+id_project, this, event)
}
} */
var validator;
var role = "{{ Auth::user()->role_id }}";
$(document).ready(function() {
validator = FormValidation.formValidation(
KTUtil.getById('form_new_task_css'),
{
fields: {
judul_: {
validators: {
notEmpty: {
message: 'Wajib diisi!'
}
}
},
deskripsi_: {
validators: {
notEmpty: {
message: 'Wajib diisi!'
}
}
},
level_: {
validators: {
notEmpty: {
message: 'Wajib diisi!'
}
}
},
},
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap()
}
}
);
/* var dServer = '{{ date('F d, Y H:i:s', time()) }}';
var date = new Date(dServer)
setInterval(function() {
// var date = new Date();
console.log(date)
var day = ('0' + date.getDate()).slice(-2);
var month = ( date.getMonth() < 10 ? '0' : '') + date.getMonth();
var monthIndex = date.getMonth();
var year = date.getFullYear();
var hours = ( date.getHours() < 10 ? '0' : '' ) + date.getHours();
var minute = ( date.getMinutes() < 10 ? '0' : '' ) + date.getMinutes();
var second = ( date.getSeconds() < 10 ? '0' : '' ) + date.getSeconds();
var monthNamesSmall = [
"Jan", "Feb", "Mar",
"Apr", "Mei", "Jun", "Jul",
"Ags", "Sep", "Okt",
"Nov", "Des"
];
$('#clock-wrapper').html(
day + ' ' + monthNamesSmall[(monthIndex)] + ' ' + year + ' ' + hours + ":" + minute + ":" + second
);
// var timeNow = year + '-' + month + '-' + day + ' ' + hours + ':' + minute + ':' + second;
var timeNow = '{{ date('F d, Y H:i:s', time()) }}';
date = new Date(timeNow);
}, 500); */
setInterval(setTime, 1000);
})
function invalidSymbol() {
var str = document.getElementById("judul_");
var regex = /[^a-z]/gi;
str.value = str.value.replace(regex ,"");
}
function checkTime(i) {
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
var today=new Date('<?php print date("F d, Y H:i:s", time())?>');
function setTime() {
today.setSeconds(today.getSeconds()+1)
var monthNamesSmall = [
"Jan", "Feb", "Mar",
"Apr", "Mei", "Jun", "Jul",
"Ags", "Sep", "Okt",
"Nov", "Des"
];
var year=today.getFullYear();
var month=today.getMonth();
var monthIndex = today.getMonth();
var day=today.getDate();
day = checkTime(day);
var hour=today.getHours();
hour = checkTime(hour);
var minute=today.getMinutes();
var second=today.getSeconds();
minute = checkTime(minute);
second = checkTime(second);
month = checkTime(month);
// var time = year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
var time = day + ' ' + monthNamesSmall[(monthIndex)] + ' ' + year + ' ' + hour + ":" + minute + ":" + second
$('#clock-wrapper').html(time);
}
function formLanjutkan() {
if($('#client_').val()=='') {
znNotif('warning', 'Pilih Client');
} else if($('#project_').val()=='') {
znNotif('warning', 'Pilih Project');
} else {
if(role!=1 && role != 4 && role != 5) {
var client = $('#client_').val();
var client_name = $('#client_').find('option:selected').text();
$("#client_id_modal_").val(client)
$('#client_modal_').html(client_name)
}
var project = $('#project_').val()
var project_name = $('#project_').find('option:selected').text()
$("#project_id_modal_").val(project)
$('#project_name_modal_').html(project_name)
var request = $('#request_').val()
var request_name = $('#request_').find('option:selected').text()
$('#req_id_modal_').val(request)
$('#req_modal_').html(request_name)
var tglNow = G_formatDate(new Date, 'd-M-Y')
var tglId = G_formatDateM(new Date)
$('#tanggal_id_modal_').val(tglId)
$('#tanggal_modal_').html(tglNow)
$('#row_file').val(0)
for (var index = 1; index <= 3; index++) {
$('#dokumen'+index+'_').addClass('d-none')
}
$('#form_new_task_css')[0].reset()
validator.resetForm();
znModal('newTaskCss')
}
}
function getFile(row) {
var rowNew = parseInt(row) + 1;
if(rowNew>3) {
znNotif('warning', 'Dokumen maksimal 3')
} else {
$('#file_input_'+rowNew+'_').click()
}
}
function getFileUrl(input, img, row) {
readURL(input, img);
$(img).removeClass('d-none');
var rowNew = parseInt(row) + 1;
$('#row_file').val(rowNew)
}
function getProject(set_id = 'project_', client_id, id=null) {
var formData = new FormData();
formData.append('client', client_id)
return doPost(base_url+'projects/get_any/get_project', formData, function (msg, data) {
$('#'+set_id).html(``)
$('#'+set_id).append(`<option value="">Pilih Project</option>`)
$.each(data.data, function(k,v) {
var selected = v.id==id?'selected':'';
$('#'+set_id).append('<option value="'+v.id+'" '+selected+'>'+v.project_name+'</option>')
})
})
}
function storeData(e) {
e.preventDefault()
var row = $('#row_file').val()
validator.validate().then(function(status) {
if(status == 'Valid') {
if(row<1) {
znNotif('warning', 'Wajib mencantumkan minimal 1 dokumen Maksimal 3 dokumen')
} else {
popConfirm("Konfirmasi Proses",
`<div class="mt-2">Yakin Akan Mengirimkan Data Ini ?</div>`, function () {
let myForm = document.getElementById('form_new_task_css');
let formData = new FormData(myForm);
znLoadingModal('newTaskCss');
doPost(base_url+'projects/act_any/store_css_task', formData, function (msg, data) {
znLoadingModalEnd('newTaskCss');
if (data == null){
znNotif("danger", msg);
}else {
if(data.rc == 0){
znNotif('success','Berhasil Mengirimkan Data');
$('#newTaskCss').modal('hide');
location.reload()
}else{
znNotif("danger", data.rm);
}
}
})
});
}
}
})
}
</script>