`;
})
$('#company_compare_list').html(html);
})
})
Array.prototype.remove = function() {
var what, a = arguments, L = a.length, ax;
while (L && this.length) {
what = a[--L];
while ((ax = this.indexOf(what)) !== -1) {
this.splice(ax, 1);
}
}
return this;
};
let selectedCompanies = [];
let removed = [];
let product_id = null;
let product_html = null;
let product_code = null;
let product_data = { product_id:null, company_id: [], product_code: null };
function renderCompaniesBtn(){
let html = '';
let html_all = `
გაგზავნე ყველგან
`;
let html_selected = `
არჩეული ორგანიზაციები
`;
if(product_data.product_id !== null){
if(!(product_data.company_id.length > 0)) html = html_all;
else html = html_selected;
}
$('#selected-product-container').html(html);
}
function getSelectedCompanies() {
//selectedCompanies = [];
/* let input = document.getElementsByName('companies[]');
let val = [];
for (let i = 0; i < input.length; i++) {
let a = input[i];
if(a.checked)
val.push(parseInt(a.value));
}*/
return selectedCompanies;
}
function setAllCompanies(){
selectedCompanies = [];
}
function setCompany(id){
selectedCompanies.push(parseInt(id))
}
$('#application-popup').on('popup_opened',function (e){
console.log(e.detail)
axios.get(route('client.get-products'))
.then((response) => {
console.log(response.data)
let html = ``;
response.data.map((item, index) => {
html += `