455 lines
15 KiB
JavaScript
455 lines
15 KiB
JavaScript
var shiftNumber = $('#shiftWorkval').val();
|
|
|
|
|
|
if (shiftNumber === "4") {
|
|
|
|
$('#ComplexFildset').addClass("shiftDisplayNone");
|
|
$('#WeeklyFildset').removeClass("shiftDisplayNone");
|
|
} else {
|
|
$('#WeeklyFildset').addClass("shiftDisplayNone");
|
|
$('#ComplexFildset').removeClass("shiftDisplayNone");
|
|
}
|
|
|
|
|
|
if ($('#fw1').is(":checked")) {//شنبه
|
|
$('#shanbehw1').addClass("btn-active");
|
|
} else {
|
|
$('#shanbehw1').removeClass("btn-active");
|
|
$('#shanbehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#shanbehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f1w1').is(":checked")) {//یکشنبه
|
|
$('#yekshanbehw1').addClass("btn-active");
|
|
} else {
|
|
$('#yekshanbehw1').removeClass("btn-active");
|
|
$('#yekshanbehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#yekshanbehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f2w1').is(":checked")) {//دوشنبه
|
|
$('#doshanbehw1').addClass("btn-active");
|
|
} else {
|
|
$('#doshanbehw1').removeClass("btn-active");
|
|
$('#doshanbehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#doshanbehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
if ($('#f3w1').is(":checked")) {//سه شنبه
|
|
$('#seshanbehw1').addClass("btn-active");
|
|
} else {
|
|
$('#seshanbehw1').removeClass("btn-active");
|
|
$('#seshanbehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#seshanbehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f4w1').is(":checked")) {//چهارشنبه
|
|
$('#cheharshanbehw1').addClass("btn-active");
|
|
} else {
|
|
$('#cheharshanbehw1').removeClass("btn-active");
|
|
$('#cheharshanbehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#cheharshanbehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f5w1').is(":checked")) {//پنجشنبه
|
|
$('#panjshanbehw1').addClass("btn-active");
|
|
|
|
} else {
|
|
$('#panjshanbehw1').removeClass("btn-active");
|
|
$('#panjshanbehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#panjshanbehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f6w1').is(":checked")) {//جمعه
|
|
$('#jomehw1').addClass("btn-active");
|
|
} else {
|
|
$('#jomehw1').removeClass("btn-active");
|
|
$('#jomehRow3w1 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
$(this).val("");
|
|
});
|
|
$('#jomehRow3w1 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
//week2 days by value
|
|
if ($('#fw2').is(":checked")) {//شنبه
|
|
$('#shanbehw2').addClass("btn-active");
|
|
} else {
|
|
$('#shanbehw2').removeClass("btn-active");
|
|
$('#shanbehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#shanbehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f1w2').is(":checked")) {//یکشنبه
|
|
$('#yekshanbehw2').addClass("btn-active");
|
|
} else {
|
|
$('#yekshanbehw2').removeClass("btn-active");
|
|
$('#yekshanbehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#yekshanbehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f2w2').is(":checked")) {//دوشنبه
|
|
$('#doshanbehw2').addClass("btn-active");
|
|
} else {
|
|
$('#doshanbehw2').removeClass("btn-active");
|
|
$('#doshanbehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#doshanbehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
if ($('#f3w2').is(":checked")) {//سه شنبه
|
|
$('#seshanbehw2').addClass("btn-active");
|
|
} else {
|
|
$('#seshanbehw2').removeClass("btn-active");
|
|
$('#seshanbehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#seshanbehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f4w2').is(":checked")) {//چهارشنبه
|
|
$('#cheharshanbehw2').addClass("btn-active");
|
|
} else {
|
|
$('#cheharshanbehw2').removeClass("btn-active");
|
|
$('#cheharshanbehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#cheharshanbehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f5w2').is(":checked")) {//پنجشنبه
|
|
$('#panjshanbehw2').addClass("btn-active");
|
|
|
|
} else {
|
|
$('#panjshanbehw2').removeClass("btn-active");
|
|
$('#panjshanbehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#panjshanbehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f6w2').is(":checked")) {//جمعه
|
|
$('#jomehw2').addClass("btn-active");
|
|
} else {
|
|
$('#jomehw2').removeClass("btn-active");
|
|
$('#jomehRow3w2 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
$(this).val("");
|
|
});
|
|
$('#jomehRow3w2 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($('#fw3').is(":checked")) {//شنبه
|
|
$('#shanbehw3').addClass("btn-active");
|
|
} else {
|
|
$('#shanbehw3').removeClass("btn-active");
|
|
$('#shanbehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#shanbehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f1w3').is(":checked")) {//یکشنبه
|
|
$('#yekshanbehw3').addClass("btn-active");
|
|
} else {
|
|
$('#yekshanbehw3').removeClass("btn-active");
|
|
$('#yekshanbehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#yekshanbehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f2w3').is(":checked")) {//دوشنبه
|
|
$('#doshanbehw3').addClass("btn-active");
|
|
} else {
|
|
$('#doshanbehw3').removeClass("btn-active");
|
|
$('#doshanbehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#doshanbehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
if ($('#f3w3').is(":checked")) {//سه شنبه
|
|
$('#seshanbehw3').addClass("btn-active");
|
|
} else {
|
|
$('#seshanbehw3').removeClass("btn-active");
|
|
$('#seshanbehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#seshanbehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f4w3').is(":checked")) {//چهارشنبه
|
|
$('#cheharshanbehw3').addClass("btn-active");
|
|
} else {
|
|
$('#cheharshanbehw3').removeClass("btn-active");
|
|
$('#cheharshanbehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#cheharshanbehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f5w3').is(":checked")) {//پنجشنبه
|
|
$('#panjshanbehw3').addClass("btn-active");
|
|
|
|
} else {
|
|
$('#panjshanbehw3').removeClass("btn-active");
|
|
$('#panjshanbehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#panjshanbehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f6w3').is(":checked")) {//جمعه
|
|
$('#jomehw3').addClass("btn-active");
|
|
} else {
|
|
$('#jomehw3').removeClass("btn-active");
|
|
$('#jomehRow3w3 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
$(this).val("");
|
|
});
|
|
$('#jomehRow3w3 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($('#fw4').is(":checked")) {//شنبه
|
|
$('#shanbehw4').addClass("btn-active");
|
|
} else {
|
|
$('#shanbehw4').removeClass("btn-active");
|
|
$('#shanbehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#shanbehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f1w4').is(":checked")) {//یکشنبه
|
|
$('#yekshanbehw4').addClass("btn-active");
|
|
} else {
|
|
$('#yekshanbehw4').removeClass("btn-active");
|
|
$('#yekshanbehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#yekshanbehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f2w4').is(":checked")) {//دوشنبه
|
|
$('#doshanbehw4').addClass("btn-active");
|
|
} else {
|
|
$('#doshanbehw4').removeClass("btn-active");
|
|
$('#doshanbehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#doshanbehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
if ($('#f3w4').is(":checked")) {//سه شنبه
|
|
$('#seshanbehw4').addClass("btn-active");
|
|
} else {
|
|
$('#seshanbehw4').removeClass("btn-active");
|
|
$('#seshanbehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#seshanbehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f4w4').is(":checked")) {//چهارشنبه
|
|
$('#cheharshanbehw4').addClass("btn-active");
|
|
} else {
|
|
$('#cheharshanbehw4').removeClass("btn-active");
|
|
$('#cheharshanbehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#cheharshanbehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f5w4').is(":checked")) {//پنجشنبه
|
|
$('#panjshanbehw4').addClass("btn-active");
|
|
|
|
} else {
|
|
|
|
$('#panjshanbehw4').removeClass("btn-active");
|
|
$('#panjshanbehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
});
|
|
$('#panjshanbehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
}
|
|
if ($('#f6w4').is(":checked")) {//جمعه
|
|
$('#jomehw4').addClass("btn-active");
|
|
} else {
|
|
$('#jomehw4').removeClass("btn-active");
|
|
$('#jomehRow3w4 input').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
$(this).val("");
|
|
});
|
|
$('#jomehRow3w4 .rest').each(function () {
|
|
$(this).prop('selectedIndex', 0);
|
|
});
|
|
|
|
}
|
|
|
|
//disable shifte 2
|
|
function towDeactive() {
|
|
$('input.tow').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
$(this).val("");
|
|
$(this).removeProp("style");
|
|
|
|
|
|
});
|
|
}
|
|
//active shift2
|
|
function towActive() {
|
|
$('input.tow').each(function () {
|
|
$(this).removeAttr("disabled");
|
|
$(this).removeClass("input-deactive");
|
|
|
|
|
|
});
|
|
}
|
|
function oneActive() {
|
|
$('input.one').each(function () {
|
|
$(this).removeAttr("disabled");
|
|
$(this).removeClass("input-deactive");
|
|
|
|
|
|
});
|
|
}
|
|
//rest disable
|
|
function restDeactive() {
|
|
$('.restActive').each(function () {
|
|
$(this).attr("disabled", "disabled");
|
|
$(this).addClass("input-deactive");
|
|
$(this).prop('selectedIndex', 0);
|
|
|
|
|
|
});
|
|
}
|
|
//empty rest
|
|
function restReset() {
|
|
$('.restActive').each(function () {
|
|
|
|
$(this).prop('selectedIndex', 0);
|
|
|
|
|
|
});
|
|
}
|
|
//rest active
|
|
function restActive() {
|
|
$('.restActive').each(function () {
|
|
$(this).removeAttr("disabled");
|
|
$(this).removeClass("input-deactive");
|
|
|
|
|
|
});
|
|
}
|
|
|
|
|
|
|
|
document.getElementById("btnPrint").onclick = function () {
|
|
printElement(document.getElementById("printThis"));
|
|
}
|
|
|
|
function printElement(elem) {
|
|
var domClone = elem.cloneNode(true);
|
|
|
|
var $printSection = document.getElementById("printSection");
|
|
|
|
if (!$printSection) {
|
|
$printSection = document.createElement("div");
|
|
$printSection.id = "printSection";
|
|
document.body.appendChild($printSection);
|
|
}
|
|
|
|
$printSection.innerHTML = "";
|
|
$printSection.appendChild(domClone);
|
|
window.print();
|
|
} |