845 lines
46 KiB
JavaScript
845 lines
46 KiB
JavaScript
var search = '';
|
|
var activeTab = '';
|
|
var showpeople = "";
|
|
var komite_list = "";
|
|
var widthpage = $(window).width();
|
|
// provincesId = [];
|
|
$(document).ready(function () {
|
|
console.log("wide", widthpage)
|
|
|
|
all_RandDCounter();
|
|
$("#darhaleejra").click();
|
|
activeTab = $("#darhaleejra").data('active')
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/research_members",
|
|
success: function (res) {
|
|
var people = res.data;
|
|
for (let i = 0; i < people.length; i++) {
|
|
showpeople =
|
|
showpeople +
|
|
'<li class="splide__slide"><div class="splide__slide__container"><img src="/' +
|
|
people[i].member_url +
|
|
'" alt=""></div>\
|
|
<div class="showmember">\
|
|
<span class="showspan">' +
|
|
people[i].member_name +
|
|
'</span>\
|
|
<span class="showspan">' +
|
|
people[i].member_duty +
|
|
'</span>\
|
|
<span class="showspan">' +
|
|
people[i].member_office +
|
|
"</span>" +
|
|
"</div>" +
|
|
"</li>";
|
|
}
|
|
|
|
$("#splide__list").append(showpeople);
|
|
if (widthpage > 1000) {
|
|
new Splide("#splide", {
|
|
type: "loop",
|
|
perPage: 3,
|
|
direction: "rtl",
|
|
height: "200px",
|
|
autoplay: true,
|
|
pauseOnHover: false,
|
|
cover: true,
|
|
breakpoints: {
|
|
height: "6rem",
|
|
},
|
|
}).mount();
|
|
} else if (widthpage < 1000 && widthpage > 801) {
|
|
new Splide("#splide", {
|
|
type: "loop",
|
|
perPage: 3,
|
|
direction: "rtl",
|
|
height: "200px",
|
|
autoplay: true,
|
|
pauseOnHover: false,
|
|
cover: true,
|
|
breakpoints: {
|
|
height: "6rem",
|
|
},
|
|
}).mount();
|
|
} else if (widthpage < 800 && widthpage > 501) {
|
|
new Splide("#splide", {
|
|
type: "loop",
|
|
perPage: 2,
|
|
direction: "rtl",
|
|
height: "200px",
|
|
autoplay: true,
|
|
pauseOnHover: false,
|
|
cover: true,
|
|
breakpoints: {
|
|
height: "6rem",
|
|
},
|
|
}).mount();
|
|
} else if (widthpage < 500) {
|
|
new Splide("#splide", {
|
|
type: "loop",
|
|
perPage: 1,
|
|
direction: "rtl",
|
|
height: "200px",
|
|
autoplay: true,
|
|
pauseOnHover: false,
|
|
cover: true,
|
|
breakpoints: {
|
|
height: "6rem",
|
|
},
|
|
}).mount();
|
|
}
|
|
|
|
},
|
|
});
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/interface_members",
|
|
success: function (res) {
|
|
append_interface(res)
|
|
},
|
|
});
|
|
|
|
|
|
});
|
|
|
|
function all_RandDCounter() {
|
|
$.ajax({
|
|
url: "/RandD/statics",
|
|
type: "GET",
|
|
beforeSend: function () {
|
|
showLoaderScreen();
|
|
},
|
|
success: function (result) {
|
|
$(".countup1").each(function () {
|
|
var $this = $(this),
|
|
countTo = result.statics.ejra;
|
|
|
|
$({
|
|
countNum: $this.text()
|
|
}).animate({
|
|
countNum: countTo,
|
|
}, {
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
});
|
|
});
|
|
$(".countup2").each(function () {
|
|
var $this = $(this),
|
|
countTo = result.statics.end;
|
|
|
|
$({
|
|
countNum: $this.text()
|
|
}).animate({
|
|
countNum: countTo,
|
|
}, {
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
});
|
|
});
|
|
$(".countup3").each(function () {
|
|
var $this = $(this),
|
|
countTo = result.statics.comite;
|
|
|
|
$({
|
|
countNum: $this.text()
|
|
}).animate({
|
|
countNum: countTo,
|
|
}, {
|
|
duration: 2000,
|
|
easing: "linear",
|
|
step: function () {
|
|
$this.text(Math.floor(this.countNum));
|
|
},
|
|
complete: function () {
|
|
$this.text(this.countNum);
|
|
},
|
|
});
|
|
});
|
|
hideLoaderScreen();
|
|
},
|
|
error: function (error) {
|
|
// console.log(error);
|
|
},
|
|
});
|
|
}
|
|
|
|
function showLoaderScreen() {
|
|
$(".divloader").css("display", "flex").hide().fadeIn();
|
|
}
|
|
|
|
function hideLoaderScreen() {
|
|
$(".divloader").fadeOut();
|
|
}
|
|
//در حال اجرا
|
|
$("#darhaleejra").on("click", function () {
|
|
activeTab = $(this).data('active');
|
|
$("body").find("#body_khateme").addClass("stylescroll");
|
|
$("#khatemeyafte").css("background-color", "#ff5c0f");
|
|
$("#darhaleejra").css("background-color", "#015688");
|
|
$("#tahtebaresi").css("background-color", "#ff5c0f");
|
|
$("#body_filter").css("display", "block");
|
|
$("#body_khateme").empty();
|
|
$("#body_khateme").append(`<div class="loading-project">در حال دریافت اطلاعات ...</div>`);
|
|
if (search == '') {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/homepage",
|
|
success: function (data) {
|
|
ejra = data.data;
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < ejra.length; index++) {
|
|
if (ejra[index].contract_status == 1) {
|
|
function returnejra() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #000; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #000; font-size: 15px;">' + ejra[index].project_title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + ejra[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + ejra[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + ejra[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + ejra[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnejra());
|
|
}
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/search?search=" + search + "&type=1",
|
|
success: function (data) {
|
|
ejra = data.data;
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < ejra.length; index++) {
|
|
function returnejra() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #000; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #000; font-size: 15px;">' + ejra[index].project_title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + ejra[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + ejra[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + ejra[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + ejra[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnejra());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//خاتمه یافته
|
|
$("#khatemeyafte").on("click", function () {
|
|
activeTab = $(this).data('active');
|
|
$("body").find("#body_khateme").addClass("stylescroll");
|
|
$("#khatemeyafte").css("background-color", "#015688");
|
|
$("#darhaleejra").css("background-color", "#ff5c0f");
|
|
$("#tahtebaresi").css("background-color", "#ff5c0f");
|
|
$("#body_filter").css("display", "block");
|
|
$("#body_khateme").empty();
|
|
$("#body_khateme").append(`<div class="loading-project">در حال دریافت اطلاعات ...</div>`);
|
|
if (search == '') {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/homepage",
|
|
success: function (data) {
|
|
khateme = data.data;
|
|
console.log("all", khateme[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < khateme.length; index++) {
|
|
if (khateme[index].contract_status == 2) {
|
|
function returnkhateme() {
|
|
var btnFiles = '';
|
|
if (khateme[index].final_report_one) btnFiles += `<a href="/${khateme[index].final_report_one}" title="قرارداد و شرح خدمات" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_two) btnFiles += `<a href="/${khateme[index].final_report_two}" title="صورتجلسه تحویل قطعی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_three) btnFiles += `<a href="/${khateme[index].final_report_three}" title="مدارک تکمیلی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_four) btnFiles += `<a href="/${khateme[index].final_report_four}" title="گزارش نهایی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div class="col-10"><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + khateme[index].project_title +
|
|
'</p></div><div class="col">' + btnFiles + '</div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + khateme[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + khateme[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + khateme[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + khateme[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnkhateme());
|
|
}
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/search?search=" + search + "&type=2",
|
|
success: function (data) {
|
|
khateme = data.data;
|
|
console.log("all", khateme[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < khateme.length; index++) {
|
|
function returnkhateme() {
|
|
var btnFiles = '';
|
|
if (khateme[index].final_report_one) btnFiles += `<a href="/${khateme[index].final_report_one}" title="قرارداد و شرح خدمات" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_two) btnFiles += `<a href="/${khateme[index].final_report_two}" title="صورتجلسه تحویل قطعی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_three) btnFiles += `<a href="/${khateme[index].final_report_three}" title="مدارک تکمیلی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_four) btnFiles += `<a href="/${khateme[index].final_report_four}" title="گزارش نهایی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div class="col-10"><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + khateme[index].project_title +
|
|
'</p></div><div class="col">' + btnFiles + '</div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + khateme[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + khateme[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + khateme[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + khateme[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnkhateme());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//تحت بررسی
|
|
$("#tahtebaresi").on("click", function () {
|
|
activeTab = $(this).data('active');
|
|
$("body").find("#body_khateme").addClass("stylescroll");
|
|
$("#khatemeyafte").css("background-color", "#ff5c0f");
|
|
$("#darhaleejra").css("background-color", "#ff5c0f");
|
|
$("#tahtebaresi").css("background-color", "#015688");
|
|
$("#body_filter").css("display", "block");
|
|
$("#body_khateme").empty();
|
|
$("#body_khateme").append(`<div class="loading-project">در حال دریافت اطلاعات ...</div>`);
|
|
if (search == '') {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/committee_projects",
|
|
success: function (data) {
|
|
baresi = data.data;
|
|
console.log("all", baresi[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < baresi.length; index++) {
|
|
function returnbaresi() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + baresi[index].title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + baresi[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + baresi[index].domain_fa +
|
|
'</p><p class="displays"> نام ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].fname_creator + ' ' + baresi[index].lname_creator +
|
|
'</p><p class="displays"> شماره تماس ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].phone_creator +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnbaresi());
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/search?search=" + search + "&type=3",
|
|
success: function (data) {
|
|
baresi = data.data;
|
|
console.log("all", baresi[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < baresi.length; index++) {
|
|
function returnbaresi() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + baresi[index].title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + baresi[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + baresi[index].domain_fa +
|
|
'</p><p class="displays"> نام ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].fname_creator + ' ' + baresi[index].lname_creator +
|
|
'</p><p class="displays"> شماره تماس ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].phone_creator +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnbaresi());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
$("#body_filter").addClass("stylescroll");
|
|
$(".shakhsi").on("click", function () {
|
|
$("#modalCenter").modal("show");
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/statics",
|
|
success: function (data) {
|
|
komite = data.data.aazaye_comite;
|
|
console.log("all", komite[0]);
|
|
for (let index = 0; index < komite.length; index++) {
|
|
function etelaateaza() {
|
|
return (
|
|
'\
|
|
<p style="display: inline; font-size: 20px; font-weight: 500;">نام: </p>\
|
|
<p style="display: inline; font-size: 17px; font-weight: 500; color:crimson;">' + komite[index].member_name + '</p>\
|
|
<br>\
|
|
<p style="display: inline; font-size: 20px; font-weight: 500;">سمت: </p>\
|
|
<p style="display: inline; font-size: 17px; font-weight: 500; color:crimson;">' + komite[index].member_duty + '</p>\
|
|
<br>\
|
|
<p style="display: inline; font-size: 20px; font-weight: 500;">محل فعالیت: </p>\
|
|
<p style="display: inline; font-size: 17px; font-weight: 500; color:crimson;">' + komite[index].member_office + '</p>\
|
|
'
|
|
);
|
|
}
|
|
$(".modal-body").append(etelaateaza());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/setad-province/all",
|
|
success: function (data) {
|
|
allpro = data.data;
|
|
// console.log("all", );
|
|
for (let index = 0; index < allpro.length; index++) {
|
|
|
|
function provincegiri() {
|
|
return (
|
|
'\
|
|
<div>\
|
|
<input type="checkbox" id="pt' + allpro[index].id + '" value="' + allpro[index].id + '" class="chBox' + allpro[index].id + ' forneed">\
|
|
<label for="pt' + allpro[index].id + ' " class="font-check" style="color: #015688;">' + allpro[index].name_fa +
|
|
'\
|
|
</label>\
|
|
</div>\
|
|
'
|
|
);
|
|
}
|
|
$(".province-filter").append(provincegiri());
|
|
}
|
|
}
|
|
});
|
|
$("#modalCenter .close").on("click", function () {
|
|
$(".modal-body").empty();
|
|
});
|
|
$(".modal-footer .btn-secondary").on("click", function () {
|
|
$(".modal-body").empty();
|
|
});
|
|
$("body").on("click", function () {
|
|
$(".modal-body").empty();
|
|
});
|
|
|
|
$(".title_filter").on("click", function () {
|
|
if ($(".province-filter").css("display") == "block") {
|
|
$(".province-filter").slideUp(500);
|
|
$(".title_filter").css("background-color", "#ff5c0f");
|
|
} else {
|
|
$(".province-filter").slideDown(500);
|
|
$(".title_filter").css("background-color", "#015688");
|
|
}
|
|
});
|
|
$(".title_filter2").on("click", function () {
|
|
if ($(".hoze_filter").css("display") == "block") {
|
|
$(".hoze_filter").slideUp(500);
|
|
$(".title_filter2").css("background-color", "#ff5c0f");
|
|
} else {
|
|
$(".hoze_filter").slideDown(500);
|
|
$(".title_filter2").css("background-color", "#015688");
|
|
}
|
|
});
|
|
|
|
$('#input-search').on('input', function () {
|
|
search = $(this).val();
|
|
|
|
$("body").find("#body_khateme").addClass("stylescroll");
|
|
$("#body_khateme").empty();
|
|
$("#body_khateme").append(`<div class="loading-project">در حال دریافت اطلاعات ...</div>`);
|
|
switch (activeTab) {
|
|
case 'ejra':
|
|
if (search == '') {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/homepage",
|
|
success: function (data) {
|
|
ejra = data.data;
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < ejra.length; index++) {
|
|
if (ejra[index].contract_status == 1) {
|
|
function returnejra() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #000; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #000; font-size: 15px;">' + ejra[index].project_title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + ejra[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + ejra[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + ejra[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + ejra[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnejra());
|
|
}
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/search?search=" + search + "&type=1",
|
|
success: function (data) {
|
|
ejra = data.data;
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < ejra.length; index++) {
|
|
function returnejra() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #000; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #000; font-size: 15px;">' + ejra[index].project_title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + ejra[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + ejra[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + ejra[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + ejra[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + ejra[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnejra());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
break;
|
|
case 'khateme':
|
|
if (search == '') {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/homepage",
|
|
success: function (data) {
|
|
khateme = data.data;
|
|
console.log("all", khateme[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < khateme.length; index++) {
|
|
if (khateme[index].contract_status == 2) {
|
|
function returnkhateme() {
|
|
var btnFiles = '';
|
|
if (khateme[index].final_report_one) btnFiles += `<a href="/${khateme[index].final_report_one}" title="قرارداد و شرح خدمات" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_two) btnFiles += `<a href="/${khateme[index].final_report_two}" title="صورتجلسه تحویل قطعی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_three) btnFiles += `<a href="/${khateme[index].final_report_three}" title="مدارک تکمیلی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_four) btnFiles += `<a href="/${khateme[index].final_report_four}" title="گزارش نهایی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div class="col-10"><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + khateme[index].project_title +
|
|
'</p></div><div class="col">' + btnFiles + '</div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + khateme[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + khateme[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + khateme[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + khateme[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnkhateme());
|
|
}
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/search?search=" + search + "&type=2",
|
|
success: function (data) {
|
|
khateme = data.data;
|
|
console.log("all", khateme[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < khateme.length; index++) {
|
|
function returnkhateme() {
|
|
var btnFiles = '';
|
|
if (khateme[index].final_report_one) btnFiles += `<a href="/${khateme[index].final_report_one}" title="قرارداد و شرح خدمات" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_two) btnFiles += `<a href="/${khateme[index].final_report_two}" title="صورتجلسه تحویل قطعی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_three) btnFiles += `<a href="/${khateme[index].final_report_three}" title="مدارک تکمیلی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
if (khateme[index].final_report_four) btnFiles += `<a href="/${khateme[index].final_report_four}" title="گزارش نهایی" class="btn btn-default btn-sm mx-1"><i class="fas fa-download"></i></a>`
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div class="col-10"><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + khateme[index].project_title +
|
|
'</p></div><div class="col">' + btnFiles + '</div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + khateme[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + khateme[index].domain_fa +
|
|
'</p><p class="displays"> مجری: </p><p class="displays" style="color: crimson">' + khateme[index].project_agent +
|
|
'</p><p class="displays"> شماره قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_number +
|
|
'</p><p class="displays"> مدت قرار داد(ماه): </p><p class="displays" style="color: crimson">' + khateme[index].contract_term +
|
|
'</p><p class="displays"> مبلغ قرارداد: </p><p class="displays" style="color: crimson">' + khateme[index].contract_amount +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnkhateme());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
break;
|
|
case 'komite':
|
|
if (search == '') {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/committee_projects",
|
|
success: function (data) {
|
|
baresi = data.data;
|
|
console.log("all", baresi[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < baresi.length; index++) {
|
|
function returnbaresi() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + baresi[index].title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + baresi[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + baresi[index].domain_fa +
|
|
'</p><p class="displays"> نام ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].fname_creator + ' ' + baresi[index].lname_creator +
|
|
'</p><p class="displays"> شماره تماس ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].phone_creator +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnbaresi());
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/RandD/search?search=" + search + "&type=3",
|
|
success: function (data) {
|
|
baresi = data.data;
|
|
console.log("all", baresi[0]);
|
|
$("#body_khateme").empty();
|
|
for (let index = 0; index < baresi.length; index++) {
|
|
function returnbaresi() {
|
|
return (
|
|
'\
|
|
<div style="border-bottom: 2px solid #ff5c0f; padding-bottom: 10px; padding-top: 10px;">\
|
|
<div class="title_all"><div><p class="displays showtext" style="color: #fff; font-size: 15px;"> عنوان پروژه: </p><p class="displays showtext" style="color: #fff; font-size: 15px;">' + baresi[index].title +
|
|
'</p></div></div><p class="displays">اداره کل: </p><p class="displays" style="color: crimson">' + baresi[index].province_fa +
|
|
'</p><p class="displays"> حوزه: </p><p class="displays" style="color: crimson">' + baresi[index].domain_fa +
|
|
'</p><p class="displays"> نام ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].fname_creator + ' ' + baresi[index].lname_creator +
|
|
'</p><p class="displays"> شماره تماس ثبت کننده: </p><p class="displays" style="color: crimson">' + baresi[index].phone_creator +
|
|
'</p></div>\
|
|
'
|
|
);
|
|
}
|
|
$("#body_khateme").append(returnbaresi());
|
|
}
|
|
}
|
|
});
|
|
}
|
|
break;
|
|
}
|
|
});
|
|
if (widthpage < 800) {
|
|
$(".counters-div1").css("border-left", "0px");
|
|
$(".counters-div2").css("border-left", "0px");
|
|
}
|
|
if (widthpage < 990) {
|
|
$(".check-res-header2").removeClass("container");
|
|
$(".check-res-header2").addClass("container-fluid");
|
|
}
|
|
if (widthpage < 460) {
|
|
$(".header-for-projectpart").addClass("d-flex");
|
|
$(".header-for-projectpart").addClass("flex-column");
|
|
$("#body_khateme").removeClass("mt-2");
|
|
}
|
|
function append_interface(res) {
|
|
var test = ""
|
|
var data_inter = res.data
|
|
// for (var i=0 ; i<res.length ; i++) {
|
|
// interface=interface+
|
|
// `<div class="slide" data-slide-index="${i}">${i}</div>`
|
|
// }
|
|
for (let i = 0; i < data_inter.length; i++) {
|
|
test = test + `<div class="slide" data-slide-index="${i}"><div class="interface_imge"><img src="/${data_inter[i].member_url}"><div class="member-style mt-1"><span>${data_inter[i].member_name}</span><span>${data_inter[i].member_duty}</span></div></div></div>`
|
|
}
|
|
$(".owl-carousel").append(test)
|
|
|
|
var el = $('.owl-carousel');
|
|
|
|
var carousel;
|
|
var carouselOptions = {
|
|
margin: 20,
|
|
nav: true,
|
|
dots: true,
|
|
slideBy: 'page',
|
|
autoplay: true,
|
|
autoplayTimeout: 3000,
|
|
autoplayHoverPause: true,
|
|
loop: true,
|
|
rtl: true,
|
|
responsive: {
|
|
0: {
|
|
items: 1,
|
|
rows: 2 //custom option not used by Owl Carousel, but used by the algorithm below
|
|
},
|
|
768: {
|
|
items: 2,
|
|
rows: 3 //custom option not used by Owl Carousel, but used by the algorithm below
|
|
},
|
|
991: {
|
|
items: 3,
|
|
rows: 2 //custom option not used by Owl Carousel, but used by the algorithm below
|
|
},
|
|
1200: {
|
|
items: 5,
|
|
rows: 2 //custom option not used by Owl Carousel, but used by the algorithm below
|
|
},
|
|
|
|
}
|
|
};
|
|
|
|
//Taken from Owl Carousel so we calculate width the same way
|
|
var viewport = function () {
|
|
var width;
|
|
if (carouselOptions.responsiveBaseElement) {
|
|
width = $(carouselOptions.responsiveBaseElement).width();
|
|
} else if (window.innerWidth) {
|
|
width = window.innerWidth;
|
|
} else if (document.documentElement && document.documentElement.clientWidth) {
|
|
width = document.documentElement.clientWidth;
|
|
} else {
|
|
console.warn('Can not detect viewport width.');
|
|
}
|
|
return width;
|
|
};
|
|
|
|
var severalRows = false;
|
|
var orderedBreakpoints = [];
|
|
for (var breakpoint in carouselOptions.responsive) {
|
|
if (carouselOptions.responsive[breakpoint].rows > 1) {
|
|
severalRows = true;
|
|
}
|
|
orderedBreakpoints.push(parseInt(breakpoint));
|
|
}
|
|
|
|
//Custom logic is active if carousel is set up to have more than one row for some given window width
|
|
if (severalRows) {
|
|
orderedBreakpoints.sort(function (a, b) {
|
|
return b - a;
|
|
});
|
|
var slides = el.find('[data-slide-index]');
|
|
var slidesNb = slides.length;
|
|
if (slidesNb > 0) {
|
|
var rowsNb;
|
|
var previousRowsNb = undefined;
|
|
var colsNb;
|
|
var previousColsNb = undefined;
|
|
|
|
//Calculates number of rows and cols based on current window width
|
|
var updateRowsColsNb = function () {
|
|
var width = viewport();
|
|
for (var i = 0; i < orderedBreakpoints.length; i++) {
|
|
var breakpoint = orderedBreakpoints[i];
|
|
if (width >= breakpoint || i == (orderedBreakpoints.length - 1)) {
|
|
var breakpointSettings = carouselOptions.responsive['' + breakpoint];
|
|
rowsNb = breakpointSettings.rows;
|
|
colsNb = breakpointSettings.items;
|
|
break;
|
|
}
|
|
}
|
|
};
|
|
|
|
var updateCarousel = function () {
|
|
updateRowsColsNb();
|
|
|
|
//Carousel is recalculated if and only if a change in number of columns/rows is requested
|
|
if (rowsNb != previousRowsNb || colsNb != previousColsNb) {
|
|
var reInit = false;
|
|
if (carousel) {
|
|
//Destroy existing carousel if any, and set html markup back to its initial state
|
|
carousel.trigger('destroy.owl.carousel');
|
|
carousel = undefined;
|
|
slides = el.find('[data-slide-index]').detach().appendTo(el);
|
|
el.find('.fake-col-wrapper').remove();
|
|
reInit = true;
|
|
}
|
|
|
|
|
|
//This is the only real 'smart' part of the algorithm
|
|
|
|
//First calculate the number of needed columns for the whole carousel
|
|
var perPage = rowsNb * colsNb;
|
|
var pageIndex = Math.floor(slidesNb / perPage);
|
|
var fakeColsNb = pageIndex * colsNb + (slidesNb >= (pageIndex * perPage + colsNb) ? colsNb : (slidesNb % colsNb));
|
|
|
|
//Then populate with needed html markup
|
|
var count = 0;
|
|
for (var i = 0; i < fakeColsNb; i++) {
|
|
//For each column, create a new wrapper div
|
|
var fakeCol = $('<div class="fake-col-wrapper"></div>').appendTo(el);
|
|
for (var j = 0; j < rowsNb; j++) {
|
|
//For each row in said column, calculate which slide should be present
|
|
var index = Math.floor(count / perPage) * perPage + (i % colsNb) + j * colsNb;
|
|
if (index < slidesNb) {
|
|
//If said slide exists, move it under wrapper div
|
|
slides.filter('[data-slide-index=' + index + ']').detach().appendTo(fakeCol);
|
|
}
|
|
count++;
|
|
}
|
|
}
|
|
//end of 'smart' part
|
|
|
|
previousRowsNb = rowsNb;
|
|
previousColsNb = colsNb;
|
|
|
|
if (reInit) {
|
|
//re-init carousel with new markup
|
|
carousel = el.owlCarousel(carouselOptions);
|
|
}
|
|
}
|
|
};
|
|
|
|
//Trigger possible update when window size changes
|
|
$(window).on('resize', updateCarousel);
|
|
|
|
//We need to execute the algorithm once before first init in any case
|
|
updateCarousel();
|
|
}
|
|
}
|
|
|
|
//init
|
|
carousel = el.owlCarousel(carouselOptions);
|
|
} |