Files
2025-05-12 15:45:17 +00:00

66 lines
1.7 KiB
JavaScript
Executable File

$(document).ready(function(){
// call the tablesorter plugin
$("table").tablesorter({
theme: 'blue',
// initialize zebra striping of the table
widgets: ['zebra','staticRow'],
// change the default striping class names
// updated in v2.1 to use widgetOptions.zebra = ["even", "odd"]
// widgetZebra: { css: [ "normal-row", "alt-row" ] } still works
widgetOptions : {
zebra : [ "normal-row", "alt-row" ]
}
});
$("#checkAll" ).click(function() {
$( "input:checkbox" ).attr('checked', this.checked);
});
});
var ajax_url = "index.php?module=EcmReports&action=helper&to_pdf=1";
function getDes(id) {
var params = {
id : id,
job : 'getDes'
};
$.ajax({
type: "POST",
url: ajax_url,
datatype : "json",
success: function(data) {
var html = "<button type='button' onclick='hide()'>Zamknij</button><br>";
if (data == '-1') {
html += "Nie ma opisów do wyświetlenia";
}else{
data = $.parseJSON(data);
html += "<table class='tablesorter tablesorter-blue'><tr><th width='30%'>Nazwa użytkownika</th><th width='20%'>Status</th><th width='50%'>Opis</th></tr>";
$.each(data, function(index, ob){
html += "<tr>";
html += "<td>"+ob.name+"</td>";
if(ob.accepted == '1'){
html += "<td>Zaakceptowany</td>";
}
if(ob.accepted == '0'){
html += "<td>Oczekujący</td>";
}
if(ob.accepted == '2'){
html += "<td>Odrzucony</td>";
}
tmp = "" +ob.accepteddes;
tmp = tmp.replace(/XVZC/g,"<br>");
html += "<td>"+tmp+"</td>";
html += "</tr>";
});
html +="</table>";
}
$('#raport').html(html);
$('#raport').show();
},
data: params
});
}
function hide() {
$('#raport').hide();
}