2025-06-16 18:28:08 +05:00

118 lines
2.7 KiB
JavaScript
Executable File

$("#save-task").click(function(event){
var task = $("#task-txt").val();
var srok = $("#task-srok").val();
var mod = $("#task-module").val();
var prioritet = $("#task-prioritet").val();
$.ajax({
type:"POST",
url:'/act/admin',
data:"act=saveTask&task=" + task + "&srok=" + srok + "&mod=" + mod + "&prioritet="+prioritet,
success:function(data){/*alert(data)*/}
});
$(".mfp-close").click();
})
/*
$.ajax({
type:"POST",
url:'/act/admin',
data:"act=getStat",
dataType: 'json',
success:function(data){
new Morris.Line({
// ID of the element in which to draw the chart.
element: 'myfirstchart',
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: data,
// The name of the data record attribute that contains x-values.
xkey: 'd',
// A list of names of data record attributes that contain y-values.
ykeys: ['speed'],
// Labels for the ykeys -- will be displayed when you hover over the
// chart.
labels: ['Value']
});
}
});
*/
$('.popup-content').magnificPopup({
type: 'inline'
});
/*dataType: 'json',*/
//кнопка отправки сообщения в модальном окошке
$("#admin_zametki").keyup(function(event){
var txt = $(this).val();
$.ajax({
type:"POST",
url:'/act/admin',
data:"act=save&txt=" + txt,
success:function(data){/*alert(data)*/}
});
})
$("#taskStatus").click(function(event){
var id=$(this).data('id');
if ($(this).is(':checked')){
var status="1";
} else {
var status="0";
}
$.ajax({
type:"POST",
url:'/act/admin',
data:"act=saveTaskStatus&status=" + status + "&id=" + id,
success:function(data){/*alert(data)*/}
});
})
$("#clearimg").click(function(event){
$.ajax({
type:"POST",
url:'/act/admin',
data:"act=clearimg",
success:function(data){ $(this).text(data) }
});
})
/*
$( ".ibox" ).draggable({ //cancel: ".ibox-head, .ibox-body",
stop: function() {
var offset = $(this).offset();
var xPos = offset.left;
var yPos = offset.top;
$.ajax({
type:"POST",
url:'/act/admin',
data:"act=savePos&elem=" + $(this).data('elem') + "&x=" + xPos + "&y=" + yPos,
success:function(data){/*alert(data)}
});
}
});*/
var grafic="";
function getPer(){
return '2022';
}
let student = [{
year: '2023',
value: 30
},{
year: '2024',
value: 35
}];
var jason_data = JSON.stringify(student);
/*[
{ year: getPer(), value: 20 },{ year: '2009', value: 10 },{ year: '2010', value: 5 },{ year: '2011', value: 5 },{ year: '2012', value: 20 }
]*/