Spaces:
Sleeping
Sleeping
Update data_gc_tab.html
Browse files- data_gc_tab.html +149 -192
data_gc_tab.html
CHANGED
@@ -183,14 +183,18 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
183 |
<option value="ws_stop">Стутус подписки</option>
|
184 |
<option value="web_st">Вебинары</option>
|
185 |
<option value="fin_prog">Прогрес по воронке</option>
|
186 |
-
<option value="pr1"
|
187 |
-
<option value="pr2"
|
188 |
-
<option value="pr3"
|
189 |
-
<option value="
|
190 |
-
<option value="pr5">Дата</option>
|
191 |
<option value="key_pr">Ключ PR</option>
|
192 |
-
<option value="
|
193 |
-
<option value="
|
|
|
|
|
|
|
|
|
|
|
194 |
</select>
|
195 |
|
196 |
<select id="filter-type">
|
@@ -204,51 +208,22 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
204 |
</select>
|
205 |
|
206 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
207 |
-
|
208 |
-
<select id="filter-field2">
|
209 |
-
<option></option>
|
210 |
-
<option value="id">Номер в списке</option>
|
211 |
-
<option value="name">Имя</option>
|
212 |
-
<option value="phone">WhatsApp</option>
|
213 |
-
<option value="email">Email</option>
|
214 |
-
<option value="b_mess">Реплики</option>
|
215 |
-
<option value="curator">Куратор</option>
|
216 |
-
<option value="shop_st">Статус покупки</option>
|
217 |
-
<option value="ad_url">Ссылка на пользователя в GC</option>
|
218 |
-
<option value="vk_id">Ссылка на VK</option>
|
219 |
-
<option value="chat_id">Ссылка на Tg</option>
|
220 |
-
<option value="ws_stop">Стутус подписки</option>
|
221 |
-
<option value="web_st">Вебинары</option>
|
222 |
-
<option value="fin_prog">Прогрес по воронке</option>
|
223 |
-
<option value="pr1">pr1</option>
|
224 |
-
<option value="pr2">pr2</option>
|
225 |
-
<option value="pr3">pr3</option>
|
226 |
-
<option value="pr4">Канал трафика</option>
|
227 |
-
<option value="pr5">Дата</option>
|
228 |
-
<option value="key_pr">Ключ PR</option>
|
229 |
-
<option value="canal">Канал</option>
|
230 |
-
<option value="data_t">Дата</option>
|
231 |
-
</select>
|
232 |
-
|
233 |
-
<input id="filter-value2" type="text" placeholder="Значение фильтра 2">
|
234 |
-
|
235 |
<button id="filter-clear">Очистить фильтр</button>
|
236 |
<button id="download-xlsx">Скачать в XLSX</button>
|
237 |
<button id="download-json">Download JSON</button>
|
238 |
<button id="download-rass">Рассылка по выбранным</button>
|
239 |
-
<button id="take-for-yourself">Взять себе</button>
|
240 |
</div>
|
241 |
<div id="example-table"></div>
|
242 |
|
243 |
<script>
|
244 |
-
|
245 |
document.addEventListener('DOMContentLoaded', function() {
|
246 |
fetch('https://diamonik7777-up-fail.hf.space/data_gc_tab_out?api_sys=fasSd345D')
|
247 |
.then(response => response.json())
|
248 |
.then(data => {
|
249 |
console.log('Data received:', data); // Логирование данных
|
250 |
-
// Переворачиваем массив данных
|
251 |
-
data.reverse();
|
252 |
var linkFormatter = function(cell, formatterParams, onRendered) {
|
253 |
var curator = cell.getValue();
|
254 |
var curatorLink = cell.getData().curator_link;
|
@@ -262,97 +237,87 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
|
|
262 |
selectable: true, // enable row selection
|
263 |
columns: [
|
264 |
{title:"Номер в списке", field:"id"},
|
265 |
-
{title:"Имя", field:"name", width:
|
266 |
-
|
267 |
-
|
268 |
-
{title:"WhatsApp", field:"phone", formatter: function(cell, formatterParams, onRendered) {
|
269 |
-
var phone = cell.getValue();
|
270 |
-
var ws_stop = cell.getData().ws_stop;
|
271 |
-
var ws_st = cell.getData().ws_st;
|
272 |
-
var imageUrl1 = "https://
|
273 |
-
var imageUrl2 = "https://
|
274 |
-
var imageUrl3 = "https://
|
275 |
-
var link = `<a href="https://web.whatsapp.com/send?phone=${phone}" target="_blank">`;
|
276 |
-
// Проверка условий
|
277 |
-
if (ws_stop !== "1" && ws_st === "1") {
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
}
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
}
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
`;
|
347 |
-
// Показываем уведомление
|
348 |
-
notyf.open({
|
349 |
-
type: 'info',
|
350 |
-
message: message,
|
351 |
-
});
|
352 |
-
}},
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
{title:"Куратор", field:"curator", formatter: linkFormatter},
|
357 |
{title:"Статус покупки", field:"shop_st", formatter: function(cell, formatterParams, onRendered) {
|
358 |
var status = cell.getValue();
|
@@ -372,95 +337,87 @@ return link + `<img src="${imageUrl3}" alt="WhatsApp" style="width: 98px; height
|
|
372 |
}
|
373 |
return `<div style="width: 20px; height: 20px; background-color: ${color};"></div>`;
|
374 |
}},
|
375 |
-
{title:"Ссылка на пользователя в GC", field:"ad_url", formatter: function(cell, formatterParams, onRendered) {
|
376 |
-
var ad_url = cell.getValue();
|
377 |
-
return `<a href="${ad_url}" target="_blank">${ad_url}</a>`;
|
378 |
-
}},
|
379 |
-
{title:"Ссылка на Tg", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
|
380 |
-
var chatId = cell.getValue();
|
381 |
-
if (chatId.startsWith('@')) {
|
382 |
-
chatId = chatId.substring(1); // Удаление символа @ в начале
|
383 |
-
}
|
384 |
-
return `<a href="https://t.me/${chatId}" target="_blank">${chatId}</a>`;
|
385 |
-
}},
|
386 |
{title:"Вебинары-присутствовал", field:"web_st", formatter:"star", formatterParams:{stars:7}, hozAlign:"center", width:90},
|
387 |
{title:"Вебинары-досмотрел до конца", field:"b_fin", formatter:function(cell, formatterParams, onRendered){
|
388 |
var value = cell.getValue();
|
389 |
-
|
390 |
if (value === 'True') {
|
391 |
-
|
392 |
} else {
|
393 |
-
|
394 |
}
|
395 |
-
|
396 |
-
}},
|
397 |
-
|
398 |
{title:"Прогрес по воронке", field:"fin_prog", formatter:"progress", formatterParams:{color:["#ff0000", "orange", "#00dd00"]}, sorter:"number", width:100},
|
399 |
-
{title:"
|
400 |
-
{title:"
|
401 |
-
|
402 |
-
|
403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
{title:"Ключ PR", field:"key_pr"},
|
405 |
-
{title:"
|
406 |
-
{title:"
|
|
|
|
|
|
|
|
|
|
|
407 |
],
|
408 |
});
|
409 |
-
|
410 |
var fieldEl = document.getElementById("filter-field");
|
411 |
var typeEl = document.getElementById("filter-type");
|
412 |
var valueEl = document.getElementById("filter-value");
|
413 |
-
var fieldEl2 = document.getElementById("filter-field2");
|
414 |
-
var valueEl2 = document.getElementById("filter-value2");
|
415 |
function updateFilter() {
|
416 |
-
var
|
417 |
-
var
|
418 |
-
var
|
419 |
-
|
420 |
-
|
421 |
-
if (filterVal1 && filterVal2) {
|
422 |
-
table.setFilter([
|
423 |
-
{ field: filterVal1, type: typeVal1, value: valueVal1 },
|
424 |
-
{ field: filterVal2, type: "=", value: valueVal2 }
|
425 |
-
]);
|
426 |
}
|
427 |
}
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
document.getElementById(
|
432 |
-
document.getElementById("filter-value2").addEventListener("keyup", updateFilter);
|
433 |
-
//trigger download of data.json file
|
434 |
-
document.getElementById("download-json").addEventListener("click", function(){
|
435 |
-
table.download("json", "data.json");
|
436 |
-
});
|
437 |
-
|
438 |
-
|
439 |
-
//trigger download of data.xlsx file
|
440 |
-
document.getElementById("download-xlsx").addEventListener("click", function(){
|
441 |
-
table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
|
442 |
-
});
|
443 |
-
document.getElementById("filter-clear").addEventListener("click", function() {
|
444 |
fieldEl.value = "";
|
445 |
typeEl.value = "=";
|
446 |
valueEl.value = "";
|
447 |
-
fieldEl2.value = "";
|
448 |
-
valueEl2.value = "";
|
449 |
table.clearFilter();
|
450 |
});
|
451 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
var tableData = table.getData("active");
|
453 |
var jsonData = JSON.stringify(tableData, null, 2);
|
454 |
console.log("Данные для рассылки:", jsonData);
|
455 |
-
}
|
456 |
-
|
457 |
-
function handleTakeForYourself() {
|
458 |
var tableData = table.getData("active");
|
459 |
var jsonData = JSON.stringify(tableData, null, 2);
|
460 |
console.log("Данные для себя:", jsonData);
|
461 |
-
}
|
462 |
-
document.getElementById("download-rass").addEventListener("click", handleDownloadRass);
|
463 |
-
document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
|
464 |
})
|
465 |
.catch(error => console.error('Error fetching data:', error));
|
466 |
});
|
|
|
183 |
<option value="ws_stop">Стутус подписки</option>
|
184 |
<option value="web_st">Вебинары</option>
|
185 |
<option value="fin_prog">Прогрес по воронке</option>
|
186 |
+
<option value="pr1">Бонусы</option>
|
187 |
+
<option value="pr2">Опросы</option>
|
188 |
+
<option value="pr3">Доступы</option>
|
189 |
+
<option value="canal">Канал трафика</option>
|
|
|
190 |
<option value="key_pr">Ключ PR</option>
|
191 |
+
<option value="utm_source">utm_source</option>
|
192 |
+
<option value="utm_medium">utm_medium</option>
|
193 |
+
<option value="utm_campaign">utm_campaign</option>
|
194 |
+
<option value="utm_term">utm_term</option>
|
195 |
+
<option value="utm_content">utm_content</option>
|
196 |
+
<option value="data_on">Дата - Последнее действие</option>
|
197 |
+
<option value="data_t">Дата - Вход</option>
|
198 |
</select>
|
199 |
|
200 |
<select id="filter-type">
|
|
|
208 |
</select>
|
209 |
|
210 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
<button id="filter-clear">Очистить фильтр</button>
|
212 |
<button id="download-xlsx">Скачать в XLSX</button>
|
213 |
<button id="download-json">Download JSON</button>
|
214 |
<button id="download-rass">Рассылка по выбранным</button>
|
215 |
+
<button id="take-for-yourself">Взять себе</button>
|
216 |
</div>
|
217 |
<div id="example-table"></div>
|
218 |
|
219 |
<script>
|
220 |
+
vkBridge.send('VKWebAppInit');
|
221 |
document.addEventListener('DOMContentLoaded', function() {
|
222 |
fetch('https://diamonik7777-up-fail.hf.space/data_gc_tab_out?api_sys=fasSd345D')
|
223 |
.then(response => response.json())
|
224 |
.then(data => {
|
225 |
console.log('Data received:', data); // Логирование данных
|
226 |
+
data.reverse(); // Переворачиваем массив данных
|
|
|
227 |
var linkFormatter = function(cell, formatterParams, onRendered) {
|
228 |
var curator = cell.getValue();
|
229 |
var curatorLink = cell.getData().curator_link;
|
|
|
237 |
selectable: true, // enable row selection
|
238 |
columns: [
|
239 |
{title:"Номер в списке", field:"id"},
|
240 |
+
{title:"Имя", field:"name", width:85},
|
241 |
+
{title:"Город", field:"b_city", width:85},
|
242 |
+
{title:"Email", field:"email", width:85},
|
243 |
+
{title:"WhatsApp", field:"phone", formatter: function(cell, formatterParams, onRendered) {
|
244 |
+
var phone = cell.getValue();
|
245 |
+
var ws_stop = cell.getData().ws_stop;
|
246 |
+
var ws_st = cell.getData().ws_st;
|
247 |
+
var imageUrl1 = "https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/ic/whatsapp-1.png"; // Замените на URL первой картинки
|
248 |
+
var imageUrl2 = "https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/ic/%D0%91%D0%B5%D0%B7%20%D0%B8%D0%BC%D0%B5%D0%BD%D0%B8-1.png"; // Замените на URL второй картинки
|
249 |
+
var imageUrl3 = "https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/ic/whatsapp-3.png"; // Замените на URL второй картинки
|
250 |
+
var link = `<a href="https://web.whatsapp.com/send?phone=${phone}" target="_blank">`;
|
251 |
+
// Проверка условий
|
252 |
+
if (ws_stop !== "1" && ws_st === "1") {
|
253 |
+
console.log("Первая переменная не равна единице, вторая равна единице");
|
254 |
+
return link + `<img src="${imageUrl2}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
|
255 |
+
} else if (ws_stop === "1" && ws_st === "1") {
|
256 |
+
console.log("Обе переменные равны единице");
|
257 |
+
return link + `<img src="${imageUrl3}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
|
258 |
+
} else {
|
259 |
+
console.log("Остальные случаи");
|
260 |
+
return link + `<img src="${imageUrl1}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
|
261 |
+
}
|
262 |
+
}},
|
263 |
+
{title:"ВКонтакте", field:"vk_id", formatter: function(cell, formatterParams, onRendered) {
|
264 |
+
var vk_id = cell.getValue();
|
265 |
+
var imageUrlvk1 = "https://i.ibb.co/BKB8R4C/2-2.png"; // Замените на URL первой картинки
|
266 |
+
var imageUrlvk2 = "https://i.ibb.co/MPCGvQX/2-1.png"; // Замените на URL второй картинки
|
267 |
+
var link1 = `<a href="https://vk.com" target="_blank">`;
|
268 |
+
var link2 = `<a href="https://vk.com/id${vk_id}" target="_blank">`;
|
269 |
+
// Проверка условий
|
270 |
+
if (vk_id === "0" || vk_id === "") {
|
271 |
+
// Если vk_id равен "0" или пуст
|
272 |
+
return link1 + `<img src="${imageUrlvk1}" alt="Image" style="width: 98px; height: 14px;">`;
|
273 |
+
} else {
|
274 |
+
// Если vk_id не пуст и не равен "0"
|
275 |
+
return link2 + `<img src="${imageUrlvk2}" alt="Image" style="width: 98px; height: 14px;">`;
|
276 |
+
}
|
277 |
+
}},
|
278 |
+
{title:"Телеграм", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
|
279 |
+
var chat_id = cell.getValue();
|
280 |
+
var imageUrltg1 = "https://i.ibb.co/3S4Wt7m/3-2.png";
|
281 |
+
var imageUrlntg2 = "https://i.ibb.co/rZrzQhb/3-1.png";
|
282 |
+
var linktg1 = `<a href="https://t.me" target="_blank">`;
|
283 |
+
var linktg2 = `<a href="https://t.me/${chat_id}" target="_blank">`;
|
284 |
+
if (chat_id === "0" || chat_id === "") {
|
285 |
+
return linktg1 + `<img src="${imageUrltg1}" alt="Image" style="width: 98px; height: 14px;">`;
|
286 |
+
} else {
|
287 |
+
return linktg2 + `<img src="${imageUrlntg2}" alt="Image" style="width: 98px; height: 14px;">`;
|
288 |
+
}
|
289 |
+
}},
|
290 |
+
{title:"GetCurse", field:"gc_url", formatter: function(cell, formatterParams, onRendered) {
|
291 |
+
var gc_url = cell.getValue();
|
292 |
+
var imageUrlvkgc1 = "https://i.ibb.co/F8825KY/1-2.png";
|
293 |
+
var imageUrlvkgc2 = "https://i.ibb.co/S3qwFKM/1-1.png";
|
294 |
+
var linkgc1 = `<a href="https://vk.com/getcourseru" target="_blank">`;
|
295 |
+
var linkgc2 = `<a href="${gc_url}" target="_blank">`;
|
296 |
+
if (gc_url === "0" || gc_url === "") {
|
297 |
+
return linkgc1 + `<img src="${imageUrlvkgc1}" alt="Image" style="width: 98px; height: 14px;">`;
|
298 |
+
} else {
|
299 |
+
return linkgc2 + `<img src="${imageUrlvkgc2}" alt="Image" style="width: 98px; height: 14px;">`;
|
300 |
+
}
|
301 |
+
}},
|
302 |
+
{title:"Реплики", field:"b_mess", width:95, cellClick:function(e, cell){
|
303 |
+
var data = cell.getData();
|
304 |
+
const notyf = new Notyf({
|
305 |
+
duration: 10000,
|
306 |
+
position: {
|
307 |
+
x: 'right',
|
308 |
+
y: 'top',
|
309 |
+
},
|
310 |
+
});
|
311 |
+
const message = `
|
312 |
+
Имя: ${data.name}\n
|
313 |
+
WhatsApp: ${data.phone}\n
|
314 |
+
Реплики: ${data.b_mess}
|
315 |
+
`;
|
316 |
+
notyf.open({
|
317 |
+
type: 'info',
|
318 |
+
message: message,
|
319 |
+
});
|
320 |
+
}},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
{title:"Куратор", field:"curator", formatter: linkFormatter},
|
322 |
{title:"Статус покупки", field:"shop_st", formatter: function(cell, formatterParams, onRendered) {
|
323 |
var status = cell.getValue();
|
|
|
337 |
}
|
338 |
return `<div style="width: 20px; height: 20px; background-color: ${color};"></div>`;
|
339 |
}},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
{title:"Вебинары-присутствовал", field:"web_st", formatter:"star", formatterParams:{stars:7}, hozAlign:"center", width:90},
|
341 |
{title:"Вебинары-досмотрел до конца", field:"b_fin", formatter:function(cell, formatterParams, onRendered){
|
342 |
var value = cell.getValue();
|
343 |
+
var icon;
|
344 |
if (value === 'True') {
|
345 |
+
icon = ' <img src="https://i.ibb.co/9sqNhYz/4-2.png" width="98" height="14" />';
|
346 |
} else {
|
347 |
+
icon = '';
|
348 |
}
|
349 |
+
return icon;
|
350 |
+
}},
|
|
|
351 |
{title:"Прогрес по воронке", field:"fin_prog", formatter:"progress", formatterParams:{color:["#ff0000", "orange", "#00dd00"]}, sorter:"number", width:100},
|
352 |
+
{title:"Бонусы", field:"pr1"},
|
353 |
+
{title:"Опросы", field:"pr2", cellClick:function(e, cell){
|
354 |
+
var data = cell.getData();
|
355 |
+
const notyf = new Notyf({
|
356 |
+
duration: 5000,
|
357 |
+
position: {
|
358 |
+
x: 'right',
|
359 |
+
y: 'top',
|
360 |
+
},
|
361 |
+
types: [
|
362 |
+
{
|
363 |
+
duration: 10000,
|
364 |
+
message: 'Опросы: ' + data.pr2,
|
365 |
+
}
|
366 |
+
]
|
367 |
+
});
|
368 |
+
notyf.open({
|
369 |
+
type: 'warning',
|
370 |
+
message: 'Опросы: ' + data.pr2
|
371 |
+
});
|
372 |
+
}},
|
373 |
+
{title:"Доступы", field:"pr3"},
|
374 |
+
{title:"Канал трафика", field:"canal"},
|
375 |
{title:"Ключ PR", field:"key_pr"},
|
376 |
+
{title:"utm_source", field:"utm_source"},
|
377 |
+
{title:"utm_medium", field:"utm_medium"},
|
378 |
+
{title:"utm_campaign", field:"utm_campaign"},
|
379 |
+
{title:"utm_term", field:"utm_term"},
|
380 |
+
{title:"utm_content", field:"utm_content"},
|
381 |
+
{title:"Дата - Последнее действие", field:"data_on"},
|
382 |
+
{title:"Дата - Вход", field:"data_t"},
|
383 |
],
|
384 |
});
|
|
|
385 |
var fieldEl = document.getElementById("filter-field");
|
386 |
var typeEl = document.getElementById("filter-type");
|
387 |
var valueEl = document.getElementById("filter-value");
|
|
|
|
|
388 |
function updateFilter() {
|
389 |
+
var filterVal = fieldEl.value;
|
390 |
+
var typeVal = typeEl.value;
|
391 |
+
var valueVal = valueEl.value;
|
392 |
+
if (filterVal) {
|
393 |
+
table.setFilter(filterVal, typeVal, valueVal);
|
|
|
|
|
|
|
|
|
|
|
394 |
}
|
395 |
}
|
396 |
+
fieldEl.addEventListener("change", updateFilter);
|
397 |
+
typeEl.addEventListener("change", updateFilter);
|
398 |
+
valueEl.addEventListener("keyup", updateFilter);
|
399 |
+
document.getElementById('filter-clear').addEventListener('click', function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
fieldEl.value = "";
|
401 |
typeEl.value = "=";
|
402 |
valueEl.value = "";
|
|
|
|
|
403 |
table.clearFilter();
|
404 |
});
|
405 |
+
document.getElementById("download-json").addEventListener("click", function() {
|
406 |
+
table.download("json", "data.json");
|
407 |
+
});
|
408 |
+
document.getElementById("download-xlsx").addEventListener("click", function() {
|
409 |
+
table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
|
410 |
+
});
|
411 |
+
document.getElementById("download-rass").addEventListener("click", function() {
|
412 |
var tableData = table.getData("active");
|
413 |
var jsonData = JSON.stringify(tableData, null, 2);
|
414 |
console.log("Данные для рассылки:", jsonData);
|
415 |
+
});
|
416 |
+
document.getElementById("take-for-yourself").addEventListener("click", function() {
|
|
|
417 |
var tableData = table.getData("active");
|
418 |
var jsonData = JSON.stringify(tableData, null, 2);
|
419 |
console.log("Данные для себя:", jsonData);
|
420 |
+
});
|
|
|
|
|
421 |
})
|
422 |
.catch(error => console.error('Error fetching data:', error));
|
423 |
});
|