3682 lines
103 KiB
JavaScript
3682 lines
103 KiB
JavaScript
// const { default: Swal } = require("sweetalert2");
|
|
Chart.defaults.global.defaultFontFamily = 'IRANSansFaNum';
|
|
var province,
|
|
town,
|
|
axisName,
|
|
axisType,
|
|
projectTitle,
|
|
contractor,
|
|
consultant,
|
|
contractDate,
|
|
contractPrice,
|
|
contractDatePicker;
|
|
var footercount = null;
|
|
var footercount2 = null
|
|
var footercount3 = null
|
|
var footercount4 = null
|
|
var footercount5 = null
|
|
var footercount6 = null
|
|
|
|
var provinces = [];
|
|
var tablefirst;
|
|
var tablesecond;
|
|
var tablethird;
|
|
var tablefourth;
|
|
var tablefifth;
|
|
var tablesix;
|
|
|
|
var flagshown = 0
|
|
var endadate;
|
|
var province_id;
|
|
var showDetails = true
|
|
var chartColors = [
|
|
'rgba(255, 99, 132, 0.6)',
|
|
'rgba(54, 162, 235, 0.6)',
|
|
'rgba(255, 206, 86, 0.6)',
|
|
'rgba(75, 192, 192, 0.6)',
|
|
'rgba(153, 102, 255, 0.6)',
|
|
'rgba(255, 159, 64, 0.6)',
|
|
'rgba(255, 64, 159, 0.6)',
|
|
'rgba(159, 255, 64, 0.6)',
|
|
'rgba(255, 64, 255, 0.6)',
|
|
'rgba(159, 159, 64, 0.6)',
|
|
'rgb(200, 221, 247 , 0.6)',
|
|
'rgb(200, 221, 166 , 0.6)',
|
|
'rgb(115, 221, 166 , 0.6)',
|
|
];
|
|
// endadate = $("#endclock").persianDatepicker({
|
|
// format: "YYYY/MM/DD",
|
|
// initialValue: false,
|
|
// autoClose: true,
|
|
// });
|
|
function showLoaderScreen() {
|
|
$(".starter-loader-container").css("display", "flex").hide().fadeIn();
|
|
}
|
|
|
|
function hideLoaderScreen() {
|
|
$(".starter-loader-container").fadeOut();
|
|
}
|
|
$(document).ready(function () {
|
|
// getProvinces();
|
|
endadate = $("#endclock").persianDatepicker({
|
|
format: "YYYY/MM/DD",
|
|
initialValue: false,
|
|
autoClose: true,
|
|
});
|
|
|
|
|
|
tablefirst = $("#example-update").DataTable({
|
|
dom: '<"maxbar">lBfrtip',
|
|
// scrollX: true,
|
|
destroy: true,
|
|
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"]],
|
|
processing: true,
|
|
ajax: {
|
|
url: "https://rms.rmto.ir/rahdari/road-maintenance-project/getstat",
|
|
type: "GET",
|
|
dataSrc: function (json) {
|
|
console.log(json);
|
|
console.log(json.data.sum)
|
|
footercount = json.data.sum
|
|
showpie(footercount)
|
|
return json.data.stat;
|
|
},
|
|
},
|
|
columns: [
|
|
{
|
|
data: "proviceName",
|
|
},
|
|
{
|
|
data: "cityName",
|
|
},
|
|
{ data: "projectsCount" },
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 13;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 13;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 12;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 12;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 12;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 2)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 12;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 2)
|
|
return data[Object.keys(data)[keyIndex]][3];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 7;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 7;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 7;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 8;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 8;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 8;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 9;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 9;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 9;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 10;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 10;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 10;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 11;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 11;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 11;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
if (data[Object.keys(data)[keyIndex]].length > 1)
|
|
return data[Object.keys(data)[keyIndex]][2];
|
|
else return "-";
|
|
}
|
|
},
|
|
},
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
extend: "excelHtml5",
|
|
title: "Excel",
|
|
text: "خروجی به اکسل",
|
|
messageTop: " عملکرد پروژه های نگهداری راه ",
|
|
},
|
|
// {
|
|
// text: "فیلتر",
|
|
// action: function (e, dt, node, config) {
|
|
// $("#endclock").val("")
|
|
// $("#province-id").val(0);
|
|
// $("#town-id").val(0);
|
|
// $("#axis0").prop("checked", false);
|
|
// $("#axis1").prop("checked", false);
|
|
// $("#axis2").prop("checked", false);
|
|
// $("#axis3").prop("checked", false);
|
|
// $("#axis4").prop("checked", false);
|
|
// $("#project-filter-modal").modal('show')
|
|
// },
|
|
// },
|
|
],
|
|
footerCallback: function (row, data, start, end, display) {
|
|
var api = this.api();
|
|
|
|
console.log(footercount);
|
|
// Update footer
|
|
$(api.column(0).footer()).html("مجموع");
|
|
if (footercount != null) {
|
|
$(api.column(1).footer()).html("مجموع");
|
|
$(api.column(2).footer()).html(footercount[0]);
|
|
$(api.column(3).footer()).html(footercount[4]);
|
|
$(api.column(4).footer()).html("_");
|
|
$(api.column(5).footer()).html(footercount[5]);
|
|
$(api.column(6).footer()).html(footercount[6]);
|
|
$(api.column(7).footer()).html(footercount[7]);
|
|
$(api.column(8).footer()).html("_");
|
|
$(api.column(9).footer()).html(footercount[8]);
|
|
$(api.column(10).footer()).html(footercount[9]);
|
|
$(api.column(11).footer()).html("_");
|
|
$(api.column(12).footer()).html(footercount[10]);
|
|
$(api.column(13).footer()).html(footercount[11]);
|
|
$(api.column(14).footer()).html("_");
|
|
$(api.column(15).footer()).html(footercount[12]);
|
|
$(api.column(16).footer()).html(footercount[13]);
|
|
$(api.column(17).footer()).html("_");
|
|
$(api.column(18).footer()).html(footercount[14]);
|
|
$(api.column(19).footer()).html(footercount[15]);
|
|
$(api.column(20).footer()).html("_");
|
|
$(api.column(21).footer()).html(footercount[16]);
|
|
$(api.column(22).footer()).html(footercount[17]);
|
|
$(api.column(23).footer()).html("_");
|
|
$(api.column(24).footer()).html(footercount[18]);
|
|
$(api.column(25).footer()).html(footercount[19]);
|
|
$(api.column(26).footer()).html("_");
|
|
$(api.column(27).footer()).html(footercount[20]);
|
|
$(api.column(28).footer()).html(footercount[21]);
|
|
$(api.column(29).footer()).html("_");
|
|
$(api.column(30).footer()).html(footercount[22]);
|
|
$(api.column(31).footer()).html(footercount[23]);
|
|
$(api.column(32).footer()).html("_");
|
|
$(api.column(33).footer()).html(footercount[24]);
|
|
$(api.column(34).footer()).html(footercount[25]);
|
|
$(api.column(35).footer()).html("_");
|
|
$(api.column(36).footer()).html(footercount[26]);
|
|
$(api.column(37).footer()).html(footercount[27]);
|
|
$(api.column(38).footer()).html("_");
|
|
$(api.column(39).footer()).html(footercount[28]);
|
|
$(api.column(40).footer()).html(footercount[29]);
|
|
$(api.column(41).footer()).html("_");
|
|
// $(api.column(42).footer()).html("_");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
},
|
|
});
|
|
});
|
|
function getProvinces() {
|
|
let reqUrl = "https://rms.rmto.ir/public/contents/provinces";
|
|
// showLoaderScreen();
|
|
$.ajax({
|
|
url: reqUrl,
|
|
type: "GET",
|
|
success: function (result) {
|
|
hideLoaderScreen();
|
|
//console.log(result);
|
|
provinces = result.data;
|
|
$("#province-id").empty();
|
|
$("#province-id").append('<option value="0">انتخاب اداره کل</option>');
|
|
for (let index = 0; index < provinces.length; index++) {
|
|
$("#province-id").append(
|
|
"\
|
|
<option value=" +
|
|
provinces[index].id +
|
|
">" +
|
|
provinces[index].name_fa +
|
|
"</option>\
|
|
"
|
|
);
|
|
}
|
|
},
|
|
error: function (error) {
|
|
// hideLoaderScreen();
|
|
//console.log(error);
|
|
},
|
|
});
|
|
}
|
|
|
|
$("#filtertable").on("click", function () {
|
|
|
|
$("#axis0").prop("checked", false);
|
|
$("#axis1").prop("checked", false);
|
|
$("#axis2").prop("checked", false);
|
|
$("#axis3").prop("checked", false);
|
|
$("#axis4").prop("checked", false);
|
|
|
|
$("#project-filter-modal").modal("show");
|
|
$("#province-id").empty();
|
|
$("#province-id").append('<option value="0">انتخاب اداره کل</option>');
|
|
// getProvinces();
|
|
for (let index = 0; index < provinces.length; index++) {
|
|
$("#province-id").append(
|
|
"\
|
|
<option value=" +
|
|
provinces[index].id +
|
|
">" +
|
|
provinces[index].name_fa +
|
|
"</option>\
|
|
"
|
|
);
|
|
}
|
|
});
|
|
getProvinces();
|
|
$("#province-id").on("change", function () {
|
|
getTowns($(this).val());
|
|
if ((value = $(this).val()) && $(this).val() != 0) {
|
|
province_id = provinces[value - 1].id;
|
|
}
|
|
})
|
|
function getTowns(id) {
|
|
let reqUrl = "https://rms.rmto.ir/public/contents/provinces/" + id;
|
|
// showLoaderScreen();
|
|
$.ajax({
|
|
url: reqUrl,
|
|
type: "GET",
|
|
success: function (result) {
|
|
// hideLoaderScreen();
|
|
console.log(result);
|
|
towns = result.data;
|
|
$("#town-id").empty();
|
|
$("#town-id").append('<option value="0">انتخاب شهرستان</option>');
|
|
|
|
for (let index = 0; index < towns.length; index++) {
|
|
|
|
$("#town-id").append(
|
|
"\
|
|
<option value=" +
|
|
towns[index].id +
|
|
">" +
|
|
towns[index].name_fa +
|
|
"</option>\
|
|
"
|
|
);
|
|
}
|
|
|
|
},
|
|
error: function (error) {
|
|
hideLoaderScreen();
|
|
//console.log(error);
|
|
},
|
|
});
|
|
}
|
|
$("#province-id").change(function () {
|
|
if ((value = $(this).val()) && $(this).val() != 0) {
|
|
province_id = provinces[value - 1].id;
|
|
}
|
|
|
|
});
|
|
$("#cancelbutton").on("click", function () {
|
|
$("#project-filter-modal").modal("hide");
|
|
});
|
|
$("#filteraddtabel").on("click", function () {
|
|
console.log("flagg", flagshown)
|
|
var axisarray = [];
|
|
let endDate
|
|
if ($("#endclock").val() != "") {
|
|
endDate = moment(
|
|
endadate.getState().selected.year +
|
|
"/" +
|
|
endadate.getState().selected.month +
|
|
"/" +
|
|
endadate.getState().selected.date,
|
|
"jYYYY/jM/jD"
|
|
).format("YYYY-MM-DD");
|
|
}
|
|
|
|
if (!$("#axis0").is(":checked")) {
|
|
if ($("#axis1").is(":checked")) {
|
|
axisarray.push(1);
|
|
test += 1 + ",";
|
|
}
|
|
if ($("#axis2").is(":checked")) {
|
|
axisarray.push(2);
|
|
test += 2 + ",";
|
|
}
|
|
|
|
if ($("#axis3").is(":checked")) {
|
|
axisarray.push(3);
|
|
test += 3 + ",";
|
|
}
|
|
if ($("#axis4").is(":checked")) {
|
|
axisarray.push(4);
|
|
test += 4 + ",";
|
|
}
|
|
} else {
|
|
axisarray.push(1);
|
|
axisarray.push(2);
|
|
axisarray.push(3);
|
|
axisarray.push(4);
|
|
}
|
|
var x = axisarray.toString();
|
|
console.log("x", x);
|
|
console.log("endDate ", endDate)
|
|
console.log(" province_id ", province_id)
|
|
|
|
showLoaderScreen()
|
|
var test = ""
|
|
var objectkol = ""
|
|
var city_idd = $("#town-id").val()
|
|
console.log("chh", city_idd)
|
|
var city_choose = "&city-id=" + city_idd
|
|
console.log("city_choose", city_choose)
|
|
// test
|
|
if ((axisarray.length != 0) && (endDate != undefined) && (province_id != undefined)) {
|
|
if (city_idd != 0 ) {
|
|
console.log("ji")
|
|
|
|
objectkol = "?axis-types=" + x + "&end-date=" + endDate + "&province-id=" + province_id + city_choose
|
|
}
|
|
else {
|
|
|
|
objectkol = "?axis-types=" + x + "&end-date=" + endDate + "&province-id=" + province_id
|
|
}
|
|
|
|
}
|
|
else if ((axisarray.length == 0) && (endDate != undefined) && (province_id != undefined)) {
|
|
if (city_idd != 0) {
|
|
objectkol = "?end-date=" + endDate + "&province-id=" + province_id + city_choose
|
|
}
|
|
else {
|
|
objectkol = "?end-date=" + endDate + "&province-id=" + province_id
|
|
}
|
|
|
|
}
|
|
else if ((axisarray.length == 0) && (endDate == undefined) && (province_id != undefined)) {
|
|
if (city_idd != 0) {
|
|
objectkol = "?province-id=" + province_id + city_choose
|
|
|
|
}
|
|
else {
|
|
|
|
objectkol = "?province-id=" + province_id
|
|
}
|
|
|
|
}
|
|
else if ((axisarray.length == 0) && (endDate == undefined) && (province_id == undefined)) {
|
|
hideLoaderScreen()
|
|
Swal.fire({
|
|
icon: "error",
|
|
title: "خطا",
|
|
text: " لطفا یکی از موارد را انتخاب کنید . ",
|
|
confirmButtonText: "بستن",
|
|
});
|
|
}
|
|
else if ((axisarray.length == 0) && (endDate != undefined) && (province_id == undefined)) {
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-maintenance-project/getstat" +
|
|
"?end-date=" +
|
|
endDate,
|
|
)
|
|
objectkol = "?end-date=" +
|
|
endDate
|
|
}
|
|
else if ((axisarray.length != 0) && (endDate == undefined) && (province_id == undefined)) {
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-maintenance-project/getstat" +
|
|
"?axis-types=" +
|
|
x
|
|
)
|
|
objectkol = "?axis-types=" +
|
|
x
|
|
|
|
|
|
}
|
|
else if ((axisarray.length != 0) && (endDate == undefined) && (province_id != undefined)) {
|
|
if (city_idd != 0) {
|
|
|
|
objectkol = "?axis-types=" +
|
|
x +
|
|
"&province-id=" +
|
|
province_id + city_choose
|
|
}
|
|
else {
|
|
|
|
objectkol = "?axis-types=" +
|
|
x +
|
|
"&province-id=" +
|
|
province_id
|
|
}
|
|
|
|
|
|
}
|
|
else if ((axisarray.length == 0) && (endDate != undefined) && (province_id != undefined)) {
|
|
if (city_idd != 0) {
|
|
objectkol = "?end-date=" +
|
|
endDate +
|
|
"&province-id=" +
|
|
province_id + city_choose
|
|
}
|
|
else {
|
|
|
|
objectkol = "?end-date=" +
|
|
endDate +
|
|
"&province-id=" +
|
|
province_id
|
|
|
|
}
|
|
|
|
|
|
}
|
|
else if ((axisarray.length != 0) && (endDate != undefined) && (province_id == undefined)) {
|
|
|
|
objectkol = "?axis-types=" +
|
|
x +
|
|
"&end-date=" +
|
|
endDate
|
|
|
|
|
|
|
|
}
|
|
console.log("objj", objectkol)
|
|
//test
|
|
if (flagshown == 0) {
|
|
hideLoaderScreen()
|
|
$("#project-filter-modal").modal("hide");
|
|
$("#example-update")
|
|
.DataTable()
|
|
.ajax.url("https://rms.rmto.ir/rahdari/road-maintenance-project/getstat" + objectkol)
|
|
.load();
|
|
// $.ajax({
|
|
// url: "https://rms.rmto.ir/rahdari/road-maintenance-project/getstat" +
|
|
// objectkol,
|
|
// type: "GET",
|
|
// success: function (result) {
|
|
// console.log("pitikoooo11111")
|
|
// console.log("resultttt", result.data);
|
|
// hideLoaderScreen()
|
|
// $("#project-filter-modal").modal("hide");
|
|
// if (result.data.stat.length != 0) {
|
|
// $("#example-update").dataTable().fnClearTable();
|
|
// $("#example-update").dataTable().fnAddData(result.data.stat);
|
|
// }
|
|
// else {
|
|
|
|
// $("#example-update").dataTable().fnClearTable();
|
|
// }
|
|
// // $("#example-update").dataTable().fnAddData(result.data.stat);
|
|
// footercount = result.data.sum
|
|
|
|
// console.log("kookoo", footercount)
|
|
// showpie(footercount)
|
|
// },
|
|
// error: function (error) {
|
|
// console.log(error);
|
|
// hideLoaderScreen()
|
|
// Swal.fire({
|
|
// icon: "error",
|
|
// title: "خطا",
|
|
// confirmButtonText: "بستن",
|
|
// });
|
|
// },
|
|
// });
|
|
}
|
|
else if (flagshown == 2) {
|
|
console.log("objectko", objectkol)
|
|
|
|
console.log("hi")
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-danger-prevention/getstat" +
|
|
objectkol
|
|
|
|
)
|
|
hideLoaderScreen()
|
|
$("#project-filter-modal").modal("hide");
|
|
$("#example-update2")
|
|
.DataTable()
|
|
.ajax.url("https://rms.rmto.ir/rahdari/road-danger-prevention/getstat" + objectkol)
|
|
.load();
|
|
// $.ajax({
|
|
// url: "https://rms.rmto.ir/rahdari/road-danger-prevention/getstat" +
|
|
// objectkol,
|
|
// type: "GET",
|
|
// success: function (result) {
|
|
// console.log(result.data);
|
|
// hideLoaderScreen()
|
|
// $("#project-filter-modal").modal("hide");
|
|
// if (result.data.stat.length != 0) {
|
|
// $("#example-update2").dataTable().fnClearTable();
|
|
// $("#example-update2").dataTable().fnAddData(result.data.stat);
|
|
// }
|
|
// else {
|
|
|
|
// $("#example-update2").dataTable().fnClearTable();
|
|
// }
|
|
// footercount2 = result.data.sum
|
|
|
|
// },
|
|
// error: function (error) {
|
|
// console.log(error);
|
|
// hideLoaderScreen()
|
|
// Swal.fire({
|
|
// icon: "error",
|
|
// title: "خطا",
|
|
// confirmButtonText: "بستن",
|
|
// });
|
|
// },
|
|
// });
|
|
}
|
|
else if (flagshown == 3) {
|
|
console.log("objectko", objectkol)
|
|
|
|
console.log("#3")
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-upgrade-safety/getstat" +
|
|
objectkol
|
|
|
|
)
|
|
hideLoaderScreen()
|
|
$("#project-filter-modal").modal("hide");
|
|
$("#example-update3")
|
|
.DataTable()
|
|
.ajax.url("https://rms.rmto.ir/rahdari/road-upgrade-safety/getstat" + objectkol)
|
|
.load();
|
|
// $.ajax({
|
|
// url: "https://rms.rmto.ir/rahdari/road-upgrade-safety/getstat" +
|
|
// objectkol,
|
|
// type: "GET",
|
|
// success: function (result) {
|
|
// console.log(result.data);
|
|
// $("#project-filter-modal").modal("hide");
|
|
// hideLoaderScreen()
|
|
// if (result.data.stat.length != 0) {
|
|
// $("#example-update3").dataTable().fnClearTable();
|
|
// $("#example-update3").dataTable().fnAddData(result.data.stat);
|
|
// }
|
|
// else {
|
|
|
|
// $("#example-update3").dataTable().fnClearTable();
|
|
// }
|
|
// footercount3 = result.data.sum
|
|
// },
|
|
// error: function (error) {
|
|
// console.log(error);
|
|
// hideLoaderScreen()
|
|
// Swal.fire({
|
|
// icon: "error",
|
|
// title: "خطا",
|
|
// confirmButtonText: "بستن",
|
|
// });
|
|
// },
|
|
// });
|
|
}
|
|
else if (flagshown == 4) {
|
|
console.log("objectko", objectkol)
|
|
|
|
console.log("#4")
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-technical-building/getstat" +
|
|
"?axis-types=" +
|
|
x +
|
|
"&end-date=" +
|
|
endDate
|
|
|
|
)
|
|
hideLoaderScreen()
|
|
$("#project-filter-modal").modal("hide");
|
|
$("#example-update4")
|
|
.DataTable()
|
|
.ajax.url("https://rms.rmto.ir/rahdari/road-technical-building/getstat" + objectkol)
|
|
.load();
|
|
// $.ajax({
|
|
// url: "https://rms.rmto.ir/rahdari/road-technical-building/getstat" +
|
|
// objectkol,
|
|
// type: "GET",
|
|
// success: function (result) {
|
|
// console.log(result.data);
|
|
// hideLoaderScreen()
|
|
// $("#project-filter-modal").modal("hide");
|
|
// if (result.data.stat.length != 0) {
|
|
// $("#example-update4").dataTable().fnClearTable();
|
|
// $("#example-update4").dataTable().fnAddData(result.data.stat);
|
|
// }
|
|
// else {
|
|
|
|
// $("#example-update4").dataTable().fnClearTable();
|
|
// }
|
|
// footercount4 = result.data.sum
|
|
// },
|
|
// error: function (error) {
|
|
// console.log(error);
|
|
// hideLoaderScreen()
|
|
// Swal.fire({
|
|
// icon: "error",
|
|
// title: "خطا",
|
|
// confirmButtonText: "بستن",
|
|
// });
|
|
// },
|
|
// });
|
|
}
|
|
else if (flagshown == 5) {
|
|
console.log("objectko", objectkol)
|
|
|
|
console.log("#5")
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-tollhouse-management/getstat" +
|
|
"?axis-types=" +
|
|
x +
|
|
"&end-date=" +
|
|
endDate
|
|
|
|
)
|
|
hideLoaderScreen()
|
|
$("#project-filter-modal").modal("hide");
|
|
$("#example-update5")
|
|
.DataTable()
|
|
.ajax.url("https://rms.rmto.ir/rahdari/road-tollhouse-management/getstat" + objectkol)
|
|
.load();
|
|
// $.ajax({
|
|
// url: "https://rms.rmto.ir/rahdari/road-tollhouse-management/getstat" +
|
|
// objectkol,
|
|
// type: "GET",
|
|
// success: function (result) {
|
|
// console.log(result.data);
|
|
// hideLoaderScreen()
|
|
// $("#project-filter-modal").modal("hide");
|
|
// if (result.data.stat.length != 0) {
|
|
// $("#example-update5").dataTable().fnClearTable();
|
|
// $("#example-update5").dataTable().fnAddData(result.data.stat);
|
|
// }
|
|
// else {
|
|
|
|
// $("#example-update5").dataTable().fnClearTable();
|
|
// }
|
|
// footercount5 = result.data.sum
|
|
// },
|
|
// error: function (error) {
|
|
// console.log(error);
|
|
// hideLoaderScreen()
|
|
// Swal.fire({
|
|
// icon: "error",
|
|
// title: "خطا",
|
|
// confirmButtonText: "بستن",
|
|
// });
|
|
// },
|
|
// });
|
|
}
|
|
else if (flagshown == 6) {
|
|
console.log("objectko", objectkol)
|
|
console.log("#6")
|
|
console.log(
|
|
"https://rms.rmto.ir/rahdari/road-construction-rural/getstat" +
|
|
"?axis-types=" +
|
|
x +
|
|
"&end-date=" +
|
|
endDate
|
|
|
|
)
|
|
hideLoaderScreen()
|
|
$("#project-filter-modal").modal("hide");
|
|
$("#example-update6")
|
|
.DataTable()
|
|
.ajax.url("https://rms.rmto.ir/rahdari/road-construction-rural/getstat" + objectkol)
|
|
.load();
|
|
// $.ajax({
|
|
// url: "https://rms.rmto.ir/rahdari/road-construction-rural/getstat" +
|
|
// objectkol,
|
|
// type: "GET",
|
|
// success: function (result) {
|
|
// console.log(result.data);
|
|
// hideLoaderScreen()
|
|
// $("#project-filter-modal").modal("hide");
|
|
// if (result.data.stat.length != 0) {
|
|
// $("#example-update6").dataTable().fnClearTable();
|
|
// $("#example-update6").dataTable().fnAddData(result.data.stat);
|
|
// }
|
|
// else {
|
|
|
|
// $("#example-update6").dataTable().fnClearTable();
|
|
// }
|
|
// footercount6 = result.data.sum
|
|
// },
|
|
// error: function (error) {
|
|
// console.log(error);
|
|
// hideLoaderScreen()
|
|
// Swal.fire({
|
|
// icon: "error",
|
|
// title: "خطا",
|
|
// confirmButtonText: "بستن",
|
|
// });
|
|
// },
|
|
// });
|
|
}
|
|
|
|
|
|
});
|
|
function showpie(sum) {
|
|
console.log("DDDd", sum)
|
|
$('#myChart').remove(); // this is my <canvas> element
|
|
$('#graph-container1').append('<canvas id="myChart" style="width: 300px !important; height: 300px !important;"><canvas>');
|
|
$('#myyChart').remove(); // this is my <canvas> element
|
|
$('#graph-container2').append('<canvas id="myyChart" style="width: 300px !important; height: 300px !important;"><canvas>');
|
|
$('#myChartt').remove(); // this is my <canvas> element
|
|
$('#graph-container3').append('<canvas id="myChartt" style="width: 300px !important; height: 300px !important;"><canvas>');
|
|
console.log("testtpitikooo", sum)
|
|
var ctx = document.getElementById("myChart").getContext("2d");
|
|
var myChart = new Chart(ctx, {
|
|
type: 'bar',
|
|
data:
|
|
{
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
'بازیافت سرد و گرم',
|
|
' میکروسرفیسینگ ',
|
|
' چیپ سیل',
|
|
' اسلاری سیل',
|
|
' اسکراب سیل',
|
|
' فوگ سیل',
|
|
' سیل کت',
|
|
' کیپ سیل',
|
|
' آسفالت سرد ردمیکس'
|
|
],
|
|
datasets: [{
|
|
label: 'کیلومتر ',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
borderWidth: 1,
|
|
data: [sum[4], sum[5], sum[8], sum[10], sum[12], sum[14], sum[16], sum[18], sum[20], sum[22], sum[24], sum[26], sum[28]],
|
|
|
|
}, {
|
|
label: 'تناژ',
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
borderWidth: 1,
|
|
data: [0, sum[7], sum[9], sum[11], sum[13], sum[15], sum[17], sum[19], sum[21], sum[23], sum[25], sum[27], sum[29]],
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'top',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های انجام شده تاکنون',
|
|
position: 'bottom'
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: true,
|
|
|
|
}
|
|
}]
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
}
|
|
}
|
|
});
|
|
|
|
var cctx = document.getElementById("myyChart").getContext("2d");
|
|
|
|
var myChart = new Chart(cctx, {
|
|
type: 'doughnut',
|
|
data: {
|
|
datasets: [{
|
|
// data: [footercount[4], footercount[5], footercount[8], footercount[10], footercount[12], footercount[14], footercount[16], footercount[18], footercount[20], footercount[22], footercount[24], footercount[26], footercount[28]],
|
|
data: [sum[4], sum[5], sum[8], sum[10], sum[12], sum[14], sum[16], sum[18], sum[20], sum[22], sum[24], sum[26], sum[28]],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[7],
|
|
chartColors[8],
|
|
chartColors[9],
|
|
chartColors[10],
|
|
chartColors[11],
|
|
chartColors[12],
|
|
|
|
|
|
|
|
],
|
|
label: 'تفکیک پروژه های راهداری'
|
|
}],
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
'بازیافت سرد و گرم',
|
|
' میکروسرفیسینگ ',
|
|
' چیپ سیل',
|
|
' اسلاری سیل',
|
|
' اسکراب سیل',
|
|
' فوگ سیل',
|
|
' سیل کت',
|
|
' کیپ سیل',
|
|
' آسفالت سرد ردمیکس'
|
|
]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'left',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های راهداری',
|
|
position: 'bottom'
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
},
|
|
|
|
|
|
|
|
}
|
|
});
|
|
var ctxx = document.getElementById("myChartt").getContext("2d");
|
|
var myChart = new Chart(ctxx, {
|
|
type: 'line',
|
|
data: {
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
'بازیافت سرد و گرم',
|
|
' میکروسرفیسینگ ',
|
|
' چیپ سیل',
|
|
' اسلاری سیل',
|
|
' اسکراب سیل',
|
|
' فوگ سیل',
|
|
' سیل کت',
|
|
' کیپ سیل',
|
|
' آسفالت سرد ردمیکس'
|
|
],
|
|
datasets: [{
|
|
label: ' کیلومتر',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
data: [sum[4], sum[5], sum[8], sum[10], sum[12], sum[14], sum[16], sum[18], sum[20], sum[22], sum[24], sum[26], sum[28]],
|
|
fill: false,
|
|
fontFamily: "IRANSans"
|
|
}, {
|
|
label: ' تناژ',
|
|
fill: false,
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
data: [0, sum[7], sum[9], sum[11], sum[13], sum[15], sum[17], sum[19], sum[21], sum[23], sum[25], sum[27], sum[29]],
|
|
}]
|
|
},
|
|
options: {
|
|
data: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
datasets: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
responsive: true,
|
|
labels: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
legend: {
|
|
display: showDetails,
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontFamily: 'IRANSans',
|
|
|
|
|
|
},
|
|
title: {
|
|
fontFamily: 'IRANSans',
|
|
},
|
|
|
|
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'نسبت پیشرفت فیزیکی به ریالی',
|
|
position: 'bottom',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails,
|
|
mode: 'index',
|
|
intersect: false,
|
|
titleFontFamily: "IRANSans"
|
|
},
|
|
hover: {
|
|
mode: 'nearest',
|
|
intersect: true
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'ماه',
|
|
fontFamily: "IRANSans"
|
|
}
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'مقدار',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
ticks: {
|
|
fontFamily: "IRANSans",
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
}
|
|
//second
|
|
function showpie2(sum) {
|
|
var dynamiclables = []
|
|
var dynamicdata = []
|
|
console.log("sum", sum[0].cityName)
|
|
for (var i = 0; i < sum.length; i++) {
|
|
dynamiclables.push(sum[i].cityName)
|
|
}
|
|
console.log("dynamiclables", dynamiclables)
|
|
var ctx2 = document.getElementById("myChart2").getContext("2d");
|
|
// for (var i=0 ; i<=)
|
|
var myChart = new Chart(ctx2, {
|
|
type: 'bar',
|
|
data:
|
|
{
|
|
|
|
labels: dynamiclables,
|
|
datasets: [{
|
|
label: 'درصد پیشرفت ',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
borderWidth: 1,
|
|
data: [12],
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'top',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های انجام شده تاکنون',
|
|
position: 'bottom'
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: true,
|
|
}
|
|
}]
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
}
|
|
}
|
|
});
|
|
var cctx2 = document.getElementById("myyChart2").getContext("2d");
|
|
var myChart = new Chart(cctx2, {
|
|
type: 'doughnut',
|
|
data: {
|
|
datasets: [{
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[7]
|
|
|
|
],
|
|
label: 'تفکیک پروژه های راهداری'
|
|
}],
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
' اسلاری سیل ',
|
|
' کیپ سیل',
|
|
'فوگ سیل',
|
|
'سیل کت'
|
|
]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'left',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های راهداری',
|
|
position: 'bottom'
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
},
|
|
|
|
|
|
|
|
}
|
|
});
|
|
var ctxx2 = document.getElementById("myChartt2").getContext("2d");
|
|
var myChart = new Chart(ctxx2, {
|
|
type: 'line',
|
|
data: {
|
|
labels: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور'],
|
|
datasets: [{
|
|
label: 'پیشرفت فیزیکی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
fill: false,
|
|
fontFamily: "IRANSans"
|
|
}, {
|
|
label: 'پیشرفت ریالی',
|
|
fill: false,
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
data: [12, 2, 90, 5, 80, 3],
|
|
}]
|
|
},
|
|
options: {
|
|
data: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
datasets: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
responsive: true,
|
|
labels: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
legend: {
|
|
display: showDetails,
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontFamily: 'IRANSans',
|
|
|
|
|
|
},
|
|
title: {
|
|
fontFamily: 'IRANSans',
|
|
},
|
|
|
|
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'نسبت پیشرفت فیزیکی به ریالی',
|
|
position: 'bottom',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails,
|
|
mode: 'index',
|
|
intersect: false,
|
|
titleFontFamily: "IRANSans"
|
|
},
|
|
hover: {
|
|
mode: 'nearest',
|
|
intersect: true
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'ماه',
|
|
fontFamily: "IRANSans"
|
|
}
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'مقدار',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
ticks: {
|
|
fontFamily: "IRANSans",
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//third
|
|
function showpie3(sum) {
|
|
var ctx3 = document.getElementById("myChart3").getContext("2d");
|
|
var myChart = new Chart(ctx3, {
|
|
type: 'bar',
|
|
data:
|
|
{
|
|
labels: ['مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
|
|
datasets: [{
|
|
label: 'راه روستایی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
}, {
|
|
label: 'راهداری',
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 9000],
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'top',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های انجام شده تاکنون',
|
|
position: 'bottom'
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: true,
|
|
labelString: '7 whole grain flakes'
|
|
}
|
|
}]
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
}
|
|
}
|
|
});
|
|
var cctx3 = document.getElementById("myyChart3").getContext("2d");
|
|
var myChart = new Chart(cctx3, {
|
|
type: 'doughnut',
|
|
data: {
|
|
datasets: [{
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[7]
|
|
|
|
],
|
|
label: 'تفکیک پروژه های راهداری'
|
|
}],
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
' اسلاری سیل ',
|
|
' کیپ سیل',
|
|
'فوگ سیل',
|
|
'سیل کت'
|
|
]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'left',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های راهداری',
|
|
position: 'bottom'
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
},
|
|
|
|
|
|
|
|
}
|
|
});
|
|
var ctxx3 = document.getElementById("myChartt3").getContext("2d");
|
|
var myChart = new Chart(ctxx3, {
|
|
type: 'line',
|
|
data: {
|
|
labels: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور'],
|
|
datasets: [{
|
|
label: 'پیشرفت فیزیکی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
fill: false,
|
|
fontFamily: "IRANSans"
|
|
}, {
|
|
label: 'پیشرفت ریالی',
|
|
fill: false,
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
data: [12, 2, 90, 5, 80, 3],
|
|
}]
|
|
},
|
|
options: {
|
|
data: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
datasets: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
responsive: true,
|
|
labels: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
legend: {
|
|
display: showDetails,
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontFamily: 'IRANSans',
|
|
|
|
|
|
},
|
|
title: {
|
|
fontFamily: 'IRANSans',
|
|
},
|
|
|
|
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'نسبت پیشرفت فیزیکی به ریالی',
|
|
position: 'bottom',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails,
|
|
mode: 'index',
|
|
intersect: false,
|
|
titleFontFamily: "IRANSans"
|
|
},
|
|
hover: {
|
|
mode: 'nearest',
|
|
intersect: true
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'ماه',
|
|
fontFamily: "IRANSans"
|
|
}
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'مقدار',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
ticks: {
|
|
fontFamily: "IRANSans",
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//fourth
|
|
function showpie4(sum) {
|
|
var ctx4 = document.getElementById("myChart4").getContext("2d");
|
|
var myChart = new Chart(ctx4, {
|
|
type: 'bar',
|
|
data:
|
|
{
|
|
labels: ['مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
|
|
datasets: [{
|
|
label: 'راه روستایی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
}, {
|
|
label: 'راهداری',
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 9000],
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'top',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های انجام شده تاکنون',
|
|
position: 'bottom'
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: true,
|
|
labelString: '7 whole grain flakes'
|
|
}
|
|
}]
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
}
|
|
}
|
|
});
|
|
var cctx4 = document.getElementById("myyChart4").getContext("2d");
|
|
var myChart = new Chart(cctx4, {
|
|
type: 'doughnut',
|
|
data: {
|
|
datasets: [{
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[7]
|
|
|
|
],
|
|
label: 'تفکیک پروژه های راهداری'
|
|
}],
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
' اسلاری سیل ',
|
|
' کیپ سیل',
|
|
'فوگ سیل',
|
|
'سیل کت'
|
|
]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'left',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های راهداری',
|
|
position: 'bottom'
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
},
|
|
|
|
|
|
|
|
}
|
|
});
|
|
var ctxx4 = document.getElementById("myChartt4").getContext("2d");
|
|
var myChart = new Chart(ctxx4, {
|
|
type: 'line',
|
|
data: {
|
|
labels: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور'],
|
|
datasets: [{
|
|
label: 'پیشرفت فیزیکی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
fill: false,
|
|
fontFamily: "IRANSans"
|
|
}, {
|
|
label: 'پیشرفت ریالی',
|
|
fill: false,
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
data: [12, 2, 90, 5, 80, 3],
|
|
}]
|
|
},
|
|
options: {
|
|
data: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
datasets: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
responsive: true,
|
|
labels: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
legend: {
|
|
display: showDetails,
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontFamily: 'IRANSans',
|
|
|
|
|
|
},
|
|
title: {
|
|
fontFamily: 'IRANSans',
|
|
},
|
|
|
|
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'نسبت پیشرفت فیزیکی به ریالی',
|
|
position: 'bottom',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails,
|
|
mode: 'index',
|
|
intersect: false,
|
|
titleFontFamily: "IRANSans"
|
|
},
|
|
hover: {
|
|
mode: 'nearest',
|
|
intersect: true
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'ماه',
|
|
fontFamily: "IRANSans"
|
|
}
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'مقدار',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
ticks: {
|
|
fontFamily: "IRANSans",
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//fifth
|
|
function showpie5(sum) {
|
|
var ctx5 = document.getElementById("myChart5").getContext("2d");
|
|
var myChart = new Chart(ctx5, {
|
|
type: 'bar',
|
|
data:
|
|
{
|
|
labels: ['مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
|
|
datasets: [{
|
|
label: 'راه روستایی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
}, {
|
|
label: 'راهداری',
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 9000],
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'top',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های انجام شده تاکنون',
|
|
position: 'bottom'
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: true,
|
|
labelString: '7 whole grain flakes'
|
|
}
|
|
}]
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
}
|
|
}
|
|
});
|
|
var cctx5 = document.getElementById("myyChart5").getContext("2d");
|
|
var myChart = new Chart(cctx5, {
|
|
type: 'doughnut',
|
|
data: {
|
|
datasets: [{
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[7]
|
|
|
|
],
|
|
label: 'تفکیک پروژه های راهداری'
|
|
}],
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
' اسلاری سیل ',
|
|
' کیپ سیل',
|
|
'فوگ سیل',
|
|
'سیل کت'
|
|
]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'left',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های راهداری',
|
|
position: 'bottom'
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
},
|
|
|
|
|
|
|
|
}
|
|
});
|
|
var ctxx5 = document.getElementById("myChartt5").getContext("2d");
|
|
var myChart = new Chart(ctxx5, {
|
|
type: 'line',
|
|
data: {
|
|
labels: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور'],
|
|
datasets: [{
|
|
label: 'پیشرفت فیزیکی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
fill: false,
|
|
fontFamily: "IRANSans"
|
|
}, {
|
|
label: 'پیشرفت ریالی',
|
|
fill: false,
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
data: [12, 2, 90, 5, 80, 3],
|
|
}]
|
|
},
|
|
options: {
|
|
data: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
datasets: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
responsive: true,
|
|
labels: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
legend: {
|
|
display: showDetails,
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontFamily: 'IRANSans',
|
|
|
|
|
|
},
|
|
title: {
|
|
fontFamily: 'IRANSans',
|
|
},
|
|
|
|
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'نسبت پیشرفت فیزیکی به ریالی',
|
|
position: 'bottom',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails,
|
|
mode: 'index',
|
|
intersect: false,
|
|
titleFontFamily: "IRANSans"
|
|
},
|
|
hover: {
|
|
mode: 'nearest',
|
|
intersect: true
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'ماه',
|
|
fontFamily: "IRANSans"
|
|
}
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'مقدار',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
ticks: {
|
|
fontFamily: "IRANSans",
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//six
|
|
function showpie6() {
|
|
var ctx6 = document.getElementById("myChart6").getContext("2d");
|
|
var myChart = new Chart(ctx6, {
|
|
type: 'bar',
|
|
data:
|
|
{
|
|
labels: ['مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
|
|
datasets: [{
|
|
label: 'راه روستایی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
}, {
|
|
label: 'راهداری',
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
borderWidth: 1,
|
|
data: [12, 19, 3, 5, 2, 9000],
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'top',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های انجام شده تاکنون',
|
|
position: 'bottom'
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: true,
|
|
labelString: '7 whole grain flakes'
|
|
}
|
|
}]
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
}
|
|
}
|
|
});
|
|
var cctx6 = document.getElementById("myyChart6").getContext("2d");
|
|
var myChart = new Chart(cctx6, {
|
|
type: 'doughnut',
|
|
data: {
|
|
datasets: [{
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
backgroundColor: [
|
|
chartColors[0],
|
|
chartColors[1],
|
|
chartColors[2],
|
|
chartColors[3],
|
|
chartColors[4],
|
|
chartColors[5],
|
|
chartColors[6],
|
|
chartColors[7]
|
|
|
|
],
|
|
label: 'تفکیک پروژه های راهداری'
|
|
}],
|
|
labels: [
|
|
'درزگیری',
|
|
'لکه گیری',
|
|
' روکش آسفالت',
|
|
'ماسه آسفالت',
|
|
' اسلاری سیل ',
|
|
' کیپ سیل',
|
|
'فوگ سیل',
|
|
'سیل کت'
|
|
]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
legend: {
|
|
display: showDetails,
|
|
position: 'left',
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'تفکیک پروژه های راهداری',
|
|
position: 'bottom'
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails
|
|
},
|
|
|
|
|
|
|
|
}
|
|
});
|
|
var ctxx6 = document.getElementById("myChartt6").getContext("2d");
|
|
var myChart = new Chart(ctxx6, {
|
|
type: 'line',
|
|
data: {
|
|
labels: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور'],
|
|
datasets: [{
|
|
label: 'پیشرفت فیزیکی',
|
|
backgroundColor: chartColors[0],
|
|
borderColor: chartColors[0],
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
fill: false,
|
|
fontFamily: "IRANSans"
|
|
}, {
|
|
label: 'پیشرفت ریالی',
|
|
fill: false,
|
|
backgroundColor: chartColors[1],
|
|
borderColor: chartColors[1],
|
|
data: [12, 2, 90, 5, 80, 3],
|
|
}]
|
|
},
|
|
options: {
|
|
data: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
datasets: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
responsive: true,
|
|
labels: {
|
|
fontFamily: "IRANSans"
|
|
},
|
|
legend: {
|
|
display: showDetails,
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontFamily: 'IRANSans',
|
|
|
|
|
|
},
|
|
title: {
|
|
fontFamily: 'IRANSans',
|
|
},
|
|
|
|
|
|
},
|
|
title: {
|
|
display: showDetails,
|
|
text: 'نسبت پیشرفت فیزیکی به ریالی',
|
|
position: 'bottom',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
tooltips: {
|
|
enabled: showDetails,
|
|
mode: 'index',
|
|
intersect: false,
|
|
titleFontFamily: "IRANSans"
|
|
},
|
|
hover: {
|
|
mode: 'nearest',
|
|
intersect: true
|
|
},
|
|
scales: {
|
|
xAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'ماه',
|
|
fontFamily: "IRANSans"
|
|
}
|
|
}],
|
|
yAxes: [{
|
|
display: showDetails,
|
|
scaleLabel: {
|
|
display: showDetails,
|
|
labelString: 'مقدار',
|
|
fontFamily: "IRANSans"
|
|
},
|
|
ticks: {
|
|
fontFamily: "IRANSans",
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
$("#optionfilter").on("change", function () {
|
|
if (parseInt($(this).children("option:selected").val()) == 0) {
|
|
$("#project1").css('display', 'none')
|
|
$("#project0").css('display', 'block')
|
|
$("#project4").css('display', 'none')
|
|
$("#project2").css('display', 'none')
|
|
$("#project3").css('display', 'none')
|
|
$("#project5").css('display', 'none')
|
|
|
|
}
|
|
if (parseInt($(this).children("option:selected").val()) == 1) {
|
|
flagshown = 2
|
|
$("#project1").css('display', 'block')
|
|
$("#project0").css('display', 'none')
|
|
$("#project4").css('display', 'none')
|
|
$("#project2").css('display', 'none')
|
|
$("#project3").css('display', 'none')
|
|
$("#project5").css('display', 'none')
|
|
tablesecond = $("#example-update2").DataTable({
|
|
dom: 'lBfrtip',
|
|
// scrollX: true,
|
|
destroy: true,
|
|
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"]],
|
|
processing: true,
|
|
ajax: {
|
|
url: "https://rms.rmto.ir/rahdari/road-danger-prevention/getstat",
|
|
type: "GET",
|
|
dataSrc: function (json) {
|
|
console.log(json);
|
|
console.log(json.data.sum)
|
|
// showpie2(json.data.stat)
|
|
footercount2 = json.data.sum
|
|
return json.data.stat;
|
|
},
|
|
},
|
|
columns: [
|
|
{
|
|
data: "proviceName",
|
|
},
|
|
{
|
|
data: "cityName",
|
|
},
|
|
{ data: "projectsCount" },
|
|
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
console.log(data[Object.keys(data)[keyIndex]][0])
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 7;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 8;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
extend: "excelHtml5",
|
|
title: "Excel",
|
|
text: "خروجی به اکسل",
|
|
messageTop: " عملکرد پروژه های نگهداری راه ",
|
|
},
|
|
// {
|
|
// text: "فیلتر",
|
|
// action: function (e, dt, node, config) {
|
|
// console.log("pitikoo")
|
|
// $("#endclock").val("")
|
|
// console.log($("#endclock").val(""))
|
|
// $("#axis0").prop("checked", false);
|
|
// $("#axis1").prop("checked", false);
|
|
// $("#axis2").prop("checked", false);
|
|
// $("#axis3").prop("checked", false);
|
|
// $("#axis4").prop("checked", false);
|
|
// $("#project-filter-modal").modal('show')
|
|
// },
|
|
// },
|
|
],
|
|
footerCallback: function (row, data, start, end, display) {
|
|
var api = this.api();
|
|
|
|
console.log(footercount2);
|
|
// Update footer
|
|
$(api.column(0).footer()).html("مجموع");
|
|
if (footercount2 != null) {
|
|
$(api.column(1).footer()).html("-");
|
|
$(api.column(2).footer()).html(footercount2[0]);
|
|
$(api.column(3).footer()).html("-");
|
|
$(api.column(4).footer()).html("-");
|
|
$(api.column(5).footer()).html("-");
|
|
$(api.column(6).footer()).html("-");
|
|
$(api.column(7).footer()).html("-");
|
|
$(api.column(8).footer()).html("-");
|
|
$(api.column(9).footer()).html("-");
|
|
$(api.column(10).footer()).html("-");
|
|
|
|
|
|
}
|
|
},
|
|
});
|
|
|
|
}
|
|
if (parseInt($(this).children("option:selected").val()) == 2) {
|
|
flagshown = 3
|
|
$("#project2").css('display', 'block')
|
|
$("#project0").css('display', 'none')
|
|
$("#project1").css('display', 'none')
|
|
$("#project4").css('display', 'none')
|
|
$("#project3").css('display', 'none')
|
|
$("#project5").css('display', 'none')
|
|
tablethird = $("#example-update3").DataTable({
|
|
dom: 'lBfrtip',
|
|
// scrollX: true,
|
|
destroy: true,
|
|
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"]],
|
|
processing: true,
|
|
ajax: {
|
|
url: "https://rms.rmto.ir/rahdari/road-upgrade-safety/getstat",
|
|
type: "GET",
|
|
dataSrc: function (json) {
|
|
console.log(json);
|
|
console.log(json.data.sum)
|
|
// showpie3(json.data.stat)
|
|
footercount3 = json.data.sum
|
|
return json.data.stat;
|
|
},
|
|
},
|
|
columns: [
|
|
{
|
|
data: "proviceName",
|
|
},
|
|
{
|
|
data: "cityName",
|
|
},
|
|
{ data: "projectsCount" },
|
|
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][1];
|
|
|
|
}
|
|
},
|
|
},
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
extend: "excelHtml5",
|
|
title: "Excel",
|
|
text: "خروجی به اکسل",
|
|
messageTop: " عملکرد پروژه های نگهداری راه ",
|
|
},
|
|
// {
|
|
// text: "فیلتر",
|
|
// action: function (e, dt, node, config) {
|
|
// $("#endclock").val("")
|
|
// $("#axis0").prop("checked", false);
|
|
// $("#axis1").prop("checked", false);
|
|
// $("#axis2").prop("checked", false);
|
|
// $("#axis3").prop("checked", false);
|
|
// $("#axis4").prop("checked", false);
|
|
// // to do yasiiii
|
|
// $("#project-filter-modal").modal('show')
|
|
// },
|
|
// },
|
|
],
|
|
footerCallback: function (row, data, start, end, display) {
|
|
var api = this.api();
|
|
|
|
console.log(footercount3);
|
|
// Update footer
|
|
$(api.column(0).footer()).html("مجموع");
|
|
if (footercount3 != null) {
|
|
$(api.column(1).footer()).html("-");
|
|
$(api.column(2).footer()).html(footercount3[0]);
|
|
$(api.column(3).footer()).html("-");
|
|
$(api.column(4).footer()).html("-");
|
|
$(api.column(5).footer()).html("-");
|
|
$(api.column(6).footer()).html("-");
|
|
$(api.column(7).footer()).html("-");
|
|
$(api.column(8).footer()).html("-");
|
|
$(api.column(9).footer()).html("-");
|
|
$(api.column(10).footer()).html("-");
|
|
$(api.column(11).footer()).html("-");
|
|
$(api.column(12).footer()).html("-");
|
|
$(api.column(13).footer()).html("-");
|
|
$(api.column(14).footer()).html("-");
|
|
$(api.column(15).footer()).html("-");
|
|
$(api.column(16).footer()).html("-");
|
|
$(api.column(17).footer()).html("-");
|
|
$(api.column(18).footer()).html("-");
|
|
$(api.column(19).footer()).html("-");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
},
|
|
});
|
|
|
|
}
|
|
if (parseInt($(this).children("option:selected").val()) == 3) {
|
|
flagshown = 4
|
|
$("#project3").css('display', 'block')
|
|
$("#project0").css('display', 'none')
|
|
$("#project1").css('display', 'none')
|
|
$("#project2").css('display', 'none')
|
|
$("#project5").css('display', 'none')
|
|
$("#project4").css('display', 'none')
|
|
tablefourth = $("#example-update4").DataTable({
|
|
dom: 'lBfrtip',
|
|
// scrollX: true,
|
|
destroy: true,
|
|
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"]],
|
|
processing: true,
|
|
ajax: {
|
|
url: "https://rms.rmto.ir/rahdari/road-technical-building/getstat",
|
|
type: "GET",
|
|
dataSrc: function (json) {
|
|
console.log(json);
|
|
console.log(json.data.sum)
|
|
footercount4 = json.data.sum
|
|
return json.data.stat;
|
|
},
|
|
},
|
|
columns: [
|
|
{
|
|
data: "proviceName",
|
|
},
|
|
{
|
|
data: "cityName",
|
|
},
|
|
{ data: "projectsCount" },
|
|
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 7;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
extend: "excelHtml5",
|
|
title: "Excel",
|
|
text: "خروجی به اکسل",
|
|
messageTop: " عملکرد پروژه های نگهداری راه ",
|
|
},
|
|
// {
|
|
// text: "فیلتر",
|
|
// action: function (e, dt, node, config) {
|
|
// $("#endclock").val("")
|
|
// $("#axis0").prop("checked", false);
|
|
// $("#axis1").prop("checked", false);
|
|
// $("#axis2").prop("checked", false);
|
|
// $("#axis3").prop("checked", false);
|
|
// $("#axis4").prop("checked", false);
|
|
// $("#project-filter-modal").modal('show')
|
|
// },
|
|
// },
|
|
],
|
|
footerCallback: function (row, data, start, end, display) {
|
|
var api = this.api();
|
|
|
|
console.log(footercount4);
|
|
// Update footer
|
|
$(api.column(0).footer()).html("مجموع");
|
|
if (footercount4 != null) {
|
|
$(api.column(1).footer()).html("-");
|
|
$(api.column(2).footer()).html(footercount4[0]);
|
|
$(api.column(3).footer()).html("-");
|
|
$(api.column(4).footer()).html("-");
|
|
$(api.column(5).footer()).html("-");
|
|
$(api.column(6).footer()).html("-");
|
|
$(api.column(7).footer()).html("-");
|
|
$(api.column(8).footer()).html("-");
|
|
$(api.column(9).footer()).html("-");
|
|
|
|
|
|
|
|
}
|
|
},
|
|
});
|
|
|
|
}
|
|
if (parseInt($(this).children("option:selected").val()) == 4) {
|
|
flagshown = 5
|
|
$("#project4").css('display', 'block')
|
|
$("#project0").css('display', 'none')
|
|
$("#project1").css('display', 'none')
|
|
$("#project2").css('display', 'none')
|
|
$("#project3").css('display', 'none')
|
|
$("#project5").css('display', 'none')
|
|
tablefifth = $("#example-update5").DataTable({
|
|
dom: 'lBfrtip',
|
|
// scrollX: true,
|
|
destroy: true,
|
|
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"]],
|
|
processing: true,
|
|
ajax: {
|
|
url: "https://rms.rmto.ir/rahdari/road-tollhouse-management/getstat",
|
|
type: "GET",
|
|
dataSrc: function (json) {
|
|
console.log(json);
|
|
console.log(json.data.sum)
|
|
footercount5 = json.data.sum
|
|
// console.log(footercount[09])
|
|
return json.data.stat;
|
|
},
|
|
},
|
|
columns: [
|
|
{
|
|
data: "proviceName",
|
|
},
|
|
{
|
|
data: "cityName",
|
|
},
|
|
{ data: "projectsCount" },
|
|
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 5;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 6;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 7;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
extend: "excelHtml5",
|
|
title: "Excel",
|
|
text: "خروجی به اکسل",
|
|
messageTop: " عملکرد پروژه های نگهداری راه ",
|
|
},
|
|
// {
|
|
// text: "فیلتر",
|
|
// action: function (e, dt, node, config) {
|
|
// $("#endclock").val("")
|
|
// $("#axis0").prop("checked", false);
|
|
// $("#axis1").prop("checked", false);
|
|
// $("#axis2").prop("checked", false);
|
|
// $("#axis3").prop("checked", false);
|
|
// $("#axis4").prop("checked", false);
|
|
// $("#project-filter-modal").modal('show')
|
|
// },
|
|
// },
|
|
],
|
|
footerCallback: function (row, data, start, end, display) {
|
|
var api = this.api();
|
|
|
|
console.log(footercount5);
|
|
// Update footer
|
|
$(api.column(0).footer()).html("مجموع");
|
|
if (footercount5 != null) {
|
|
$(api.column(1).footer()).html("-");
|
|
$(api.column(2).footer()).html(footercount5[0]);
|
|
$(api.column(3).footer()).html("-");
|
|
$(api.column(4).footer()).html("-");
|
|
$(api.column(5).footer()).html("-");
|
|
$(api.column(6).footer()).html("-");
|
|
$(api.column(7).footer()).html("-");
|
|
$(api.column(8).footer()).html("-");
|
|
$(api.column(9).footer()).html("-");
|
|
|
|
|
|
|
|
}
|
|
},
|
|
});
|
|
|
|
}
|
|
if (parseInt($(this).children("option:selected").val()) == 5) {
|
|
flagshown = 6
|
|
$("#project5").css('display', 'block')
|
|
$("#project0").css('display', 'none')
|
|
$("#project1").css('display', 'none')
|
|
$("#project2").css('display', 'none')
|
|
$("#project3").css('display', 'none')
|
|
$("#project4").css('display', 'none')
|
|
tablesix = $("#example-update6").DataTable({
|
|
dom: 'lBfrtip',
|
|
// scrollX: true,
|
|
destroy: true,
|
|
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"]],
|
|
processing: true,
|
|
ajax: {
|
|
url: "https://rms.rmto.ir/rahdari/road-construction-rural/getstat",
|
|
type: "GET",
|
|
dataSrc: function (json) {
|
|
console.log(json);
|
|
console.log(json.data.sum)
|
|
footercount6 = json.data.sum
|
|
// console.log(footercount[09])
|
|
return json.data.stat;
|
|
},
|
|
},
|
|
columns: [
|
|
{
|
|
data: "proviceName",
|
|
},
|
|
{
|
|
data: "cityName",
|
|
},
|
|
{ data: "projectsCount" },
|
|
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 1;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 2;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 3;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
data: "projectDistance",
|
|
render: function (data, type, row) {
|
|
let keyIndex = Object.keys(data).findIndex(function (entry) {
|
|
return entry == 4;
|
|
});
|
|
if (keyIndex == -1) {
|
|
return "-";
|
|
} else {
|
|
|
|
return data[Object.keys(data)[keyIndex]][0];
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
extend: "excelHtml5",
|
|
title: "Excel",
|
|
text: "خروجی به اکسل",
|
|
messageTop: " عملکرد پروژه های نگهداری راه ",
|
|
},
|
|
// {
|
|
// text: "فیلتر",
|
|
// action: function (e, dt, node, config) {
|
|
// $("#endclock").val("")
|
|
// $("#axis0").prop("checked", false);
|
|
// $("#axis1").prop("checked", false);
|
|
// $("#axis2").prop("checked", false);
|
|
// $("#axis3").prop("checked", false);
|
|
// $("#axis4").prop("checked", false);
|
|
// $("#project-filter-modal").modal('show')
|
|
// },
|
|
// },
|
|
],
|
|
footerCallback: function (row, data, start, end, display) {
|
|
var api = this.api();
|
|
|
|
console.log(footercount6);
|
|
// Update footer
|
|
$(api.column(0).footer()).html("مجموع");
|
|
if (footercount6 != null) {
|
|
$(api.column(1).footer()).html("-");
|
|
$(api.column(2).footer()).html(footercount6[0]);
|
|
$(api.column(3).footer()).html("-");
|
|
$(api.column(4).footer()).html("-");
|
|
$(api.column(5).footer()).html("-");
|
|
$(api.column(6).footer()).html("-");
|
|
}
|
|
},
|
|
});
|
|
|
|
|
|
}
|
|
|
|
}) |