Files
backend/public/dist/js/archive.js
2024-02-01 09:53:53 +00:00

106 lines
3.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var fromDatee = "";
var toDatee = "";
function showLoaderScreen() {
$('.starter-loader-container').css('display', 'flex').hide().fadeIn();
}
function hideLoaderScreen() {
$('.starter-loader-container').fadeOut();
}
$(document).ready(function () {
var tablee = $('#examplee').DataTable({
// "pagingType": "full_numbers",
// dom: 'Bfrtip',
// "scrollX": true,
dom: 'lBfrtip',
"pagingType": "simple_numbers",
language: {
"sEmptyTable": "هیچ داده‌ای در جدول وجود ندارد",
"sInfo": "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
"sInfoEmpty": "نمایش 0 تا 0 از 0 ردیف",
"sInfoFiltered": "(فیلتر شده از _MAX_ ردیف)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "نمایش _MENU_ ردیف",
"sLoadingRecords": "در حال بارگزاری...",
"sProcessing": "در حال پردازش...",
"sSearch": "جستجو: ",
"sZeroRecords": "رکوردی با این مشخصات پیدا نشد",
"oPaginate": {
"sFirst": "برگه‌ی نخست",
"sLast": "برگه‌ی آخر",
"sNext": "بعدی",
"sPrevious": "قبلی"
},
"oAria": {
"sSortAscending": ": فعال سازی نمایش به صورت صعودی",
"sSortDescending": ": فعال سازی نمایش به صورت نزولی"
}
},
order: [[0, 'asc'], [2, 'pstring-desc']],
processing: true,
ajax: {
url: "/events/archive",
type: "GET",
dataSrc: function (json) {
// if (json.data[0])
// hideLoaderScreen()
// console.log("json", json)
// if (json.data[0].sub_projects.item!=unde){
// console.log(json.data[0][36].sub_projects.item)
// console.log(json.data[0][1].sub_projects[i].item)
return json.data;
},
},
"columns": [
{
data: null,
render: function (data, type, row, meta) {
// console.log(meta.row);
return meta.row + 1;
},
},
{ orderable: false, "data": "title" },
{ "data": "deadline" },
{ orderable: false, "data": "description" },
{
orderable: false,
className: "text-center",
"data": null,
render: function (data, type, row) {
if (data.files != null) {
return '<a href=' + data.files + ' download><button class="btn btn-danger btn-sm" title=" دانلود فایل"><i class="fa fa-download"></i></button></a> <button class="btn btn-warning btn-sm" title=" تاریخچه" onclick="window.open(`https://rms.rmto.ir/events/histories/' + data.id + '`)"><i class="fa fa-history"></i></button> <button class="btn btn-primary btn-sm" title=" دانلود تمامی فایل ها" disabled><i class="fa fa-file"></i></button>'
}
else return '<button class="btn btn-warning btn-sm" title=" تاریخچه" onclick="window.open(`https://rms.rmto.ir/events/histories/' + data.id + '`)"><i class="fa fa-history"></i></button> <button class="btn btn-primary btn-sm" title=" دانلود تمامی فایل ها" disabled><i class="fa fa-file"></i></button>'
}
},
],
buttons: [
{
extend: 'excelHtml5',
title: 'Excel',
text: 'خروجی به اکسل',
messageTop: ' آرشیو اطلاعیه ها ',
// header : true,
//Columns to export
exportOptions: {
columns: [0, 1, 2, 3]
}
}
]
});
});