2366 lines
83 KiB
JavaScript
2366 lines
83 KiB
JavaScript
var contractDatePicker;
|
||
var idkol;
|
||
var edit;
|
||
var idEdit;
|
||
var provinces = [];
|
||
var myfile = "";
|
||
var RandD_table = "/RandD/projects/all";
|
||
var RandD_table_update = "/RandD/projects/update";
|
||
var RandD_table_delete = "/RandD/projects/delete";
|
||
var RandD_table_add = "/RandD/projects/add";
|
||
var isAdmin = false;
|
||
var completepic = 0;
|
||
var RandDAgents = 0;
|
||
var acnt = "کارشناسی ثبت نشده";
|
||
var randdAgents = {};
|
||
var AgentList = [];
|
||
var maxagent = 2;
|
||
var currAgentcnt = 1;
|
||
var tableOnWork;
|
||
var CanSubmit;
|
||
var serverUp = "/public/uploads/";
|
||
var newplan_all_url = "/RandD/proposed_projects/all";
|
||
var newplan_add_url = "/RandD/proposed_projects/add";
|
||
var newplan_del_url = "/RandD/proposed_projects/delete";
|
||
var api_url = "/RandD";
|
||
var webapi_url = "/RandD";
|
||
|
||
|
||
$.fn.dataTable.ext.errMode = "none";
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
var showpdf = function (targetx) {
|
||
|
||
$('#pdf-view').attr('src', targetx);
|
||
$('#ModalPDF').modal('show');
|
||
|
||
|
||
}
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
var AllValidity = function () {
|
||
if ($('#allocatecredit-no').is(':checked')) {
|
||
$("#new-target-amount").val(" ")
|
||
}
|
||
CanSubmit = true;
|
||
let newPlanForm = document.getElementById("FormNewPlan");
|
||
let newPlanInputs = newPlanForm.querySelectorAll("input");
|
||
for (var i = 0; i < newPlanInputs.length; i++) {
|
||
if (!newPlanInputs[i].value) {
|
||
newPlanInputs[i].classList.add("is-invalid-input");
|
||
canAdd = false;
|
||
CanSubmit = false;
|
||
} else {
|
||
newPlanInputs[i].classList.remove("is-invalid-input");
|
||
|
||
|
||
}
|
||
}
|
||
if ($("#new-province-id").val() == null) {
|
||
$("#new-province-id").addClass("is-invalid-input")
|
||
}
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
GoSubmitNewPlan();
|
||
};
|
||
|
||
var GoSubmitNewPlan = function () {
|
||
if (CanSubmit) {
|
||
// alert("can submit");
|
||
PostNewPlan();
|
||
}
|
||
|
||
}
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
var NPlanFormData = new FormData();
|
||
var proj_rfp_file;
|
||
var proj_justification_file;
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$("#1ndfileUpload").change(function () {
|
||
proj_rfp_file = this.files;
|
||
// NPlanFormData.append("proj_rfp_file", proj_rfp_file);
|
||
$.each(proj_rfp_file, function (i, file) {
|
||
NPlanFormData.append("proj_rfp_file", file);
|
||
});
|
||
});
|
||
$("#2ndfileUpload").change(function () {
|
||
proj_justification_file = this.files;
|
||
// NPlanFormData.append("proj_justification_file", proj_justification_file);
|
||
$.each(proj_justification_file, function (i, file) {
|
||
NPlanFormData.append("proj_justification_file", file);
|
||
});
|
||
});
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Pack inputs
|
||
var PostNewPlan = function () {
|
||
|
||
|
||
var project_title = $("#new-project-title").val();
|
||
var province_fa = $("#new-province-id option:selected").text();
|
||
var domain_fa = $("#new_domain_id option:selected").text();
|
||
var proj_etimate_amount = $("#new-contract-amount").val();
|
||
var proj_credit_state = $("input[name='proj_credit_state']:checked").val();
|
||
var proj_credit_resource = $("#new-target-amount").val();
|
||
var proj_agents = AgentList.toString();
|
||
var proj_regby_name = $("#proj_regby_name").val();
|
||
var proj_regby_family = $("#proj_regby_family").val();
|
||
var proj_regby_phone = $("#proj_regby_phone").val();
|
||
|
||
|
||
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
|
||
|
||
NPlanFormData.append("project_title", project_title);
|
||
NPlanFormData.append("province_fa", province_fa);
|
||
NPlanFormData.append("domain_fa", domain_fa);
|
||
NPlanFormData.append("proj_etimate_amount", proj_etimate_amount);
|
||
NPlanFormData.append("proj_credit_state", proj_credit_state);
|
||
NPlanFormData.append("proj_credit_resource", proj_credit_resource);
|
||
NPlanFormData.append("proj_agents", proj_agents);
|
||
// NPlanFormData.append("proj_rfp_file", "24");
|
||
// NPlanFormData.append("proj_justification_file", "24");
|
||
NPlanFormData.append("proj_regby_name", proj_regby_name);
|
||
NPlanFormData.append("proj_regby_family", proj_regby_family);
|
||
NPlanFormData.append("proj_regby_phone", proj_regby_phone);
|
||
for (var pair of NPlanFormData.entries()) {
|
||
console.log(pair[0] + ', ' + pair[1]);
|
||
}
|
||
console.log(NPlanFormData);
|
||
$.ajax({
|
||
url: newplan_add_url,
|
||
type: "post",
|
||
headers: {
|
||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||
},
|
||
data: NPlanFormData,
|
||
processData: false,
|
||
contentType: false,
|
||
success: function (response, status, jqxhr) {
|
||
hideLoaderScreen();
|
||
// $('#RandDnew').DataTable().ajax.reload(null, false);
|
||
$("#SuccessModal").modal("show");
|
||
//newplan submitted maxter
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
},
|
||
error: function (jqxhr, status, errorMessage) {
|
||
hideLoaderScreen();
|
||
$("#UnSuccessModal").modal("show");
|
||
}
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
// var tablenewx = $('#RandDnew').DataTable();
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$('#RandDnew').on("click", "button.deletsubmit", function () {
|
||
|
||
|
||
data_row = $('#RandDnew').DataTable().row($(this).closest('tr')).data();
|
||
rowid = data_row.id;
|
||
|
||
//==============================================================Delete row
|
||
|
||
var element = $(this);
|
||
|
||
|
||
var info = {
|
||
id: data_row.id
|
||
};
|
||
// if (confirm("تایید برای حذف رکورد")) {
|
||
// $.ajax({
|
||
// type: "POST",
|
||
// url: newplan_del_url,
|
||
|
||
// data: info,
|
||
// success: function() {
|
||
|
||
// $('#RandDnew').DataTable().ajax.reload(null, false);
|
||
|
||
|
||
|
||
// }
|
||
// });
|
||
// $(this).parents(".show").animate({ backgroundColor: "#003" }, "slow")
|
||
// .animate({ opacity: "hide" }, "slow");
|
||
// }
|
||
|
||
|
||
Swal.fire({
|
||
icon: "warning",
|
||
title: "آیا برای حذف مطمئن هستید؟",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#3085d6",
|
||
cancelButtonColor: "#d33",
|
||
confirmButtonText: "بله، تایید میشود",
|
||
cancelButtonText: "منصرف شدم!",
|
||
showLoaderOnConfirm: true,
|
||
preConfirm: () => {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: newplan_del_url,
|
||
data: info,
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
|
||
success: function (result) {
|
||
$('#RandDnew').DataTable().ajax.reload(null, false);
|
||
},
|
||
error: function (error) {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
},
|
||
});
|
||
},
|
||
});
|
||
});
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
let guid = () => {
|
||
let s4 = () => {
|
||
return Math.floor((1 + Math.random()) * 0x10000)
|
||
.toString(16)
|
||
.substring(1);
|
||
}
|
||
var xuud = "";
|
||
xuud = s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4();
|
||
// xuud = xuud.replace("-", "");
|
||
// return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
||
return xuud;
|
||
}
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;maxter load
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$(window).on('load', function () {
|
||
$('#SelectModalRandD').modal('show');
|
||
});
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$('#swicon').change(function () {
|
||
var x = $("#swicon option:selected").attr('value');
|
||
switch (x) {
|
||
case '1':
|
||
showrAndfirst()
|
||
break;
|
||
case '2':
|
||
showrandsecond()
|
||
break;
|
||
}
|
||
|
||
// $('#listTitle').css('display', 'none')
|
||
// $("#RandD-holder").css('display', 'none');
|
||
// $("#RandDnew-holder").css('display', 'none');
|
||
// $('#open_select_modal').css('display', 'none')
|
||
|
||
// $("#SelectModalRandD").modal("show");
|
||
|
||
});
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Table switcher max0d3r
|
||
var SwTable = function (ix) {
|
||
if (ix == 1) {
|
||
// $("#RandD-holder").css('display', 'block');
|
||
$("#RandD-holder").fadeOut("slow");
|
||
$("#RandDnew-holder").css('display', 'none');
|
||
} else {
|
||
$("#RandDnew-holder").fadeOut("slow");
|
||
$("#RandD-holder").css('display', 'none');
|
||
|
||
|
||
}
|
||
}
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Form SElector maxt0r;;;;;;;;;;;;;;;;;
|
||
$('#open_select_modal').click(function () {
|
||
$('#stepModalRandD').modal({
|
||
backdrop: 'static',
|
||
keyboard: false
|
||
});
|
||
if (tableOnWork == 'OfferProject') {
|
||
$("#NewPlanModal").modal("show");
|
||
$("#submitNewProject").css("display", "inline");
|
||
$("#EditNewProject").css("display", "none");
|
||
} else {
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$("#uploadedItemspic").empty();
|
||
$("#uploadedItemspic2").empty();
|
||
$("#uploadedItemspic3").empty();
|
||
$("#uploadedItemspic4").empty();
|
||
$("#submitNewRow").attr("disabled", false);
|
||
edit = false;
|
||
showModal(0);
|
||
initialField();
|
||
$("#SelectModalRandD").modal("hide");
|
||
$("#submitNewRow").css("display", "none");
|
||
|
||
$("#submitNewRow_new").css("display", "block");
|
||
|
||
// $("#showfile").css("visibility", "hidden");
|
||
$("#province-id").empty();
|
||
$("#province-id").append('<option value="0" selected = "selected" disabled>انتخاب اداره کل</option>');
|
||
|
||
for (let index = 0; index < provinces.length; index++) {
|
||
$("#province-id").append(
|
||
"\
|
||
<option value=" +
|
||
provinces[index].id +
|
||
">" +
|
||
provinces[index].name_fa +
|
||
"</option>\
|
||
"
|
||
);
|
||
}
|
||
|
||
$("#stepModalRandD").modal("show");
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
|
||
}
|
||
|
||
});
|
||
//::::::::::::::::::::::::::::::::::::::::Maxter RandD::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||
var rdAgentSw = function (cnt) {
|
||
|
||
switch (cnt) {
|
||
case 1:
|
||
acnt = "یک کارشناس";
|
||
|
||
break;
|
||
case 2:
|
||
acnt = "دو کارشناس";
|
||
break;
|
||
|
||
case 3:
|
||
acnt = "سه کارشناس";
|
||
// code block
|
||
|
||
default:
|
||
// code block
|
||
}
|
||
|
||
return acnt;
|
||
}
|
||
//============================================================================
|
||
function initialnewprojectForm() {
|
||
$('#allocatecredit-ok').prop('checked', false);
|
||
$('#allocatecredit-no').prop('checked', true);
|
||
|
||
}
|
||
|
||
//=========add agent
|
||
|
||
|
||
//
|
||
$('#addagentRND').on('click', function () {
|
||
var agentreq = 0;
|
||
var fieldkey;
|
||
var fieldVal;
|
||
var agentObj = [];
|
||
var rowAgent;
|
||
//...................... validate Section.....................................................
|
||
let agentsDiv = document.getElementById("rdagentsection");
|
||
let inputAgents = agentsDiv.querySelectorAll("input");
|
||
for (var i = 0; i < inputAgents.length; i++) {
|
||
if (!inputAgents[i].value) {
|
||
inputAgents[i].classList.add("is-invalid-input");
|
||
canAdd = false;
|
||
} else {
|
||
inputAgents[i].classList.remove("is-invalid-input");
|
||
fieldkey = inputAgents[i].getAttribute("name");
|
||
fieldVal = inputAgents[i].value;
|
||
randdAgents[fieldkey] = fieldVal;
|
||
agentreq++;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
//////////////////////////////////////////////////////////////////////////
|
||
if (maxagent > currAgentcnt) {
|
||
var uidd = guid();
|
||
let agentParent = document.getElementById("rdagentslist");
|
||
let agentRows = rdagentslist.querySelectorAll("div.row");
|
||
var agntcrntRow = 0;
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
if (Object.keys(randdAgents).length > 0) {
|
||
console.log('1', AgentList);
|
||
randdAgents["xid"] = uidd;
|
||
var xrowadd;
|
||
var rowToAdd = JSON.stringify(randdAgents);
|
||
xrowadd
|
||
AgentList.push(rowToAdd);
|
||
console.log('2', AgentList);
|
||
|
||
|
||
}
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
for (var i = 0; i < agentRows.length; i++) {
|
||
agntcrntRow++;
|
||
|
||
};
|
||
currAgentcnt = agntcrntRow;
|
||
|
||
|
||
///++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||
|
||
|
||
if (agentreq > 2) {
|
||
rowAgent = '<div xid="' + uidd + '" style="border-top:1px dotted #787878" class="row w-100" id="agent-row-' + currAgentcnt + '" > ';
|
||
rowAgent += '<div class="col-1" style="padding-right:15px">' + '<span id="remove-agent-row" style="color:red">' + '<i onClick="RemoveAgentRow(\'' + uidd + '\')" class="fa fa-minus-circle" aria-hidden="true"></i>' + '</span>' + '</div>';
|
||
rowAgent += '<div class="col-3">' + '<span style="font-size:12px">' + 'نام : ' + randdAgents["projectagentname"] + '</span>' + '</div>';
|
||
rowAgent += '<div class="col-3">' + '<span style="font-size:12px">' + ' نام خانوادگی : ' + randdAgents["projectagentfamily"] + '</span>' + '</div > ';
|
||
rowAgent += '<div class="col-3">' + '<span style="font-size:12px">' + 'تلفن :' + randdAgents["projectagentphone"] + '</span>' + '</div>';
|
||
rowAgent += '</div>'
|
||
console.log(randdAgents[0]);
|
||
$('#rdagentslist').append(rowAgent);
|
||
// currAgentcnt++;
|
||
}
|
||
} else {
|
||
$('#agentiscomp').css('display', 'block');
|
||
}
|
||
nameName = $("#projectagentname").val();
|
||
familyName = $("#projectagentfamily").val();
|
||
numberName = $("#projectagentphone").val();
|
||
console.log("kose ammatun", nameName);
|
||
console.log("kose ammatun", familyName);
|
||
console.log("kose ammatun", numberName);
|
||
GenerateTablefilter(nameName, familyName, numberName);
|
||
});
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
///////////////////////////////////////////////////////Submit newPlan
|
||
$('#submitNewProject').on('click', function () {
|
||
AllValidity();
|
||
// showLoaderScreen();
|
||
});
|
||
|
||
$('#regnewplancomp').on('click', function () {
|
||
$('#NewPlanModal').modal('hide');
|
||
$('#RandDnew').DataTable().ajax.reload(null, false);
|
||
|
||
|
||
});
|
||
|
||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||
var RemoveAgentRow = function (ixx) {
|
||
var remrow = 'div[xid="' + ixx + '"]';
|
||
var itemjson;
|
||
$(remrow).remove();
|
||
AgentList.forEach(function (item, indexthis) {
|
||
itemjson = JSON.parse(item)
|
||
if (itemjson.xid == ixx) {
|
||
AgentList.splice(indexthis, 1);
|
||
}
|
||
|
||
});
|
||
console.log('after-remobing', AgentList);
|
||
currAgentcnt--;
|
||
|
||
};
|
||
//----------------------------------Upload File-----MAx0der-------------------------------------------------------------
|
||
$('#2ndfileUpload').change(function (e) {
|
||
$('#2ndfileSelected').val($(this).val());
|
||
});
|
||
|
||
document.getElementById('2getfile').onclick = function () {
|
||
document.getElementById('2ndfileUpload').click();
|
||
};
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$('#1ndfileUpload').change(function (e) {
|
||
$('#1ndfileSelected').val($(this).val());
|
||
});
|
||
|
||
document.getElementById('1getfile').onclick = function () {
|
||
document.getElementById('1ndfileUpload').click();
|
||
};
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$(document).ready(function () {
|
||
setTimeout(() => {
|
||
checkPosition();
|
||
}, 50);
|
||
init_row_filter()
|
||
//new add after upload
|
||
//just number for contract amount and number and date
|
||
$("#contract-amount").keypress(function (e) {
|
||
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
});
|
||
// $("#contract-num").keypress(function(e) {
|
||
// if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
// });
|
||
$("#contract-date").keypress(function (e) {
|
||
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
});
|
||
$("#projectagentphone").keypress(function (e) {
|
||
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
});
|
||
$("#projectagentphone").keypress(function (e) {
|
||
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
});
|
||
$("#proj_regby_phone").keypress(function (e) {
|
||
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
});
|
||
$("#proj_responsible_phone").keypress(function (e) {
|
||
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
|
||
});
|
||
//just number for contract amount and number and date
|
||
//new add after upload
|
||
|
||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Maxter x0d3r
|
||
|
||
//+++++++++++++++++++++++++
|
||
});
|
||
|
||
function showLoaderScreen() {
|
||
$(".divloader").css("display", "flex").hide().fadeIn();
|
||
}
|
||
|
||
function hideLoaderScreen() {
|
||
$(".divloader").fadeOut();
|
||
}
|
||
|
||
function ajaxcalltablefirst() {
|
||
$.ajax({
|
||
url: RandD_table,
|
||
type: "GET",
|
||
success: function (result) {
|
||
$("#example").dataTable().fnClearTable();
|
||
$("#example").dataTable().fnAddData(result.data);
|
||
hideLoaderScreen();
|
||
// Swal.fire({
|
||
// icon: "success",
|
||
// title: "با موفقیت بروزرسانی شد",
|
||
// confirmButtonText: "بستن",
|
||
// });
|
||
},
|
||
});
|
||
}
|
||
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Rendering Tables Maxter;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
var newtable;
|
||
var OfferTableRender = function () {
|
||
|
||
newtable = $("#RandDnew").DataTable({
|
||
dom: "<flB<t>p>",
|
||
pagingType: "simple_numbers",
|
||
scrollX: true,
|
||
// // scrollY: "500px",
|
||
scrollY: true,
|
||
responsive: true,
|
||
pageLength: 8,
|
||
language: {
|
||
sEmptyTable: "هیچ دادهای در جدول وجود ندارد",
|
||
sInfo: "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
|
||
sInfoEmpty: "نمایش 0 تا 0 از 0 ردیف",
|
||
sInfoFiltered: "(فیلتر شده از _MAX_ ردیف)",
|
||
sInfoPostFix: "",
|
||
sInfoThousands: ",",
|
||
sLengthMenu: "نمایش _MENU_ ردیف",
|
||
sLoadingRecords: "در حال بارگذاری...",
|
||
sProcessing: "در حال پردازش...",
|
||
sSearch: "جستجو: ",
|
||
sZeroRecords: "رکوردی با این مشخصات پیدا نشد",
|
||
oPaginate: {
|
||
sFirst: "برگهی نخست",
|
||
sLast: "برگهی آخر",
|
||
sNext: "بعدی",
|
||
sPrevious: "قبلی",
|
||
},
|
||
oAria: {
|
||
sSortAscending: ": فعال سازی نمایش به صورت صعودی",
|
||
sSortDescending: ": فعال سازی نمایش به صورت نزولی",
|
||
},
|
||
},
|
||
|
||
processing: true,
|
||
select: true,
|
||
ajax: {
|
||
url: newplan_all_url,
|
||
type: "GET",
|
||
|
||
},
|
||
columns: [{
|
||
className: "text-center",
|
||
data: null,
|
||
render: function (data, type, row, meta) {
|
||
return meta.row + 1;
|
||
},
|
||
},
|
||
{
|
||
data: "id"
|
||
},
|
||
{
|
||
data: "province_fa"
|
||
},
|
||
{
|
||
data: "project_title"
|
||
},
|
||
{
|
||
data: "domain_fa"
|
||
},
|
||
{
|
||
data: "proj_etimate_amount"
|
||
},
|
||
{
|
||
data: "proj_credit_state"
|
||
},
|
||
{
|
||
data: "proj_credit_resource"
|
||
},
|
||
|
||
{
|
||
data: "proj_rfp_file",
|
||
|
||
render: function (data, type, row) {
|
||
var targeturl = serverUp + data + ".pdf";
|
||
|
||
return '<a class="btn-dataTable" onClick="showpdf(\'' + targeturl + '\')" href="#"><i class="fa fa-download icondwn" aria-hidden="true"></i></a>';
|
||
|
||
}
|
||
},
|
||
{
|
||
data: "proj_justification_file",
|
||
render: function (data, type, row) {
|
||
var targeturl2 = serverUp + data + ".pdf";
|
||
|
||
// return '<a class="btn-dataTable" onClick="window.open(\'' + targeturl2 + '\',\'' + "_blank" + '\')" href="#"><i class="fa fa-download icondwn" aria-hidden="true"></i></a>';
|
||
return '<a class="btn-dataTable" onClick="showpdf(\'' + targeturl2 + '\')" href="#"><i class="fa fa-download icondwn" aria-hidden="true"></i></a>';
|
||
|
||
}
|
||
},
|
||
{
|
||
data: "proj_agents",
|
||
render: function (rdata, type, row, meta) {
|
||
// var rowid = meta.row;
|
||
// var agentshow = '<input class="form-control" id="showlist-' + rowid + '" value="" />';
|
||
// return agentshow;
|
||
var ObjectShow = [];
|
||
var jsonRow;
|
||
var jsonrowlist;
|
||
// var datarowshow = data.proj_agents;
|
||
ObjectShow.push(rdata);
|
||
console.log('objectshow', ObjectShow);
|
||
|
||
jsonRow = '[' + ObjectShow[0] + ']';
|
||
jsonrowlist = JSON.parse(jsonRow);
|
||
console.log('jsonRow', jsonrowlist);
|
||
var lstselect = '<div class="row w-100" style="overflow-x: scroll">';
|
||
// lstselect += '<div class="row w-100" style="background-color:#ff8000"><div class="col-4" style="border:1px solid #c0c0c0"><span >نام خانوادگی</span> </div><div class="col-4" style="border:1px solid #c0c0c0"><span >نام </span></div><div class="col-4" style="border:1px solid #c0c0c0"><span >تلفن</span></div></div>';
|
||
lstselect += '<select style="width:100%;">';
|
||
|
||
// $.each(jsonrowlist, function(key, value) {
|
||
|
||
// lstselect += '<option>' + value.projectagentfamily + ' :::::::: ' + value.projectagentname + ' :::::::: ' + value.projectagentphone + '</option>'
|
||
// });
|
||
lstselect += '</select>';
|
||
lstselect += '</div>';
|
||
// return $select.html();
|
||
return lstselect;
|
||
}
|
||
|
||
|
||
|
||
},
|
||
//sabt konande
|
||
{
|
||
data: "proj_regby_name"
|
||
},
|
||
{
|
||
data: "proj_regby_family"
|
||
},
|
||
{
|
||
data: "proj_regby_phone"
|
||
},
|
||
//sabt konande
|
||
{
|
||
className: "text-center",
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
return `<div class="d-flex justify-content-center parent-btn">
|
||
<button class="btn-dataTable details-control delete_row" title=" ویرایش "><i class="fa fa-edit icon-btnTable"></i></button>
|
||
|
||
<div class="line-btn-table"></div>
|
||
|
||
<button class="btn-dataTable deletsubmit delete_row" title=" حذف " ><i class="fa fa-trash icon-btnTable"></i></button>
|
||
|
||
</div>`
|
||
},
|
||
},
|
||
],
|
||
|
||
columnDefs: [{
|
||
className: "center-col",
|
||
targets: "_all"
|
||
},
|
||
|
||
],
|
||
|
||
buttons: [{
|
||
extend: "excelHtml5",
|
||
title: "Excel",
|
||
text: '<div class="d-flex flex-column xelbtn"><i class="fa mb-2 fa-book icon-color"></i>اکسل</div>',
|
||
messageTop: "تحقیق و توسعه(R&D)",
|
||
exportOptions: {
|
||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8],
|
||
},
|
||
customize: function (xlsx) {
|
||
var sheet = xlsx.xl.worksheets["sheet1.xml"];
|
||
|
||
// Loop over the cells in column `C`
|
||
$('row c[r^="M"]', sheet).each(function () {
|
||
// Get the value
|
||
|
||
$(this).attr("s", "52");
|
||
});
|
||
$('row c[r^="N"]', sheet).each(function () {
|
||
// Get the value
|
||
|
||
$(this).attr("s", "52");
|
||
});
|
||
},
|
||
},],
|
||
initcomplete: function () {
|
||
$("body").find(".dataTables_scrollBody").addClass("scrollbar");
|
||
$("body").find(".dataTables_scrollBody").addClass("stylescroll");
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;maxter
|
||
|
||
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
},
|
||
drawCallback: function (settings) {
|
||
$("body").find(".dataTables_scrollBody").addClass("scrollbar");
|
||
$("body").find(".dataTables_scrollBody").addClass("stylescroll");
|
||
|
||
},
|
||
|
||
});
|
||
|
||
$('#OpenFormAdd').css('display', 'block');
|
||
$('#open_select_modal').css('display', 'block');
|
||
|
||
};
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;showing pdf maxter::::::::::::::::::::::::::
|
||
var openpdf = function (targetx) {
|
||
$("#dialog").dialog({
|
||
modal: true,
|
||
title: targetx,
|
||
width: 540,
|
||
height: 450,
|
||
buttons: {
|
||
Close: function () {
|
||
$(this).dialog('close');
|
||
}
|
||
},
|
||
open: function () {
|
||
var object = "<object data=\"{FileName}\" type=\"application/pdf\" width=\"500px\" height=\"300px\">";
|
||
object += "If you are unable to view file, you can download from <a href = \"{FileName}\">here</a>";
|
||
object += " or download <a target = \"_blank\" href = \"http://get.adobe.com/reader/\">Adobe PDF Reader</a> to view the file.";
|
||
object += "</object>";
|
||
object = object.replace(/{FileName}/g, "Files/" + targetx);
|
||
$("#dialog").html(object);
|
||
}
|
||
});
|
||
|
||
}
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
var table;
|
||
var CurrtableRender = function () {
|
||
showLoaderScreen();
|
||
table = $("#RandD").DataTable({
|
||
dom: "<flB<t>p>",
|
||
pagingType: "simple_numbers",
|
||
scrollX: true,
|
||
// scrollY: "500px",
|
||
scrollY: true,
|
||
responsive: true,
|
||
language: {
|
||
sEmptyTable: "هیچ دادهای در جدول وجود ندارد",
|
||
sInfo: "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
|
||
sInfoEmpty: "نمایش 0 تا 0 از 0 ردیف",
|
||
sInfoFiltered: "(فیلتر شده از _MAX_ ردیف)",
|
||
sInfoPostFix: "",
|
||
sInfoThousands: ",",
|
||
sLengthMenu: "نمایش _MENU_ ردیف",
|
||
sLoadingRecords: "در حال بارگذاری...",
|
||
sProcessing: "در حال پردازش...",
|
||
sSearch: "جستجو: ",
|
||
sZeroRecords: "رکوردی با این مشخصات پیدا نشد",
|
||
oPaginate: {
|
||
sFirst: "برگهی نخست",
|
||
sLast: "برگهی آخر",
|
||
sNext: "بعدی",
|
||
sPrevious: "قبلی",
|
||
},
|
||
oAria: {
|
||
sSortAscending: ": فعال سازی نمایش به صورت صعودی",
|
||
sSortDescending: ": فعال سازی نمایش به صورت نزولی",
|
||
},
|
||
},
|
||
order: [
|
||
[0, "asc"][(1, "asc")],
|
||
[2, "desc"],
|
||
[3, "desc"],
|
||
[4, "desc"]
|
||
],
|
||
order: [
|
||
[0, "desc"]
|
||
],
|
||
processing: true,
|
||
select: true,
|
||
ajax: {
|
||
url: RandD_table,
|
||
type: "GET",
|
||
dataSrc: function (json) {
|
||
cansubmit = json.can_submit;
|
||
if (cansubmit == 1) {
|
||
$("#add_sabbatical").css("display", "block");
|
||
} else if (cansubmit == 0) {
|
||
$("#add_sabbatical").css("display", "none");
|
||
}
|
||
return json.data;
|
||
},
|
||
},
|
||
columns: [{
|
||
className: "text-center",
|
||
data: null,
|
||
render: function (data, type, row, meta) {
|
||
return meta.row + 1;
|
||
},
|
||
},
|
||
{
|
||
data: "unique_id"
|
||
},
|
||
{
|
||
data: "province_fa"
|
||
},
|
||
{
|
||
data: "project_title"
|
||
},
|
||
{
|
||
data: "domain_fa"
|
||
},
|
||
{
|
||
data: "contract_date"
|
||
},
|
||
{
|
||
data: "contract_number"
|
||
},
|
||
{
|
||
data: "contract_amount"
|
||
},
|
||
{
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.contract_status == 2) {
|
||
return `<p>خاتمه یافته</p>`
|
||
} else {
|
||
return `<p>در حال اجرا</p>`
|
||
}
|
||
}
|
||
},
|
||
{
|
||
data: "contract_term"
|
||
},
|
||
{
|
||
data: "project_agent"
|
||
},
|
||
{
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.contract_status == 2) {
|
||
|
||
return `<div class="d-flex justify-content-center parent-btn" id="onprocceschange">
|
||
<button id="editButton${data.id}" class="btn-dataTable editor downloadpdf" title="دانلود "><i class="fa fa-download icon-btnTable"></i></button>
|
||
</div>`
|
||
} else {
|
||
return `<div class="line-empty-col"></div>`
|
||
}
|
||
}
|
||
},
|
||
{
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.contract_status == 2) {
|
||
|
||
return `<div class="d-flex justify-content-center parent-btn" id="onprocceschange">
|
||
<button id="editButton${data.id}" class="btn-dataTable editor downloadpdf2" title="دانلود "><i class="fa fa-download icon-btnTable"></i></button>
|
||
</div>`
|
||
} else {
|
||
return `<div class="line-empty-col"></div>`
|
||
}
|
||
}
|
||
},
|
||
|
||
//inja avaz shod
|
||
{
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.contract_status == 2 && data.final_report_three != null) {
|
||
|
||
return `<div class="d-flex justify-content-center parent-btn" id="onprocceschange">
|
||
<button id="editButton${data.id}" class="btn-dataTable editor downloadpdf3" title="دانلود "><i class="fa fa-download icon-btnTable"></i></button>
|
||
</div>`
|
||
} else {
|
||
return `<div class="line-empty-col"></div>`
|
||
}
|
||
}
|
||
},
|
||
{
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.contract_status == 2) {
|
||
|
||
return `<div class="d-flex justify-content-center parent-btn" id="onprocceschange">
|
||
<button id="editButton${data.id}" class="btn-dataTable editor downloadpdf4" title="دانلود "><i class="fa fa-download icon-btnTable"></i></button>
|
||
</div>`
|
||
} else {
|
||
return `<div class="line-empty-col"></div>`
|
||
}
|
||
}
|
||
},
|
||
//inja avaz shod
|
||
//////////////injaro bardar////////////////
|
||
{
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.project_status == 1) {
|
||
return `<p style= "margin-bottom: unset;">تحت بررسی</p>`
|
||
} else {
|
||
return `<p style= "margin-bottom: unset;">در حال اجرا</p>`
|
||
}
|
||
},
|
||
},
|
||
//////////////injaro bardar////////////////
|
||
{
|
||
className: "text-center",
|
||
data: null,
|
||
render: function (data, type, row) {
|
||
if (data.project_status == 1) {
|
||
return `<div class="line-empty-col"></div>`
|
||
} else {
|
||
var isAction = false
|
||
var content = `<div class="d-flex justify-content-center parent-btn">`
|
||
if (data.perm.isCUD) {
|
||
content += `<button id="editButton${data.id}" class="btn-dataTable editor details-control" title="ویرایش"><i class="fa fa-edit icon-btnTable"></i></button>`
|
||
content += `<div class="line-btn-table"></div>`
|
||
content += `<button class="btn-dataTable deletsubmit" title=" حذف " ><i class="fa fa-trash icon-btnTable"></i></button>`
|
||
isAction = true;
|
||
}
|
||
if (data.perm.requestFinish) {
|
||
content += `<div class="line-btn-table"></div>`
|
||
content += `<button class="btn-dataTable finishsubmit" title=" درخواست اتمام فرآیند "><i class="fas fa-check icon-btnTable"></i></button>`
|
||
isAction = true;
|
||
}
|
||
if (!isAction) content += `<div class="line-empty-col"></div>`
|
||
content += `</div>`
|
||
|
||
return content;
|
||
}
|
||
},
|
||
},
|
||
],
|
||
buttons: [{
|
||
extend: "excelHtml5",
|
||
title: "Excel",
|
||
text: '<div class="d-flex flex-column xelbtn"><i class="fa mb-2 fa-book icon-color"></i>اکسل</div>',
|
||
messageTop: "تحقیق و توسعه(R&D)",
|
||
exportOptions: {
|
||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8],
|
||
},
|
||
customize: function (xlsx) {
|
||
var sheet = xlsx.xl.worksheets["sheet1.xml"];
|
||
|
||
// Loop over the cells in column `C`
|
||
$('row c[r^="M"]', sheet).each(function () {
|
||
// Get the value
|
||
|
||
$(this).attr("s", "52");
|
||
});
|
||
$('row c[r^="N"]', sheet).each(function () {
|
||
// Get the value
|
||
|
||
$(this).attr("s", "52");
|
||
});
|
||
},
|
||
},],
|
||
initComplete: function () {
|
||
$("body").find(".dataTables_scrollBody").addClass("scrollbar");
|
||
$("body").find(".dataTables_scrollBody").addClass("stylescroll");
|
||
$(".js-example-basic-multiple").append(
|
||
'<option value="0" disabled>انتخاب اداره کل</option>'
|
||
);
|
||
if ($('#btn-fillter-project-by-status').data('all') == 'true') {
|
||
$('#btn-fillter-project-by-status').text('پروژه های در حال اجرا')
|
||
table.columns(8).search('').draw();
|
||
$('#btn-fillter-project-by-status').data('all', 'false')
|
||
} else {
|
||
$('#btn-fillter-project-by-status').text('همه پروژه ها')
|
||
table.columns(8).search('در حال اجرا').draw();
|
||
$('#btn-fillter-project-by-status').data('all', 'true')
|
||
}
|
||
hideLoaderScreen();
|
||
},
|
||
});
|
||
$('#OpenFormAdd').css('display', 'block');
|
||
$('#open_select_modal').css('display', 'block');
|
||
}
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
$(document).on("load", function () {
|
||
$(window).bind("resize", checkPosition);
|
||
});
|
||
|
||
function checkPosition() {
|
||
if ($(window).width() < 1300) {
|
||
$("#RandD_wrapper").css("margin-top", "20px");
|
||
|
||
} else {
|
||
$("#RandD_wrapper").css("margin-top", "");
|
||
}
|
||
if ($(window).width() < 555) {
|
||
$(".content-center-dataTable").css("width", "260px");
|
||
} else {
|
||
$(".content-center-dataTable").css("width", "");
|
||
}
|
||
if ($(window).width() < 440) {
|
||
$(".dataTables_filter input").css("width", "94px");
|
||
$(".dataTables_filter").css("margin-bottom", "10px");
|
||
$(".dt-buttons").addClass("d-flex");
|
||
$(".dt-buttons").addClass("justify-content-center");
|
||
$(".dt-buttons button").css("font-size", "10px");
|
||
} else {
|
||
$(".dataTables_filter input").css("width", "");
|
||
$(".dataTables_filter").css("margin-bottom", "");
|
||
$(".dt-buttons").removeClass("d-flex");
|
||
$(".dt-buttons button").css("font-size", "");
|
||
$(".dt-buttons").removeClass("justify-content-center");
|
||
// pooria
|
||
}
|
||
}
|
||
$(".second-menu-img").click(function () {
|
||
$(".queen-size-nav").toggle({
|
||
direction: "right"
|
||
}, 50);
|
||
if (
|
||
$(".second-menu-img").attr("src") ==
|
||
"../dist/images/new-design/burger-list.svg"
|
||
) {
|
||
$(".second-menu-img").attr("src", "../dist/images/new-design/delete.svg");
|
||
$(".queen-size-nav").css("position", "absolute");
|
||
$(".queen-size-nav").css("z-index", "2");
|
||
$(".queen-size-nav").css("width", "30%");
|
||
$(".queen-size-nav").css("height", "100%");
|
||
$(".second-top-menu").css("z-index", "2");
|
||
} else if (
|
||
$(".second-menu-img").attr("src") == "../dist/images/new-design/delete.svg"
|
||
) {
|
||
$(".second-menu-img").attr(
|
||
"src",
|
||
"../dist/images/new-design/burger-list.svg"
|
||
);
|
||
$(".second-top-menu").css("margin-right", "0px");
|
||
$(".queen-size-nav").css("width", "0%");
|
||
$(".queen-size-nav").css("height", "0%");
|
||
}
|
||
});
|
||
$(".queen-res").click(function () {
|
||
$(".first-step-res").slideToggle(300);
|
||
if ($(".first-step-res").css("display") == "block") {
|
||
$(".arrow-changing1").attr(
|
||
"src",
|
||
"../dist/images/new-design/arrow-down.svg"
|
||
);
|
||
}
|
||
setTimeout(() => {
|
||
if ($(".first-step-res").css("display") == "none") {
|
||
$(".arrow-changing1").attr(
|
||
"src",
|
||
"../dist/images/new-design/arrow-left.svg"
|
||
);
|
||
}
|
||
}, 320);
|
||
});
|
||
|
||
$(".second-queen-res").click(function () {
|
||
if ($(".first-step-res").css("display") == "block") {
|
||
$(".first-step-res").slideUp(300);
|
||
setTimeout(() => {
|
||
if ($(".first-step-res").css("display") == "none") {
|
||
$(".arrow-changing1").attr(
|
||
"src",
|
||
"../dist/images/new-design/arrow-left.svg"
|
||
);
|
||
}
|
||
}, 320);
|
||
}
|
||
});
|
||
$(".fivth-queen-res").click(function () {
|
||
$(".eight-step-res").slideToggle(300);
|
||
});
|
||
|
||
|
||
|
||
function showModal(id) {
|
||
$("#stepModalRandD").modal("show");
|
||
$(".cancel").on("click", function () {
|
||
$("#stepModalRandD").modal("hide");
|
||
});
|
||
}
|
||
contractDatePicker = $("input[name=contract-date]").persianDatepicker({
|
||
format: "YYYY/MM/DD",
|
||
initialValue: false,
|
||
autoClose: true,
|
||
initialValueType: "persian",
|
||
// position: [-150, 10],
|
||
onSelect: function (unix) {
|
||
if (contractDatePicker == "") {
|
||
$("#contract-date-id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-date-id").removeClass("is-invalid-input");
|
||
}
|
||
},
|
||
});
|
||
|
||
function initialField() {
|
||
|
||
$("#domain_id").val("");
|
||
$("#project-title").val("");
|
||
$("#province-id").val("");
|
||
$("#contract-term").val("");
|
||
$("#contract-date").val("");
|
||
$("#contract-num").val("");
|
||
$("#contract-amount").val("");
|
||
// $("#contract-conditon-id").val("");
|
||
$("#last-report").val("");
|
||
$("#last-report2").val("");
|
||
$("#last-report3").val("");
|
||
$("#last-report4").val("");
|
||
$("#executer").val("");
|
||
|
||
|
||
|
||
$("#domain_id").removeClass("is-invalid-input");
|
||
$("#project-title").removeClass("is-invalid-input");
|
||
$("#province-id").removeClass("is-invalid-input");
|
||
$("#contract-term").removeClass("is-invalid-input");
|
||
$("#contract-num").removeClass("is-invalid-input");
|
||
$("#contract-amount").removeClass("is-invalid-input");
|
||
$("#contract-conditon-id").removeClass("is-invalid-input");
|
||
$("#last-report").removeClass("is-invalid-input");
|
||
$("#last-report2").removeClass("is-invalid-input");
|
||
// $("#last-report3").removeClass("is-invalid-input");
|
||
$("#last-report4").removeClass("is-invalid-input");
|
||
$("#contract-date").removeClass("is-invalid-input");
|
||
$("#executer").removeClass("is-invalid-input");
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
|
||
|
||
|
||
}
|
||
//yadet bashe ha
|
||
$("#RandD").on("click", "button.downloadpdf", function () {
|
||
// // alert("hi")
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
var final_report_one = row.data().final_report_one;
|
||
console.log("final_report_one", final_report_one);
|
||
window.open("/" + final_report_one, '_blank')
|
||
});
|
||
$("#RandD").on("click", "button.downloadpdf2", function () {
|
||
window.location
|
||
// // alert("hi")
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
var final_report_two = row.data().final_report_two;
|
||
console.log("final_report_two", final_report_two);
|
||
window.open("/" + final_report_two, '_blank')
|
||
});
|
||
$("#RandD").on("click", "button.downloadpdf3", function () {
|
||
window.location
|
||
// // alert("hi")
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
var final_report_three = row.data().final_report_three;
|
||
console.log("final_report_three", final_report_three);
|
||
window.open("/" + final_report_three, '_blank')
|
||
});
|
||
$("#RandD").on("click", "button.downloadpdf4", function () {
|
||
window.location
|
||
// // alert("hi")
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
var final_report_four = row.data().final_report_four;
|
||
console.log("final_report_four", final_report_four);
|
||
window.open("/" + final_report_four, '_blank')
|
||
});
|
||
$("#RandD").on("click", "button.details-control", function () {
|
||
//new add after upload
|
||
if ($("#province-id").hasClass("is-invalid-input")) {
|
||
$("#province-id").removeClass("is-invalid-input");
|
||
};
|
||
if ($("#contract-term").hasClass("is-invalid-input")) {
|
||
$("#contract-term").removeClass("is-invalid-input");
|
||
};
|
||
if ($("#project-title").hasClass("is-invalid-input")) {
|
||
$("#project-title").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-conditon-id").hasClass("is-invalid-input")) {
|
||
$("#contract-conditon-id").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-amount").hasClass("is-invalid-input")) {
|
||
$("#contract-amount").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#domain_id").hasClass("is-invalid-input")) {
|
||
$("#domain_id").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-num").hasClass("is-invalid-input")) {
|
||
$("#contract-num").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-date").hasClass("is-invalid-input")) {
|
||
$("#contract-date").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#executer").hasClass("is-invalid-input")) {
|
||
$("#executer").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-term").hasClass("is-invalid-input")) {
|
||
$("#contract-term").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#file-input-validity").hasClass("is-invalid-input")) {
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#file-input-validity2").hasClass("is-invalid-input")) {
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
}
|
||
// if ($("#file-input-validity3").hasClass("is-invalid-input")) {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// }
|
||
if ($("#file-input-validity4").hasClass("is-invalid-input")) {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
}
|
||
|
||
//new add after upload
|
||
showModal(0);
|
||
edit = true;
|
||
// $("#showfile").empty();
|
||
$("#showfile").css('visibility', 'hidden');
|
||
$("#showfile2").css('visibility', 'hidden');
|
||
$("#showfile3").css('visibility', 'hidden');
|
||
$("#showfile4").css('visibility', 'hidden');
|
||
$("#submitNewRow_new").css("display", "none");
|
||
$("#submitNewRow").css("display", "block");
|
||
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
idEdit = row.data().id;
|
||
$("#contract-date-id").val(row.data().contract_date);
|
||
var provinceid = row.data().province_id;
|
||
var provincefa = row.data().province_fa;
|
||
|
||
var projectTitle = row.data().project_title;
|
||
var contract_date = row.data().contract_date;
|
||
var contractNum = row.data().contract_number;
|
||
var ProjectTitle = row.data().project_name;
|
||
var contraact_amount = row.data().contract_amount;
|
||
var contract_term = row.data().contract_term;
|
||
var contract_conditon_id = row.data().contract_status;
|
||
var domain_id = row.data().domain_id;
|
||
var executee = row.data().project_agent;
|
||
$("#project-title").val(projectTitle);
|
||
$("#contract-date").val(contract_date);
|
||
$("#domain_id").val(domain_id);
|
||
$("#contract-num").val(contractNum);
|
||
$("#contract-amount").val(contraact_amount);
|
||
$("#contract-term").val(contract_term);
|
||
$("#contract-conditon-id").val(contract_conditon_id);
|
||
$("#executer").val(executee);
|
||
if (contract_conditon_id == 2) {
|
||
$("#showfile").css("visibility", "visible");
|
||
}
|
||
// $("#province-id").empty();
|
||
$("#province-id").append('<option value="0" disabled>انتخاب اداره کل</option>');
|
||
|
||
for (let index = 0; index < provinces.length; index++) {
|
||
$("#province-id").append(
|
||
"\
|
||
<option value=" +
|
||
provinces[index].id +
|
||
">" +
|
||
provinces[index].name_fa +
|
||
"</option>\
|
||
"
|
||
);
|
||
}
|
||
$("#province-id").val(provinceid);
|
||
// if (parseInt($(this).children("option:selected").val()) == 1) {
|
||
// $("#showfile").css('visibility', 'hidden')
|
||
// $("#onprocceschange").css('display', 'none')
|
||
// }
|
||
// if (parseInt($(this).children("option:selected").val()) == 2) {
|
||
// $("#showfile").css('visibility', 'visible')
|
||
// }
|
||
// if($("#contract-conditon-id").val() == 1) {
|
||
$("#showfile").css('visibility', 'visible');
|
||
$("#showfile2").css('visibility', 'visible');
|
||
$("#showfile3").css('visibility', 'visible');
|
||
$("#showfile4").css('visibility', 'visible');
|
||
// }
|
||
});
|
||
$("#RandDnew").on("click", "button.details-control", function () {
|
||
//new add after upload
|
||
|
||
if ($("#new-project-title").hasClass("is-invalid-input")) {
|
||
$("#new-project-title").removeClass("is-invalid-input");
|
||
};
|
||
if ($("#new-province-id").hasClass("is-invalid-input")) {
|
||
$("#new-province-id").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#new_domain_id").hasClass("is-invalid-input")) {
|
||
$("#new_domain_id").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#new-contract-amount").hasClass("is-invalid-input")) {
|
||
$("#new-contract-amount").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#new-target-amount").hasClass("is-invalid-input")) {
|
||
$("#new-target-amount").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#projectagentname").hasClass("is-invalid-input")) {
|
||
$("#projectagentname").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#projectagentfamily").hasClass("is-invalid-input")) {
|
||
$("#projectagentfamily").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#projectagentphone").hasClass("is-invalid-input")) {
|
||
$("#projectagentphone").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#1ndfileSelected").hasClass("is-invalid-input")) {
|
||
$("#1ndfileSelected").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#2ndfileSelected").hasClass("is-invalid-input")) {
|
||
$("#2ndfileSelected").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#proj_regby_name").hasClass("is-invalid-input")) {
|
||
$("#proj_regby_name").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#proj_regby_family").hasClass("is-invalid-input")) {
|
||
$("#proj_regby_family").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#proj_regby_phone").hasClass("is-invalid-input")) {
|
||
$("#proj_regby_phone").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#file-input-validity").hasClass("is-invalid-input")) {
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#file-input-validity2").hasClass("is-invalid-input")) {
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
}
|
||
// if ($("#file-input-validity3").hasClass("is-invalid-input")) {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// }
|
||
if ($("#file-input-validity4").hasClass("is-invalid-input")) {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
}
|
||
|
||
// $("#new-province-id").empty();
|
||
// $("#new_domain_id").empty();
|
||
// $("#new-contract-amount").empty();
|
||
// $("#new-target-amount").empty();
|
||
// $("#projectagentname").empty();
|
||
// $("#projectagentfamily").empty();
|
||
// $("#projectagentphone").empty();
|
||
// $("#1ndfileSelected").empty();
|
||
// $("#2ndfileSelected").empty();
|
||
// $("#proj_regby_name").empty();
|
||
// $("#proj_regby_family").empty();
|
||
// $("#proj_regby_phone").empty();
|
||
// $("#file-input-validity").empty();
|
||
$("#NewPlanModal").modal("show");
|
||
$("#NewPlanModal").find(".form-control").empty();
|
||
edit = true;
|
||
$("#submitNewProject").css("display", "none");
|
||
$("#EditNewProject").css("display", "inline");
|
||
|
||
var tr = $(this).closest("tr");
|
||
// var row = table.row(tr);
|
||
// idEdit = row.data().id;
|
||
console.log("gooz", tr);
|
||
// $("#contract-date-id").val(row.data().contract_date);
|
||
// var provinceid = row.data().province_id;
|
||
// var provincefa = row.data().province_fa;
|
||
|
||
// var projectTitle = row.data().project_title;
|
||
// var contract_date = row.data().contract_date;
|
||
// var contractNum = row.data().contract_num;
|
||
// var ProjectTitle = row.data().project_name;
|
||
// var contraact_amount = row.data().contract_amount;
|
||
// var contract_conditon_id = row.data().contract_condition_id;
|
||
// var domain_id = row.data().domain_id;
|
||
// var executee = row.data().executer;
|
||
// $("#project-title").val(projectTitle);
|
||
// $("#contract-date").val(contract_date);
|
||
// $("#domain_id").val(domain_id);
|
||
// $("#contract-num").val(contractNum);
|
||
// $("#contract-amount").val(contraact_amount);
|
||
// $("#contract-conditon-id").val(contract_conditon_id);
|
||
// $("#executer").val(executee);
|
||
// if (contract_conditon_id == 2) {
|
||
// $("#showfile").css("visibility", "visible");
|
||
// }
|
||
// $("#province-id").empty();
|
||
// $("#province-id").append('<option value="0" disabled>انتخاب اداره کل</option>');
|
||
|
||
// for (let index = 0; index < provinces.length; index++) {
|
||
// $("#province-id").append(
|
||
// "\
|
||
// <option value=" +
|
||
// provinces[index].id +
|
||
// ">" +
|
||
// provinces[index].name_fa +
|
||
// "</option>\
|
||
// "
|
||
// );
|
||
// }
|
||
// $("#province-id").val(provinceid);
|
||
});
|
||
|
||
$("#submitNewRow_new").on("click", function () {
|
||
$("#submitNewRow_new").attr("disabled", "disabled")
|
||
let formData = new FormData();
|
||
|
||
let provinceVal = $("#province-id").val();
|
||
let province_fa = $("#province-id :selected").text();
|
||
let project_title_val = $("#project-title").val();
|
||
let contract_date_val = $("#contract-date").val();
|
||
let contract_num_val = $("#contract-num").val();
|
||
let domain_id_val = $("#domain_id").val();
|
||
let contract_amount_val = $("#contract-amount").val();
|
||
let contract_term_val = $("#contract-term").val();
|
||
let contract_conditon_id_val = $("#contract-conditon-id").val();
|
||
// let contract_conditon_fa_val = $("#contract-conditon-id :selected").text();
|
||
let executer = $("#executer").val();
|
||
if (provinceVal == null) {
|
||
$("#province-id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#province-id").removeClass("is-invalid-input");
|
||
}
|
||
if (contract_term_val == "") {
|
||
$("#contract-term").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-term").removeClass("is-invalid-input");
|
||
}
|
||
if (project_title_val == "") {
|
||
$("#project-title").addClass("is-invalid-input");
|
||
} else {
|
||
$("#project-title").removeClass("is-invalid-input");
|
||
}
|
||
if (executer == "") {
|
||
$("#executer").addClass("is-invalid-input");
|
||
} else {
|
||
$("#executer").removeClass("is-invalid-input");
|
||
}
|
||
if (contract_date_val == "") {
|
||
$("#contract-date").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-date").removeClass("is-invalid-input");
|
||
}
|
||
if (contract_num_val == "") {
|
||
$("#contract-num").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-num").removeClass("is-invalid-input");
|
||
}
|
||
if (domain_id_val == null) {
|
||
$("#domain_id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#domain_id").removeClass("is-invalid-input");
|
||
}
|
||
if (contract_amount_val == "") {
|
||
$("#contract-amount").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-amount").removeClass("is-invalid-input");
|
||
}
|
||
if (contract_conditon_id_val == null) {
|
||
$("#contract-conditon-id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-conditon-id").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic-0").val() != "") {
|
||
$("#file-input-validity").addClass("is-invalid-input");
|
||
$("#last-report").addClass("is-invalid-input");
|
||
} else {
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
$("#last-report").removeClass("is-invalid-input");
|
||
}
|
||
} else if ($("#contract-conditon-id").val() == 1) {
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic2-0").val() != "") {
|
||
$("#file-input-validity2").addClass("is-invalid-input");
|
||
$("#last-report2").addClass("is-invalid-input");
|
||
} else {
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
$("#last-report2").removeClass("is-invalid-input");
|
||
}
|
||
} else if ($("#contract-conditon-id").val() == 1) {
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
}
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic3-0").val() != "") {
|
||
// $("#file-input-validity3").addClass("is-invalid-input");
|
||
// $("#last-report3").addClass("is-invalid-input");
|
||
}
|
||
// else {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// $("#last-report3").removeClass("is-invalid-input");
|
||
// }
|
||
}
|
||
// else if ($("#contract-conditon-id").val() == 1) {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// }
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic4-0").val() != "") {
|
||
$("#file-input-validity4").addClass("is-invalid-input");
|
||
$("#last-report4").addClass("is-invalid-input");
|
||
} else {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
$("#last-report4").removeClass("is-invalid-input");
|
||
}
|
||
} else if ($("#contract-conditon-id").val() == 1) {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
}
|
||
formData.append("province_id", provinceVal);
|
||
formData.append("province_fa", province_fa);
|
||
formData.append("project_title", project_title_val);
|
||
formData.append("contract_date", contract_date_val);
|
||
formData.append("contract_number", contract_num_val);
|
||
formData.append("domain_id", domain_id_val);
|
||
formData.append("contract_amount", contract_amount_val);
|
||
formData.append("contract_term", contract_term_val);
|
||
// formData.append("contract_condition_id", contract_conditon_id_val);
|
||
formData.append("contract_status", contract_conditon_id_val);
|
||
formData.append("project_agent", executer);
|
||
if ($("input[name=modalUpFilepic2]")[0].files.length != 0)
|
||
formData.append(
|
||
"file1",
|
||
$("input[name=modalUpFilepic2]")[0].files[0]
|
||
);
|
||
if ($("input[name=modalUpFilepic]")[0].files.length != 0)
|
||
formData.append(
|
||
"file2",
|
||
$("input[name=modalUpFilepic]")[0].files[0]
|
||
);
|
||
if ($("input[name=modalUpFilepic3]")[0].files.length != 0)
|
||
formData.append(
|
||
"file3",
|
||
$("input[name=modalUpFilepic3]")[0].files[0]
|
||
);
|
||
if ($("input[name=modalUpFilepic4]")[0].files.length != 0)
|
||
formData.append(
|
||
"file4",
|
||
$("input[name=modalUpFilepic4]")[0].files[0]
|
||
);
|
||
if ($("#stepModalRandD").find(".is-invalid-input").length || $("#file-input-validity").hasClass("is-invalid-input") || $("#file-input-validity2").hasClass("is-invalid-input") || $("#file-input-validity4").hasClass("is-invalid-input")) {
|
||
// has error
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "لطفا تمامی فیلدهای مرتبط را تکمیل کنید.",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
$("#submitNewRow_new").removeAttr("disabled");
|
||
|
||
} else {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: "/RandD/projects/add",
|
||
type: "POST",
|
||
data: formData,
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
$("#submitNewRow_new").removeAttr("disabled");
|
||
// hideLoaderScreen();
|
||
ajaxcalltable();
|
||
showLoaderScreen();
|
||
},
|
||
error: function (error) {
|
||
$("#submitNewRow_new").removeAttr("disabled");
|
||
|
||
hideLoaderScreen();
|
||
// Swal.fire({
|
||
// icon: "error",
|
||
// title: "خطا",
|
||
// text: "خطایی رخ داده است",
|
||
// confirmButtonText: "بستن",
|
||
// });
|
||
},
|
||
});
|
||
}
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic-0").val() != "") {
|
||
$("#file-input-validity").addClass("is-invalid-input");
|
||
$("#last-report").addClass("is-invalid-input");
|
||
} else {
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
$("#last-report").removeClass("is-invalid-input");
|
||
}
|
||
} else if ($("#contract-conditon-id").val() == 1) {
|
||
$("#file-input-validity").removeClass("is-invalid-input");
|
||
}
|
||
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic2-0").val() != "") {
|
||
$("#file-input-validity2").addClass("is-invalid-input");
|
||
$("#last-report2").addClass("is-invalid-input");
|
||
} else {
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
$("#last-report2").removeClass("is-invalid-input");
|
||
}
|
||
} else if ($("#contract-conditon-id").val() == 1) {
|
||
$("#file-input-validity2").removeClass("is-invalid-input");
|
||
}
|
||
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
// if ($("#itempic3-0").val() != "") {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// $("#last-report3").addClass("is-invalid-input");
|
||
// }
|
||
// else {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// $("#last-report3").addClass("is-invalid-input");
|
||
// }
|
||
}
|
||
// else if ($("#contract-conditon-id").val() == 1) {
|
||
// $("#file-input-validity3").removeClass("is-invalid-input");
|
||
// }
|
||
|
||
if ($("#contract-conditon-id").val() == 2) {
|
||
if ($("#itempic4-0").val() != "") {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
$("#last-report4").addClass("is-invalid-input");
|
||
} else {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
$("#last-report4").addClass("is-invalid-input");
|
||
}
|
||
} else if ($("#contract-conditon-id").val() == 1) {
|
||
$("#file-input-validity4").removeClass("is-invalid-input");
|
||
}
|
||
|
||
|
||
});
|
||
//balaii khube
|
||
//paiini ashghale
|
||
$("#submitNewRow").on("click", function () {
|
||
|
||
let formData = new FormData();
|
||
|
||
let provinceVal = $("#province-id :selected").text();
|
||
|
||
let provinceidVal = $("#province-id").val();
|
||
|
||
let projectVal = $("#project-title").val();
|
||
|
||
let contractdateVal = $("#contract-date").val();
|
||
|
||
let contractnumVal = $("#contract-num").val();
|
||
|
||
let domainidVal = $("#domain_id").val();
|
||
|
||
let contractamountVal = $("#contract-amount").val();
|
||
|
||
let contractConditionVal = $("#contract-conditon-id :selected").text();
|
||
|
||
let contractConditionidVal = $("#contract-conditon-id").val();
|
||
//////////////injaro bardar/////////////////
|
||
let contract_term_val = $("#contract-term").val()
|
||
//////////////injaro bardar/////////////////
|
||
let executerVal = $("#executer").val();
|
||
|
||
if (provinceVal == "") {
|
||
$("#province-id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#province-id").removeClass("is-invalid-input");
|
||
}
|
||
if (projectVal == "") {
|
||
$("#project-title").addClass("is-invalid-input");
|
||
} else {
|
||
$("#project-title").removeClass("is-invalid-input");
|
||
}
|
||
if (contractdateVal == "") {
|
||
$("#contract-date").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-date").removeClass("is-invalid-input");
|
||
}
|
||
if (contractnumVal == "") {
|
||
$("#contract-num").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-num").removeClass("is-invalid-input");
|
||
}
|
||
if (domainidVal == "") {
|
||
$("#domain_id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#domain_id").removeClass("is-invalid-input");
|
||
}
|
||
if (contractamountVal == "") {
|
||
$("#contract-amount").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-amount").removeClass("is-invalid-input");
|
||
}
|
||
if (contractConditionVal == "") {
|
||
$("#contract-conditon-id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#contract-conditon-id").removeClass("is-invalid-input");
|
||
}
|
||
if (executerVal == "") {
|
||
$("#executer").addClass("is-invalid-input");
|
||
} else {
|
||
$("#executer").removeClass("is-invalid-input");
|
||
}
|
||
formData.append("id", idEdit);
|
||
formData.append("province_id", provinceidVal);
|
||
formData.append("province_fa", provinceVal);
|
||
formData.append("project_title", projectVal);
|
||
formData.append("contract_date", contractdateVal);
|
||
formData.append("contract_number", contractnumVal);
|
||
formData.append("domain_id", domainidVal);
|
||
formData.append("contract_amount", contractamountVal);
|
||
formData.append("contract_term", contract_term_val);
|
||
formData.append("contract_status", contractConditionidVal);
|
||
// formData.append("contract_condition_fa", contractConditionVal);
|
||
formData.append("project_agent", executerVal);
|
||
|
||
|
||
if ($("input[name=modalUpFilepic]")[0].files.length != 0)
|
||
formData.append(
|
||
"final_report_two",
|
||
$("input[name=modalUpFilepic]")[0].files[0]
|
||
);
|
||
if ($("input[name=modalUpFilepic2]")[0].files.length != 0)
|
||
formData.append(
|
||
"final_report_one",
|
||
$("input[name=modalUpFilepic2]")[0].files[0]
|
||
);
|
||
if ($("input[name=modalUpFilepic3]")[0].files.length != 0)
|
||
formData.append(
|
||
"final_report_three",
|
||
$("input[name=modalUpFilepic3]")[0].files[0]
|
||
);
|
||
if ($("input[name=modalUpFilepic4]")[0].files.length != 0)
|
||
formData.append(
|
||
"final_report_four",
|
||
$("input[name=modalUpFilepic4]")[0].files[0]
|
||
);
|
||
if ($("#stepModalRandD").find(".is-invalid-input").length) {
|
||
// has error
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "لطفا تمامی فیلدهای مرتبط را تکمیل کنید.",
|
||
confirmButtonText: "بستن",
|
||
}).then((result) => {
|
||
console.log(result);
|
||
if (result.isConfirmed) {
|
||
// Swal.fire('Saved!', '', 'success')
|
||
} else if (result.isDenied) {
|
||
// Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
});
|
||
}
|
||
$.ajax({
|
||
url: "/RandD/projects/update/" + idEdit,
|
||
type: "POST",
|
||
headers: {
|
||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||
},
|
||
data: formData,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
ajaxcalltable();
|
||
},
|
||
error: function (error) {
|
||
hideLoaderScreen();
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
text: "خطایی رخ داده است",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
},
|
||
});
|
||
});
|
||
|
||
function showrandsecond() {
|
||
$('#listTitle').text('پروژه های در حال اجرا/خاتمه یافته');
|
||
$('#listTitle').css('display', 'block');
|
||
tableOnWork = "CurrProject";
|
||
$('#RandDnew-holder').css('display', 'none');
|
||
$('#RandD-holder').css('display', 'block');
|
||
$('#OpenFormAdd').css('display', 'block');
|
||
$('#open_select_modal').css('display', 'block');
|
||
if (!table) {
|
||
CurrtableRender();
|
||
}
|
||
|
||
$('#SelectModalRandD').modal('hide');
|
||
|
||
}
|
||
|
||
$('#listTitle').text('پروژه های در حال اجرا/خاتمه یافته');
|
||
$('#listTitle').css('display', 'block');
|
||
tableOnWork = "CurrProject";
|
||
$('#RandDnew-holder').css('display', 'none');
|
||
$('#RandD-holder').css('display', 'block');
|
||
$('#OpenFormAdd').css('display', 'block');
|
||
$('#open_select_modal').css('display', 'block');
|
||
if (!table) {
|
||
CurrtableRender();
|
||
}
|
||
|
||
$('#SelectModalRandD').modal('hide');
|
||
|
||
function showrAndfirst() {
|
||
$('#listTitle').text('پروژه های پیشنهادی جهت کارگروه');
|
||
$('#listTitle').css('display', 'block');
|
||
console.log($('#listTitle').text())
|
||
|
||
tableOnWork = 'OfferProject';
|
||
$('#RandDnew-holder').css('display', 'block');
|
||
$('#RandD-holder').css('display', 'none');
|
||
$('#OpenFormAdd').css('display', 'block');
|
||
$('#open_select_modal').css('display', 'block');
|
||
$("body").find(".dataTables_scrollBody").addClass("scrollbar");
|
||
$("body").find(".dataTables_scrollBody").addClass("stylescroll");
|
||
if (!newtable) {
|
||
OfferTableRender();
|
||
|
||
}
|
||
|
||
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
// $("#NewPlanModal").modal("show");
|
||
$("#SelectModalRandD").modal("hide");
|
||
|
||
$("#new-province-id").empty();
|
||
$("#new-province-id").append('<option value="0" selected = "selected" disabled>انتخاب اداره کل</option>');
|
||
|
||
for (let index = 0; index < provinces.length; index++) {
|
||
$("#new-province-id").append(
|
||
"\
|
||
<option value=" +
|
||
provinces[index].id +
|
||
">" +
|
||
provinces[index].name_fa +
|
||
"</option>\
|
||
"
|
||
);
|
||
}
|
||
|
||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||
initialnewprojectForm();
|
||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||
|
||
}
|
||
|
||
$('#switch-credit').on("click", function () {
|
||
var CreditChecked = $('#allocatecredit-ok').prop('checked');
|
||
if (CreditChecked) {
|
||
$('#credit-target-holder').css('display', 'block');
|
||
} else {
|
||
$('#credit-target-holder').css('display', 'none');
|
||
|
||
}
|
||
|
||
});
|
||
|
||
|
||
|
||
|
||
//button for delete row start
|
||
$("#RandD").on("click", "button.deletsubmit", function () {
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
idkol = row.data().id;
|
||
Swal.fire({
|
||
icon: "warning",
|
||
title: "آیا برای حذف مطمئن هستید؟",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#3085d6",
|
||
cancelButtonColor: "#d33",
|
||
confirmButtonText: "بله، تایید میشود",
|
||
cancelButtonText: "منصرف شدم!",
|
||
showLoaderOnConfirm: true,
|
||
preConfirm: () => {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: webapi_url + "/projects/delete/" + idkol,
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
ajaxcalltablefirst();
|
||
showLoaderScreen();
|
||
table.ajax.reload(null, false);
|
||
},
|
||
error: function (error) {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
},
|
||
});
|
||
},
|
||
});
|
||
});
|
||
|
||
function getProvinces() {
|
||
let reqUrl = api_url + "/setad-province/all";
|
||
$.ajax({
|
||
url: reqUrl,
|
||
type: "GET",
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
provinces = result.data;
|
||
},
|
||
error: function (error) { },
|
||
});
|
||
}
|
||
$("#province-id").on("change", function () {
|
||
if (parseInt($(this).children("option:selected").val()) == 0) {
|
||
$("#province-id").addClass("is-invalid-input");
|
||
} else {
|
||
$("#province-id").removeClass("is-invalid-input");
|
||
}
|
||
});
|
||
|
||
function init_row_filter() {
|
||
$.ajax({
|
||
url: api_url + "/setad-province/all",
|
||
type: "GET",
|
||
success: function (data) {
|
||
provinces = data.data;
|
||
for (let index = 0; index < provinces.length; index++) {
|
||
$(".js-example-basic-multiple").append(
|
||
"\
|
||
<option value=" +
|
||
provinces[index].id +
|
||
">" +
|
||
provinces[index].name_fa +
|
||
"</option>\
|
||
"
|
||
);
|
||
}
|
||
},
|
||
});
|
||
}
|
||
//for province
|
||
function ajaxcalltable() {
|
||
$.ajax({
|
||
url: RandD_table,
|
||
type: "GET",
|
||
success: function (result) {
|
||
$("#RandD").dataTable().fnClearTable();
|
||
$("#RandD").dataTable().fnAddData(result.data);
|
||
|
||
hideLoaderScreen();
|
||
|
||
// Swal.fire({
|
||
// icon: "success",
|
||
// title: "ثبت موفقیت آمیز",
|
||
// text: "اطلاعات اولیه با موفقیت ثبت گردید!",
|
||
// confirmButtonText: "بستن",
|
||
// });
|
||
|
||
$("#stepModalRandD").modal("hide");
|
||
},
|
||
});
|
||
}
|
||
|
||
function restrictInputOtherThanArabic($field) {
|
||
// Arabic characters fall in the Unicode range 0600 - 06FF
|
||
var arabicCharUnicodeRange = /[\u0600-\u06FF-0-9-45]/;
|
||
|
||
$field.bind("keypress", function (event) {
|
||
var key = event.which;
|
||
// 0 = numpad
|
||
// 8 = backspace
|
||
// 32 = space
|
||
if (key == 8 || key == 0 || key === 32) {
|
||
return true;
|
||
}
|
||
|
||
var str = String.fromCharCode(key);
|
||
if (arabicCharUnicodeRange.test(str)) {
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
});
|
||
}
|
||
restrictInputOtherThanArabic($("#province-id"));
|
||
// restrictInputOtherThanArabic($("#project-title"));
|
||
// restrictInputOtherThanArabic($("#contract-num"));
|
||
restrictInputOtherThanArabic($("#domain_id"));
|
||
restrictInputOtherThanArabic($("#contract-conditon-id"));
|
||
// restrictInputOtherThanArabic($("#contract-amount"));
|
||
restrictInputOtherThanArabic($("#executer"));
|
||
|
||
|
||
$("#RandD").on("click", "tbody tr", function () {
|
||
if ($(this).hasClass("selected")) {
|
||
$(this).removeClass("selected");
|
||
$(this).css("color", "");
|
||
$(this).find("i").css("color", "");
|
||
} else {
|
||
table.$("tr.selected").find("i").css("color", "");
|
||
table.$("tr.selected").css("color", "");
|
||
table.$("tr.selected").removeClass("selected");
|
||
$(this).addClass("selected");
|
||
$(this).css("color", "white");
|
||
$(this).find("i").css("color", "white");
|
||
}
|
||
});
|
||
|
||
|
||
$("#contract-conditon-id").on('change', function () {
|
||
if (parseInt($(this).children("option:selected").val()) == 1) {
|
||
$("#labelChanger").css("display", "none")
|
||
$("#labelChanger2").css("display", "none")
|
||
$("#labelChanger3").css("display", "none")
|
||
$("#labelChanger4").css("display", "none")
|
||
$("#uploadedfileee").css("display", "none")
|
||
$("#uploadedfileee2").css("display", "none")
|
||
$("#uploadedfileee3").css("display", "none")
|
||
$("#uploadedfileee4").css("display", "none")
|
||
$("#uploadedItemspic").css("display", "none")
|
||
$("#uploadedItemspic2").css("display", "none")
|
||
$("#uploadedItemspic3").css("display", "none")
|
||
$("#uploadedItemspic4").css("display", "none")
|
||
|
||
|
||
|
||
}
|
||
if (parseInt($(this).children("option:selected").val()) == 2) {
|
||
$("#labelChanger").css("display", "block")
|
||
$("#labelChanger2").css("display", "block")
|
||
$("#labelChanger3").css("display", "block")
|
||
$("#labelChanger4").css("display", "block")
|
||
$("#uploadedfileee").css("display", "block")
|
||
$("#uploadedfileee2").css("display", "block")
|
||
$("#uploadedfileee3").css("display", "block")
|
||
$("#uploadedfileee4").css("display", "block")
|
||
$("#uploadedItemspic").css("display", "block")
|
||
$("#uploadedItemspic2").css("display", "block")
|
||
$("#uploadedItemspic3").css("display", "block")
|
||
$("#uploadedItemspic4").css("display", "block")
|
||
|
||
|
||
|
||
|
||
document.getElementById("labelChanger").innerHTML = "آپلود قرار داد و شرح خدمات";
|
||
document.getElementById("labelChanger2").innerHTML = "آپلود صورتجلسه تحویل قطعی";
|
||
document.getElementById("labelChanger3").innerHTML = "آپلود مدارک تکمیلی";
|
||
document.getElementById("labelChanger4").innerHTML = "آپلود گزارش نهایی";
|
||
}
|
||
});
|
||
|
||
function showUploadedFilespic(input) {
|
||
if (input.files) {
|
||
if (completepic == 0) {
|
||
|
||
$('#uploadedItemspic').append('\
|
||
<div class="row" id="itempic-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
completepic = 1;
|
||
} else {
|
||
$('#uploadedItemspic').empty();
|
||
$('#uploadedItemspic').append('\
|
||
<div class="row" id="itempic-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
}
|
||
}
|
||
}
|
||
|
||
function showUploadedFilespic2(input) {
|
||
if (input.files) {
|
||
if (completepic == 0) {
|
||
|
||
$('#uploadedItemspic2').append('\
|
||
<div class="row" id="itempic2-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic2(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
completepic = 1;
|
||
} else {
|
||
$('#uploadedItemspic2').empty();
|
||
$('#uploadedItemspic2').append('\
|
||
<div class="row" id="itempic2-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic2(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
}
|
||
}
|
||
}
|
||
|
||
function showUploadedFilespic3(input) {
|
||
if (input.files) {
|
||
if (completepic == 0) {
|
||
|
||
$('#uploadedItemspic3').append('\
|
||
<div class="row" id="itempic3-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic3(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
completepic = 1;
|
||
} else {
|
||
$('#uploadedItemspic3').empty();
|
||
$('#uploadedItemspic3').append('\
|
||
<div class="row" id="itempic3-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic3(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
}
|
||
}
|
||
}
|
||
|
||
function showUploadedFilespic4(input) {
|
||
if (input.files) {
|
||
if (completepic == 0) {
|
||
|
||
$('#uploadedItemspic4').append('\
|
||
<div class="row" id="itempic4-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic4(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
completepic = 1;
|
||
} else {
|
||
$('#uploadedItemspic4').empty();
|
||
$('#uploadedItemspic4').append('\
|
||
<div class="row" id="itempic4-' + 0 + '">\
|
||
<div class="col-md-5"><span style="margin-right: 12px;">نام: </span><span>' + input.files[0].name + '</span></div>\
|
||
<div class="col-md-2"><span style="margin-right: 12px;">حجم: </span><span>' + input.files[0].size / 1000 + 'KB</span></div>\
|
||
<div class="col-md-1" onclick="deletfilepic4(' + 0 + ')"><span style="margin-right: 12px; cursor: pointer" ><i class="fa fa-trash icon-btnTable"></i></span><br></div>\
|
||
</div>\
|
||
');
|
||
}
|
||
}
|
||
}
|
||
|
||
function deletfilepic(id) {
|
||
$('#itempic-' + id).remove()
|
||
$('input[name=modalUpFilepic]').val('')
|
||
$(".pdf1").css("color", "#ff5c0f");
|
||
|
||
}
|
||
|
||
function deletfilepic2(id) {
|
||
$('#itempic2-' + id).remove()
|
||
$('input[name=modalUpFilepic2]').val('')
|
||
$(".pdf2").css("color", "#ff5c0f");
|
||
|
||
}
|
||
|
||
function deletfilepic3(id) {
|
||
$('#itempic3-' + id).remove()
|
||
$('input[name=modalUpFilepic3]').val('')
|
||
$(".pdf3").css("color", "#ff5c0f");
|
||
|
||
}
|
||
|
||
function deletfilepic4(id) {
|
||
$('#itempic4-' + id).remove()
|
||
$('input[name=modalUpFilepic4]').val('')
|
||
$(".pdf4").css("color", "#ff5c0f");
|
||
|
||
}
|
||
|
||
|
||
function GenerateTablefilter(nameName, familyName, numberName) {
|
||
// console.log("str" , str)
|
||
var customers = new Array();
|
||
if (customers != []) {
|
||
customers = [];
|
||
}
|
||
customers.push(["نام", "نام خانوادگی ", "شماره تماس"]);
|
||
|
||
// for (let i = 0; i < name.length; i++) {
|
||
customers.push([
|
||
nameName,
|
||
familyName, numberName,
|
||
]);
|
||
// }
|
||
var table = document.createElement("TABLE");
|
||
$(table).attr("width", "100%");
|
||
$(table).addClass("table");
|
||
$(table).addClass("table-bordered");
|
||
$(table).addClass("tablemodal");
|
||
|
||
table.border = "1";
|
||
|
||
//Get the count of columns.
|
||
var columnCount = customers[0].length;
|
||
|
||
//Add the header row.
|
||
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);
|
||
}
|
||
|
||
//Add the data rows.
|
||
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("rdagentslist");
|
||
dvTable.innerHTML = "";
|
||
dvTable.appendChild(table);
|
||
}
|
||
$("#RandD").on("click", "button.finishsubmit", function () {
|
||
var tr = $(this).closest("tr");
|
||
var row = table.row(tr);
|
||
idkol = row.data().id;
|
||
Swal.fire({
|
||
icon: "warning",
|
||
title: "آیا برای ثبت نهایی اطمینان دارید؟",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#3085d6",
|
||
cancelButtonColor: "#d33",
|
||
confirmButtonText: "بله، تایید میشود",
|
||
cancelButtonText: "منصرف شدم!",
|
||
showLoaderOnConfirm: true,
|
||
preConfirm: () => {
|
||
showLoaderScreen();
|
||
$.ajax({
|
||
url: api_url + "/projects/processRegistration" + idkol,
|
||
type: "POST",
|
||
headers: {
|
||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||
},
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (result) {
|
||
hideLoaderScreen();
|
||
ajaxcalltablefirst();
|
||
showLoaderScreen();
|
||
table.ajax.reload(null, false);
|
||
},
|
||
error: function (error) {
|
||
Swal.fire({
|
||
icon: "error",
|
||
title: "خطا",
|
||
confirmButtonText: "بستن",
|
||
});
|
||
},
|
||
});
|
||
},
|
||
});
|
||
});
|
||
|
||
if ($("#contract-conditon-id").val() == 0) {
|
||
$(".style-jsi").css("margin-top", "80px");
|
||
}
|
||
$("#last-report2").on("change", function () {
|
||
$(".pdf2").css("color", "rgb(43, 125, 43)")
|
||
});
|
||
$("#last-report").on("change", function () {
|
||
$(".pdf1").css("color", "rgb(43, 125, 43)")
|
||
});
|
||
$("#last-report3").on("change", function () {
|
||
$(".pdf3").css("color", "rgb(43, 125, 43)")
|
||
});
|
||
$("#last-report4").on("change", function () {
|
||
$(".pdf4").css("color", "rgb(43, 125, 43)")
|
||
});
|
||
|
||
$('#btn-fillter-project-by-status').on('click', function () {
|
||
if ($(this).data('all') == 'true') {
|
||
$(this).text('پروژه های در حال اجرا')
|
||
table.columns(8).search('').draw();
|
||
$(this).data('all', 'false')
|
||
} else {
|
||
$(this).text('همه پروژه ها')
|
||
table.columns(8).search('در حال اجرا').draw();
|
||
$(this).data('all', 'true')
|
||
}
|
||
});
|
||
|
||
if (screen.width < 530) {
|
||
$(".body-table-style").removeClass("px-4")
|
||
$(".body-table-style").removeClass("pt-3")
|
||
$(".body-table-style").removeClass("row")
|
||
} else {
|
||
$(".body-table-style").addClass("px-4")
|
||
$(".body-table-style").addClass("pt-3")
|
||
$(".body-table-style").addClass("row")
|
||
} |