8767 lines
295 KiB
JavaScript
8767 lines
295 KiB
JavaScript
const API_ENDPOINT = "https://141.ir/api";
|
||
const MAP_ENDPOINT = "https://rmsmap.rmto.ir";
|
||
const MAP_MIN_ZOOM = 5;
|
||
const MAP_MAX_ZOOM = 10;
|
||
const API_TEST = "https://rms.rmto.ir";
|
||
|
||
var globalqueryparam = "";
|
||
var frommDate, toDate;
|
||
var mapradar = null;
|
||
var WindowWidth = null;
|
||
|
||
var marker141Layers = null;
|
||
var markersproject = null;
|
||
var markerLayers1 = null;
|
||
var markerLayers2 = null;
|
||
var markerLayers3 = null;
|
||
var markerLayers4 = null;
|
||
var markerLayers5 = null;
|
||
|
||
var marker141List = [];
|
||
var projectbamamap = [];
|
||
var rookeshbama = [];
|
||
var hadesemap = [];
|
||
var erteghamap = [];
|
||
var abniemap = [];
|
||
var rahdarmap = [];
|
||
var sharyanimap = [];
|
||
var aslimap = [];
|
||
var faryimap = [];
|
||
var roostayimap = [];
|
||
var darhaltajhiz = [];
|
||
var dardastmonaghsese = [];
|
||
var updateroostayi = [];
|
||
var motale = [];
|
||
var ejrafal = [];
|
||
var ejramotevaghef = [];
|
||
var updatefirst = [];
|
||
var efteteha = [];
|
||
var year1395 = [];
|
||
var secondyear = [];
|
||
var thirsyear = [];
|
||
var fourthyear = [];
|
||
var fifthyear = [];
|
||
|
||
var globalcolor = "";
|
||
var routeControls = [];
|
||
var routecolor = [];
|
||
var routeControlsPath = [];
|
||
var isSetEndAbrarMarker = false;
|
||
var isSetStartAbrarMarker = false;
|
||
var marker141LayersWithoutCluster = null;
|
||
var itempoint = null;
|
||
var provincesArray;
|
||
var citiesArray;
|
||
var iranGeoJSON;
|
||
var iranMapGeo;
|
||
var iranArrayCount = 0;
|
||
var iranCityCount = 0;
|
||
var keepMapFeatureColor = null;
|
||
var fullCityGeoJSONTemp = new Object();
|
||
var fullCityGeoJSON = null;
|
||
var iranCityMapGeo;
|
||
var flagProvince = 0;
|
||
var flagCity = 0;
|
||
var HopeData;
|
||
var statusSet;
|
||
var markerlis1 = [];
|
||
var markerlis2 = [];
|
||
var markerlis3 = [];
|
||
var markerlis4 = [];
|
||
var markerlis5 = [];
|
||
var markerlis6 = [];
|
||
var markerlis7 = [];
|
||
var markerlis8 = [];
|
||
var markerrashtnew = [];
|
||
var markerlisfirooz = [];
|
||
var markerlistamo = [];
|
||
var markerlist;
|
||
var markerchaloos = [];
|
||
var markersemnan = [];
|
||
var markertabriz = [];
|
||
var markerkermanshah = [];
|
||
var firoozlayer = [];
|
||
var amollayer = [];
|
||
var rashtlayer = [];
|
||
var markerfiroozkooh = [];
|
||
var markeramol = [];
|
||
var markerrasht = [];
|
||
var newrashtlayer = [];
|
||
var chalooslayer = [];
|
||
var semnanlayer = [];
|
||
var tabrizlayer = [];
|
||
var kermanlayer = [];
|
||
var ekipmarker = null;
|
||
var issetekipmarker = false;
|
||
var endAbrarMarker = null;
|
||
var isSetEndAbrarMarker = false;
|
||
var smarkerGhRa;
|
||
var emarkerGhRa;
|
||
var smarkerKarCh;
|
||
var emarkerKarCh;
|
||
var smarkerThSe;
|
||
var emarkerThSe;
|
||
var smarkerThKer;
|
||
var emarkerThKer;
|
||
var smarkerfirooz;
|
||
var emarkerfirooz;
|
||
var smarkertabriz;
|
||
var emarkertabriz;
|
||
var tabrizpoly = null;
|
||
var machinarydatavalid = "";
|
||
var ekiplistvalid = "";
|
||
var smarkerrasht;
|
||
var emarkerrasht;
|
||
var rashtpoly = null;
|
||
var startmarkerpin = [];
|
||
var endmarkerpin = [];
|
||
var project_update_list = [];
|
||
var projectarraymachine = [];
|
||
var ekiplist = [];
|
||
var smarkeramol;
|
||
var emarkeramol;
|
||
var amolpoly = null;
|
||
var firstpolyline = null;
|
||
var firoozpoly = null;
|
||
var forthpolyline = null;
|
||
var fifthpolyline = null;
|
||
var seventhpolyline = null;
|
||
var startAbrarMarker = null;
|
||
var isSetStartAbrarMarker = false;
|
||
var routeControls = [];
|
||
var routecolor = [];
|
||
var routeControlsPath = [];
|
||
var routingArray = [];
|
||
var showfastreactionmarker = [];
|
||
var slideIndexlayer = 1;
|
||
|
||
var ppList = [];
|
||
var ptList = [];
|
||
var atList = [];
|
||
var psList = [];
|
||
var pyList = [];
|
||
var priority = [];
|
||
var followup = [];
|
||
|
||
var list_sub;
|
||
|
||
var pprahdar = [];
|
||
var statusrahdar = [];
|
||
var typerahdar = [];
|
||
var pointrahdar = -1;
|
||
|
||
var ppfast = [];
|
||
var featurefast = [];
|
||
var activityfast = [];
|
||
//coridor line
|
||
var selectedCoridor = 0;
|
||
var selectedCoridorArr = [];
|
||
var poly_1 = null;
|
||
var poly_2 = null;
|
||
var poly_3 = null;
|
||
var poly_4 = null;
|
||
var poly_5 = null;
|
||
var poly_6 = null;
|
||
var poly_7 = null;
|
||
var poly_8 = null;
|
||
var layer_1 = [];
|
||
var layer_2 = [];
|
||
var layer_3 = [];
|
||
var layer_4 = [];
|
||
var layer_5 = [];
|
||
var layer_6 = [];
|
||
var layer_7 = [];
|
||
var layer_8 = [];
|
||
var marker_1 = [];
|
||
var marker_2 = [];
|
||
var marker_3 = [];
|
||
var marker_4 = [];
|
||
var marker_5 = [];
|
||
var marker_6 = [];
|
||
var marker_7 = [];
|
||
var marker_8 = [];
|
||
var marker_1_list = [];
|
||
var marker_2_list = [];
|
||
var marker_3_list = [];
|
||
var marker_4_list = [];
|
||
var marker_5_list = [];
|
||
var marker_6_list = [];
|
||
var marker_7_list = [];
|
||
var marker_8_list = [];
|
||
var coridorMarkerArray = [];
|
||
var coridorArray = [];
|
||
var ajaxCheck = false;
|
||
var querylength = 0;
|
||
var queryparams = "";
|
||
var urlParams;
|
||
var currentFilterQueryfrom;
|
||
var currentFilterQueryto;
|
||
|
||
UncheckAll();
|
||
|
||
var toDatefast, frommDatefast;
|
||
|
||
var startAbrarDivIcon = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-start" class="pin-marker pin-set">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">شروع</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
var endAbrarDivIcon = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-end" class="pin-marker pin-set">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">پایان</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
var startAbrarDivIconrahdar = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-startrahdar" class="pin-marker">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">شروع</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
var endAbrarDivIconrahdar = L.divIcon({
|
||
html: `
|
||
<div id="pin-marker-endrahdar" class="pin-marker">
|
||
<div class="map-pin-marker">
|
||
<div class="pin-main-circle"></div>
|
||
<div class="pin-white-circle"></div>
|
||
<div class="pin-title-circle">
|
||
<span class="title-circle-text">پایان</span>
|
||
</div>
|
||
<div class="pin-main-line"></div>
|
||
</div>
|
||
<div class="pin-main-shadow">
|
||
<div class="shadow-dot">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`,
|
||
iconSize: [55, 75],
|
||
iconAnchor: [33, 64],
|
||
});
|
||
|
||
frommDatefast = $("#fastreact-fromdate").persianDatepicker({
|
||
observer: true,
|
||
format: "YYYY/MM/DD",
|
||
altField: ".observer-example-alt",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
frommDatefast.touched = true;
|
||
|
||
$("#fastreact-todate").prop("disabled", "");
|
||
|
||
if (
|
||
frommDatefast.getState().selected.unixDate >=
|
||
toDatefast.getState().selected.unixDate
|
||
) {
|
||
toDatefast.setDate(frommDatefast.getState().selected.unixDate);
|
||
}
|
||
if (
|
||
toDatefast &&
|
||
toDatefast.options &&
|
||
toDatefast.options.minDate != unix
|
||
) {
|
||
let cachedValue = toDatefast.getState().selected.unixDate;
|
||
|
||
toDatefast.options = { minDate: unix };
|
||
|
||
if (toDatefast.touched) {
|
||
toDatefast.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
|
||
toDatefast = $("#fastreact-todate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
toDatefast.touched = true;
|
||
},
|
||
});
|
||
|
||
function drawStartToEndPath(pathType, source, dest, pathColor) {
|
||
if (routeControlsPath.length) {
|
||
$(routeControlsPath).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routeControlsPath.splice(routeControlsPath.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (polylinePath != null) {
|
||
map.removeLayer(polylinePath);
|
||
}
|
||
switch (pathType) {
|
||
case "line": {
|
||
polylinePath = L.polyline(
|
||
[
|
||
[source[0], source[1]],
|
||
[dest[0], dest[1]],
|
||
],
|
||
{
|
||
color: pathColor,
|
||
opacity: 0.8,
|
||
weight: 3,
|
||
}
|
||
).addTo(map);
|
||
break;
|
||
}
|
||
case "axis": {
|
||
$.get(
|
||
`https://rmsmap.rmto.ir/route/v1/driving/${source[1]},${source[0]};${dest[1]},${dest[0]}?overview=full&alternatives=false`,
|
||
function (data) {
|
||
alert("ppp");
|
||
routeControlsPath.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(parseFloat(source[0]), parseFloat(source[1])),
|
||
L.latLng(parseFloat(dest[0]), parseFloat(dest[1])),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
draggableWaypoints: true,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: pathColor,
|
||
opacity: 0.8,
|
||
weight: 3,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routesfound", function (e) {
|
||
for (let index = 0; index < popupArraysPath.length; index++) {
|
||
if (popupArraysPath[index] !== null) {
|
||
map.removeLayer(popupArraysPath[index]);
|
||
}
|
||
}
|
||
})
|
||
.addTo(map)
|
||
);
|
||
}
|
||
);
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
function calculateRouteCoridor(first, last, num) {
|
||
let routeArray = [];
|
||
|
||
let result = new Promise(function (resolve, reject) {
|
||
if (num == 0) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/51.4013785,35.7006177;52.8579311,36.4636399?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
if (num == 1) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/51.4013785,35.7006177;52.3499009,36.4718947?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
if (num == 2) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/49.5846102,37.2793607;49.589109420776374,37.01365617294853;49.39663410186768,36.76501688279228;49.41307067871094,36.71865951515749;49.53460693359376,36.618903290216785;49.59546089172364,36.3709172544364;49.81874942779541,36.31037025501364;50.006663,36.2804074?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
if (num == 3) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/50.006663,36.2804074;49.5846102,37.2793607?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
} else if (num == 4) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/51.0073853,35.8121955;51.4222349,36.6506071?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
} else if (num == 5) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/51.4013785,35.7006177;53.3882906,35.5834074?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
} else if (num == 6) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/51.4013785,35.7006177;46.2961952,38.0739964?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
} else if (num == 7) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/51.4013785,35.7006177;50.21301269531251,35.00862766620555;49.531173706054695,35.12440157992044;48.740158081054695,35.09463077862675;47.0735891,34.3239414?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
} else {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir" +
|
||
"/route/v1/driving/" +
|
||
first[1] +
|
||
"," +
|
||
first[0] +
|
||
";" +
|
||
last[1] +
|
||
"," +
|
||
last[0] +
|
||
"?overview=full&alternatives=false",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
});
|
||
|
||
result.then((response) => {
|
||
routeArray = response;
|
||
showCoridorLayer(routeArray, num);
|
||
console.log(routeArray);
|
||
if (num == 0) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
firoozpoly = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
firoozpoly.addTo(map);
|
||
}
|
||
if (num == 1) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
amolpoly = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
amolpoly.addTo(map);
|
||
} else if (num == 2) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
firstpolyline = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
firstpolyline.addTo(map);
|
||
} else if (num == 3) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
rashtpoly = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
rashtpoly.addTo(map);
|
||
} else if (num == 4) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
forthpolyline = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
forthpolyline.addTo(map);
|
||
} else if (num == 5) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
fifthpolyline = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
fifthpolyline.addTo(map);
|
||
} else if (num == 6) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
tabrizpoly = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
tabrizpoly.addTo(map);
|
||
} else if (num == 7) {
|
||
var myarray = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
myarray.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
seventhpolyline = new L.Polyline(myarray, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
seventhpolyline.addTo(map);
|
||
}
|
||
});
|
||
|
||
if (
|
||
num != 0 &&
|
||
num != 1 &&
|
||
num != 2 &&
|
||
num != 6 &&
|
||
num != 7 &&
|
||
num != 5 &&
|
||
num != 4 &&
|
||
num != 3
|
||
) {
|
||
routeControls.push(
|
||
L.Routing.control({
|
||
routeWhileDragging: true,
|
||
reverseWaypoints: true,
|
||
addWaypoints: false,
|
||
waypoints: [L.latLng(first[0], first[1]), L.latLng(last[0], last[1])],
|
||
lineOptions: {
|
||
styles: [
|
||
{
|
||
color: "#5789f2",
|
||
opacity: 1,
|
||
weight: 5,
|
||
},
|
||
],
|
||
},
|
||
createMarker: function (i, wp) {
|
||
if (i == 0) {
|
||
return L.marker(wp.latLng, { icon: startAbrarDivIcon });
|
||
} else {
|
||
return L.marker(wp.latLng, { icon: endAbrarDivIcon });
|
||
}
|
||
},
|
||
}).addTo(map)
|
||
);
|
||
} else if (num == 0) {
|
||
smarkerfirooz = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkerfirooz = L.marker([last[0], last[1]], {
|
||
icon: endAbrarDivIcon,
|
||
}).addTo(map);
|
||
} else if (num == 1) {
|
||
smarkeramol = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkeramol = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(
|
||
map
|
||
);
|
||
} else if (num == 2) {
|
||
smarkerGhRa = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkerGhRa = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(
|
||
map
|
||
);
|
||
} else if (num == 3) {
|
||
smarkerrasht = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkerrasht = L.marker([last[0], last[1]], {
|
||
icon: endAbrarDivIcon,
|
||
}).addTo(map);
|
||
} else if (num == 4) {
|
||
smarkerKarCh = L.marker([35.8121955, 51.0073853], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkerKarCh = L.marker([last[0], last[1]], {
|
||
icon: endAbrarDivIcon,
|
||
}).addTo(map);
|
||
} else if (num == 5) {
|
||
smarkerThSe = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkerThSe = L.marker([last[0], last[1]], { icon: endAbrarDivIcon }).addTo(
|
||
map
|
||
);
|
||
} else if (num == 6) {
|
||
smarkertabriz = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkertabriz = L.marker([last[0], last[1]], {
|
||
icon: endAbrarDivIcon,
|
||
}).addTo(map);
|
||
} else if (num == 7) {
|
||
smarkerThKer = L.marker([first[0], first[1]], {
|
||
icon: startAbrarDivIcon,
|
||
}).addTo(map);
|
||
emarkerThKer = L.marker([last[0], last[1]], {
|
||
icon: endAbrarDivIcon,
|
||
}).addTo(map);
|
||
}
|
||
|
||
for (var i = 0; i < routeControls.length; i++) {}
|
||
if ($(".leaflet-routing-container").length) {
|
||
$(".leaflet-routing-container").remove();
|
||
}
|
||
}
|
||
|
||
function drawPath() {
|
||
if (routeControls.length) {
|
||
$(routeControls).each(function (index, control) {
|
||
mapradar.removeControl(control);
|
||
routeControls.splice(routeControls.indexOf(index), 1);
|
||
});
|
||
}
|
||
routeControls.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(
|
||
parseFloat(startAbrarMarker.getLatLng().lat),
|
||
parseFloat(startAbrarMarker.getLatLng().lng)
|
||
),
|
||
L.latLng(
|
||
parseFloat(endAbrarMarker.getLatLng().lat),
|
||
parseFloat(endAbrarMarker.getLatLng().lng)
|
||
),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
|
||
draggableWaypoints: true,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: "#28a745",
|
||
opacity: 0.8,
|
||
weight: 5,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routingstart ", function (e) {})
|
||
.addTo(mapradar)
|
||
);
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
}
|
||
|
||
var greenIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-greenn'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var redIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-redd'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var sBlueIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-sBlueIcon'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var purpleIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-purple'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var pinkIcon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-pink'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var greenIconFix = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-green-fix'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var yellowicon = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-yellow-fix'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var redIconFix = L.divIcon({
|
||
className: "custom-div-icon",
|
||
html: "<span class='beacon beacon-red-fix'></span>",
|
||
iconSize: [30, 42],
|
||
});
|
||
var rahdariIconO = L.icon({
|
||
iconUrl: "../../dist/images/icons/tollHouseO_pin.png",
|
||
iconSize: [12, 12],
|
||
});
|
||
var rahdariIconY = L.icon({
|
||
iconUrl: "../../dist/images/icons/tollHouse_pin.png",
|
||
iconSize: [10, 10],
|
||
});
|
||
var bounds = [
|
||
[42.9130026312, 75.6166317076],
|
||
[20.5782370061, 30.5092252948],
|
||
];
|
||
var map = L.map("map", {
|
||
maxBounds: bounds,
|
||
minZoom: 6,
|
||
zoomControl: false,
|
||
}).setView([35.5468992, 51.7300532], 7);
|
||
L.tileLayer(MAP_ENDPOINT + "/141map/{z}/{x}/{y}.png", {}).addTo(map);
|
||
L.PrintPreview().addTo(map);
|
||
|
||
$(document).ready(function () {
|
||
document.location.search.length != 0 ? (querylength = 1) : (querylength = 0);
|
||
urlParams = new URLSearchParams(window.location.search);
|
||
queryparams = window.location.search;
|
||
function onLocationFound(e) {
|
||
var radius = e.accuracy / 2;
|
||
L.circle(e.latlng, radius).addTo(map);
|
||
}
|
||
map.locate({ setView: true, maxZoom: 16 });
|
||
map.on("locationfound", onLocationFound);
|
||
|
||
var urlParams = new URLSearchParams(window.location.search);
|
||
globalqueryparam = urlParams.get("type");
|
||
if (globalqueryparam == "allpoints") {
|
||
$(".guid-custom-box-allpoint").css("display", "block");
|
||
|
||
showallpoint();
|
||
} else if (globalqueryparam == "fastreact") {
|
||
$(".guid-custom-box-fast").css("display", "block");
|
||
|
||
$(".filterTitle").on("click", function () {
|
||
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
||
$(this).parent().children(".filterGroup").show(1000);
|
||
} else {
|
||
$(this).parent().children(".filterGroup").hide(1000);
|
||
}
|
||
});
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
success: function (data) {
|
||
var list_rahdar = data.data;
|
||
for (let index = 0; index < list_rahdar.length; index++) {
|
||
$("#all-pro-fast").append(
|
||
"<div class='icheck-primary d-inline ml-2'><label for='ppfast" +
|
||
list_rahdar[index].id +
|
||
"' class='font-check province-label'>" +
|
||
list_rahdar[index].name_fa +
|
||
"</label><input type='checkbox' id='ppfast" +
|
||
list_rahdar[index].id +
|
||
"' name='provinceshowe' value='" +
|
||
index +
|
||
"' class='fastboxpro' /></div></br>"
|
||
);
|
||
}
|
||
showboxfast();
|
||
},
|
||
});
|
||
showfastreaction();
|
||
} else if (globalqueryparam == "pro") {
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/csi/operation",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
async: false,
|
||
success: function (res) {
|
||
operation_res = res;
|
||
$.each(operation_res, function (key, value) {
|
||
$(".operation_nature").append(
|
||
`<div class="icheck-primary d-inline ml-2">
|
||
<label for="pt${key}" class="font-check" style="color: ${value.color};">${value.farsi} </label>
|
||
<input type="checkbox" id="pt${key}" name="rishe" value="${key}" class="chBox1" />
|
||
</div>`
|
||
);
|
||
});
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "مشکل در در دریافت ماهیت پروژه",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
console.log(error);
|
||
},
|
||
});
|
||
$(".guid-custom-box").css("display", "block");
|
||
|
||
$(".filterTitle").on("click", function () {
|
||
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
||
$(this).parent().children(".filterGroup").show(1000);
|
||
} else {
|
||
$(this).parent().children(".filterGroup").hide(1000);
|
||
}
|
||
});
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
success: function (data) {
|
||
list_province = data.data;
|
||
for (let index = 0; index < list_province.length; index++) {
|
||
$("#all-pro-pro").append(
|
||
"<div class='icheck-primary d-inline ml-2'><label for='pp" +
|
||
list_province[index].id +
|
||
"' class='font-check province-label'>" +
|
||
list_province[index].name_fa +
|
||
"</label><input type='checkbox' id='pp" +
|
||
list_province[index].id +
|
||
"' name='provinceshowe' value='" +
|
||
index +
|
||
"' class='chBox5' /></div></br>"
|
||
);
|
||
}
|
||
checkboxchecked();
|
||
},
|
||
});
|
||
|
||
$(".chBox1").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
var test = parseInt(this.id.substr(2));
|
||
if (this.checked) {
|
||
ptList.push(parseInt(this.id.substr(2)));
|
||
} else {
|
||
var index = ptList.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
ptList.splice(index, 1);
|
||
}
|
||
}
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
|
||
$(".chBox2").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
if (this.checked) {
|
||
atList.push(parseInt(parseInt(this.id.substr(2))));
|
||
} else {
|
||
var index = atList.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
atList.splice(index, 1);
|
||
}
|
||
}
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
|
||
$(".chBox3").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
if (this.checked) {
|
||
psList.push(parseInt(this.id.substr(2)));
|
||
} else {
|
||
var index = psList.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
psList.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
|
||
$(".chBox6").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
if (this.checked) {
|
||
priority.push(parseInt(this.id.substr(2)));
|
||
} else {
|
||
var index = priority.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
priority.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
$(".chBox7").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
if (this.checked) {
|
||
followup.push(parseInt(this.id.substr(2)));
|
||
} else {
|
||
var index = followup.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
followup.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
|
||
$(".chBox4").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
if (this.checked) {
|
||
pyList.push(parseInt(this.id.substr(2)));
|
||
} else {
|
||
var index = pyList.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
pyList.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
var currentDate = {};
|
||
currentFilterYear = parseInt(this.id.substr(2));
|
||
currentDate.from = moment(currentFilterYear, "jYYYY");
|
||
currentFilterQueryfrom = currentDate.from
|
||
.locale("en")
|
||
.format("YYYY-MM-DD");
|
||
currentDate.to = moment(currentFilterYear, "jYYYY");
|
||
currentDate.to.add(1, "year");
|
||
currentFilterQueryto = currentDate.to.locale("en").format("YYYY-MM-DD");
|
||
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
} else if (globalqueryparam == "rahdari") {
|
||
$(".guid-custom-box").css("display", "none");
|
||
$("body").find(".queen-size-nav-rahdari").addClass("stylescroll");
|
||
WindowWidth = $(window).width();
|
||
|
||
$("#select-city").empty();
|
||
$("#select-city").append('<option value="0">انتخاب شهرستان </option>');
|
||
|
||
$("#province-id").on("change", function () {
|
||
init_data_filter();
|
||
if ($("#province-id").val() == 0) {
|
||
$("#select-city").attr("disabled", true);
|
||
} else {
|
||
$("#select-city").attr("disabled", false);
|
||
}
|
||
});
|
||
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/api/get-items-and-subs",
|
||
type: "GET",
|
||
success: function (data) {
|
||
list_sub = data.data;
|
||
},
|
||
});
|
||
|
||
showDailyRahdariActivity();
|
||
} else if (globalqueryparam == "251points") {
|
||
$(".guid-custom-box-251points").css("display", "block");
|
||
showAccident251Points();
|
||
} else if (globalqueryparam == "qarargah") {
|
||
showgharargah();
|
||
} else if (globalqueryparam == "camp") {
|
||
showwintercamp();
|
||
} else if (globalqueryparam == "campNew") {
|
||
$(".guid-custom-boxcamp").css("display", "block");
|
||
|
||
$(".filterTitle").on("click", function () {
|
||
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
||
$(this).parent().children(".filterGroup").show(1000);
|
||
} else {
|
||
$(this).parent().children(".filterGroup").hide(1000);
|
||
}
|
||
});
|
||
showcamp();
|
||
} else if (globalqueryparam == "rahdari") {
|
||
WindowWidth = $(window).width();
|
||
|
||
showDailyRahdariActivity();
|
||
} else if (globalqueryparam == "rahdar") {
|
||
$(".filterTitle").on("click", function () {
|
||
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
||
$(this).parent().children(".filterGroup").show(1000);
|
||
} else {
|
||
$(this).parent().children(".filterGroup").hide(1000);
|
||
}
|
||
});
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
success: function (data) {
|
||
var list_rahdar = data.data;
|
||
for (let index = 0; index < list_rahdar.length; index++) {
|
||
$("#all-pro").append(
|
||
"<div class='icheck-primary d-inline ml-2'><label for='pprah" +
|
||
list_rahdar[index].id +
|
||
"' class='font-check province-label'>" +
|
||
list_rahdar[index].name_fa +
|
||
"</label><input type='checkbox' id='pprah" +
|
||
list_rahdar[index].id +
|
||
"' name='provinceshowe' value='" +
|
||
index +
|
||
"' class='checkboxpro' /></div></br>"
|
||
);
|
||
}
|
||
checkboxshowrahdar();
|
||
},
|
||
});
|
||
showrahdarkhane();
|
||
} else if (globalqueryparam == "barkhordari") {
|
||
$(".list-province").removeClass("d-none");
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
provincesArray = result.data;
|
||
renderprovince(provincesArray);
|
||
},
|
||
error: function (error) {},
|
||
});
|
||
$.ajax({
|
||
url: "https://141.ir/api/provinces35geojson",
|
||
type: "GET",
|
||
success: function (response) {
|
||
iranGeoJSON = JSON.parse(response);
|
||
},
|
||
});
|
||
$.ajax({
|
||
url: "https://141.ir/api/cities430geojson",
|
||
type: "GET",
|
||
success: function (response) {
|
||
fullCityGeoJSON = JSON.parse(response);
|
||
},
|
||
});
|
||
|
||
function addCityFeaturesToMap() {
|
||
keepMapFeatureColor = null;
|
||
if (fullCityGeoJSONTemp) {
|
||
iranCityMapGeo = L.geoJson(fullCityGeoJSONTemp, {
|
||
style: initStyleCityMapFeatures,
|
||
onEachFeature: onEachCityFeature,
|
||
});
|
||
iranCityMapGeo.addTo(map);
|
||
}
|
||
}
|
||
|
||
function getForArrayFeatureColor(arrayNum) {
|
||
if (keepMapFeatureColor) {
|
||
return { num: -1, color: keepMapFeatureColor };
|
||
} else {
|
||
return arrayNum >= 83
|
||
? { num: arrayNum, color: "#a366ff" }
|
||
: arrayNum >= 67
|
||
? { num: arrayNum, color: "#80b3ff" }
|
||
: arrayNum >= 50
|
||
? { num: arrayNum, color: "#66cc66" }
|
||
: arrayNum >= 31
|
||
? { num: arrayNum, color: "#ffeda0" }
|
||
: { num: arrayNum, color: "#ff704d" };
|
||
}
|
||
}
|
||
|
||
function fillcolorme(featureRow) {
|
||
for (let i = 0; i < provincesArray.length; i++) {
|
||
if (i == featureRow) {
|
||
return provincesArray[i].abrar_process;
|
||
}
|
||
}
|
||
}
|
||
|
||
function initStyleMapFeatures() {
|
||
let getRandom = null;
|
||
getRandom = getForArrayFeatureColor(fillcolorme(iranArrayCount));
|
||
let makeStyle = {
|
||
fillColor: getRandom.color,
|
||
weight: 2,
|
||
opacity: 1,
|
||
color: "white",
|
||
fillOpacity: 0.7,
|
||
};
|
||
if (getRandom.num != -1) {
|
||
if (iranArrayCount == 35) {
|
||
iranArrayCount = 0;
|
||
}
|
||
iranArrayCount++;
|
||
}
|
||
return makeStyle;
|
||
}
|
||
|
||
function highlightMapFeature(e) {
|
||
let targetAtt = e.target.feature.properties;
|
||
let featureLayer = null;
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
keepMapFeatureColor = featureLayer.options.fillColor;
|
||
featureLayer.setStyle({
|
||
weight: 4,
|
||
color: "#666",
|
||
fillOpacity: 0.85,
|
||
});
|
||
if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
|
||
featureLayer.bringToFront();
|
||
}
|
||
if (e.target) {
|
||
if (flagProvince == 0) {
|
||
let popup = L.popup();
|
||
for (let i = 0; i < provincesArray.length; i++) {
|
||
if (targetAtt.province_id == provincesArray[i].id) {
|
||
popup
|
||
.setLatLng([
|
||
provincesArray[i].center_lat,
|
||
provincesArray[i].center_long,
|
||
])
|
||
.setContent(
|
||
`<div class="parent-popup-enjoyment text-center">
|
||
<div class="d-flex flex-column ">
|
||
<span style="font-size: 10px;" class="font-weight-bold">${provincesArray[i].name_fa}</span>
|
||
<div style="color:rgb(255, 159, 107)" class="d-flex justify-content-center mt-1">
|
||
<span class="ml-1">مقدار</span>
|
||
<span style="font-family:IRANSansFaNum">${provincesArray[i].abrar_process}%</span>
|
||
</div>
|
||
</div>
|
||
<div class="line-popup"></div>
|
||
<a href="${provincesArray[i].abrar_link}" class="btn-download">
|
||
<div class="d-flex flex-column mt-2">
|
||
<i style="color:rgb(255, 159, 107);font-size:15px" class="fa fa-download"></i>
|
||
<span style="font-size: 10px;" class="font-weight-bold">
|
||
دانلود فایل
|
||
</span>
|
||
</div>
|
||
</a>
|
||
</div>
|
||
`
|
||
)
|
||
.openOn(map);
|
||
}
|
||
}
|
||
$(`#target${targetAtt.province_id}`)
|
||
.css("transform", "scale(1.1)")
|
||
.animate({
|
||
marginTop: "10px",
|
||
marginBottom: "10px",
|
||
});
|
||
$("html .list-province")
|
||
.stop()
|
||
.animate({
|
||
scrollTop:
|
||
$(`#target${targetAtt.province_id}`).offset().top - 380.59,
|
||
});
|
||
}
|
||
}
|
||
if (targetAtt.city_id) {
|
||
if (flagCity == 0) {
|
||
let popup = L.popup();
|
||
for (let i = 0; i < citiesArray.length; i++) {
|
||
if (targetAtt.city_id == citiesArray[i].id) {
|
||
popup
|
||
.setLatLng(e.latlng)
|
||
.setContent(
|
||
`<div class="parent-popup-enjoyment text-center">
|
||
<div class="d-flex flex-column ">
|
||
<span style="font-size: 10px;" class="font-weight-bold">${citiesArray[i].name_fa}</span>
|
||
<div style="color:rgb(255, 159, 107)" class="d-flex justify-content-center mt-1">
|
||
<span class="ml-1">مقدار</span>
|
||
<span style="font-family:IRANSansFaNum">${citiesArray[i].abrar_process}%</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`
|
||
)
|
||
.openOn(map);
|
||
}
|
||
}
|
||
}
|
||
$(`#target${targetAtt.city_id}`)
|
||
.css("transform", "scale(1.1)")
|
||
.animate({
|
||
marginTop: "10px",
|
||
marginBottom: "10px",
|
||
});
|
||
$("html .list-province")
|
||
.stop()
|
||
.animate({
|
||
scrollTop: $(`#target${targetAtt.city_id}`).offset().top - 380.59,
|
||
});
|
||
}
|
||
}
|
||
|
||
function resetMapFeatureHighlight(e) {
|
||
let targetAtt = e.target.feature.properties;
|
||
let featureLayer = null;
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
iranMapGeo.resetStyle(featureLayer);
|
||
keepMapFeatureColor = null;
|
||
$(`#target${targetAtt.province_id}`).css("transform", "").animate({
|
||
marginTop: "",
|
||
marginBottom: "",
|
||
});
|
||
$(`#target${targetAtt.city_id}`).css("transform", "").animate({
|
||
marginTop: "",
|
||
marginBottom: "",
|
||
});
|
||
$("html .list-province").stop().animate({
|
||
scrollTop: 0,
|
||
});
|
||
}
|
||
|
||
function zoomMapToFeature(e) {
|
||
if ($(".backStack").has("d-none")) {
|
||
$(".backStack")
|
||
.removeClass("d-none")
|
||
.addClass("animate__animated animate__backInLeft");
|
||
} else {
|
||
$(".backStack")
|
||
.addClass("d-none")
|
||
.removeClass("animate__animated animate__backInLeft");
|
||
}
|
||
|
||
let IdProvince = e.target.feature.properties.province_id;
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces/" + IdProvince,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
citiesArray = result.data;
|
||
},
|
||
error: function (error) {},
|
||
});
|
||
|
||
let featureLayer = null;
|
||
let featuresLayerCity = [];
|
||
|
||
if (e.target) {
|
||
featureLayer = e.target;
|
||
} else {
|
||
featureLayer = e;
|
||
}
|
||
map.flyToBounds(featureLayer.getBounds());
|
||
showLoaderScreen();
|
||
removeFeaturesFromMap();
|
||
fullCityGeoJSONTemp.type = "FeatureCollection";
|
||
|
||
$.each(fullCityGeoJSON.features, function (key, value) {
|
||
if (
|
||
value &&
|
||
featureLayer.feature.properties.province_id ===
|
||
value.properties.province_id
|
||
) {
|
||
featuresLayerCity.push(value);
|
||
} else {
|
||
}
|
||
});
|
||
|
||
setTimeout(function () {
|
||
fullCityGeoJSONTemp.features = featuresLayerCity;
|
||
for (let i = 0; i < fullCityGeoJSONTemp.features.length; i++) {
|
||
for (let j = 0; j < citiesArray.length; j++) {
|
||
if (
|
||
fullCityGeoJSONTemp.features[i].properties.city_id ==
|
||
citiesArray[j].id
|
||
) {
|
||
fullCityGeoJSONTemp.features[i].properties["abrar_process"] =
|
||
citiesArray[j].abrar_process;
|
||
}
|
||
}
|
||
}
|
||
statusSet = true;
|
||
renderprovince(fullCityGeoJSONTemp.features, statusSet);
|
||
|
||
addCityFeaturesToMap();
|
||
}, 1000);
|
||
|
||
setTimeout(function () {
|
||
hideLoaderScreen();
|
||
}, 1500);
|
||
flagProvince = 1;
|
||
iranCityCount = 0;
|
||
}
|
||
$(".backStack").on("click", function () {
|
||
removeFeaturesCity();
|
||
});
|
||
|
||
function onEachFeature(feature, featureLayer) {
|
||
featureLayer.on({
|
||
mouseover: highlightMapFeature,
|
||
mouseout: resetMapFeatureHighlight,
|
||
click: zoomMapToFeature,
|
||
});
|
||
}
|
||
|
||
function onEachCityFeature(feature, featureLayer) {
|
||
featureLayer.on({
|
||
mouseover: highlightMapFeature,
|
||
mouseout: resetMapFeatureHighlight,
|
||
});
|
||
}
|
||
|
||
function getRandomFeatureColor(arrayNum) {
|
||
if (keepMapFeatureColor) {
|
||
return { num: -1, color: keepMapFeatureColor };
|
||
} else {
|
||
return arrayNum.abrar_process >= 83
|
||
? { num: arrayNum, color: "#a366ff" }
|
||
: arrayNum.abrar_process >= 67
|
||
? { num: arrayNum, color: "#80b3ff" }
|
||
: arrayNum.abrar_process >= 50
|
||
? { num: arrayNum, color: "#66cc66" }
|
||
: arrayNum.abrar_process >= 31
|
||
? { num: arrayNum, color: "#ffeda0" }
|
||
: { num: arrayNum, color: "#ff704d" };
|
||
}
|
||
}
|
||
|
||
function fillcolorCity(featureRow) {
|
||
for (let i = 0; i < fullCityGeoJSONTemp.features.length; i++) {
|
||
if (i == featureRow) {
|
||
return fullCityGeoJSONTemp.features[i].properties;
|
||
}
|
||
}
|
||
}
|
||
|
||
function initStyleCityMapFeatures(feature) {
|
||
let getRandom = getRandomFeatureColor(fillcolorCity(iranCityCount));
|
||
let makeStyle = {
|
||
fillColor: getRandom.color,
|
||
weight: 2,
|
||
opacity: 1,
|
||
color: "white",
|
||
fillOpacity: 0.5,
|
||
};
|
||
|
||
if (iranCityCount == fullCityGeoJSONTemp.features.length) {
|
||
iranCityCount = 0;
|
||
}
|
||
iranCityCount++;
|
||
|
||
return makeStyle;
|
||
}
|
||
|
||
function removeFeaturesFromMap() {
|
||
if (iranMapGeo) {
|
||
map.removeLayer(iranMapGeo);
|
||
}
|
||
}
|
||
|
||
function removeFeaturesCity() {
|
||
if (fullCityGeoJSONTemp.features) {
|
||
map.removeLayer(iranCityMapGeo);
|
||
statusSet = false;
|
||
flagProvince = 0;
|
||
}
|
||
setTimeout(() => {
|
||
iranMapGeo = L.geoJson(iranGeoJSON, {
|
||
style: initStyleMapFeatures,
|
||
onEachFeature: onEachFeature,
|
||
});
|
||
iranMapGeo.addTo(map);
|
||
}, 1000);
|
||
renderprovince(provincesArray);
|
||
}
|
||
setTimeout(() => {
|
||
iranMapGeo = L.geoJson(iranGeoJSON, {
|
||
style: initStyleMapFeatures,
|
||
onEachFeature: onEachFeature,
|
||
});
|
||
iranMapGeo.addTo(map);
|
||
}, 1000);
|
||
|
||
function renderprovince(data, ajaze) {
|
||
if ($(".province-data").children().length) {
|
||
$(".province-data").children().remove();
|
||
}
|
||
data.forEach((element) => {
|
||
if (ajaze) {
|
||
$(".province-data").append(`
|
||
<div class="parent-popup" id=target${
|
||
element.properties.city_id
|
||
} class="mt-3">
|
||
<div class="d-flex justify-content-between">
|
||
<div class="province-title">${
|
||
element.properties.city_name
|
||
}</div>
|
||
<div class="ml-5"><span style="color:rgb(255, 159, 107);font-family:IRANSansFaNum">${
|
||
element.properties.abrar_process
|
||
}%</span></div>
|
||
</div>
|
||
<div class="parent-progressBar-province">
|
||
<div class="progressBar-province" style="width:${
|
||
element.properties.abrar_process == "-"
|
||
? 5
|
||
: element.properties.abrar_process
|
||
}%"><span class="d-none">${
|
||
element.properties.abrar_process
|
||
}</span></div>
|
||
</div>
|
||
</div>
|
||
`);
|
||
} else {
|
||
$(".province-data").append(`
|
||
<div class="parent-popup" id=target${element.id} class="mt-3">
|
||
<div class="d-flex justify-content-between">
|
||
<div class="province-title">${element.name_fa}</div>
|
||
<div class="ml-5"><span style="color:rgb(255, 159, 107);font-family:IRANSansFaNum">${
|
||
element.abrar_process
|
||
}%</span></div>
|
||
</div>
|
||
<div class="parent-progressBar-province">
|
||
<div class="progressBar-province" style="width:${
|
||
element.abrar_process == "-"
|
||
? 0
|
||
: element.abrar_process
|
||
}%"><span class="d-none">${
|
||
element.abrar_process
|
||
}</span></div>
|
||
</div>
|
||
</div>
|
||
`);
|
||
}
|
||
});
|
||
|
||
$(".progressBar-province span").each(function (index, element) {
|
||
if ($(element).text() >= "83") {
|
||
$(element).parent().css({
|
||
backgroundColor: "#a366ff",
|
||
height: "100%",
|
||
borderRadius: "10px",
|
||
});
|
||
} else if ($(element).text() >= "67") {
|
||
$(element).parent().css({
|
||
backgroundColor: "#80b3ff",
|
||
height: "100%",
|
||
borderRadius: "10px",
|
||
});
|
||
} else if ($(element).text() >= "50") {
|
||
$(element).parent().css({
|
||
backgroundColor: "#66cc66",
|
||
height: "100%",
|
||
borderRadius: "10px",
|
||
});
|
||
} else if ($(element).text() >= "31") {
|
||
$(element).parent().css({
|
||
backgroundColor: "#ffeda0",
|
||
height: "100%",
|
||
borderRadius: "10px",
|
||
});
|
||
} else {
|
||
$(element).parent().css({
|
||
backgroundColor: "#ff704d",
|
||
height: "100%",
|
||
borderRadius: "10px",
|
||
});
|
||
}
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
$(document).mouseup(function (e) {
|
||
var container = $(".left-menu-view-chartt");
|
||
if (!container.is(e.target) && container.has(e.target).length === 0) {
|
||
$(".left-menu-view-chartt").css("left", "-1600px");
|
||
}
|
||
});
|
||
if ($("#pp1").prop("checked") == true) {
|
||
alert("byyyyyy");
|
||
}
|
||
|
||
function showrahdarkhane() {
|
||
$(".guid-custom-box-rahdar").css("display", "block");
|
||
remove141Layer();
|
||
showLoaderScreen();
|
||
$.get(API_TEST + "/rahdari-points", function (result) {
|
||
data = result.data;
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
setIcon = rahdariIconY;
|
||
|
||
if (data[i].lat == null) {
|
||
}
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0" ||
|
||
data[i].lat == null ||
|
||
data[i].lng == null
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
})
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let datatext = this.options.content;
|
||
|
||
$("#houserahdar").val(datatext.name);
|
||
$("#rahdarid").val(datatext.id);
|
||
$("#edarekol").val(datatext.province_name);
|
||
$("#mainCity").val(datatext.city_name);
|
||
$("#sit").val(datatext.status); //action
|
||
$("#type").val(datatext.type);
|
||
$("#phone").val(datatext.phone);
|
||
$("#ekipnum").val(datatext.team_num);
|
||
$("#personelnum").val(datatext.staff_num);
|
||
$("#masol").val(datatext.responsible_name);
|
||
$("#masolmobile").val(datatext.responsible_mobile);
|
||
$("#janeshin").val(datatext.successor_name);
|
||
$("#janeshinmobile").val(datatext.successor_mobile);
|
||
$("#lightmachine").val(datatext.machines_light);
|
||
$("#meduimachin").val(datatext.machines_sheavy);
|
||
$("#bigmachin").val(datatext.machines_heavy);
|
||
$("#lat-rahdar").val(datatext.lat);
|
||
$("#lng-rahdar").val(datatext.lng);
|
||
})
|
||
.bindPopup(getPopupContentRahdar(data[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
// if (result.edit_id == data[i].province_id) {
|
||
// markerG.push(marker);
|
||
// } else {
|
||
marker141List.push(marker);
|
||
// }
|
||
}
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
|
||
$(".status").on("change", function () {
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
statusrahdar.push(parseInt(this.value));
|
||
} else {
|
||
var index = statusrahdar.indexOf(parseInt(this.value));
|
||
if (index > -1) {
|
||
statusrahdar.splice(index, 1);
|
||
}
|
||
}
|
||
showLoaderScreen();
|
||
|
||
$.get("https://rms.rmto.ir/api/public/rahdarKhanehMapFilter", {
|
||
province_id: pprahdar,
|
||
status: statusrahdar,
|
||
type: typerahdar,
|
||
}).done(function (data) {
|
||
show_filter_rahdar(data.data, pointrahdar);
|
||
});
|
||
});
|
||
$(".type").on("change", function () {
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
typerahdar.push(parseInt(this.value));
|
||
} else {
|
||
var index = typerahdar.indexOf(parseInt(this.value));
|
||
if (index > -1) {
|
||
typerahdar.splice(index, 1);
|
||
}
|
||
}
|
||
showLoaderScreen();
|
||
|
||
$.get("https://rms.rmto.ir/api/public/rahdarKhanehMapFilter", {
|
||
province_id: pprahdar,
|
||
status: statusrahdar,
|
||
type: typerahdar,
|
||
}).done(function (data) {
|
||
show_filter_rahdar(data.data, pointrahdar);
|
||
});
|
||
});
|
||
}
|
||
|
||
function showAccident251Points() {
|
||
remove141Layer();
|
||
showLoaderScreen();
|
||
|
||
$.get(API_TEST + "/accident-251-points", function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
|
||
if (roadAccidentPoints[i].progress == "100") {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = greenIconFix;
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = redIconFix;
|
||
}
|
||
}
|
||
let marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let valueprogress = "";
|
||
let datatext = this.options.content;
|
||
|
||
$("#pointid").val(datatext.id);
|
||
$("#opration").val(datatext.operation); //oparation
|
||
$("#target").val(datatext.target); //target
|
||
$("#action").val(datatext.actions); //action
|
||
$("#ac-point-lat").val(datatext.lat);
|
||
$("#ac-point-lng").val(datatext.lng);
|
||
valueprogress = datatext.progress;
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="ex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#sliderphysici").empty();
|
||
|
||
$("#sliderphysici").append(
|
||
'<label class="slider-label label-allpoint-style" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#sliderphysici").append(test);
|
||
|
||
$(".ex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
|
||
$("#end-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
$("#cost").val(datatext.cost); //cost
|
||
$("#end-date").val(datatext.end_date); //end-date
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident_251(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
markerG.push(marker);
|
||
} catch (e) {}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function showfastreaction() {
|
||
var showFastReactionPoint = true;
|
||
$("#fastreact_search_option").on("click", function () {
|
||
showLoaderScreen();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (
|
||
$("#fastreact-fromdate").val() != " " &&
|
||
$("#fastreact-todate").val() != " "
|
||
) {
|
||
let startDatefast = moment(
|
||
frommDatefast.getState().selected.year +
|
||
"/" +
|
||
frommDatefast.getState().selected.month +
|
||
"/" +
|
||
frommDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let endDatefast = moment(
|
||
toDatefast.getState().selected.year +
|
||
"/" +
|
||
toDatefast.getState().selected.month +
|
||
"/" +
|
||
toDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
if (showFastReactionPoint) {
|
||
$.get(
|
||
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
endDatefast +
|
||
"&start-date=" +
|
||
startDatefast,
|
||
{
|
||
ProvinceId: ppfast,
|
||
FeatureType: featurefast,
|
||
Status: activityfast,
|
||
}
|
||
).done(function (data) {
|
||
hideLoaderScreen();
|
||
show_fast_points(data);
|
||
});
|
||
} else {
|
||
$.ajax({
|
||
url:
|
||
API_TEST +
|
||
"/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
endDatefast +
|
||
"&start-date=" +
|
||
startDatefast,
|
||
type: "GET",
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
show_point(result.data);
|
||
},
|
||
error: function (error) {},
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
$(".FeatureType").on("change", function () {
|
||
showLoaderScreen();
|
||
let startDatefeauture = moment(
|
||
frommDatefast.getState().selected.year +
|
||
"/" +
|
||
frommDatefast.getState().selected.month +
|
||
"/" +
|
||
frommDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let endDatefeautre = moment(
|
||
toDatefast.getState().selected.year +
|
||
"/" +
|
||
toDatefast.getState().selected.month +
|
||
"/" +
|
||
toDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
featurefast.push(parseInt(this.value));
|
||
} else {
|
||
var index = featurefast.indexOf(parseInt(this.value));
|
||
if (index > -1) {
|
||
featurefast.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.get(
|
||
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
endDatefeautre +
|
||
"&start-date=" +
|
||
startDatefeauture,
|
||
{
|
||
ProvinceId: ppfast,
|
||
FeatureType: featurefast,
|
||
Status: activityfast,
|
||
}
|
||
).done(function (data) {
|
||
hideLoaderScreen();
|
||
show_fast_points(data);
|
||
});
|
||
});
|
||
$(".activity").on("change", function () {
|
||
showLoaderScreen();
|
||
let startDateactivity = moment(
|
||
frommDatefast.getState().selected.year +
|
||
"/" +
|
||
frommDatefast.getState().selected.month +
|
||
"/" +
|
||
frommDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let enddateacitivity = moment(
|
||
toDatefast.getState().selected.year +
|
||
"/" +
|
||
toDatefast.getState().selected.month +
|
||
"/" +
|
||
toDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
activityfast.push(parseInt(this.value));
|
||
} else {
|
||
var index = activityfast.indexOf(parseInt(this.value));
|
||
if (index > -1) {
|
||
activityfast.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.get(
|
||
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
enddateacitivity +
|
||
"&start-date=" +
|
||
startDateactivity,
|
||
{
|
||
ProvinceId: ppfast,
|
||
FeatureType: featurefast,
|
||
Status: activityfast,
|
||
}
|
||
).done(function (data) {
|
||
hideLoaderScreen();
|
||
show_fast_points(data);
|
||
});
|
||
});
|
||
}
|
||
|
||
function showallpoint() {
|
||
remove141Layer();
|
||
showLoaderScreen();
|
||
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
$.ajax({
|
||
url: API_TEST + "/accident-points",
|
||
type: "GET",
|
||
success: function (result) {
|
||
let roadAccidentPoints = result.data;
|
||
hideLoaderScreen();
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadAccidentPoints.length; i++) {
|
||
if (
|
||
roadAccidentPoints[i].progress == "100" ||
|
||
(roadAccidentPoints[i].accident251_point &&
|
||
roadAccidentPoints[i].accident251_point.progress == "100")
|
||
) {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = "#28a745";
|
||
}
|
||
} else {
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = "#dc3545";
|
||
}
|
||
}
|
||
|
||
try {
|
||
let marker = null;
|
||
|
||
if (result.edit_id == roadAccidentPoints[i].province_id) {
|
||
marker = L.marker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
icon: setIcon,
|
||
content: roadAccidentPoints[i],
|
||
}
|
||
)
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
let valueprogress = "";
|
||
let contentData = this.options.content;
|
||
$("#allpointid").val(contentData.id);
|
||
|
||
$("#allend-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
if (contentData.accident251_point) {
|
||
$("#alloperation").val(
|
||
contentData.accident251_point.operation
|
||
);
|
||
$("#alltarget").val(contentData.accident251_point.target);
|
||
$("#allaction").val(contentData.accident251_point.actions);
|
||
$("#allcost").val(contentData.accident251_point.cost);
|
||
$("#allend-date").val(contentData.accident251_point.end_date);
|
||
valueprogress = contentData.accident251_point.progress;
|
||
} else {
|
||
$("#alloperation").val("-");
|
||
$("#alltarget").val("-");
|
||
$("#allaction").val("-");
|
||
$("#allcost").val(contentData.cost);
|
||
$("#allcost").val(contentData.cost);
|
||
$("#allend-date").val("-");
|
||
valueprogress = contentData.progress;
|
||
}
|
||
|
||
$("#allac-point-lat").val(contentData.lat);
|
||
$("#allac-point-lng").val(contentData.lng);
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="allex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#allsliderphysici").empty();
|
||
|
||
$("#allsliderphysici").append(
|
||
'<label class="allslider-label label-allpoint-style" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#allsliderphysici").append(test);
|
||
$(".allex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
})
|
||
.bindPopup(
|
||
getPopupContentAccident(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
} else {
|
||
marker = L.circleMarker(
|
||
[roadAccidentPoints[i].lat, roadAccidentPoints[i].lng],
|
||
{
|
||
color: setIcon,
|
||
stroke: false,
|
||
radius: 3,
|
||
fillOpacity: 1,
|
||
}
|
||
).bindPopup(
|
||
getPopupContentAccident(roadAccidentPoints[i], result.edit_id),
|
||
{ className: "customPopupStyle" }
|
||
);
|
||
}
|
||
|
||
markerG.push(marker);
|
||
} catch (e) {}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
},
|
||
error: function (error) {},
|
||
});
|
||
}
|
||
|
||
function getPopupContentAccident(data, edit_id) {
|
||
let popupTitle251 = "";
|
||
|
||
if (data.accident251_point) {
|
||
popupTitle251 = " (اولویت ۲۵۱ نقطه)";
|
||
}
|
||
|
||
if (edit_id == data.province_id) {
|
||
if (data.accident251_point) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.accident251_point.province +
|
||
"، محور: " +
|
||
data.accident251_point.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.operation +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.cost +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point btn btn-danger" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else if (
|
||
(data.target && data.target != "-") ||
|
||
(data.operation && data.operation != "-")
|
||
) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
(data.operation ? data.operation : "-") +
|
||
'</div></div>\
|
||
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
||
(data.target ? data.target : "-") +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
(data.actions ? data.actions : "-") +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
(data.end_date ? data.end_date : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point btn btn-danger" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_start +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> انتهای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_end +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.distance +
|
||
" " +
|
||
"کیلومتر" +
|
||
'</div> </div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
||
data.geometric_desc +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div> </div>\
|
||
<div class="col-4" style="text-align:center"><span class="header-popupcontent-allpoints"> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point btn btn-danger" onclick="showAccidentPointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
} else {
|
||
if (data.accident251_point) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.accident251_point.province +
|
||
"، محور: " +
|
||
data.accident251_point.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.operation +
|
||
'</div></div>\
|
||
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.cost +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.accident251_point.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>\
|
||
"
|
||
);
|
||
} else if (
|
||
(data.target && data.target != "-") ||
|
||
(data.operation && data.operation != "-")
|
||
) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
(data.operation ? data.operation : "-") +
|
||
'</div></div>\
|
||
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
||
(data.target ? data.target : "-") +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter">\
|
||
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
(data.actions ? data.actions : "-") +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="popUpBox col-4" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
(data.end_date ? data.end_date : "-") +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>\
|
||
"
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقاط پرتصادف' +
|
||
popupTitle251 +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_start +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> انتهای محور</span><div class="popUpBoxContent">' +
|
||
data.axis_end +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> فاصله از ابتدای محور</span><div class="popUpBoxContent">' +
|
||
data.distance +
|
||
" " +
|
||
"کیلومتر" +
|
||
'</div> </div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> توصیف هندسی نقطه</span><div class="popUpBoxContent">' +
|
||
data.geometric_desc +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; text-align:center"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div> </div>\
|
||
<div class="col-4" style="text-align:center"><span class="header-popupcontent-allpoints"> طول جغرافیایی</span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
function showLoaderScreen() {
|
||
$(".divloader").css("display", "flex").hide().fadeIn();
|
||
}
|
||
|
||
function hideLoaderScreen() {
|
||
$(".divloader").fadeOut();
|
||
}
|
||
|
||
function remove141Layer() {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
}
|
||
|
||
function getpopcounterrahdari(data, num) {
|
||
var deactive;
|
||
if (data.status == 1) {
|
||
var deactive = '<div class="popUpBoxContent">فعال</div>';
|
||
} else {
|
||
var deactive = '<div class="popUpBoxContent">غیر فعال</div>';
|
||
}
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span>' +
|
||
deactive +
|
||
'</div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
returntype(data.type) +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showrahdarModalcoridor(' +
|
||
data.id +
|
||
')">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
|
||
function getPopupContentAccident_251(data, edit_id) {
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقطه پرتصادف</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter col-12">\
|
||
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point btn btn-danger" onclick="showAccident251PointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">نقطه پرتصادف</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province +
|
||
"، محور: " +
|
||
data.native_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> عملیات مورد نیاز </span><div class="popUpBoxContent">' +
|
||
data.operation +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> هدف کمی </span><div class="popUpBoxContent">' +
|
||
data.target +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter col-12">\
|
||
<span class="header-popupcontent-allpoints"> اقدامات انجام شده </span><div class="popUpBoxContent">' +
|
||
data.actions +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> اعتبارات هزینه شده (میلیون ریال) </span><div class="popUpBoxContent">' +
|
||
data.cost +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> پیشرفت فیزیکی (درصد) </span><div class="popUpBoxContent">' +
|
||
data.progress +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ خاتمه </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
|
||
function getPopupContentcampNew(data, edit_id) {
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">\
|
||
<span class="popupHeader">متن تست</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_fa +
|
||
"، محور: " +
|
||
data.axis_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> نوع محور </span><div class="popUpBoxContent">' +
|
||
data.axis_type_fa +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> علت انسداد </span><div class="popUpBoxContent">' +
|
||
data.blockage_cause_fa +
|
||
'</div></div> </div>\
|
||
<div class="popupFooter col-12">\
|
||
<span class="header-popupcontent-allpoints"> طول راه </span><div class="popUpBoxContent">' +
|
||
data.blockage_length +
|
||
'</div> </div>\
|
||
</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد عوامل راهدار فعال در محور </span><div class="popUpBoxContent">' +
|
||
data.active_rahdar_count +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد ماشین الات فعال در محور </span><div class="popUpBoxContent">' +
|
||
data.active_cars_count +
|
||
"٪" +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> براورد اولیه خسارت </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ انسداد </span><div class="popUpBoxContent">' +
|
||
data.end_date +
|
||
'</div></div>\
|
||
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> پیش بینی تاریخ بازگشایی </span><div class="popUpBoxContent">' +
|
||
data.prediction_time_fa +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popUpBox col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> تاریخ بازگشایی </span><div class="popUpBoxContent">' +
|
||
data.is_open_type_fa +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point btn btn-danger" onclick="showAccident251PointEditModal()">بروزرسانی</button>\
|
||
</div>\
|
||
'
|
||
);
|
||
} else {
|
||
return ` <div class="popup">
|
||
<div class="popupTitle">
|
||
<img src="../../dist/images/icons/por_accident_village.svg" alt="">
|
||
<span class="popupHeader">متن تست</span>
|
||
</div>
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل
|
||
${data.province_fa}
|
||
، محور:
|
||
${data.axis_name}
|
||
</div>
|
||
<div class="popupContent row col-12">
|
||
<div class="popUpBox col-5" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> نوع محور </span><div class="popUpBoxContent">
|
||
${data.axis_type_fa}
|
||
</div></div>
|
||
<div class="popUpBox col-5" style="border-bottom:2px solid #ff5c0f;"><span class="header-popupcontent-allpoints"> علت انسداد </span><div class="popUpBoxContent">
|
||
${data.blockage_cause_fa}
|
||
</div></div> </div>
|
||
<div class="popupFooter col-12">
|
||
<span class="header-popupcontent-allpoints"> طول راه </span><div class="popUpBoxContent">
|
||
${data.blockage_length}
|
||
</div> </div>
|
||
</div>
|
||
<div class="popupContent row col-12">
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد عوامل راهدار فعال در محور </span><div class="popUpBoxContent">
|
||
${
|
||
data.active_rahdar_count == undefined ? "" : data.active_rahdar_count
|
||
}
|
||
</div></div>
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد ماشین الات فعال در محور </span><div class="popUpBoxContent">
|
||
% ${
|
||
data.active_cars_count == undefined
|
||
? ""
|
||
: data.active_cars_count
|
||
}
|
||
|
||
</div></div>
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> براورد اولیه خسارت </span><div class="popUpBoxContent">
|
||
${
|
||
data.blockage_damage_money == undefined
|
||
? ""
|
||
: data.blockage_damage_money
|
||
}
|
||
</div></div>
|
||
<div class="popUpBox col-5" style="border-left:2px solid #ff5c0f; text-align:center; justify-content: center; border-bottom: 2px solid #ff5c0f; margin-top: 0px;"><span class="header-popupcontent-allpoints"> تاریخ انسداد </span><div class="popUpBoxContent">
|
||
${data.end_date == undefined ? "" : data.end_date}
|
||
</div></div>
|
||
<div class="popUpBox col-5" style="text-align:center; justify-content: center; border-bottom: 2px solid #ff5c0f; margin-top: 0px;"><span class="header-popupcontent-allpoints"> پیش بینی تاریخ بازگشایی </span><div class="popUpBoxContent">
|
||
${data.prediction_time_fa}
|
||
</div></div>
|
||
</div>
|
||
<div class="popupContent popUpBox col-5" style="text-align:center; padding: 2%;"><span class="header-popupcontent-allpoints" style:"color: #0051cd !important; font-size: 9px !important;"> تاریخ بازگشایی </span><div class="popUpBoxContent">
|
||
${data.is_open_type_fa == null ? "" : data.is_open_type_fa}
|
||
</div></div>
|
||
</div>`;
|
||
}
|
||
}
|
||
|
||
function getPopupContentRahdar(data, edit_id) {
|
||
var deactive;
|
||
if (data.status == 1) {
|
||
var deactive = '<div class="popUpBoxContent">فعال</div>';
|
||
} else {
|
||
var deactive = '<div class="popUpBoxContent">غیر فعال</div>';
|
||
}
|
||
if (edit_id == data.province_id) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> وضعیت </span><div class="popUpBoxContent">' +
|
||
deactive +
|
||
'</div></div>\
|
||
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> نوع </span><div class="popUpBoxContent">' +
|
||
returntype(data.type) +
|
||
'</div></div>\
|
||
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class=" col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button" style="display:none">\
|
||
<button class="popup-btn-edit-point btn btn-danger" onclick="showrahdarModal(' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
", " +
|
||
parseFloat(data.l).toFixed(5) +
|
||
')">بروزرسانی</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> وضعیت </span><div class="popUpBoxContent">' +
|
||
deactive +
|
||
'</div></div>\
|
||
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> نوع </span><div class="popUpBoxContent">' +
|
||
returntype(data.type) +
|
||
'</div></div>\
|
||
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class=" col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class=" col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
"</div></div>\
|
||
</div>\
|
||
</div>"
|
||
);
|
||
}
|
||
}
|
||
// popup coridor
|
||
function getPopupContentCoridor(data) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> وضعیت </span><div class="popUpBoxContent">' +
|
||
data.status +
|
||
'</div></div>\
|
||
<div class="col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> نوع </span><div class="popUpBoxContent">' +
|
||
data.type +
|
||
'</div></div>\
|
||
<div class="col-12" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تلفن </span><div class="popUpBoxContent">' +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class=" col-4" style="border-left:2px solid #ff5c0f; border-bottom:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-left:2px solid #ff5c0f; border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="col-4" style="border-bottom: 2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class=" col-6" style="border-left:2px solid #ff5c0f; text-align:center;"><span class="header-popupcontent-allpoints"> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class=" col-6" style="text-align:center;"><span class="header-popupcontent-allpoints"> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showcoridorfinall(' +
|
||
data.id +
|
||
')">بروزرسانی</button>\
|
||
<button class="popup-btn-edit-point" onclick="deletecoridor(' +
|
||
data.id +
|
||
')">حذف</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
//popup coridor
|
||
|
||
function showAccidentPointEditModal() {
|
||
$("#allpointedit").modal("show");
|
||
}
|
||
$("#editpoints").on("click", function () {
|
||
saveEditedPoint();
|
||
});
|
||
|
||
function saveEditedPoint() {
|
||
if (accident251EditedPointValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("actions", $("#action").val());
|
||
formData.append("progress", $(".ex2").slider("getValue"));
|
||
formData.append("cost", $("#cost").val());
|
||
formData.append("end_date", $("#end-date").val());
|
||
|
||
let lat = $("#ac-point-lat").val().slice(1, -1);
|
||
let lng = $("#ac-point-lng").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (let i = 0; i < $("input[name=modalUpFile]")[0].files.length; i++) {
|
||
formData.append(
|
||
"point_files_" + i,
|
||
$("input[name=modalUpFile]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
$("#pointedit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/accident-251-points/" + $("#pointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
showAccident251Points();
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
/*} else {
|
||
$('#sliderphysici').find('.slider-label').text('پیشرفت فیزیکی (مقدار جدید نباید از درصد قبلی کمتر باشد)');
|
||
$('#sliderphysici').find('.slider-label').css('color', 'red');
|
||
}*/
|
||
}
|
||
}
|
||
$("#alleditpoints").on("click", function () {
|
||
saveAccidentEditedPoint();
|
||
});
|
||
|
||
function saveAccidentEditedPoint() {
|
||
if (accidentEditedPointValidate()) {
|
||
formData = new FormData();
|
||
|
||
formData.append("operation", $("#alloperation").val());
|
||
formData.append("target", $("#alltarget").val());
|
||
formData.append("actions", $("#allaction").val());
|
||
formData.append("progress", $(".allex2").slider("getValue"));
|
||
formData.append("cost", $("#allcost").val());
|
||
formData.append("end_date", $("#allend-date").val());
|
||
|
||
let lat = $("#allac-point-lat").val().slice(1, -1);
|
||
let lng = $("#allac-point-lng").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (let i = 0; i < $("input[name=allmodalUpFile]")[0].files.length; i++) {
|
||
formData.append(
|
||
"point_files_" + i,
|
||
$("input[name=allmodalUpFile]")[0].files[i]
|
||
);
|
||
}
|
||
$("#allpointedit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/accident-points/" + $("#allpointid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
showRoadAccidentLayerWithoutCluster();
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
}
|
||
|
||
function accidentEditedPointValidate() {
|
||
let isValidate = true;
|
||
if (
|
||
!$("#alloperation").val() ||
|
||
!checkPersianWordValidation($("#alloperation").val())
|
||
) {
|
||
$("#alloperation").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#alloperation").removeClass("is-invalid");
|
||
}
|
||
|
||
if (
|
||
!$("#alltarget").val() ||
|
||
!checkPersianWordValidation($("#alltarget").val())
|
||
) {
|
||
$("#alltarget").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#alltarget").removeClass("is-invalid");
|
||
}
|
||
|
||
if (
|
||
!$("#allaction").val() ||
|
||
!checkPersianWordValidation($("#allaction").val())
|
||
) {
|
||
$("#allaction").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allaction").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allcost").val()) {
|
||
$("#allcost").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allcost").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allend-date").val()) {
|
||
$("#allend-date").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allend-date").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allac-point-lat").val()) {
|
||
$("#allac-point-lat").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allac-point-lat").removeClass("is-invalid");
|
||
}
|
||
|
||
if (!$("#allac-point-lng").val()) {
|
||
$("#allac-point-lng").addClass("is-invalid");
|
||
isValidate = false;
|
||
} else {
|
||
$("#allac-point-lng").removeClass("is-invalid");
|
||
}
|
||
|
||
return isValidate;
|
||
}
|
||
|
||
function showrahdarModal(start, end) {
|
||
$("#deviceImg1Preview").removeAttr("src");
|
||
$("#deviceImg2Preview").removeAttr("src");
|
||
$("#deviceImg3Preview").removeAttr("src");
|
||
$("#deviceImg4Preview").removeAttr("src");
|
||
$("#deviceImg5Preview").removeAttr("src");
|
||
$("#deviceImg1").val("");
|
||
$("#deviceImg2").val("");
|
||
$("#deviceImg3").val("");
|
||
$("#deviceImg4").val("");
|
||
$("#deviceImg5").val("");
|
||
|
||
$("#deviceImg1Title").css("display", "");
|
||
$("#deviceImg2Title").css("display", "");
|
||
$("#deviceImg3Title").css("display", "");
|
||
$("#deviceImg4Title").css("display", "");
|
||
$("#deviceImg5Title").css("display", "");
|
||
|
||
$("#deleteDeviceImg1").prop("disabled", true);
|
||
$("#deleteDeviceImg2").prop("disabled", true);
|
||
$("#deleteDeviceImg3").prop("disabled", true);
|
||
$("#deleteDeviceImg4").prop("disabled", true);
|
||
$("#deleteDeviceImg5").prop("disabled", true);
|
||
$("#houserahdar").prop("disabled", false);
|
||
$(".basic").spectrum({
|
||
color: "#fff",
|
||
change: function (color) {
|
||
$("#basic-log").text("رنگ " + color.toHexString());
|
||
globalcolor = color.toHexString();
|
||
},
|
||
});
|
||
$("#rahdaredit").modal("show");
|
||
}
|
||
|
||
$("#editrahdar").on("click", function () {
|
||
saveRahdariEdited();
|
||
});
|
||
|
||
function saveRahdariEdited() {
|
||
formData = new FormData();
|
||
|
||
formData.append("status", $("#sit").val());
|
||
formData.append("type", $("#type").val());
|
||
formData.append("phone", $("#phone").val());
|
||
formData.append("team_num", $("#ekipnum").val());
|
||
formData.append("staff_num", $("#personelnum").val());
|
||
formData.append("responsible_name", $("#masol").val());
|
||
formData.append("responsible_mobile", $("#masolmobile").val());
|
||
formData.append("successor_name", $("#janeshin").val());
|
||
formData.append("successor_mobile", $("#janeshinmobile").val());
|
||
formData.append("machines_light", $("#lightmachine").val());
|
||
formData.append("machines_sheavy", $("#meduimachin").val());
|
||
formData.append("machines_heavy", $("#bigmachin").val());
|
||
let lat = $("#lat-rahdar").val().slice(1, -1);
|
||
let lng = $("#lng-rahdar").val().slice(1, -1);
|
||
lat = lat.replace(/_/g, "");
|
||
lng = lng.replace(/_/g, "");
|
||
formData.append("lat", lat);
|
||
formData.append("lng", lng);
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_overview]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"overview_files_" + i,
|
||
$("input[name=modalUpFileRahdari_overview]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_machinery]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"machinery_files_" + i,
|
||
$("input[name=modalUpFileRahdari_machinery]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_store]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"store_files_" + i,
|
||
$("input[name=modalUpFileRahdari_store]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_office]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"office_files_" + i,
|
||
$("input[name=modalUpFileRahdari_office]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
for (
|
||
let i = 0;
|
||
i < $("input[name=modalUpFileRahdari_others]")[0].files.length;
|
||
i++
|
||
) {
|
||
formData.append(
|
||
"others_files_" + i,
|
||
$("input[name=modalUpFileRahdari_others]")[0].files[i]
|
||
);
|
||
}
|
||
|
||
$("#rahdaredit").modal("hide");
|
||
showLoaderScreen();
|
||
|
||
$.ajax({
|
||
url: "/rahdari-points/" + $("#rahdarid").val(),
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
if (result.data.color) {
|
||
drawPathwithColor(
|
||
result.data.lat_from,
|
||
result.data.lng_from,
|
||
result.data.lat_to,
|
||
result.data.lng_to,
|
||
result.data.color
|
||
);
|
||
}
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function createLeafletMap(ekipP, startP, endP) {
|
||
let bounds = [
|
||
[42.9130026312, 75.6166317076],
|
||
[20.5782370061, 35.5092252948],
|
||
];
|
||
mapradar = new L.map("abrar-map", {
|
||
maxBounds: bounds,
|
||
minZoom: 6,
|
||
minZoom: 6,
|
||
zoomControl: true,
|
||
zoom: 1,
|
||
zoomAnimation: false,
|
||
fadeAnimation: true,
|
||
markerZoomAnimation: true,
|
||
}).setView(ekipP, 14);
|
||
ekipmarker = new L.marker(ekipP, {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).addTo(mapradar);
|
||
|
||
L.tileLayer("https://rmsmap.rmto.ir/141map/{z}/{x}/{y}.png", {}).addTo(
|
||
mapradar
|
||
);
|
||
if (startP[0] != null) {
|
||
startAbrarMarker = new L.marker(startP, {
|
||
icon: startAbrarDivIconrahdar,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
endAbrarMarker = new L.marker(endP, {
|
||
icon: endAbrarDivIconrahdar,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
isSetStartAbrarMarker = true;
|
||
isSetEndAbrarMarker = true;
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(startP);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(endP);
|
||
$("#pin-marker-startrahdar").removeClass("pin-move").addClass("pin-set");
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
|
||
checkMarkersAndDrawPath();
|
||
} else {
|
||
isSetStartAbrarMarker = false;
|
||
isSetEndAbrarMarker = false;
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val("");
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val("");
|
||
$("#pin-marker-startrahdar").removeClass("pin-set");
|
||
$("#pin-marker-endrahdar").removeClass("pin-set");
|
||
startAbrarMarker = new L.marker(ekipP, {
|
||
icon: startAbrarDivIconrahdar,
|
||
draggable: true,
|
||
}).addTo(mapradar);
|
||
endAbrarMarker = new L.marker(ekipP, {
|
||
icon: endAbrarDivIconrahdar,
|
||
draggable: true,
|
||
});
|
||
}
|
||
|
||
mapradar.on("move", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
});
|
||
|
||
mapradar.on("moveend", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
});
|
||
|
||
startAbrarMarker.on("click", function () {
|
||
if (!isSetStartAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetStartAbrarMarker = true;
|
||
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
endAbrarMarker.addTo(mapradar);
|
||
mapradar.setView(markerLatLng);
|
||
}
|
||
});
|
||
|
||
endAbrarMarker.on("click", function () {
|
||
if (!isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetEndAbrarMarker = true;
|
||
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
|
||
checkMarkersAndDrawPath();
|
||
}
|
||
});
|
||
|
||
endAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-endrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath();
|
||
});
|
||
|
||
endAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-endrahdar").removeClass("pin-move");
|
||
|
||
if ($("#pin-marker-endrahdar").hasClass("pin-set") || isSetEndAbrarMarker) {
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#pin-marker-endrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath();
|
||
} else {
|
||
mapradar.setView(endAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
|
||
startAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-startrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath();
|
||
});
|
||
|
||
startAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-startrahdar").removeClass("pin-move");
|
||
|
||
if (
|
||
$("#pin-marker-startrahdar").hasClass("pin-set") ||
|
||
isSetStartAbrarMarker
|
||
) {
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#pin-marker-startrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath();
|
||
} else {
|
||
mapradar.setView(startAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
}
|
||
|
||
function initialMarkerMapValue(ekipP, startP, endP) {
|
||
if (startP[0] == null) {
|
||
isSetStartAbrarMarker = false;
|
||
isSetEndAbrarMarker = false;
|
||
startAbrarMarker.setLatLng(ekipP);
|
||
endAbrarMarker.remove();
|
||
removeStartToEndPath();
|
||
$("#pin-marker-endrahdar").removeClass(" pin-set");
|
||
$("#pin-marker-startrahdar").removeClass(" pin-set");
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val("");
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val("");
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
} else {
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(startP);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").val(endP);
|
||
isSetEndAbrarMarker = true;
|
||
isSetStartAbrarMarker = true;
|
||
startAbrarMarker.setLatLng(startP);
|
||
endAbrarMarker.addTo(mapradar);
|
||
endAbrarMarker.setLatLng(endP);
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#pin-marker-startrahdar").removeClass("pin-move").addClass("pin-set");
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
checkMarkersAndDrawPath();
|
||
}
|
||
startAbrarMarker.on("click", function () {
|
||
if (!isSetStartAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetStartAbrarMarker = true;
|
||
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move pin-warn")
|
||
.addClass("pin-set");
|
||
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#coridoredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
|
||
mapradar.setView(markerLatLng);
|
||
|
||
endAbrarMarker.setLatLng(markerLatLng);
|
||
endAbrarMarker.addTo(mapradar);
|
||
}
|
||
});
|
||
|
||
mapradar.setView(ekipP, 9);
|
||
ekipmarker.setLatLng(ekipP);
|
||
|
||
mapradar.on("move", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-set").addClass("pin-move");
|
||
}
|
||
});
|
||
|
||
mapradar.on("moveend", function () {
|
||
if (!isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
startAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-startrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
|
||
if (isSetStartAbrarMarker && !isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
$("#pin-marker-endrahdar").removeClass("pin-move pin-set");
|
||
}
|
||
});
|
||
|
||
endAbrarMarker.on("click", function () {
|
||
if (!isSetEndAbrarMarker) {
|
||
endAbrarMarker.setLatLng(L.latLng(mapradar.getCenter()));
|
||
isSetEndAbrarMarker = true;
|
||
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
|
||
checkMarkersAndDrawPath();
|
||
}
|
||
});
|
||
|
||
endAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-endrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath();
|
||
});
|
||
|
||
endAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-endrahdar").removeClass("pin-move");
|
||
|
||
if ($("#pin-marker-endrahdar").hasClass("pin-set") || isSetEndAbrarMarker) {
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").val(
|
||
endAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
endAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#rahdaredit input[name=abrar-project-latlng-end]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#pin-marker-endrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath();
|
||
} else {
|
||
mapradar.setView(endAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
|
||
startAbrarMarker.on("drag", function () {
|
||
$("#pin-marker-startrahdar").addClass("pin-move");
|
||
checkMarkersAndDrawPath();
|
||
});
|
||
|
||
startAbrarMarker.on("dragend", function () {
|
||
$("#pin-marker-startrahdar").removeClass("pin-move");
|
||
|
||
if (
|
||
$("#pin-marker-startrahdar").hasClass("pin-set") ||
|
||
isSetStartAbrarMarker
|
||
) {
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").val(
|
||
startAbrarMarker.getLatLng().lat.toFixed(6) +
|
||
startAbrarMarker.getLatLng().lng.toFixed(6)
|
||
);
|
||
$("#rahdaredit input[name=abrar-project-latlng-start]").removeClass(
|
||
"is-invalid-input"
|
||
);
|
||
$("#pin-marker-startrahdar").addClass("pin-set");
|
||
checkMarkersAndDrawPath();
|
||
} else {
|
||
mapradar.setView(startAbrarMarker.getLatLng());
|
||
}
|
||
});
|
||
}
|
||
|
||
function removeStartToEndPath() {
|
||
if (routeControls.length) {
|
||
$(routeControls).each(function (index, control) {
|
||
mapradar.removeControl(control);
|
||
|
||
routeControls.splice(routeControls.indexOf(index), 1);
|
||
});
|
||
}
|
||
}
|
||
|
||
function showAccident251PointEditModal() {
|
||
$("#pointedit").modal("show");
|
||
}
|
||
|
||
$(".layerButton1 > input:radio").change(function () {
|
||
$("#datepickfromdate").removeClass("is-invalid-input");
|
||
if ($(this).is(":checked")) {
|
||
frommDate = $("#datepickfromdate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
frommDate.touched = true;
|
||
|
||
$("#datepicktodate").prop("disabled", "");
|
||
|
||
if (
|
||
frommDate.getState().selected.unixDate >=
|
||
tooDate.getState().selected.unixDate
|
||
) {
|
||
tooDate.setDate(frommDate.getState().selected.unixDate);
|
||
}
|
||
|
||
if (tooDate && tooDate.options && tooDate.options.minDate != unix) {
|
||
let cachedValue = tooDate.getState().selected.unixDate;
|
||
|
||
tooDate.options = { minDate: unix };
|
||
|
||
if (tooDate.touched) {
|
||
tooDate.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
|
||
tooDate = $("#datepicktodate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
tooDate.touched = true;
|
||
},
|
||
});
|
||
$("#choosetime").modal("show");
|
||
showlayer($(this).val());
|
||
} else {
|
||
$("#choosetime").modal("hide");
|
||
}
|
||
});
|
||
|
||
function showlayer(index) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
function clickfindshow(index) {
|
||
if (index == 16) {
|
||
itempoint = 20;
|
||
} else {
|
||
itempoint = parseInt(index) + 1;
|
||
}
|
||
$("#sub_item").empty();
|
||
$("#sub_item").append('<option value="0">انتخاب نوع ریز فعالیت</option>');
|
||
list_sub.forEach((element) => {
|
||
if (element.item == itempoint) {
|
||
$("#sub_item").append(`<option value="${element.sub_item}">
|
||
${element.sub_item_str}
|
||
</option>`);
|
||
}
|
||
});
|
||
if (itempoint == 17) {
|
||
itempoint = 20;
|
||
} else if (itempoint == 18) {
|
||
itempoint = 0;
|
||
}
|
||
}
|
||
|
||
switch (parseInt(index)) {
|
||
case 0: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> مرمت رویه </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText"> فعالیت روزانه و جاری آیتم مرمت رویه</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
break;
|
||
}
|
||
case 1: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> پاکسازی </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری آیتم پاکسازی </h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 2: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> علائم</button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری آیتم علائم</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 3: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> حفاظ</button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری حفاظ</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 4: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> روشنایی</button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری روشنایی</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 5: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> خط کشی </button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری خط کشی</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 6: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> رنگ آمیزی </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری رنگ آمیزی </h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 7: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> شست و شو </button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText"> فعالیت روزانه و جاری شست و شو </h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 8: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> ایمن سازی </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری ایمن سازی </h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 9: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> حریم </button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری حریم </h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 10: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere"> پل </button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری پل</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 11: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> تونل و گالری </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری تونل و گالری</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 12: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> عملیات زمستانی </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری عملیات زمستانی </h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 13: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> ماشین آلات </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText"> فعالیت روزانه و جاری ماشین آلات</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 14: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> راهدارخانه </button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری راهدارخانه</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 15: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> موارد اضطراری</button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری موارد اضطراری</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 16: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append(
|
||
'<button class="showWhereThere"> آیتم های بازدید بازرسی و کنترل</button>'
|
||
);
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">فعالیت روزانه و جاری آیتم های بازدید بازرسی و کنترل</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
case 17: {
|
||
$(".showWhereThere").css("display", "none");
|
||
$("body").append('<button class="showWhereThere">همه فعالیت ها</button>');
|
||
$(".modalTitleText").empty();
|
||
$("#modalTextChange").append(
|
||
'<h4 class="modalTitleText">همه فعالیت ها</h4>'
|
||
);
|
||
showwhertherefunc();
|
||
$("#datepickfromdate").attr("disabled", false);
|
||
$("#datepicktodate").attr("disabled", false);
|
||
$("#province-id").attr("disabled", false);
|
||
$("#select-city").attr("disabled", false);
|
||
$("#sub_item").attr("disabled", false);
|
||
$("#howToShow").attr("disabled", false);
|
||
clickfindshow(index);
|
||
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
function showwhertherefunc() {
|
||
$(".showWhereThere").on("click", function () {
|
||
$("#choosetime").modal("show");
|
||
});
|
||
}
|
||
|
||
frommDate = $("#datepickfromdate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
frommDate.touched = true;
|
||
|
||
$("#datepicktodate").prop("disabled", "");
|
||
|
||
if (
|
||
frommDate.getState().selected.unixDate >=
|
||
tooDate.getState().selected.unixDate
|
||
) {
|
||
tooDate.setDate(frommDate.getState().selected.unixDate);
|
||
}
|
||
|
||
if (tooDate && tooDate.options && tooDate.options.minDate != unix) {
|
||
let cachedValue = tooDate.getState().selected.unixDate;
|
||
|
||
tooDate.options = { minDate: unix };
|
||
|
||
if (tooDate.touched) {
|
||
tooDate.setDate(cachedValue);
|
||
}
|
||
}
|
||
},
|
||
});
|
||
|
||
tooDate = $("#datepicktodate").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
autoClose: true,
|
||
onSelect: function (unix) {
|
||
tooDate.touched = true;
|
||
},
|
||
});
|
||
var showFastReactionPoint = false;
|
||
$("#chooseclock").on("click", function () {
|
||
var first = $("#datepickfromdate");
|
||
var second = $("#datepicktodate");
|
||
var currentDate = [];
|
||
var differece;
|
||
currentDate.from = moment(
|
||
frommDate.getState().selected.year +
|
||
"/" +
|
||
frommDate.getState().selected.month +
|
||
"/" +
|
||
frommDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("M-D-YYYY");
|
||
|
||
currentDate.to = moment(
|
||
tooDate.getState().selected.year +
|
||
"/" +
|
||
tooDate.getState().selected.month +
|
||
"/" +
|
||
tooDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("M-D-YYYY");
|
||
|
||
function parseDate(str) {
|
||
var mdy = str.split("-");
|
||
return new Date(mdy[2], mdy[0] - 1, mdy[1]);
|
||
}
|
||
|
||
function datediff(first, second) {
|
||
differece = Math.round((second - first) / (1000 * 60 * 60 * 24));
|
||
}
|
||
|
||
datediff(parseDate(currentDate.from), parseDate(currentDate.to));
|
||
|
||
$(".leaflet-marker-pane").empty();
|
||
let provinceVal = $("#province-id").val() - 1;
|
||
if (provinceVal !== -1) {
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
success: function (data) {
|
||
let centerLat = data.data[provinceVal].center_lat;
|
||
let centerLong = data.data[provinceVal].center_long;
|
||
|
||
map.flyTo([centerLat, centerLong], 8);
|
||
},
|
||
});
|
||
} else {
|
||
map.setView([35.5468992, 51.7300532], 7);
|
||
}
|
||
|
||
if (
|
||
$("#datepickfromdate").val() != " " &&
|
||
$("#datepicktodate").val() != " "
|
||
) {
|
||
let startDate = moment(
|
||
frommDate.getState().selected.year +
|
||
"/" +
|
||
frommDate.getState().selected.month +
|
||
"/" +
|
||
frommDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let endDate = moment(
|
||
tooDate.getState().selected.year +
|
||
"/" +
|
||
tooDate.getState().selected.month +
|
||
"/" +
|
||
tooDate.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
|
||
provinceId = $("#province-id").children("option:selected").val();
|
||
|
||
subId = $("#sub_item").children("option:selected").val();
|
||
cityId = $("#select-city").children("option:selected").val();
|
||
var namayeshpart = $("#howToShow").children("option:selected").val();
|
||
|
||
if (showFastReactionPoint) {
|
||
showFastFunction(startDate, endDate);
|
||
} else {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url:
|
||
"https://rms.rmto.ir/api/get-items-on-map" +
|
||
"?item=" +
|
||
itempoint +
|
||
"&date_to=" +
|
||
endDate +
|
||
"&date_from=" +
|
||
startDate +
|
||
"&province_id=" +
|
||
provinceId +
|
||
"&city_id=" +
|
||
cityId +
|
||
"&sub_id=" +
|
||
subId,
|
||
type: "GET",
|
||
success: function (result) {
|
||
if (differece >= 30) {
|
||
hideLoaderScreen();
|
||
Swal.fire({
|
||
icon: "warning",
|
||
title: "خطا",
|
||
text: "تاریخ مجاز باید کمتر از 30 روز باشد",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
$("#datepickfromdate").addClass("is-invalid-input");
|
||
} else {
|
||
$("#datepickfromdate").removeClass("is-invalid-input");
|
||
if (result.count >= 500000000) {
|
||
hideLoaderScreen();
|
||
if ($("#howToShow").val() == 1) {
|
||
$("#howToShow").removeClass("is-invalid-input");
|
||
$("#choosetime").modal("hide");
|
||
show_point_rahdari(result.data, namayeshpart);
|
||
} else {
|
||
Swal.fire({
|
||
icon: "warning",
|
||
title: "خطا",
|
||
text: "نوع نمایش را کلاستر قرار دهید",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
$("#howToShow").addClass("is-invalid-input");
|
||
}
|
||
} else {
|
||
$("#howToShow").removeClass("is-invalid-input");
|
||
$("#choosetime").modal("hide");
|
||
show_point_rahdari(result.data, namayeshpart);
|
||
}
|
||
}
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "خطا در دریافت اطلاعات",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
},
|
||
});
|
||
}
|
||
}
|
||
//mohammad changes
|
||
});
|
||
|
||
function headermodal(item) {
|
||
$("#headerid").empty();
|
||
if (item == 1) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> مرمت رویه </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 2) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> پاکسازی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 3) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> علائم </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 4) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> حفاظ </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 5) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> روشنایی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 6) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> خط کشی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 7) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> رنگ آمیزی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 8) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> شستشو </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 9) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> ایمن سازی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 10) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> حریم </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 11) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> پل </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 12) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> تونل و گالری </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 13) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> عملیات زمستانی </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 14) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> ماشین آلات </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 15) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> راهدارخانه </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
} else if (item == 16) {
|
||
$("#headerid").append(
|
||
'<h4 class="modal-title starter-project-page"> موارد اضطراری </h4> <button type="button" class="close" data-dismiss="modal">×</button >'
|
||
);
|
||
}
|
||
}
|
||
|
||
function getdatacheck(data) {
|
||
subarray = [];
|
||
vahedarray = [];
|
||
strarray = [];
|
||
meghararray = [];
|
||
$("#edarepoint").val(data.items.province_fa);
|
||
$("#citypoint").val(data.items.user_name);
|
||
$("#datepoint").val(data.items.created_at_fa);
|
||
GenerateTablefilter(
|
||
data.items.sub_item_fa,
|
||
data.items.sub_item_data,
|
||
data.items.unit_fa
|
||
);
|
||
}
|
||
|
||
function GenerateTablefilter(name, number, vahed) {
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
customers.push(["ردیف", "ریزفعالیت ", "مقدار"]);
|
||
|
||
// for (let i = 0; i < name.length; i++) {
|
||
customers.push([1, name, number + vahed]);
|
||
// }
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
var columnCount = customers[0].length;
|
||
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showtable");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
|
||
function show_point(data) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
marker141Layers = L.markerClusterGroup();
|
||
let markerG = [];
|
||
for (let index = 0; index < data.length; index++) {
|
||
let marker = L.marker([data[index].start_lat, data[index].start_lng], {
|
||
icon: redIconFix,
|
||
}).on("click", function (e) {
|
||
$("#datepoint").val(data[index].created_at);
|
||
$("#edarepoint").val(data[index].province_name);
|
||
$("#citypoint").val(data[index].city_name);
|
||
headermodal(data[index].item);
|
||
$("#showpoint").modal("show");
|
||
GenerateTable(
|
||
data[index].sub_items,
|
||
data[index].sub_items_data,
|
||
data[index].item
|
||
);
|
||
show_point_photo(data[index].files);
|
||
});
|
||
markerG.push(marker);
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
}
|
||
|
||
function GenerateTable(item, dataitem, numberitem) {
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
customers.push(["ردیف", "ریزفعالیت ", "مقدار"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([
|
||
i + 1,
|
||
subshow(item[i], numberitem),
|
||
showcount(item[i], dataitem, numberitem),
|
||
]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
var columnCount = customers[0].length;
|
||
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showtable");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
|
||
function subshow(index, numberitem) {
|
||
if (numberitem == 1) {
|
||
if (index == 1) {
|
||
return "ترمیم افتادگی لبه آسفالت";
|
||
}
|
||
if (index == 2) {
|
||
return "شانه سازی";
|
||
}
|
||
if (index == 3) {
|
||
return "پر کردن گودافتادگی یا چاله با آسفالت";
|
||
}
|
||
if (index == 4) {
|
||
return "لکه گیری هندسی راه";
|
||
}
|
||
if (index == 5) {
|
||
return "مرمت آبشستگی راه ها و شانه راه ها";
|
||
}
|
||
if (index == 6) {
|
||
return "تنظیم سطح بستر حریم";
|
||
}
|
||
if (index == 8) {
|
||
return "درزگیری";
|
||
}
|
||
if (index == 9) {
|
||
return "مضرس کردن سطح راه ";
|
||
}
|
||
if (index == 10) {
|
||
return " تراشه رویه های موج زده ";
|
||
}
|
||
if (index == 11) {
|
||
return " تیغ زنی راه های روستایی";
|
||
}
|
||
if (index == 12) {
|
||
return " شن ریزی ،تسطیح و کمپکت راه روستایی";
|
||
}
|
||
if (index == 13) {
|
||
return " عملیات تسطیح ،خاکبرداری و خاکریزی در رفوژ میانی";
|
||
}
|
||
} else if (numberitem == 2) {
|
||
if (index == 1) {
|
||
return "پاک سازی و جاروزنی سطح راه";
|
||
}
|
||
if (index == 2) {
|
||
return "پاک سازی و تنقیه آبروهای کوچک";
|
||
}
|
||
if (index == 3) {
|
||
return "پاک سازی سطح راه از لاشه حیوانات";
|
||
}
|
||
if (index == 4) {
|
||
return "پاک سازی قنوها و آبروهای طولی";
|
||
}
|
||
if (index == 5) {
|
||
return "پاک سازی سطح راه از آثار تصادفات";
|
||
}
|
||
if (index == 6) {
|
||
return "علف کنی و بوته کنی" + "<br>";
|
||
}
|
||
if (index == 7) {
|
||
return "پاک سازی حریم راه از مواد زائد و نخاله های ساختمانی";
|
||
}
|
||
if (index == 8) {
|
||
return "جمع آوری قطعات آسیب دیده حفاظ، علائم و ...";
|
||
}
|
||
if (index == 9) {
|
||
return "پاکسازی پارکینگ راه ها";
|
||
}
|
||
if (index == 9) {
|
||
return "پاکسازی پارکینگ راه ها";
|
||
}
|
||
if (index == 10) {
|
||
return "پاکسازی کنار قرنیز پلها ،دیواره تونل ها ، جداول و نیوجرسی از مصالح انباشته شده";
|
||
}
|
||
if (index == 11) {
|
||
return "پاکسازی و تمیز کاری جزیره های میانی";
|
||
}
|
||
if (index == 12) {
|
||
return "پاکسازی و تنقیه داخل پل ها";
|
||
}
|
||
if (index == 13) {
|
||
return "پاکسازی و تنقیه سیفون ها";
|
||
}
|
||
if (index == 14) {
|
||
return "پاکسازی و جمع آوری شاخه درختان از دهانه آبنماهای لوله ای";
|
||
}
|
||
if (index == 15) {
|
||
return "پاکسازی سطح راه از مواد نفتی یا روغنی";
|
||
}
|
||
if (index == 15) {
|
||
return "پاکسازی سطح راه از مواد نفتی یا روغنی";
|
||
}
|
||
if (index == 16) {
|
||
return "علف کنی و بوته کنی بصورت دستی اطراف تابلو ، علائم ،...";
|
||
}
|
||
if (index == 17) {
|
||
return "ریزش برداری";
|
||
}
|
||
if (index == 18) {
|
||
return "جمع آوری خرده سنگهای ریزشی";
|
||
}
|
||
if (index == 19) {
|
||
return "لایروبی";
|
||
}
|
||
} else if (itempoint == 3) {
|
||
if (index == 1) {
|
||
return "نصب تابلوهای اخطاری، انتظامی و مسیرنما";
|
||
}
|
||
if (index == 2) {
|
||
return "نصب تابلوهای اطلاعاتی";
|
||
}
|
||
if (index == 3) {
|
||
return "تعویض شبرنگ تابلوهای اطلاعاتی";
|
||
}
|
||
if (index == 4) {
|
||
return "نصب بازتاب بر روی گاردریل و حفاظ های حاشیه راه و چشم گربه ای";
|
||
}
|
||
if (index == 5) {
|
||
return " تعویض صفحه های تابلوهای اخطاری ، انتظامی فاقد بازتاب و معیوب ";
|
||
}
|
||
if (index == 6) {
|
||
return "مرمت شکستگی ، خم شدگی و ... تابلوهای اطلاعاتی ";
|
||
}
|
||
if (index == 7) {
|
||
return "اصلاح کج شدگی پایه تابلوها و علائم ";
|
||
}
|
||
if (index == 8) {
|
||
return "نصب یا برداشتن علائم موقت ";
|
||
}
|
||
} else if (itempoint == 4) {
|
||
if (index == 1) {
|
||
return "ارتقای حفاظ موجود میانی راه ها با حفاظ های مرسوم یا سایر روش ها";
|
||
}
|
||
if (index == 2) {
|
||
return (
|
||
"ارتقای حفاظ موجود پل ها و پرتگاه ها با حفاظ های مرسوم یا سایر روش ها" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 3) {
|
||
return "بهسازی حفاظ های موجود و آسیب دیده" + "<br>";
|
||
}
|
||
} else if (itempoint == 5) {
|
||
if (index == 1) {
|
||
return "نگهداری و پاکسازی روشنایی طولی راه";
|
||
}
|
||
if (index == 2) {
|
||
return " نگهداری و پاکسازی روشنایی نقطه ای در حاشیه راه";
|
||
}
|
||
if (index == 3) {
|
||
return " نگهداری و پاکسازی روشنایی نقطه ای تقاطع در حاشیه راه";
|
||
}
|
||
if (index == 4) {
|
||
return "نگهداری و پاکسازی روشنایی نقطه ای محل نصب دوربین در حاشیه راه";
|
||
}
|
||
if (index == 5) {
|
||
return "نگهداری و پاکسازی روشنایی طولی نواحی یا گردنه های مه گیر";
|
||
}
|
||
if (index == 6) {
|
||
return " نگهداری و پاکسازی روشنایی تونل";
|
||
}
|
||
if (index == 7) {
|
||
return " تعمیرات شبکه روشنایی (کابل)";
|
||
}
|
||
if (index == 8) {
|
||
return " تعمیرات شبکه روشنایی (کله چراغ)";
|
||
}
|
||
if (index == 9) {
|
||
return " تعمیرات شبکه روشنایی (مفصل زنی )";
|
||
}
|
||
if (index == 10) {
|
||
return " تعمیرات شبکه روشنایی (تعمیر تابلو )";
|
||
}
|
||
if (index == 10) {
|
||
return " تعمیرات برج نوری";
|
||
}
|
||
} else if (itempoint == 6) {
|
||
if (index == 1) {
|
||
return "خط کشی با رنگ گرم ترافیکی";
|
||
}
|
||
if (index == 2) {
|
||
return "خط کشی با رنگ سرد ترافیکی";
|
||
}
|
||
if (index == 3) {
|
||
return "ترسیم نقوش، فلش، خط نوشته و ...";
|
||
}
|
||
if (index == 4) {
|
||
return "اجرای اکستروژن طولی";
|
||
}
|
||
if (index == 5) {
|
||
return "اجرای اکستروژن عرضی";
|
||
}
|
||
if (index == 5) {
|
||
return "پاک کردن خطوط ترافیکی از سطح راه";
|
||
}
|
||
} else if (itempoint == 7) {
|
||
if (index == 1) {
|
||
return "رنگ آمیزی پایه تابلوها";
|
||
}
|
||
if (index == 2) {
|
||
return "رنگ آمیزی پایه چراغ ها";
|
||
}
|
||
if (index == 3) {
|
||
return "رنگ آمیزی پایه های روشنایی";
|
||
}
|
||
if (index == 4) {
|
||
return "رنگ آمیزی پل های عابر پیاده";
|
||
}
|
||
if (index == 5) {
|
||
return "رنگ آمیزی پایه تابلوهای دروازه ای";
|
||
}
|
||
if (index == 6) {
|
||
return "رنگ آمیزی حفاظ های فلزی";
|
||
}
|
||
if (index == 7) {
|
||
return "رنگ آمیری نیوجرسی ها و سایر حفاظ بتنی";
|
||
}
|
||
if (index == 8) {
|
||
return "رنگ آمیزی سرعتگاه";
|
||
}
|
||
if (index == 9) {
|
||
return " رنگ آمیزی پایه و کوله پل ها جهت آشکارسازی";
|
||
}
|
||
} else if (itempoint == 8) {
|
||
if (index == 1) {
|
||
return "شستشوی علائم ایمنی اخطاری، انتظامی، مسیرنما و ...";
|
||
}
|
||
if (index == 2) {
|
||
return " شستشوی تابلوهای اطلاعاتی";
|
||
}
|
||
if (index == 3) {
|
||
return " شستشوی جداول";
|
||
}
|
||
if (index == 4) {
|
||
return " شستشوی نیوجرسی ها";
|
||
}
|
||
if (index == 5) {
|
||
return " شستشوی گاردریل ها و هندریل ها";
|
||
}
|
||
if (index == 6) {
|
||
return "شستشوی دیواره تونل ها";
|
||
}
|
||
if (index == 7) {
|
||
return "شستشوی تکیه گاه پل ها";
|
||
}
|
||
} else if (itempoint == 9) {
|
||
if (index == 1) {
|
||
return "ایمن سازی سرگاردریل، موانع صلب، دماغه ها و موانع صلب";
|
||
}
|
||
|
||
if (index == 4) {
|
||
return "نصب و راه اندازی چراغ های آذرخشی و چشمک زن";
|
||
}
|
||
if (index == 5) {
|
||
return "ایجاد شیارهای لرزاننده ی طولی در لاین کنار";
|
||
}
|
||
if (index == 6) {
|
||
return "ضربه گیر استوانه ای";
|
||
}
|
||
if (index == 7) {
|
||
return "نصب سرعت گیر استاندارد پلاستیکی";
|
||
}
|
||
if (index == 8) {
|
||
return "ایجاد شیار های لرزاننده طولی در اکس راه های دو طرفه";
|
||
}
|
||
if (index == 9) {
|
||
return "استوانه ایمنی جهت هدایت ترافیک";
|
||
}
|
||
if (index == 11) {
|
||
return "احداث سرعت گیر آسفالتی";
|
||
}
|
||
if (index == 12) {
|
||
return "اجرای هره خاکی نقطه ای";
|
||
}
|
||
if (index == 13) {
|
||
return " اجرای هره خاکی طولی";
|
||
}
|
||
if (index == 14) {
|
||
return " تعریض مقطعی جهت خروج اضطراری در سراشیبی ها";
|
||
}
|
||
if (index == 15) {
|
||
return " حذف یا جابه جایی موانع صلب در حاشیه راه در محدوده عاری از مانع";
|
||
}
|
||
} else if (itempoint == 10) {
|
||
if (index == 1) {
|
||
return "اخطار،تخریب،بازدیدو یا تهیه اطلاعات از ساخت و ساز در حریم";
|
||
}
|
||
if (index == 2) {
|
||
return "اخطار ،تخریب،بازدیدو یا تهیه اطلاعات از راه دسترسی در حریم";
|
||
}
|
||
if (index == 3) {
|
||
return "اخطار ،تخریب،بازدیدو یا تهیه اطلاعات از عبور تاسیسات زیربنایی در حریم";
|
||
}
|
||
if (index == 4) {
|
||
return "برخورد با دستفروشان حاشیه راه";
|
||
}
|
||
if (index == 5) {
|
||
return "جمع آوری تابلوهای غیرمجاز در حاشیه راه ها";
|
||
}
|
||
if (index == 6) {
|
||
return "جمع آوری بنر های تبلیغاتی غیر مجاز";
|
||
}
|
||
} else if (itempoint == 11) {
|
||
if (index == 1) {
|
||
return "احداث یا مرمت قرنیز پل";
|
||
}
|
||
if (index == 2) {
|
||
return "لوله گذاری آبروها";
|
||
}
|
||
if (index == 3) {
|
||
return "تطویل و رفع انسداد آبچکان پل ها";
|
||
}
|
||
if (index == 4) {
|
||
return "بازسازی نرده پل";
|
||
}
|
||
if (index == 5) {
|
||
return "تعمیرات آبرو شامل کوله دستک و دال";
|
||
}
|
||
if (index == 6) {
|
||
return "مرمت و بازسازی درز انبساط";
|
||
}
|
||
if (index == 7) {
|
||
return "تعمیرات رادیه و برید";
|
||
}
|
||
} else if (itempoint == 12) {
|
||
if (index == 1) {
|
||
return "زهکشی طاق تونل";
|
||
}
|
||
if (index == 2) {
|
||
return "مرمت و بازرسی آبروهای هدایت آب";
|
||
}
|
||
if (index == 3) {
|
||
return "لاینینگ";
|
||
}
|
||
if (index == 4) {
|
||
return "تعمیر و بازسازی گالری";
|
||
}
|
||
if (index == 5) {
|
||
return "گاباریت";
|
||
}
|
||
if (index == 6) {
|
||
return "نگهداری دوربین ها و ابزار دقیق";
|
||
}
|
||
if (index == 7) {
|
||
return "نگهداری تهویه تونل";
|
||
}
|
||
} else if (itempoint == 13) {
|
||
if (index == 1) {
|
||
return "عملیات یخ زدایی با شن و نمک پاشی";
|
||
}
|
||
if (index == 2) {
|
||
return "برف روبی";
|
||
}
|
||
|
||
if (index == 5) {
|
||
return "میزان نمک شن و ماسه مصرفی";
|
||
}
|
||
|
||
if (index == 7) {
|
||
return "مسافرین اسکان داده شده";
|
||
}
|
||
if (index == 8) {
|
||
return "کمک رسانی به خودرو";
|
||
}
|
||
} else if (itempoint == 14) {
|
||
if (index == 1) {
|
||
return "بنزین مصرفی کل ماشین آلات فعال -ماهانه";
|
||
}
|
||
if (index == 2) {
|
||
return "گازوئیل مصرفی کل ماشین آلات فعال - ماهانه";
|
||
}
|
||
if (index == 3) {
|
||
return " مواد مصرفی نفتی و انواع روغن -ماهانه";
|
||
}
|
||
if (index == 4) {
|
||
return "بازسازی و راه اندازی ماشین آلات";
|
||
}
|
||
if (index == 8) {
|
||
return "سرویس کاری و تعمیرات جزئی روزانه";
|
||
}
|
||
if (index == 9) {
|
||
return "شستشو نمک پاش ها و سایر ماشین آلات";
|
||
}
|
||
if (index == 10) {
|
||
return "جابه جایی دستگاهای سنگین راهداری";
|
||
}
|
||
} else if (itempoint == 15) {
|
||
if (index == 4) {
|
||
return "تعمیرات جزئی و موردی راهدارخانه ها";
|
||
}
|
||
if (index == 3) {
|
||
return "جلسات تشکیل شده در خصوص مدیریت بحران و پدافند غیرعامل";
|
||
}
|
||
} else if (itempoint == 16) {
|
||
if (index == 1) {
|
||
return (
|
||
"پاک سازی سطح راه و رفع انسداد ناشی از ریزش کوه و سقوط بهمن" + "<br>"
|
||
);
|
||
}
|
||
if (index == 2) {
|
||
return (
|
||
"برقراری تردد و رفع انسداد ناشی از وقوع تصادف یا واژگونی وسایط نقلیه و پخش محموله در سطح راه" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 3) {
|
||
return "برقراری ارتباط و رفع انسداد ناشی از شن های روان" + "<br>";
|
||
}
|
||
if (index == 4) {
|
||
return (
|
||
"برقراری ارتباط در راه هایی که به دلیل آب بردگی دچار قطع ارتباط شده اند" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 5) {
|
||
return (
|
||
"برقراری ارتباط موقت در راه هایی که به دلیل شکستگی پل یا ریزش تونل یا ... قطع شده اند" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 6) {
|
||
return "بستن راه و هدایت ترافیکی در مواقع اضطراری" + "<br>";
|
||
}
|
||
if (index == 7) {
|
||
return "بازگشایی محور هایی که به علت کولاک مسدود شده اند" + "<br>";
|
||
}
|
||
if (index == 8) {
|
||
return "جابه جایی ماشین های سنگین گرفتار در سطح راه" + "<br>";
|
||
}
|
||
if (index == 9) {
|
||
return "لق گیری" + "<br>";
|
||
}
|
||
} else if (itempoint == 20) {
|
||
if (index == 1) {
|
||
return (
|
||
"بازدید ادواری از ابنیه فنی و تکمیل چک لیست های مربوط توسط کارشناسان" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 2) {
|
||
return (
|
||
"بازدید ادواری از وضعیت علائم و تعیین کسری علائم و ارزیابی وضعیت خط کشی ها ، تجهیزات روشنایی و تهویه تونلها و گاردریل و نظایر آنها و تکمیل چک لیستها توسط کارشناسان" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 3) {
|
||
return (
|
||
"ارزیابی ادواری وضعیت پایداری ترانشه ها و شیروانیها، سیستم های زهکشی و ارزیابی علل ریزش ترانشه ها و علل شکست راه و تکمیل چک لیست توسط کارشناسان" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 4) {
|
||
return (
|
||
"ارزیابی ادواری وضعیت رویه های آسفالتی و شانه ها و ارزیابی و کنترل ترکها و تکمیل چک لیستها توسط کارشناسان" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 5) {
|
||
return (
|
||
"بررسی وضعیت حریم راه و تهیه گزارش مربوط با تجهیز و اعزام کارشناس" +
|
||
"<br>"
|
||
);
|
||
}
|
||
if (index == 6) {
|
||
return "بازديد كارشناسان از ماشين آلات استان" + "<br>";
|
||
}
|
||
}
|
||
}
|
||
|
||
function showcount(item, data, itemselected) {
|
||
if (itemselected == 1) {
|
||
let textfile = "";
|
||
if (item == 13) {
|
||
if (data["reconstruction13-1"] != undefined) {
|
||
return data["reconstruction13-1"] + "متر مکعب";
|
||
}
|
||
}
|
||
if (item == 8) {
|
||
if (data["reconstruction8-1"] != undefined) {
|
||
return data["reconstruction8-1"] + "متر طول";
|
||
}
|
||
}
|
||
if (item == 9) {
|
||
if (data["reconstruction9-1"] != undefined) {
|
||
return data["reconstruction9-1"] + "متر مربع";
|
||
}
|
||
}
|
||
if (item == 10) {
|
||
if (data["reconstruction10-1"] != undefined) {
|
||
return data["reconstruction10-1"] + "متر مربع";
|
||
}
|
||
}
|
||
if (item == 11) {
|
||
if (data["reconstruction11-1"] != undefined) {
|
||
return data["reconstruction11-1"] + " کیلومتر";
|
||
}
|
||
}
|
||
if (item == 12) {
|
||
if (data["reconstruction12-1"] != undefined) {
|
||
return data["reconstruction12-1"] + " کیلومتر";
|
||
}
|
||
}
|
||
if (item == 13) {
|
||
if (data["reconstruction13-1"] != undefined) {
|
||
return data["reconstruction13-1"] + " متر مکعب ";
|
||
}
|
||
} else if (item == 6) {
|
||
if (data["reconstruction6-1"] != undefined) {
|
||
return data["reconstruction6-1"] + "کیلومتر ";
|
||
}
|
||
}
|
||
if (item == 1) {
|
||
if (data["reconstruction1-1"] != undefined) {
|
||
textfile = data["reconstruction1-1"] + "کیلومتر " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["reconstruction2-1"] != undefined) {
|
||
textfile = data["reconstruction2-1"] + " کیلومتر" + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["reconstruction3-1"] != undefined) {
|
||
textfile = data["reconstruction3-1"] + " تن" + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["reconstruction4-1"] != undefined) {
|
||
textfile = data["reconstruction4-1"] + "متر مربع " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["reconstruction5-1"] != undefined) {
|
||
textfile = data["reconstruction5-1"] + "متر مکعب " + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 2) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["cleaning1-1"] != undefined) {
|
||
textfile += data["cleaning1-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["cleaning2-1"] != undefined) {
|
||
textfile += data["cleaning2-1"] + "متر مکعب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["cleaning3-1"] != undefined) {
|
||
textfile += data["cleaning3-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["cleaning4-1"] != undefined) {
|
||
textfile += data["cleaning4-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["cleaning5-1"] != undefined) {
|
||
textfile += data["cleaning5-1"] + "مترطول-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["cleaning6-1"] != undefined) {
|
||
textfile += data["cleaning6-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["cleaning7-1"] != undefined) {
|
||
textfile += data["cleaning7-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["cleaning8-1"] != undefined) {
|
||
textfile += data["cleaning8-1"] + "تن" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 9) {
|
||
if (data["cleaning9-1"] != undefined) {
|
||
textfile += data["cleaning9-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 10) {
|
||
if (data["cleaning10-1"] != undefined) {
|
||
textfile += data["cleaning10-1"] + "متر مکعب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 11) {
|
||
if (data["cleaning11-1"] != undefined) {
|
||
textfile += data["cleaning11-1"] + "متر مربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 12) {
|
||
if (data["cleaning12-1"] != undefined) {
|
||
textfile += data["cleaning12-1"] + " متر مکعب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 13) {
|
||
if (data["cleaning13-1"] != undefined) {
|
||
textfile += data["cleaning13-1"] + " متر مکعب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 14) {
|
||
if (data["cleaning14-1"] != undefined) {
|
||
textfile += data["cleaning14-1"] + " نفرساعت" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 15) {
|
||
if (data["cleaning15-1"] != undefined) {
|
||
textfile += data["cleaning15-1"] + " متر طول - باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 16) {
|
||
if (data["cleaning16-1"] != undefined) {
|
||
textfile += data["cleaning16-1"] + " متر مربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 17) {
|
||
if (data["cleaning17-1"] != undefined) {
|
||
textfile += data["cleaning17-1"] + " مقطع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 18) {
|
||
if (data["cleaning18-1"] != undefined) {
|
||
textfile += data["cleaning18-1"] + " نفر-ساعت" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 19) {
|
||
if (data["cleaning19-1"] != undefined) {
|
||
textfile += data["cleaning19-1"] + " متر مکعب" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 3) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["signs1-1"] != undefined) {
|
||
textfile += data["signs1-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["signs2-1"] != undefined) {
|
||
textfile += data["signs2-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["signs3-1"] != undefined) {
|
||
textfile += data["signs3-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["signs4-1"] != undefined) {
|
||
textfile += data["signs4-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["signs5-1"] != undefined) {
|
||
textfile += data["signs5-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["signs6-1"] != undefined) {
|
||
textfile += data["signs6-1"] + "متر مربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["signs7-1"] != undefined) {
|
||
textfile += data["signs7-1"] + "عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["signs8-1"] != undefined) {
|
||
textfile += data["signs8-1"] + "عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 4) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["shield1-2-1"] != undefined) {
|
||
return data["shield1-2-1"] + "متر-طول";
|
||
}
|
||
}
|
||
if (item == 2) {
|
||
if (data["shield2-2-1"] != undefined) {
|
||
return data["shield2-2-1"] + "متر-طول";
|
||
}
|
||
}
|
||
if (item == 3) {
|
||
if (data["shield3-2-1"] != undefined) {
|
||
return data["shield3-2-1"] + "متر-طول";
|
||
}
|
||
}
|
||
} else if (itempoint == 5) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["lighting1-2-1"] != undefined) {
|
||
textfile += data["lighting1-2-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["lighting2-2-1"] != undefined) {
|
||
textfile += data["lighting2-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 3) {
|
||
if (data["lighting3-2-1"] != undefined) {
|
||
textfile += data["lighting3-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 4) {
|
||
if (data["lighting4-2-1"] != undefined) {
|
||
textfile += data["lighting4-2-1"] + "موردی" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 5) {
|
||
if (data["lighting5-2-1"] != undefined) {
|
||
textfile += data["lighting5-2-1"] + "متر طول" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 6) {
|
||
if (data["lighting6-2-1"] != undefined) {
|
||
textfile += data["lighting6-2-1"] + "متر طول" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 7) {
|
||
if (data["lighting7-2-1"] != undefined) {
|
||
textfile += data["lighting7-2-1"] + "متر طول" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["lighting8-2-1"] != undefined) {
|
||
textfile += data["lighting8-2-1"] + " عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 9) {
|
||
if (data["lighting9-2-1"] != undefined) {
|
||
textfile += data["lighting9-2-1"] + " عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 10) {
|
||
if (data["lighting10-2-1"] != undefined) {
|
||
textfile += data["lighting10-2-1"] + " عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 11) {
|
||
if (data["lighting11-2-1"] != undefined) {
|
||
textfile += data["lighting11-2-1"] + " عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itempoint == 6) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["lining1-1"] != undefined) {
|
||
textfile += data["lining1-1"] + "کیلومتر-رنگ" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["lining2-1"] != undefined) {
|
||
textfile += data["lining2-1"] + "کیلومتر-رنگ" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["lining3-1"]) {
|
||
textfile += data["lining3-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["lining4-1"]) {
|
||
textfile += data["lining4-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["lining5-1"]) {
|
||
textfile += data["lining5-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["lining6-1"]) {
|
||
textfile += data["lining6-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 7) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["coloring1-1"] != undefined) {
|
||
textfile += data["coloring1-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["coloring2-1"] != undefined) {
|
||
textfile += data["coloring2-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["coloring3-1"] != undefined) {
|
||
textfile += data["coloring3-1"] + "اصله" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["coloring4-1"] != undefined) {
|
||
textfile += data["coloring4-1"] + "دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["coloring5-1"] != undefined) {
|
||
textfile += data["coloring5-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["coloring6-1"] != undefined) {
|
||
textfile += data["coloring6-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["coloring7-1"] != undefined) {
|
||
textfile += data["coloring7-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["coloring8-1"] != undefined) {
|
||
textfile += data["coloring8-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 9) {
|
||
if (data["coloring9-1"] != undefined) {
|
||
textfile += data["coloring9-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 8) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["washing1-1"] != undefined) {
|
||
textfile += data["washing1-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["washing2-1"] != undefined) {
|
||
textfile += data["washing2-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["washing3-1"] != undefined) {
|
||
textfile += data["washing3-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["washing4-1"] != undefined) {
|
||
textfile += data["washing4-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["washing5-1"] != undefined) {
|
||
textfile += data["washing5-1"] + "کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["washing6-1"] != undefined) {
|
||
textfile += data["washing6-1"] + "مترمربع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["washing7-1"] != undefined) {
|
||
textfile += data["washing7-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 9) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["securing1-1"] != undefined) {
|
||
textfile += data["securing1-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
|
||
if (item == 4) {
|
||
if (data["securing4-1"] != undefined) {
|
||
textfile += data["securing4-1"] + "دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["securing5-1"] != undefined) {
|
||
textfile += data["securing5-1"] + "کیلومتر-شیار" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["securing6-1"] != undefined) {
|
||
textfile += data["securing6-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["securing7-1"] != undefined) {
|
||
textfile += data["securing7-1"] + "طول" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["securing8-1"] != undefined) {
|
||
textfile += data["securing8-1"] + "کیلومتر-شیار" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 9) {
|
||
if (data["securing9-1"] != undefined) {
|
||
textfile += data["securing9-1"] + "عدد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 11) {
|
||
if (data["securing11-1"] != undefined) {
|
||
textfile += data["securing11-1"] + "متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 12) {
|
||
if (data["securing12-1"] != undefined) {
|
||
textfile += data["securing12-1"] + "موردی " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 13) {
|
||
if (data["securing13-1"] != undefined) {
|
||
textfile += data["securing13-1"] + "متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 14) {
|
||
if (data["securing14-1"] != undefined) {
|
||
textfile += data["securing14-1"] + "متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 15) {
|
||
if (data["securing15-1"] != undefined) {
|
||
textfile += data["securing15-1"] + " عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 10) {
|
||
var textfile = "";
|
||
|
||
if (item == 1) {
|
||
if (data["privacy1-1"] != undefined) {
|
||
textfile += data["privacy1-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["privacy2-1"] != undefined) {
|
||
textfile += data["privacy2-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["privacy2-1"] != undefined) {
|
||
textfile += data["privacy2-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["privacy3-1"] != undefined) {
|
||
textfile += data["privacy3-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["privacy4-1"] != undefined) {
|
||
textfile += data["privacy4-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["privacy5-1"] != undefined) {
|
||
textfile += data["privacy5-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["privacy6-1"] != undefined) {
|
||
textfile += data["privacy6-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 11) {
|
||
var textfile = "";
|
||
|
||
if (item == 1) {
|
||
if (data["bridge1-1"] != undefined) {
|
||
textfile += data["bridge1-1"] + " متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["bridge2-1"] != undefined) {
|
||
textfile += data["bridge2-1"] + " متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["bridge3-1"] != undefined) {
|
||
textfile += data["bridge3-1"] + " تعداد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["bridge3-1"] != undefined) {
|
||
textfile += data["bridge3-1"] + " متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["bridge4-1"] != undefined) {
|
||
textfile += data["bridge4-1"] + " متر مکعب " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["bridge5-1"] != undefined) {
|
||
textfile += data["bridge5-1"] + " متر مکعب " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["bridge6-1"] != undefined) {
|
||
textfile += data["bridge6-1"] + " عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["bridge7-1"] != undefined) {
|
||
textfile += data["bridge7-1"] + " متر مکعب " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 12) {
|
||
var textfile = "";
|
||
if (item == 1) {
|
||
if (data["tunnel1-1"] != undefined) {
|
||
textfile += data["tunnel1-1"] + " مورد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["tunnel2-1"] != undefined) {
|
||
textfile += data["tunnel2-1"] + " متر طول " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["tunnel3-1"] != undefined) {
|
||
textfile += data["tunnel3-1"] + " متر مکعب " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["tunnel4-1"] != undefined) {
|
||
textfile += data["tunnel4-1"] + " عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["tunnel5-1"] != undefined) {
|
||
textfile += data["tunnel5-1"] + " عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["tunnel6-1"] != undefined) {
|
||
textfile += data["tunnel6-1"] + " عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["tunnel7-1"] != undefined) {
|
||
textfile += data["tunnel7-1"] + " عدد " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 13) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["winterOperation1-1"] != undefined) {
|
||
textfile += data["winterOperation1-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["winterOperation1-2"] != undefined) {
|
||
textfile += data["winterOperation1-2"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["winterOperation3-1"] != undefined) {
|
||
textfile += data["winterOperation3-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["winterOperation4-1"] != undefined) {
|
||
textfile += data["winterOperation4-1"] + "کیلومتر-باند" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["winterOperation5-1"] != undefined) {
|
||
textfile += data["winterOperation5-1"] + "تن" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["winterOperation6-1"] != undefined) {
|
||
textfile += data["winterOperation6-1"] + "مقطع" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["winterOperation7-1"] != undefined) {
|
||
textfile += data["winterOperation7-1"] + "تعداد" + "<br>";
|
||
} else textfile = "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["winterOperation8-1"] != undefined) {
|
||
textfile += data["winterOperation8-1"] + "تعداد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 14) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["machinery1-1"] != undefined) {
|
||
textfile += data["machinery1-1"] + "لیتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["machinery2-1"] != undefined) {
|
||
textfile += data["machinery2-1"] + "لیتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["machinery3-1"] != undefined) {
|
||
textfile += data["machinery3-1"] + "لیتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["machinery4-1"] != undefined) {
|
||
textfile += data["machinery4-1"] + "تعداد دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["machinery5-1"] != undefined) {
|
||
textfile += data["machinery5-1"] + "تعداد دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["machinery8-1"] != undefined) {
|
||
textfile += data["machinery8-1"] + "تعداد دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 9) {
|
||
if (data["machinery9-1"] != undefined) {
|
||
textfile += data["machinery9-1"] + "تعداد دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 10) {
|
||
if (data["machinery10-1"] != undefined) {
|
||
textfile += data["machinery10-1"] + " مسافت کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 15) {
|
||
let textfile = "";
|
||
if (item == 4) {
|
||
if (data["machinery4-1"] != undefined) {
|
||
textfile += data["machinery4-1"] + " مورد" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 16) {
|
||
var textfile = "";
|
||
if (item == 1) {
|
||
if (data["emergency1-1"] != undefined) {
|
||
textfile += data["emergency1-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["emergency2-1"] != undefined) {
|
||
textfile += data["emergency2-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["emergency3-1"] != undefined) {
|
||
textfile += data["emergency3-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["emergency4-1"] != undefined) {
|
||
textfile += data["emergency4-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["emergency5-1"] != undefined) {
|
||
textfile += data["emergency5-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["emergency6-1"] != undefined) {
|
||
textfile += data["emergency6-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 7) {
|
||
if (data["emergency7-1"] != undefined) {
|
||
textfile += data["emergency7-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 8) {
|
||
if (data["emergency8-1"] != undefined) {
|
||
textfile += data["emergency8-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 9) {
|
||
if (data["emergency9-1"] != undefined) {
|
||
textfile += data["emergency9-1"] + " تعداد محور " + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
} else if (itemselected == 20) {
|
||
let textfile = "";
|
||
if (item == 1) {
|
||
if (data["itemcontrol1-1"] != undefined) {
|
||
textfile += data["itemcontrol1-1"] + " نفر ساعت" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 2) {
|
||
if (data["itemcontrol2-1"] != undefined) {
|
||
textfile += data["itemcontrol2-1"] + " تفرساعت" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 3) {
|
||
if (data["itemcontrol3-1"] != undefined) {
|
||
textfile += data["itemcontrol3-1"] + " نفرساعت" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 4) {
|
||
if (data["itemcontrol4-1"] != undefined) {
|
||
textfile += data["itemcontrol4-1"] + " کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 5) {
|
||
if (data["itemcontrol5-1"] != undefined) {
|
||
textfile += data["itemcontrol5-1"] + " کیلومتر" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
if (item == 6) {
|
||
if (data["itemcontrol6-1"] != undefined) {
|
||
textfile += data["itemcontrol6-1"] + " تعداد دستگاه" + "<br>";
|
||
} else textfile += "_" + "<br>";
|
||
return textfile;
|
||
}
|
||
}
|
||
}
|
||
|
||
function show_point_photo(array) {
|
||
$("#showpicture").empty();
|
||
if (array.length > 0) {
|
||
array.forEach((element) =>
|
||
$("#showpicture").append('<img class="zoom" src ="' + element + '" >')
|
||
);
|
||
}
|
||
}
|
||
|
||
function getPopupContentMaintenance(data, index) {
|
||
var title = "";
|
||
if (index == 1) {
|
||
title = "روکش آسفالت (نگهداری راه )";
|
||
} else if (index == 2) {
|
||
title = "احداث راه روستایی";
|
||
} else if (index == 3) {
|
||
title = "ابنیه فنی ";
|
||
} else if (index == 4) {
|
||
title = " ارتقای ایمنی راه ";
|
||
} else if (index == 5) {
|
||
title = "پروژه راهدارخانه ها (بهسازی و نوسازی )";
|
||
} else if (index == 6) {
|
||
title = "رفع نقاط حادثه خیز/پرتصادف";
|
||
}
|
||
var upload =
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src=".../../dist/images/icons/caution.svg" alt="">\
|
||
<span class="popupHeader">' +
|
||
title +
|
||
'</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province.name +
|
||
"، شهرستان: " +
|
||
showcity(data.cities) +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> نام محور </span><div class="popUpBoxContent">' +
|
||
data.axis_name +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> نوع محور </span><div class="popUpBoxContent">' +
|
||
showaxistype(data.axis_type) +
|
||
'</div></div> </div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px">\
|
||
<span> عنوان پروژه </span><div class="popUpBoxContent">' +
|
||
data.project_name +
|
||
'</div> </div>\
|
||
<div class="popUpBox" style="width:75px"><span> آخرین وضعیت پروژه </span><div class="popUpBoxContent">' +
|
||
showstatus(data.project_status) +
|
||
'</div></div>\
|
||
</div>\
|
||
</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBox" style="width:75px"><span> پیمانکار </span><div class="popUpBoxContent">' +
|
||
data.contractor_name +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> سال شروع </span><div class="popUpBoxContent">' +
|
||
data.contract_date +
|
||
"" +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تاریخ ثبت سامانه </span><div class="popUpBoxContent">' +
|
||
data.submited_at +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تاریخ آخرین بروزرسانی </span><div class="popUpBoxContent">' +
|
||
data.last_updated_at +
|
||
'</div></div>\
|
||
<div class="popupContent">\
|
||
<div class="popupFooter" ><span> نوع و طول عملیات </span><div class="popUpBoxContent" id="showtabel' +
|
||
data.id +
|
||
'">' +
|
||
'</div></div>\
|
||
<button class=" popUpBox popup-btn-edit-point" id="popup-btn-edit-pointphoto" onclick="show_point_photo1()" style=" color: white;background-color: #0051cd;">نمایش تصاویر</button>\
|
||
<button class=" popUpBox popup-btn-edit-point" onclick="upadate(' +
|
||
index +
|
||
')" style=" color: white;background-color: #0051cd;"> بروزرسانی</button>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>\
|
||
</div>';
|
||
return upload;
|
||
}
|
||
|
||
function show_point_photo1() {
|
||
var dataLength = imagekol.length;
|
||
|
||
if (dataLength != 0) {
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
$(imagekol).each(function (index, item) {
|
||
let divSlide =
|
||
'<div class="mySlides"><div class="numbertext">' +
|
||
dataLength +
|
||
" / " +
|
||
(index + 1) +
|
||
'</div><img src="' +
|
||
item +
|
||
'"><div class="text" style="display:none>' +
|
||
"</div></div>";
|
||
$("#slideshow-slide").append(divSlide);
|
||
$("#slideshow-dot").append(
|
||
'<span class="dot" onclick="currentCameraSlide(' +
|
||
(index + 1) +
|
||
')"></span>'
|
||
);
|
||
});
|
||
if (dataLength > 0) {
|
||
slideindex = 1;
|
||
layerslidershow(slideindex);
|
||
$("#slideroverlay").css("display", "block");
|
||
}
|
||
} else {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "فایلی جهت نمایش وجود ندارد .",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
}
|
||
}
|
||
|
||
function showDailyRahdariActivity() {
|
||
$(".second-top-menu").css("display", "none");
|
||
$(".guid-custom-box-item").css("display", "block");
|
||
$(".filterTitle").on("click", function () {
|
||
if ($(this).parent().children(".filterGroup").css("display") == "none") {
|
||
$(this).parent().children(".filterGroup").show(1000);
|
||
} else {
|
||
$(this).parent().children(".filterGroup").hide(1000);
|
||
}
|
||
});
|
||
}
|
||
|
||
function getMaintenanceProjects() {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/road-maintenance-project/getpoints",
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
let markerG = [];
|
||
let markerGConstructionRural = [];
|
||
let markerGTechnicalBuilding = [];
|
||
let markerGUpgradeSafety = [];
|
||
let markerGTollhouseManagement = [];
|
||
let markerGDangerPrevention = [];
|
||
let roadMaintenancePoints = result.RoadMaintenanceProject;
|
||
let roadConstructionRuralPoints = result.RoadConstructionRural;
|
||
let roadTechnicalBuildingPoints = result.RoadTechnicalBuilding;
|
||
let roadUpgradeSafetyPoints = result.RoadUpgradeSafety;
|
||
let roadTollhouseManagementPoints = result.RoadTollhouseManagement;
|
||
let roadDangerPreventionPoints = result.RoadDangerPrevention;
|
||
$.each(roadMaintenancePoints, function (key, value) {
|
||
try {
|
||
let setIcon = greenIcon;
|
||
if (value.physical_progress < "50") setIcon = redIconFix;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 1), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
1
|
||
);
|
||
});
|
||
markerG.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
});
|
||
$.each(roadConstructionRuralPoints, function (key, value) {
|
||
try {
|
||
let setIcon = redIconFix;
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 2), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
2
|
||
);
|
||
});
|
||
markerGConstructionRural.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
});
|
||
$.each(roadTechnicalBuildingPoints, function (key, value) {
|
||
try {
|
||
let setIcon = technicalBuildingIcon;
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 3), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
3
|
||
);
|
||
});
|
||
markerGTechnicalBuilding.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
});
|
||
$.each(roadUpgradeSafetyPoints, function (key, value) {
|
||
try {
|
||
let setIcon = upgradeSafetyIcon;
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 4), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
4
|
||
);
|
||
});
|
||
markerGUpgradeSafety.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
});
|
||
$.each(roadTollhouseManagementPoints, function (key, value) {
|
||
try {
|
||
let setIcon = tollhouseManagementIcon;
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 5), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
5
|
||
);
|
||
});
|
||
markerGTollhouseManagement.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
});
|
||
$.each(roadDangerPreventionPoints, function (key, value) {
|
||
try {
|
||
let setIcon = dangerPreventionIcon;
|
||
|
||
if (value.start_latlng != null) {
|
||
let marker = L.marker(value.start_latlng, {
|
||
icon: setIcon,
|
||
})
|
||
.bindPopup(getPopupContentMaintenance(value, 6), {
|
||
className: "customPopupStyle",
|
||
})
|
||
.on("click", function (e) {
|
||
(imagekol = value.images),
|
||
GenerateTablestart(
|
||
value.id,
|
||
value.project_distance_update,
|
||
6
|
||
);
|
||
});
|
||
markerGDangerPrevention.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
});
|
||
|
||
marker141Layers = L.layerGroup(markerG);
|
||
marker141LayersConstructionRural = L.layerGroup(markerGConstructionRural);
|
||
marker141LayersTechnicalBuilding = L.layerGroup(markerGTechnicalBuilding);
|
||
marker141LayersUpgradeSafety = L.layerGroup(markerGUpgradeSafety);
|
||
marker141LayersDangerPrevention = L.layerGroup(markerGDangerPrevention);
|
||
marker141LayersTollhouseManagement = L.layerGroup(
|
||
markerGTollhouseManagement
|
||
);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersConstructionRural);
|
||
map.addLayer(marker141LayersTechnicalBuilding);
|
||
map.addLayer(marker141LayersUpgradeSafety);
|
||
map.addLayer(marker141LayersDangerPrevention);
|
||
map.addLayer(marker141LayersTollhouseManagement);
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
$(".datarahdari").on("click", "p.res-daily-vertical", function () {
|
||
$(this)
|
||
.addClass("res-daily-vertical-check")
|
||
.siblings()
|
||
.removeClass("res-daily-vertical-check");
|
||
$(this).addClass("changeColor").siblings().removeClass("changeColor");
|
||
$(".title-daily").text($(this).text());
|
||
});
|
||
|
||
function showgharargah() {
|
||
$("#gharargah-modal-roating").css("display", "block");
|
||
|
||
WindowWidth = $(window).width();
|
||
if (WindowWidth < 800) {
|
||
$(".gharargah-modal-button").on("click", function () {
|
||
$("#gharargah-modal-roating").fadeIn(500);
|
||
$(".gharargah-modal-button").css("display", "none");
|
||
});
|
||
}
|
||
}
|
||
$("#firoozkooh").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#firoozkooh").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (firoozlayer != null) {
|
||
markerlis1 = [];
|
||
map.removeLayer(firoozlayer);
|
||
}
|
||
map.removeLayer(smarkerfirooz);
|
||
map.removeLayer(emarkerfirooz);
|
||
map.removeLayer(firoozpoly);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#firoozkooh").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [35.70061770364413, 51.40137849422223];
|
||
var dest = [36.45714233035437, 52.86483042728247];
|
||
map.flyTo([35.9936, 52.2647], 9);
|
||
calculateRouteCoridor(origin, dest, 0);
|
||
routingArray.push("firoozkooh");
|
||
}
|
||
});
|
||
$("#amol").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#amol").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (amollayer != null) {
|
||
markerlis2 = [];
|
||
map.removeLayer(amollayer);
|
||
}
|
||
map.removeLayer(smarkeramol);
|
||
map.removeLayer(emarkeramol);
|
||
map.removeLayer(amolpoly);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#amol").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [35.70061770364413, 51.40137849422223];
|
||
var dest = [36.47189472825926, 52.34990088821553];
|
||
map.flyTo([36.0269, 51.8994], 9);
|
||
calculateRouteCoridor(origin, dest, 1);
|
||
routingArray.push("amol");
|
||
}
|
||
});
|
||
$("#ghazvin").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#ghazvin").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (rashtlayer != null) {
|
||
markerlis3 = [];
|
||
map.removeLayer(rashtlayer);
|
||
}
|
||
$("#ghazvin").css("background-color", "rgb(255, 255, 255)");
|
||
$("#ghazvin").css("color", "#000");
|
||
|
||
map.removeLayer(smarkerGhRa);
|
||
map.removeLayer(emarkerGhRa);
|
||
|
||
map.removeLayer(firstpolyline);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#ghazvin").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [36.28308897867362, 50.00192014879593];
|
||
var dest = [37.279360690543456, 49.584610211991674];
|
||
var city_name = "ghazvin";
|
||
calculateRouteCoridor(origin, dest, 2);
|
||
routingArray.push("ghazvin");
|
||
map.flyTo([36.9084, 49.8947], 9);
|
||
}
|
||
});
|
||
$("#karaj-chaloos").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#karaj-chaloos").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (chalooslayer != null) {
|
||
markerlis5 = [];
|
||
map.removeLayer(chalooslayer);
|
||
}
|
||
$("#karaj-chaloos").css("background-color", "rgb(255, 255, 255)");
|
||
$("#karaj-chaloos").css("color", "#000");
|
||
|
||
map.removeLayer(smarkerKarCh);
|
||
map.removeLayer(emarkerKarCh);
|
||
|
||
map.removeLayer(forthpolyline);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#karaj-chaloos").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [35.70061770364413, 51.40137849422223];
|
||
var dest = [36.65851701025201, 51.424223549477404];
|
||
map.flyTo([36.1223, 51.5176], 9);
|
||
calculateRouteCoridor(origin, dest, 4);
|
||
routingArray.push("chaloos");
|
||
}
|
||
});
|
||
$("#newrasht").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#newrasht").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (newrashtlayer != null) {
|
||
markerlis4 = [];
|
||
map.removeLayer(newrashtlayer);
|
||
}
|
||
$("#newrasht").css("background-color", "rgb(255, 255, 255)");
|
||
map.removeLayer(smarkerrasht);
|
||
map.removeLayer(emarkerrasht);
|
||
map.removeLayer(rashtpoly);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#newrasht").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [36.28308897867362, 50.00192014879593];
|
||
var dest = [37.279360690543456, 49.584610211991674];
|
||
calculateRouteCoridor(origin, dest, 3);
|
||
routingArray.push("newrasht");
|
||
map.flyTo([36.9084, 49.8947], 9);
|
||
}
|
||
});
|
||
$("#semnan").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#semnan").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (semnanlayer != null) {
|
||
markerlis6 = [];
|
||
map.removeLayer(semnanlayer);
|
||
}
|
||
$("#semnan").css("background-color", "rgb(255, 255, 255)");
|
||
$("#semnan").css("color", "#000");
|
||
map.removeLayer(smarkerThSe);
|
||
map.removeLayer(emarkerThSe);
|
||
|
||
map.removeLayer(fifthpolyline);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#semnan").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [35.70061770364413, 51.40137849422223];
|
||
var dest = [35.57781784221976, 53.38200041498726];
|
||
map.flyTo([35.6392, 52.3916], 9);
|
||
calculateRouteCoridor(origin, dest, 5);
|
||
routingArray.push("semnan");
|
||
}
|
||
});
|
||
$("#tabriz").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#tabriz").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
|
||
if (tabrizlayer != null) {
|
||
markerlis7 = [];
|
||
map.removeLayer(tabrizlayer);
|
||
}
|
||
$("#tabriz").css("background-color", "rgb(255, 255, 255)");
|
||
$("#tabriz").css("color", "#000");
|
||
map.removeLayer(smarkertabriz);
|
||
map.removeLayer(emarkertabriz);
|
||
map.removeLayer(tabrizpoly);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#tabriz").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
|
||
var origin = [35.70061770364413, 51.40137849422223];
|
||
var dest = [38.07399638132807, 46.29619515208469];
|
||
map.flyTo([36.8869, 48.8487], 9);
|
||
calculateRouteCoridor(origin, dest, 6);
|
||
routingArray.push("tabriz");
|
||
}
|
||
});
|
||
|
||
$("#kermanshah").on("click", function () {
|
||
var color = $(this).css("border-color");
|
||
if (color == "rgb(255, 92, 15)") {
|
||
$("#kermanshah").css("border-color", "rgb(206, 206, 206)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
if (kermanlayer != null) {
|
||
markerlis8 = [];
|
||
map.removeLayer(kermanlayer);
|
||
}
|
||
$("#kermanshah").css("background-color", "rgb(255, 255, 255)");
|
||
$("#kermanshah").css("color", "#000");
|
||
map.removeLayer(smarkerThKer);
|
||
map.removeLayer(emarkerThKer);
|
||
map.removeLayer(seventhpolyline);
|
||
} else if (color == "rgb(206, 206, 206)") {
|
||
$("#kermanshah").css("border-color", "rgb(255, 92, 15)");
|
||
if (WindowWidth < 800) {
|
||
$("#gharargah-modal-roating").fadeOut(500);
|
||
$(".gharargah-modal-button").fadeIn(500);
|
||
}
|
||
var origin = [35.70061770364413, 51.40137849422223];
|
||
var dest = [34.32394142945338, 47.073589114346305];
|
||
map.flyTo([35.0198, 49.2374], 9);
|
||
calculateRouteCoridor(origin, dest, 7);
|
||
routingArray.push("kermanshah");
|
||
}
|
||
});
|
||
|
||
function showCoridorLayer(routeArray, num) {
|
||
showLoaderScreen();
|
||
$.post(
|
||
"https://rms.rmto.ir/api/RahesEsential/all",
|
||
{
|
||
latlng: routeArray,
|
||
type: 1,
|
||
},
|
||
function (data) {
|
||
globalmodaldata = [];
|
||
globalmodaldata = data.data;
|
||
markershowdata = [];
|
||
markershowdata = data.data;
|
||
hideLoaderScreen();
|
||
if (num == 0) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis1 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerfiroozkooh.push(markerlis1);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
firoozlayer = L.layerGroup(markerfiroozkooh);
|
||
map.addLayer(firoozlayer);
|
||
}
|
||
if (num == 1) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerli2 = L.marker([markershowdata[i].lat, markershowdata[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markeramol.push(markerli2);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
amollayer = L.layerGroup(markeramol);
|
||
map.addLayer(amollayer);
|
||
}
|
||
if (num == 2) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis3 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerrasht.push(markerlis3);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
rashtlayer = L.layerGroup(markerrasht);
|
||
map.addLayer(rashtlayer);
|
||
}
|
||
if (num == 3) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis4 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerrashtnew.push(markerlis4);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
newrashtlayer = L.layerGroup(markerrashtnew);
|
||
map.addLayer(newrashtlayer);
|
||
}
|
||
if (num == 4) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis5 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerchaloos.push(markerlis5);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
chalooslayer = L.layerGroup(markerchaloos);
|
||
map.addLayer(chalooslayer);
|
||
}
|
||
if (num == 5) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis6 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markersemnan.push(markerlis6);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
semnanlayer = L.layerGroup(markersemnan);
|
||
map.addLayer(semnanlayer);
|
||
}
|
||
if (num == 6) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis7 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markertabriz.push(markerlis7);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
tabrizlayer = L.layerGroup(markertabriz);
|
||
map.addLayer(tabrizlayer);
|
||
}
|
||
if (num == 7) {
|
||
for (let i = 0; i < markershowdata.length; i++) {
|
||
markerlis8 = L.marker(
|
||
[markershowdata[i].lat, markershowdata[i].lng],
|
||
{
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}
|
||
).bindPopup(getpopupcoridor(markershowdata[i], 1), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerkermanshah.push(markerlis8);
|
||
if (
|
||
markershowdata[i].color != null &&
|
||
markershowdata[i].start_lat != null &&
|
||
markershowdata[i].end_lng != null &&
|
||
markershowdata[i].color != "" &&
|
||
markershowdata[i].start_lat != "" &&
|
||
markershowdata[i].end_lng != "" &&
|
||
markershowdata[i].start_lat != NaN &&
|
||
markershowdata[i].end_lng != NaN
|
||
) {
|
||
drawPathwithColor(
|
||
markershowdata[i].start_lat,
|
||
markershowdata[i].start_lng,
|
||
markershowdata[i].end_lat,
|
||
markershowdata[i].end_lng,
|
||
markershowdata[i].color
|
||
);
|
||
}
|
||
}
|
||
kermanlayer = L.layerGroup(markerkermanshah);
|
||
map.addLayer(kermanlayer);
|
||
}
|
||
}
|
||
);
|
||
}
|
||
|
||
function drawPathwithColor(lat_from, lng_from, lat_to, lng_to, color) {
|
||
routecolor.push(
|
||
L.Routing.control({
|
||
waypoints: [
|
||
L.latLng(parseFloat(lat_from), parseFloat(lng_from)),
|
||
L.latLng(parseFloat(lat_to), parseFloat(lng_to)),
|
||
],
|
||
fitSelectedRoutes: false,
|
||
|
||
draggableWaypoints: false,
|
||
createMarker: function () {
|
||
return null;
|
||
},
|
||
lineOptions: {
|
||
addWaypoints: false,
|
||
styles: [
|
||
{
|
||
color: color,
|
||
opacity: 1,
|
||
weight: 10,
|
||
},
|
||
],
|
||
},
|
||
})
|
||
.on("routingstart ", function (e) {})
|
||
.addTo(map)
|
||
);
|
||
|
||
$(".leaflet-control-container").css("display", "none");
|
||
$(".leaflet-routing-container-hide").css("display", "none");
|
||
}
|
||
|
||
function getpopupcoridor(data, num) {
|
||
var deactive;
|
||
if (data.status == 1) {
|
||
var deactive = '<div class="popUpBoxContent">فعال</div>';
|
||
} else {
|
||
var deactive = '<div class="popUpBoxContent">غیر فعال</div>';
|
||
}
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle">\
|
||
<img src="../../dist/images/icons/tollHouse.svg" alt="">\
|
||
<span class="popupHeader"> راهدارخانه (' +
|
||
data.name +
|
||
') </span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.province_name +
|
||
"، شهرستان: " +
|
||
data.city_name +
|
||
'</div>\
|
||
<div class="popupContent">\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> وضعیت </span><div class="popUpBoxContent">' +
|
||
deactive +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> نوع </span><div class="popUpBoxContent">' +
|
||
returntype(data.type) +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> تلفن </span><div class="popUpBoxContent">' +
|
||
data.phone +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد اکیپ </span><div class="popUpBoxContent">' +
|
||
data.team_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> تعداد پرسنل </span><div class="popUpBoxContent">' +
|
||
data.staff_num +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> مسئول </span><div class="popUpBoxContent">' +
|
||
data.responsible_name +
|
||
"<br>" +
|
||
data.responsible_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> جانشین </span><div class="popUpBoxContent">' +
|
||
data.successor_name +
|
||
"<br>" +
|
||
data.successor_mobile +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سبک </span><div class="popUpBoxContent">' +
|
||
data.machines_light +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات نیمه سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_sheavy +
|
||
'</div></div>\
|
||
<div class="popUpBoxlevel" style="width:75px"><span> ماشینآلات سنگین </span><div class="popUpBoxContent">' +
|
||
data.machines_heavy +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> عرض جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lat).toFixed(5) +
|
||
'</div></div>\
|
||
<div class="popUpBox" style="width:75px"><span> طول جغرافیایی </span><div class="popUpBoxContent">' +
|
||
parseFloat(data.lng).toFixed(5) +
|
||
'</div></div>\
|
||
</div>\
|
||
<div class="popupContent-button">\
|
||
<button class="popup-btn-edit-point" onclick="showcoridorfinall(' +
|
||
data.id +
|
||
')">بروزرسانی</button>\
|
||
<button class="popup-btn-edit-point" onclick="deletecoridor(' +
|
||
data.id +
|
||
')">حذف</button>\
|
||
</div>\
|
||
</div>'
|
||
);
|
||
}
|
||
|
||
function deletecoridor(num) {
|
||
formData = new FormData();
|
||
|
||
formData.append("id", num);
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/api/RahesEsential/delete",
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
alert("hii");
|
||
hideLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
}
|
||
|
||
function showcoridorfinall(id) {
|
||
$("#ekipname").val("");
|
||
$("#ekipphone").val("");
|
||
$("#typeofdastgah").val("");
|
||
$("#machiner_name").val("");
|
||
$("#telephone_num").val("");
|
||
$(".color-check").addClass("d-none");
|
||
$("#ekipname").removeClass("is-invalid");
|
||
$("#ekipphone").removeClass("is-invalid");
|
||
$("#typeofdastgah").removeClass("is-invalid");
|
||
$("#machiner_name").removeClass("is-invalid");
|
||
$("#telephone_num").removeClass("is-invalid");
|
||
$(".map-latlng-first-input").removeClass("is-invalid");
|
||
$(".map-latlng-sec-input").removeClass("is-invalid");
|
||
|
||
$("#basic-log").css("display", "none");
|
||
var tollhouse_latlng = [];
|
||
for (var i = 0; i < coridorMarkerArray.length; i++) {
|
||
if (coridorMarkerArray[i].id == id) {
|
||
idkolcor = coridorMarkerArray[i].id;
|
||
$("#showcoridorekip").empty();
|
||
$("#showmachinekip").empty();
|
||
$("[data-mask]").inputmask();
|
||
$(".map-latlng-first-input").val("");
|
||
$(".map-latlng-sec-input").val("");
|
||
$("#edarekolcoridor").val(coridorMarkerArray[i].name);
|
||
$("#mainCitycor").val(coridorMarkerArray[i].city_name);
|
||
$("#Tollhouse_agent").val(coridorMarkerArray[i].responsible_name);
|
||
$("#Tollhouse_name").val(coridorMarkerArray[i].name);
|
||
$("#Tollhouse_mobile").val(coridorMarkerArray[i].responsible_mobile); //action
|
||
if (
|
||
coridorMarkerArray[i].machine_data != null &&
|
||
coridorMarkerArray[i].machine_data != "[]"
|
||
) {
|
||
var markermachin = jQuery.parseJSON(coridorMarkerArray[i].machine_data);
|
||
for (var z = 0; z < markermachin.length; z++) {
|
||
projectarraymachine.push(markermachin[z]);
|
||
}
|
||
generatemachinary(coridorMarkerArray[i].machine_data, 1);
|
||
}
|
||
if (
|
||
coridorMarkerArray[i].team_data != null &&
|
||
coridorMarkerArray[i].team_data != "[]"
|
||
) {
|
||
ekiplistvalid = jQuery.parseJSON(coridorMarkerArray[i].team_data);
|
||
for (var j = 0; j < ekiplistvalid.length; j++) {
|
||
ekiplist.push(ekiplistvalid[j]);
|
||
}
|
||
generatetablecoridor(coridorMarkerArray[i].team_data, 1);
|
||
}
|
||
tollhouse_latlng = [
|
||
parseFloat(coridorMarkerArray[i].lat),
|
||
parseFloat(coridorMarkerArray[i].lng),
|
||
];
|
||
startmarkerpin = [
|
||
coridorMarkerArray[i].start_lat,
|
||
coridorMarkerArray[i].start_lng,
|
||
];
|
||
endmarkerpin = [
|
||
coridorMarkerArray[i].end_lat,
|
||
coridorMarkerArray[i].end_lng,
|
||
];
|
||
}
|
||
}
|
||
$(".basic").spectrum({
|
||
color: "#fff",
|
||
change: function (color) {
|
||
$("#basic-log").css("display", "block");
|
||
|
||
$("#basic-log").text("رنگ " + color.toHexString());
|
||
globalcolor = color.toHexString();
|
||
},
|
||
});
|
||
$("#coridoredit").modal("show");
|
||
if (mapradar == null) {
|
||
setTimeout(() => {
|
||
createLeafletMap(tollhouse_latlng, startmarkerpin, endmarkerpin);
|
||
}, 400);
|
||
} else {
|
||
initialMarkerMapValue(tollhouse_latlng, startmarkerpin, endmarkerpin);
|
||
}
|
||
}
|
||
|
||
function decode(src, precision) {
|
||
var i = 0;
|
||
var lat = 0;
|
||
var lng = 0;
|
||
var filteredCallSets = [];
|
||
var shift = 0;
|
||
var result = 0;
|
||
var digit = null;
|
||
var latDelta;
|
||
var granularity;
|
||
var count = Math.pow(10, Number.isInteger(precision) ? precision : 5);
|
||
for (; i < src.length; ) {
|
||
digit = null;
|
||
shift = 0;
|
||
result = 0;
|
||
do {
|
||
digit = src.charCodeAt(i++) - 63;
|
||
result = result | ((digit & 31) << shift);
|
||
shift = shift + 5;
|
||
} while (digit >= 32);
|
||
latDelta = result & 1 ? ~(result >> 1) : result >> 1;
|
||
shift = result = 0;
|
||
do {
|
||
digit = src.charCodeAt(i++) - 63;
|
||
result = result | ((digit & 31) << shift);
|
||
shift = shift + 5;
|
||
} while (digit >= 32);
|
||
granularity = result & 1 ? ~(result >> 1) : result >> 1;
|
||
lat = lat + latDelta;
|
||
lng = lng + granularity;
|
||
filteredCallSets.push([lat / count, lng / count]);
|
||
}
|
||
return filteredCallSets;
|
||
}
|
||
$("#editcoridor").on("click", function () {
|
||
saveRahdariEditedCoridor();
|
||
});
|
||
|
||
function saveRahdariEditedCoridor() {
|
||
var start_lat;
|
||
var start_lng;
|
||
var end_lat;
|
||
var end_lng;
|
||
ajaxCheck = false;
|
||
|
||
var Tollhouse_agent = $("#Tollhouse_agent").val();
|
||
var Tollhouse_name = $("#Tollhouse_name").val();
|
||
var Tollhouse_mobile = $("#Tollhouse_mobile").val();
|
||
if (startAbrarMarker.getLatLng() != null) {
|
||
start_lat = startAbrarMarker.getLatLng().lat.toFixed(6);
|
||
start_lng = startAbrarMarker.getLatLng().lng.toFixed(6);
|
||
}
|
||
|
||
if (endAbrarMarker.getLatLng() != null) {
|
||
end_lat = endAbrarMarker.getLatLng().lat.toFixed(6);
|
||
end_lng = endAbrarMarker.getLatLng().lng.toFixed(6);
|
||
}
|
||
var start_check = $(".map-latlng-first-input").val();
|
||
var end_check = $(".map-latlng-sec-input").val();
|
||
|
||
if (Tollhouse_agent != "") {
|
||
ajaxCheck = true;
|
||
$("#Tollhouse_agent").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$("#Tollhouse_agent").addClass("is-invalid");
|
||
}
|
||
|
||
if (Tollhouse_name != "") {
|
||
ajaxCheck = true;
|
||
$("#Tollhouse_name").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$("#Tollhouse_name").addClass("is-invalid");
|
||
}
|
||
|
||
if (Tollhouse_mobile != "") {
|
||
ajaxCheck = true;
|
||
$("#Tollhouse_mobile").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$("#Tollhouse_mobile").addClass("is-invalid");
|
||
}
|
||
|
||
if (projectarraymachine.length != 0) {
|
||
ajaxCheck = true;
|
||
$("#ekipname").removeClass("is-invalid");
|
||
$("#ekipphone").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$("#ekipname").addClass("is-invalid");
|
||
$("#ekipphone").addClass("is-invalid");
|
||
}
|
||
|
||
if (ekiplist.length != 0) {
|
||
ajaxCheck = true;
|
||
$("#typeofdastgah").removeClass("is-invalid");
|
||
$("#machiner_name").removeClass("is-invalid");
|
||
$("#telephone_num").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$("#typeofdastgah").addClass("is-invalid");
|
||
$("#machiner_name").addClass("is-invalid");
|
||
$("#telephone_num").addClass("is-invalid");
|
||
}
|
||
|
||
if (start_check != "") {
|
||
ajaxCheck = true;
|
||
$(".map-latlng-first-input").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$(".map-latlng-first-input").addClass("is-invalid");
|
||
}
|
||
|
||
if (end_check != "") {
|
||
ajaxCheck = true;
|
||
$(".map-latlng-sec-input").removeClass("is-invalid");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$(".map-latlng-sec-input").addClass("is-invalid");
|
||
}
|
||
if (globalcolor != "") {
|
||
ajaxCheck = true;
|
||
$(".color-check").removeClass("d-none");
|
||
} else {
|
||
ajaxCheck = false;
|
||
$(".color-check").removeClass("d-none");
|
||
}
|
||
formData = new FormData();
|
||
formData.append("id", idkolcor);
|
||
formData.append("successor_name", Tollhouse_agent);
|
||
formData.append("name", Tollhouse_name);
|
||
formData.append("responsible_mobile", Tollhouse_mobile);
|
||
formData.append("machine_data", JSON.stringify(projectarraymachine));
|
||
formData.append("team_data", JSON.stringify(ekiplist));
|
||
formData.append("start_lat", start_lat);
|
||
formData.append("start_lng", start_lng);
|
||
formData.append("color", globalcolor);
|
||
formData.append("end_lat", end_lat);
|
||
formData.append("end_lng", end_lng);
|
||
//swal
|
||
if (ajaxCheck) {
|
||
$("#coridoredit").modal("hide");
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/api/RahesEsential/update",
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
if (result.data.color) {
|
||
drawPathwithColor(
|
||
result.data.start_lat,
|
||
result.data.start_lng,
|
||
result.data.end_lat,
|
||
result.data.end_lng,
|
||
result.data.color
|
||
);
|
||
}
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
} else {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "لطفا تمامی مقادیر را کامل کنید . ",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
}
|
||
}
|
||
|
||
function checkMarkersAndDrawPath() {
|
||
if (
|
||
$("#pin-marker-startrahdar").hasClass("pin-set") &&
|
||
!$("#pin-marker-startrahdar").hasClass("pin-move") &&
|
||
$("#pin-marker-endrahdar").hasClass("pin-set") &&
|
||
!$("#pin-marker-endrahdar").hasClass("pin-move")
|
||
) {
|
||
drawPath();
|
||
}
|
||
}
|
||
$("#ekiplist").on("click", function () {
|
||
var nameofekip = "";
|
||
var ekipphone = "";
|
||
nameofekip = $("#ekipname").val();
|
||
ekipphone = $("#ekipphone").val();
|
||
var obj = {};
|
||
obj = {
|
||
nameofekip: nameofekip,
|
||
ekipphone: ekipphone,
|
||
};
|
||
ekiplist.push(obj);
|
||
generatetablecoridor(ekiplist, 0);
|
||
});
|
||
|
||
function generatetablecoridor(data, flag) {
|
||
if (flag == 0) {
|
||
var item = data;
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", "نام اکیپ ", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([
|
||
i + 1,
|
||
showekip(item[i].nameofekip),
|
||
showphone(item[i].ekipphone),
|
||
]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
var columnCount = customers[0].length;
|
||
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showcoridorekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
} else {
|
||
var item = jQuery.parseJSON(data);
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", "نام اکیپ ", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([
|
||
i + 1,
|
||
showekip(item[i].nameofekip),
|
||
showphone(item[i].ekipphone),
|
||
]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
var columnCount = customers[0].length;
|
||
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showcoridorekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
}
|
||
$("#submitekip").on("click", function () {
|
||
var nameofdastgah = "";
|
||
var drivername = "";
|
||
var phonedriver = "";
|
||
nameofdastgah = $("#typeofdastgah").val();
|
||
drivername = $("#machiner_name").val();
|
||
phonedriver = $("#telephone_num").val();
|
||
var obj = {};
|
||
obj = {
|
||
dastgahtype: nameofdastgah,
|
||
drivername: drivername,
|
||
driverphone: phonedriver,
|
||
};
|
||
projectarraymachine.push(obj);
|
||
generatemachinary(projectarraymachine, 0);
|
||
});
|
||
|
||
function generatemachinary(data, flag) {
|
||
if (flag == 0) {
|
||
var item = data;
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", " نوع دستگاه ", " نام راننده", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([
|
||
i + 1,
|
||
dastgahname(item[i].dastgahtype),
|
||
drivername(item[i].drivername),
|
||
showphone(item[i].driverphone),
|
||
]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
var columnCount = customers[0].length;
|
||
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showmachinekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
} else {
|
||
var item = jQuery.parseJSON(data);
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
|
||
customers.push(["ردیف", " نوع دستگاه ", " نام راننده", "شماره تلفن"]);
|
||
|
||
for (var i = 0; i < item.length; i++) {
|
||
customers.push([
|
||
i + 1,
|
||
dastgahname(item[i].dastgahtype),
|
||
drivername(item[i].drivername),
|
||
showphone(item[i].driverphone),
|
||
]);
|
||
}
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
var columnCount = customers[0].length;
|
||
|
||
var row = table.insertRow(-1);
|
||
for (var i = 0; i < columnCount; i++) {
|
||
var headerCell = document.createElement("TH");
|
||
headerCell.innerHTML = customers[0][i];
|
||
row.appendChild(headerCell);
|
||
}
|
||
|
||
for (var i = 1; i < customers.length; i++) {
|
||
row = table.insertRow(-1);
|
||
for (var j = 0; j < columnCount; j++) {
|
||
var cell = row.insertCell(-1);
|
||
cell.innerHTML = customers[i][j];
|
||
}
|
||
}
|
||
|
||
var dvTable = document.getElementById("showmachinekip");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
}
|
||
|
||
function showekip(data) {
|
||
return data;
|
||
}
|
||
|
||
function showphone(data) {
|
||
return data;
|
||
}
|
||
|
||
function dastgahname(data) {
|
||
return data;
|
||
}
|
||
|
||
function drivername(data) {
|
||
return data;
|
||
}
|
||
restrictInputOtherThanArabic($("#Tollhouse_agent"));
|
||
restrictInputOtherThanArabic($("#Tollhouse_name"));
|
||
restrictInputOtherThanArabic($("#Tollhouse_mobile"));
|
||
restrictInputOtherThanArabic($("#ekipname"));
|
||
restrictInputOtherThanArabic($("#ekipphone"));
|
||
restrictInputOtherThanArabic($("#typeofdastgah"));
|
||
restrictInputOtherThanArabic($("#machiner_name"));
|
||
restrictInputOtherThanArabic($("#telephone_num"));
|
||
|
||
function restrictInputOtherThanArabic($field) {
|
||
var arabicCharUnicodeRange = /[\u0600-\u06FF-0-9-45]/;
|
||
|
||
$field.bind("keypress", function (event) {
|
||
var key = event.which;
|
||
if (key == 8 || key == 0 || key === 32) {
|
||
return true;
|
||
}
|
||
|
||
var str = String.fromCharCode(key);
|
||
if (arabicCharUnicodeRange.test(str)) {
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
});
|
||
}
|
||
|
||
$("layerButton").on("click", function () {
|
||
$("#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>\
|
||
"
|
||
);
|
||
}
|
||
});
|
||
|
||
function showcamp() {
|
||
remove141Layer();
|
||
showLoaderScreen();
|
||
|
||
$.get("https://rms.rmto.ir/camp/all", function (result) {
|
||
let campNewPoints = result.data;
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < campNewPoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
|
||
if (campNewPoints[i].progress == "100") {
|
||
if (result.edit_id == campNewPoints[i].province_id) {
|
||
setIcon = greenIcon;
|
||
} else {
|
||
setIcon = greenIconFix;
|
||
}
|
||
} else {
|
||
if (result.edit_id == campNewPoints[i].province_id) {
|
||
setIcon = redIcon;
|
||
} else {
|
||
setIcon = redIconFix;
|
||
}
|
||
}
|
||
let marker = L.marker(
|
||
[campNewPoints[i].start_latlng[0], campNewPoints[i].start_latlng[1]],
|
||
{
|
||
icon: setIcon,
|
||
content: campNewPoints[i],
|
||
}
|
||
)
|
||
|
||
.on("click", function (e) {
|
||
$("[data-mask]").inputmask();
|
||
|
||
let valueprogress = "";
|
||
let datatext = this.options.content;
|
||
|
||
let test =
|
||
'<div class="project-slider status-slider-body pr-2 pl-2 mb-5 mt-1">\
|
||
<input class="ex2" type="text" data-slider-step="1" data-slider-value="' +
|
||
valueprogress +
|
||
'"/></div> ';
|
||
|
||
$("#sliderphysici").empty();
|
||
|
||
$("#sliderphysici").append(
|
||
'<label class="slider-label label-allpoint-style" for="inputAddress2"> پیشرفت فیزیکی</label>'
|
||
);
|
||
$("#sliderphysici").append(test);
|
||
|
||
$(".ex2").slider({
|
||
min: 0,
|
||
max: 100,
|
||
formatter: function (value) {
|
||
return value + "٪";
|
||
},
|
||
tooltip: "always",
|
||
tooltip_position: "bottom",
|
||
});
|
||
|
||
$("#end-date").persianDatepicker({
|
||
format: "MMMM YYY",
|
||
autoClose: true,
|
||
viewMode: "month",
|
||
dayPicker: {
|
||
enabled: false,
|
||
},
|
||
});
|
||
|
||
$("#cost").val(datatext.cost); //cost
|
||
$("#end-date").val(datatext.end_date); //end-date
|
||
})
|
||
.bindPopup(getPopupContentcampNew(campNewPoints[i], result.edit_id), {
|
||
className: "customPopupStyle",
|
||
});
|
||
markerG.push(marker);
|
||
} catch (e) {}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
hideLoaderScreen();
|
||
});
|
||
}
|
||
|
||
function layerslidershow(n) {
|
||
let slides = $("#slideroverlay #slideshow-slide .mySlides");
|
||
let dots = $("#slideroverlay #slideshow-dot .dot");
|
||
|
||
if (n > slides.length) {
|
||
slideIndexlayer = 1;
|
||
}
|
||
if (n < 1) {
|
||
slideIndexlayer = slides.length;
|
||
}
|
||
|
||
$(slides).each(function () {
|
||
$(this).css("display", "none");
|
||
});
|
||
$(dots).each(function () {
|
||
$(this).removeClass("active");
|
||
});
|
||
|
||
$(slides[slideIndexlayer - 1]).css("display", "block");
|
||
$(dots[slideIndexlayer - 1]).addClass("active");
|
||
}
|
||
$("#slideroverlay > .upload-confirm").on("click", function () {
|
||
$(this).parent().css("display", "none");
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
});
|
||
$("#slideroverlay .close").on("click", function () {
|
||
$(this).parent().parent().css("display", "none");
|
||
$("#slideshow-slide").find(".mySlides").remove();
|
||
$("#slideshow-dot").find(".dot").remove();
|
||
});
|
||
$("#slideroverlay #slideshow-slide .prev").on("click", function () {
|
||
layerslidershow((slideIndexlayer -= 1));
|
||
});
|
||
|
||
$("#slideroverlay #slideshow-slide .next").on("click", function () {
|
||
layerslidershow((slideIndexlayer += 1));
|
||
});
|
||
|
||
function currentCameraSlide(slideIndex) {
|
||
layerslidershow((slideIndexlayer = slideIndex));
|
||
}
|
||
|
||
function getPopupContentFastReaction(data, num) {
|
||
var img = "";
|
||
if (data.files.length != 0) {
|
||
img =
|
||
'<table class="col-md-12 table table-bordered text-center table-sm">\
|
||
<thead style="background-color: #196592">\
|
||
<th style="color: #fff;">عکس بعد</th>\
|
||
<th style="color: #fff;">عکس قبل</th>\
|
||
</thead>\
|
||
<tbody><td><img class="fastoption" src ="https://rms.rmto.ir/' +
|
||
data.files[0].path.replace("public", "storage") +
|
||
'" ></td><td><img class="fastoption" src ="https://rms.rmto.ir/' +
|
||
data.files[1].path.replace("public", "storage") +
|
||
'"></td></tbody>\
|
||
</table>';
|
||
}
|
||
if (num == 0) {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle popup-fastreact-redesign">\
|
||
<img src="../dist/images/layer-icons/emergency.svg" alt="">\
|
||
<span class="popupHeader popupheader-fastreact-redesign">واکنش سریع (کد پیگیری: ' +
|
||
data.uid +
|
||
')</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.ProvinceName +
|
||
"، شهرستان " +
|
||
data.TownName +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6 popup-header-fast popup-header-fast1" style="text-align:center"><span class="popupheader-fastreact-style"> موضوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.Title +
|
||
'</div></div>\
|
||
<div class="col-6 popup-header-fast popup-header-fast2" style="text-align:center"><span class="popupheader-fastreact-style"> نوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.EventTypeTitle +
|
||
'</div></div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6 popup-header-fast popup-header-fast1" style="text-align:center"><span class="popupheader-fastreact-style"> تاریخ شکایت </span><div class="popUpBoxContent">' +
|
||
data.StartTime_DateTime +
|
||
'</div></div>\
|
||
<div class="col-6 popup-header-fast popup-header-fast2" style="text-align:center"><span class="popupheader-fastreact-style"> توضیح شکایت </span><div class="popUpBoxContent">' +
|
||
data.Description +
|
||
"</div></div>" +
|
||
img
|
||
);
|
||
} else {
|
||
return (
|
||
'\
|
||
<div class="popup">\
|
||
<div class="popupTitle popup-fastreact-redesign">\
|
||
<img src="../dist/images/layer-icons/emergency.svg" alt="">\
|
||
<span class="popupHeader popupheader-fastreact-redesign">واکنش سریع (کد پیگیری: ' +
|
||
data.uid +
|
||
')</span>\
|
||
</div>\
|
||
<div class="popupHeaderContent"><div class="popUpBanner">اداره کل ' +
|
||
data.ProvinceName +
|
||
"، شهرستان " +
|
||
data.TownName +
|
||
'</div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6 popup-header-fast popup-header-fast1" style="text-align:center"><span class="popupheader-fastreact-style"> موضوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.Title +
|
||
'</div></div>\
|
||
<div class="col-6 popup-header-fast popup-header-fast2" style="text-align:center"><span class="popupheader-fastreact-style"> نوع شکایت </span><div class="popUpBoxContent">' +
|
||
data.EventTypeTitle +
|
||
'</div></div>\
|
||
<div class="popupContent row col-12">\
|
||
<div class="col-6 popup-header-fast popup-header-fast1" style="text-align:center"><span class="popupheader-fastreact-style"> تاریخ شکایت </span><div class="popUpBoxContent">' +
|
||
data.StartTime_DateTime +
|
||
'</div></div>\
|
||
<div class="col-6 popup-header-fast popup-header-fast2" style="text-align:center"><span class="popupheader-fastreact-style"> توضیح شکایت </span><div class="popUpBoxContent">' +
|
||
data.Description +
|
||
"</div></div>" +
|
||
img
|
||
);
|
||
}
|
||
}
|
||
|
||
function showFastFunction(startDate, endDate) {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url:
|
||
"/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
endDate +
|
||
"&start-date=" +
|
||
startDate,
|
||
type: "GET",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
showfastreactionmarker = result.data;
|
||
let roadMaintenancePoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadMaintenancePoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
let pos = null;
|
||
|
||
if (roadMaintenancePoints[i].rms_status == 0) {
|
||
setIcon = redIcon;
|
||
pos = [roadMaintenancePoints[i].lat, roadMaintenancePoints[i].lng];
|
||
} else {
|
||
setIcon = greenIcon;
|
||
pos = roadMaintenancePoints[i].rms_start_latlng;
|
||
}
|
||
|
||
if (pos != null) {
|
||
let marker = L.marker(pos, {
|
||
icon: setIcon,
|
||
content: roadMaintenancePoints[i],
|
||
}).bindPopup(
|
||
getPopupContentFastReaction(
|
||
roadMaintenancePoints[i],
|
||
roadMaintenancePoints[i].rms_status
|
||
),
|
||
{
|
||
className: "customPopupStyle",
|
||
}
|
||
);
|
||
markerG.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
},
|
||
error: function (error) {},
|
||
});
|
||
}
|
||
|
||
function showPointOnMap(data) {
|
||
var icon;
|
||
let points = data;
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < points.length; i++) {
|
||
try {
|
||
if (points[i].project_type_id == 1) {
|
||
icon = redIconFix;
|
||
} else if (points[i].project_type_id == 2) {
|
||
icon = pinkIcon;
|
||
} else if (points[i].project_type_id == 3) {
|
||
icon = purpleIcon;
|
||
} else if (points[i].project_type_id == 4) {
|
||
icon = sBlueIcon;
|
||
} else if (points[i].project_type_id == 5) {
|
||
icon = greenIcon;
|
||
} else if (points[i].project_type_id == 6) {
|
||
icon = yellowicon;
|
||
}
|
||
let marker = null;
|
||
marker = L.marker([points[i].start_lat, points[i].start_lng], {
|
||
icon: icon,
|
||
}).on("click", function () {
|
||
idpro = data[i].id;
|
||
window.open("https://rms.rmto.ir/bama/" + idpro);
|
||
});
|
||
|
||
markerG.push(marker);
|
||
} catch (e) {}
|
||
}
|
||
markersproject = L.layerGroup(markerG);
|
||
map.addLayer(markersproject);
|
||
}
|
||
|
||
function removeProjectLayer() {
|
||
if (markersproject != null) {
|
||
map.removeLayer(markersproject);
|
||
}
|
||
}
|
||
|
||
function init_data_filter() {
|
||
let hold_idSelect = $("#province-id").val();
|
||
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces/" + hold_idSelect,
|
||
type: "GET",
|
||
success: function (data) {
|
||
list_citys = data.data;
|
||
$("#select-city").empty();
|
||
$("#select-city").append('<option value="0">نمایش استانی</option>');
|
||
|
||
for (let index = 0; index < list_citys.length; index++) {
|
||
$("#select-city").append(
|
||
"\
|
||
<option value=" +
|
||
list_citys[index].id +
|
||
">" +
|
||
list_citys[index].name_fa +
|
||
"</option>\
|
||
"
|
||
);
|
||
}
|
||
},
|
||
});
|
||
}
|
||
|
||
function show_point_rahdari(data, noenamayesh) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
|
||
if (marker141LayersWithoutCluster != null) {
|
||
marker141LayersWithoutCluster = [];
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
for (let index = 0; index < data.length; index++) {
|
||
let marker = L.marker([data[index].l, data[index].g], {
|
||
icon: redIconFix,
|
||
}).on("click", function (e) {
|
||
$("#showpoint").modal("show");
|
||
let hold_idSelect = data[index].i;
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/projects/road-items/" + hold_idSelect,
|
||
type: "GET",
|
||
success: function (data) {
|
||
getdatacheck(data);
|
||
$("#showpicture").empty();
|
||
show_point_photo_rahdari(data.picture[0].path, data.picture[1].path);
|
||
},
|
||
});
|
||
});
|
||
if (noenamayesh == 1) {
|
||
marker141List.push(marker);
|
||
} else {
|
||
markerG.push(marker);
|
||
}
|
||
}
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
}
|
||
$(".layerButton1").on("click", function () {
|
||
$("#province-id").empty();
|
||
$("#province-id").append('<option value="0">نمایش کشوری</option>');
|
||
$("#select-city").empty();
|
||
$("#select-city").append('<option value="0">نمایش استانی</option>');
|
||
$("#howToShow").val(0);
|
||
|
||
$.ajax({
|
||
url: "https://rms.rmto.ir/public/contents/provinces",
|
||
type: "GET",
|
||
success: function (data) {
|
||
list_province = data.data;
|
||
for (let index = 0; index < list_province.length; index++) {
|
||
$("#province-id").append(
|
||
"\
|
||
<option value=" +
|
||
list_province[index].id +
|
||
">" +
|
||
list_province[index].name_fa +
|
||
"</option>\
|
||
"
|
||
);
|
||
}
|
||
},
|
||
});
|
||
});
|
||
$("body").find(".main-ding-style").addClass("scrollbar");
|
||
$("body").find(".main-ding-style").addClass("stylescroll");
|
||
|
||
function checkboxchecked() {
|
||
$(".chBox5").on("change", function () {
|
||
showLoaderScreen();
|
||
removeProjectLayer();
|
||
if (this.checked) {
|
||
ppList.push(parseInt(this.id.substr(2)));
|
||
} else {
|
||
var index = ppList.indexOf(parseInt(this.id.substr(2)));
|
||
if (index > -1) {
|
||
ppList.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.post("https://rms.rmto.ir/api/public/bamamap", {
|
||
province: ppList,
|
||
project_type: ptList,
|
||
axis: atList,
|
||
last_status: psList,
|
||
from_date: currentFilterQueryfrom,
|
||
to_date: currentFilterQueryto,
|
||
priority: priority,
|
||
followup: followup,
|
||
}).done(function (data) {
|
||
hideLoaderScreen();
|
||
showPointOnMap(data.data);
|
||
});
|
||
});
|
||
}
|
||
$(".list").on("click", function () {
|
||
$(".list").removeClass("active");
|
||
$(this).addClass("active");
|
||
});
|
||
|
||
function show_point_photo_rahdari(path1, path2) {
|
||
$("#showpicture").append(
|
||
'<td><img class="zoom" src ="https://rms.rmto.ir/storage/' +
|
||
path1 +
|
||
'" ></td>'
|
||
);
|
||
$("#showpicture").append(
|
||
'<td><img class="zoom" src ="https://rms.rmto.ir/storage/' +
|
||
path2 +
|
||
'" ></td>'
|
||
);
|
||
}
|
||
|
||
function checkboxshowrahdar() {
|
||
$(".checkboxpro").on("change", function () {
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
pprahdar.push(parseInt(this.value) + 1);
|
||
} else {
|
||
var index = pprahdar.indexOf(parseInt(this.value) + 1);
|
||
if (index > -1) {
|
||
pprahdar.splice(index, 1);
|
||
}
|
||
}
|
||
showLoaderScreen();
|
||
|
||
$.get("https://rms.rmto.ir/api/public/rahdarKhanehMapFilter", {
|
||
province_id: pprahdar,
|
||
type: typerahdar,
|
||
status: statusrahdar,
|
||
}).done(function (data) {
|
||
show_filter_rahdar(data.data, pointrahdar);
|
||
});
|
||
});
|
||
}
|
||
|
||
function show_filter_rahdar(data, showdataFlag) {
|
||
let markerG = [];
|
||
marker141Layers = L.markerClusterGroup();
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
setIcon = rahdariIconY;
|
||
|
||
if (data[i].lat == null) {
|
||
}
|
||
if (
|
||
data[i].lat == "-" ||
|
||
data[i].lng == "-" ||
|
||
data[i].lat == "0" ||
|
||
data[i].lng == "0" ||
|
||
data[i].lat == null ||
|
||
data[i].lng == null
|
||
) {
|
||
continue;
|
||
}
|
||
|
||
let marker = L.marker([data[i].lat, data[i].lng], {
|
||
icon: setIcon,
|
||
content: data[i],
|
||
}).bindPopup(getPopupContentRahdar(data[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
|
||
if (showdataFlag == 1) {
|
||
markerG.push(marker);
|
||
} else {
|
||
marker141List.push(marker);
|
||
}
|
||
}
|
||
|
||
marker141LayersWithoutCluster = L.layerGroup(markerG);
|
||
marker141Layers.addLayers(marker141List);
|
||
map.addLayer(marker141Layers);
|
||
map.addLayer(marker141LayersWithoutCluster);
|
||
hideLoaderScreen();
|
||
}
|
||
|
||
function showboxfast() {
|
||
$(".fastboxpro").on("change", function () {
|
||
showLoaderScreen();
|
||
let startDatepro = moment(
|
||
frommDatefast.getState().selected.year +
|
||
"/" +
|
||
frommDatefast.getState().selected.month +
|
||
"/" +
|
||
frommDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
let endDatepro = moment(
|
||
toDatefast.getState().selected.year +
|
||
"/" +
|
||
toDatefast.getState().selected.month +
|
||
"/" +
|
||
toDatefast.getState().selected.date,
|
||
"jYYYY/jM/jD"
|
||
).format("YYYY-MM-DD");
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
ppfast.push(parseInt(this.value) + 1);
|
||
} else {
|
||
var index = ppfast.indexOf(parseInt(this.value) + 1);
|
||
if (index > -1) {
|
||
ppfast.splice(index, 1);
|
||
}
|
||
}
|
||
|
||
$.get(
|
||
"https://rms.rmto.ir/public/homeprojects/fast/points" +
|
||
"?end-date=" +
|
||
endDatepro +
|
||
"&start-date=" +
|
||
startDatepro,
|
||
{
|
||
ProvinceId: ppfast,
|
||
FeatureType: featurefast,
|
||
Status: activityfast,
|
||
}
|
||
).done(function (data) {
|
||
hideLoaderScreen();
|
||
show_fast_points(data);
|
||
});
|
||
});
|
||
}
|
||
|
||
function show_fast_points(result) {
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
let roadMaintenancePoints = result.data;
|
||
|
||
let markerG = [];
|
||
|
||
for (let i = 0; i < roadMaintenancePoints.length; i++) {
|
||
try {
|
||
let setIcon = null;
|
||
let pos = null;
|
||
|
||
if (roadMaintenancePoints[i].rms_status == 0) {
|
||
setIcon = redIcon;
|
||
pos = [roadMaintenancePoints[i].lat, roadMaintenancePoints[i].lng];
|
||
} else {
|
||
setIcon = greenIcon;
|
||
pos = [roadMaintenancePoints[i].lat, roadMaintenancePoints[i].lng];
|
||
}
|
||
|
||
if (pos != null) {
|
||
let marker = L.marker(pos, {
|
||
icon: setIcon,
|
||
content: roadMaintenancePoints[i],
|
||
}).bindPopup(
|
||
getPopupContentFastReaction(
|
||
roadMaintenancePoints[i],
|
||
roadMaintenancePoints[i].rms_status
|
||
),
|
||
{
|
||
className: "customPopupStyle",
|
||
}
|
||
);
|
||
markerG.push(marker);
|
||
} else {
|
||
}
|
||
} catch (e) {}
|
||
}
|
||
marker141Layers = L.layerGroup(markerG);
|
||
map.addLayer(marker141Layers);
|
||
}
|
||
|
||
$(".showpoints").on("change", function () {
|
||
remove141Layer();
|
||
if (marker141Layers != null) {
|
||
marker141List = [];
|
||
map.removeLayer(marker141Layers);
|
||
}
|
||
if (marker141LayersWithoutCluster != null) {
|
||
map.removeLayer(marker141LayersWithoutCluster);
|
||
}
|
||
|
||
if (this.checked) {
|
||
pointrahdar = parseInt(this.value);
|
||
} else {
|
||
pointrahdar = -1;
|
||
}
|
||
showLoaderScreen();
|
||
|
||
$.get("https://rms.rmto.ir/api/public/rahdarKhanehMapFilter", {
|
||
province_id: pprahdar,
|
||
status: statusrahdar,
|
||
type: typerahdar,
|
||
}).done(function (data) {
|
||
show_filter_rahdar(data.data, pointrahdar);
|
||
});
|
||
});
|
||
|
||
function returntype(num) {
|
||
switch (num) {
|
||
case "1":
|
||
return "دائمی";
|
||
case "3":
|
||
return "موقت";
|
||
case "2":
|
||
return "فصلی ";
|
||
}
|
||
}
|
||
function showwintercamp() {
|
||
$(".guid-winter-camp").css("display", "");
|
||
}
|
||
$(".coridor").on("click", function () {
|
||
selectedCoridor = $(this).attr("data-coridor");
|
||
var startlatlng = JSON.parse($(this).attr("data-startlatlng"));
|
||
var endlatlng = JSON.parse($(this).attr("data-endlatlng"));
|
||
if (jQuery.inArray(selectedCoridor, selectedCoridorArr) !== -1) {
|
||
$(this).addClass("nonborderclass").removeClass("borderclass");
|
||
selectedCoridorArr = jQuery.grep(selectedCoridorArr, function (value) {
|
||
return value != selectedCoridor;
|
||
});
|
||
removeCoridorLayer(selectedCoridor);
|
||
} else {
|
||
$(this).addClass("borderclass").removeClass("nonborderclass");
|
||
selectedCoridorArr.push(selectedCoridor);
|
||
addCoridorLine(selectedCoridor, startlatlng, endlatlng);
|
||
map.flyTo([endlatlng[0], endlatlng[1]], 9);
|
||
}
|
||
});
|
||
function addCoridorLine(num, startlatlng, endlatlng) {
|
||
routeArray = [];
|
||
let result = new Promise(function (resolve, reject) {
|
||
if (num == 3) {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/49.5846102,37.2793607;49.589109420776374,37.01365617294853;49.39663410186768,36.76501688279228;49.41307067871094,36.71865951515749;49.53460693359376,36.618903290216785;49.59546089172364,36.3709172544364;49.81874942779541,36.31037025501364;50.006663,36.2804074?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
} else {
|
||
$.get(
|
||
"https://rmsmap.rmto.ir/route/v1/driving/" +
|
||
startlatlng[1] +
|
||
"," +
|
||
startlatlng[0] +
|
||
";" +
|
||
endlatlng[1] +
|
||
"," +
|
||
endlatlng[0] +
|
||
"?overview=full&alternatives=true&steps=true",
|
||
function (data) {
|
||
resolve(decode(data.routes[0].geometry, 6));
|
||
}
|
||
);
|
||
}
|
||
});
|
||
result.then((response) => {
|
||
routeArray = response;
|
||
console.log(routeArray , "response");
|
||
coridorMarker(routeArray, num);
|
||
var coridorLine = [];
|
||
for (i = 0; i < routeArray.length; i++) {
|
||
coridorLine.push(
|
||
new L.LatLng(routeArray[i][0] * 10, routeArray[i][1] * 10)
|
||
);
|
||
}
|
||
drawPathCoridor(coridorLine, num);
|
||
});
|
||
}
|
||
function drawPathCoridor(coridorLine, num) {
|
||
switch (num) {
|
||
case "1":
|
||
poly_1 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_1.addTo(map);
|
||
break;
|
||
case "2":
|
||
poly_2 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_2.addTo(map);
|
||
|
||
break;
|
||
case "3":
|
||
poly_3 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_3.addTo(map);
|
||
break;
|
||
case "4":
|
||
poly_4 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_4.addTo(map);
|
||
break;
|
||
case "5":
|
||
poly_5 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_5.addTo(map);
|
||
break;
|
||
case "6":
|
||
poly_6 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_6.addTo(map);
|
||
break;
|
||
case "7":
|
||
poly_7 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_7.addTo(map);
|
||
break;
|
||
case "8":
|
||
poly_8 = new L.Polyline(coridorLine, {
|
||
color: "blue",
|
||
weight: 5,
|
||
opacity: 0.5,
|
||
smoothFactor: 1,
|
||
});
|
||
poly_8.addTo(map);
|
||
break;
|
||
}
|
||
}
|
||
function coridorMarker(array, num) {
|
||
showLoaderScreen();
|
||
$.post(
|
||
"https://rms.rmto.ir/api/RahesEsential/all",
|
||
{
|
||
latlng: array,
|
||
type: 1,
|
||
},
|
||
function (data) {
|
||
hideLoaderScreen();
|
||
coridorMarkerArray = data.data;
|
||
appendMarkerToMap(coridorMarkerArray, num);
|
||
}
|
||
);
|
||
}
|
||
|
||
function appendMarkerToMap(Array, num) {
|
||
switch (num) {
|
||
case "1":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_1 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_1_list.push(marker_1);
|
||
}
|
||
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_1 = L.layerGroup(marker_1_list);
|
||
map.addLayer(layer_1);
|
||
|
||
break;
|
||
case "2":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_2 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_2_list.push(marker_2);
|
||
}
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_2 = L.layerGroup(marker_2_list);
|
||
map.addLayer(layer_2);
|
||
break;
|
||
case "3":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_3 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_3_list.push(marker_3);
|
||
}
|
||
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_3 = L.layerGroup(marker_3_list);
|
||
map.addLayer(layer_3);
|
||
break;
|
||
case "4":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_4 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_4_list.push(marker_4);
|
||
}
|
||
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_4 = L.layerGroup(marker_4_list);
|
||
map.addLayer(layer_4);
|
||
break;
|
||
case "5":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_5 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_5_list.push(marker_5);
|
||
}
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_5 = L.layerGroup(marker_5_list);
|
||
map.addLayer(layer_5);
|
||
break;
|
||
case "6":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_6 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_6_list.push(marker_6);
|
||
}
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_6 = L.layerGroup(marker_6_list);
|
||
map.addLayer(layer_6);
|
||
break;
|
||
case "7":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_7 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_7_list.push(marker_7);
|
||
}
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_7 = L.layerGroup(marker_7_list);
|
||
map.addLayer(layer_7);
|
||
break;
|
||
case "8":
|
||
for (let i = 0; i < Array.length; i++) {
|
||
if (Array[i].lat != null && Array[i].lng != null) {
|
||
marker_8 = L.marker([Array[i].lat, Array[i].lng], {
|
||
icon: rahdariIconO,
|
||
draggable: false,
|
||
}).bindPopup(getPopupContentCoridor(Array[i]), {
|
||
className: "customPopupStyle",
|
||
});
|
||
marker_8_list.push(marker_8);
|
||
}
|
||
if (
|
||
Array[i].color != null &&
|
||
Array[i].start_lat != null &&
|
||
Array[i].end_lng != null &&
|
||
Array[i].color != "" &&
|
||
Array[i].start_lat != "" &&
|
||
Array[i].end_lng != "" &&
|
||
Array[i].start_lat != NaN &&
|
||
Array[i].end_lng != NaN &&
|
||
Array[i].start_lat != undefined &&
|
||
Array[i].start_lng != undefined &&
|
||
Array[i].end_lat != undefined &&
|
||
Array[i].end_lng != undefined &&
|
||
Array[i].start_lat != "undefined" &&
|
||
Array[i].start_lng != "undefined" &&
|
||
Array[i].end_lat != "undefined" &&
|
||
Array[i].end_lng != "undefined"
|
||
) {
|
||
drawPathwithColor(
|
||
Array[i].start_lat,
|
||
Array[i].start_lng,
|
||
Array[i].end_lat,
|
||
Array[i].end_lng,
|
||
Array[i].color
|
||
);
|
||
}
|
||
}
|
||
layer_8 = L.layerGroup(marker_8_list);
|
||
map.addLayer(layer_8);
|
||
break;
|
||
}
|
||
}
|
||
function removeCoridorLayer(num) {
|
||
if (routecolor.length) {
|
||
$(routecolor).each(function (index, control) {
|
||
map.removeControl(control);
|
||
routecolor.splice(routecolor.indexOf(index), 1);
|
||
});
|
||
}
|
||
switch (num) {
|
||
case "1":
|
||
if (layer_1 != null) {
|
||
marker_1_list = [];
|
||
map.removeLayer(layer_1);
|
||
}
|
||
map.removeLayer(poly_1);
|
||
|
||
break;
|
||
case "2":
|
||
if (layer_2 != null) {
|
||
marker_2_list = [];
|
||
map.removeLayer(layer_2);
|
||
}
|
||
map.removeLayer(poly_2);
|
||
|
||
break;
|
||
case "3":
|
||
if (layer_3 != null) {
|
||
marker_3_list = [];
|
||
map.removeLayer(layer_3);
|
||
}
|
||
map.removeLayer(poly_3);
|
||
|
||
break;
|
||
case "4":
|
||
if (layer_4 != null) {
|
||
marker_4_list = [];
|
||
map.removeLayer(layer_4);
|
||
}
|
||
map.removeLayer(poly_4);
|
||
|
||
break;
|
||
case "5":
|
||
if (layer_5 != null) {
|
||
marker_5_list = [];
|
||
map.removeLayer(layer_5);
|
||
}
|
||
map.removeLayer(poly_5);
|
||
|
||
break;
|
||
case "6":
|
||
if (layer_6 != null) {
|
||
marker_6_list = [];
|
||
map.removeLayer(layer_6);
|
||
}
|
||
map.removeLayer(poly_6);
|
||
|
||
break;
|
||
case "7":
|
||
if (layer_7 != null) {
|
||
marker_7_list = [];
|
||
map.removeLayer(layer_7);
|
||
}
|
||
map.removeLayer(poly_7);
|
||
|
||
break;
|
||
case "8":
|
||
if (layer_8 != null) {
|
||
marker_8_list = [];
|
||
map.removeLayer(layer_8);
|
||
}
|
||
map.removeLayer(poly_8);
|
||
|
||
break;
|
||
}
|
||
}
|
||
function preventNonNumericalInput(e) {
|
||
e = e || window.event;
|
||
var charCode = typeof e.which == "undefined" ? e.keyCode : e.which;
|
||
var charStr = String.fromCharCode(charCode);
|
||
|
||
if (!charStr.match(/^[0-9]+$/)) e.preventDefault();
|
||
}
|
||
|
||
// reset input
|
||
$(".map-latlng-first-input").on("keyup", function () {
|
||
checkStartMarkerValidation();
|
||
});
|
||
$(".map-latlng-sec-input").on("keyup", function () {
|
||
checkEndMarkerValidation();
|
||
});
|
||
|
||
function checkStartMarkerValidation(forSaveData = false, pageOnLoad = false) {
|
||
let reg = /^([0-9]){2}\.([0-9])+$/;
|
||
let startLatLngVal = $(".map-latlng-first-input").val().split(" - ");
|
||
let startLatLng = startLatLngVal.map(function (e) {
|
||
e = e.replace(/_/g, "");
|
||
return parseFloat(e.slice(1, -1));
|
||
});
|
||
if (isNaN(startLatLng[0])) {
|
||
if (!forSaveData) {
|
||
$(".map-latlng-first-input").removeClass("is-invalid-input");
|
||
} else {
|
||
$(".map-latlng-first-input").addClass("is-invalid-input");
|
||
}
|
||
$("#pin-marker-startrahdar").removeClass("pin-move pin-set");
|
||
$(".map-latlng-first-input").val("");
|
||
$(".map-latlng-first-input").attr(
|
||
"placeholder",
|
||
"(شروع) => (عرض جغرافیایی) - (طول جغرافیایی)"
|
||
);
|
||
return false;
|
||
} else if (
|
||
!startLatLng == 2 ||
|
||
!reg.test(startLatLng[0]) ||
|
||
!reg.test(startLatLng[1])
|
||
) {
|
||
$(".map-latlng-first-input").addClass("is-invalid-input");
|
||
$("#pin-marker-startrahdar").removeClass("pin-move pin-set");
|
||
return false;
|
||
} else {
|
||
if (!forSaveData) {
|
||
$(".map-latlng-first-input").removeClass("is-invalid-input");
|
||
|
||
startAbrarMarker.setLatLng(startLatLng);
|
||
|
||
if (pageOnLoad) {
|
||
setTimeout(() => {
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move")
|
||
.addClass("pin-set");
|
||
startAbrarMarker.setLatLng(startLatLng);
|
||
}, 10);
|
||
} else {
|
||
$("#pin-marker-startrahdar")
|
||
.removeClass("pin-move")
|
||
.addClass("pin-set");
|
||
}
|
||
if (!isSetEndAbrarMarker) {
|
||
let markerLatLng = [
|
||
startAbrarMarker.getLatLng().lat,
|
||
startAbrarMarker.getLatLng().lng + 0.0008,
|
||
];
|
||
|
||
mapradar.setView(markerLatLng);
|
||
endAbrarMarker.setLatLng(markerLatLng);
|
||
|
||
if (!isSetStartAbrarMarker) {
|
||
endAbrarMarker.addTo(mapradar);
|
||
}
|
||
}
|
||
isSetStartAbrarMarker = true;
|
||
}
|
||
checkMarkersAndDrawPath();
|
||
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function checkEndMarkerValidation(forSaveData = false, pageOnLoad = false) {
|
||
let reg = /^([0-9]){2}\.([0-9])+$/;
|
||
let endLatLngVal = $(".map-latlng-sec-input").val().split(" - ");
|
||
let endLatLng = endLatLngVal.map(function (e) {
|
||
e = e.replace(/_/g, "");
|
||
return parseFloat(e.slice(1, -1));
|
||
});
|
||
|
||
if (isNaN(endLatLng[0])) {
|
||
if (!forSaveData) {
|
||
$(".map-latlng-sec-input").removeClass("is-invalid-input");
|
||
} else {
|
||
$(".map-latlng-sec-input").addClass("is-invalid-input");
|
||
}
|
||
$("#pin-marker-endrahdar").removeClass("pin-move pin-set");
|
||
$(".map-latlng-sec-input").val("");
|
||
$(".map-latlng-sec-input").attr(
|
||
"placeholder",
|
||
"(پایان) => (عرض جغرافیایی) - (طول جغرافیایی)"
|
||
);
|
||
return false;
|
||
} else if (
|
||
!endLatLng == 2 ||
|
||
!reg.test(endLatLng[0]) ||
|
||
!reg.test(endLatLng[1])
|
||
) {
|
||
$(".map-latlng-sec-input").addClass("is-invalid-input");
|
||
$("#pin-marker-endrahdar").removeClass("pin-move pin-set");
|
||
return false;
|
||
} else {
|
||
if (!forSaveData) {
|
||
$(".map-latlng-sec-input").removeClass("is-invalid-input");
|
||
|
||
endAbrarMarker.setLatLng(endLatLng);
|
||
isSetEndAbrarMarker = true;
|
||
|
||
if (pageOnLoad) {
|
||
setTimeout(() => {
|
||
$("#pin-marker-endrahdar")
|
||
.removeClass("pin-move")
|
||
.addClass("pin-set");
|
||
endAbrarMarker.setLatLng(endLatLng);
|
||
}, 10);
|
||
} else {
|
||
$("#pin-marker-endrahdar").removeClass("pin-move").addClass("pin-set");
|
||
}
|
||
}
|
||
|
||
checkMarkersAndDrawPath();
|
||
|
||
return true;
|
||
}
|
||
}
|
||
function UncheckAll() {
|
||
var w = document.getElementsByTagName("input");
|
||
for (var i = 0; i < w.length; i++) {
|
||
if (w[i].type == "checkbox") {
|
||
w[i].checked = false;
|
||
} else if (w[i].type == "radio") {
|
||
w[i].checked = false;
|
||
}
|
||
}
|
||
}
|