DmitrMakeev commited on
Commit
65ef902
1 Parent(s): f4ca1c9

Update data_gc_tab.html

Browse files
Files changed (1) hide show
  1. data_gc_tab.html +55 -6
data_gc_tab.html CHANGED
@@ -249,8 +249,9 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
249
  <input id="filter-value2" type="text" placeholder="Значение фильтра 2">
250
 
251
  <button id="filter-clear">Очистить фильтр</button>
252
- <button id="download-xlsx">Скачать в XLSX</button>
253
- <button id="download-json">Рассылка по выбранным</button>
 
254
  <button id="take-for-yourself">Взять себе</button> <!-- Добавлена вторая кнопка -->
255
  </div>
256
  <div id="example-table"></div>
@@ -258,7 +259,7 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
258
  <script>
259
  vkBridge.send('VKWebAppInit');
260
  document.addEventListener('DOMContentLoaded', function() {
261
- fetch('https://irdelsol-psy.hf.space/data_gc_tab_out?api_sys=fasSd345D')
262
  .then(response => response.json())
263
  .then(data => {
264
  console.log('Data received:', data); // Логирование данных
@@ -327,7 +328,30 @@ return link + `<img src="${imageUrl3}" alt="WhatsApp" style="width: 98px; height
327
 
328
 
329
 
330
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
 
333
 
@@ -446,6 +470,23 @@ return link + `<img src="${imageUrl3}" alt="WhatsApp" style="width: 98px; height
446
  document.getElementById("filter-value").addEventListener("keyup", updateFilter);
447
  document.getElementById("filter-field2").addEventListener("change", updateFilter);
448
  document.getElementById("filter-value2").addEventListener("keyup", updateFilter);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  //trigger download of data.xlsx file
450
  document.getElementById("download-xlsx").addEventListener("click", function(){
451
  table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
@@ -459,19 +500,27 @@ document.getElementById("download-xlsx").addEventListener("click", function(){
459
  table.clearFilter();
460
  });
461
 
462
- function handleDownloadJson() {
463
  var tableData = table.getData("active");
464
  var jsonData = JSON.stringify(tableData, null, 2);
465
  console.log("Данные для рассылки:", jsonData);
466
  }
467
 
 
 
 
 
 
 
 
 
468
  function handleTakeForYourself() {
469
  var tableData = table.getData("active");
470
  var jsonData = JSON.stringify(tableData, null, 2);
471
  console.log("Данные для себя:", jsonData);
472
  }
473
 
474
- document.getElementById("download-json").addEventListener("click", handleDownloadJson);
475
  document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
476
  })
477
  .catch(error => console.error('Error fetching data:', error));
 
249
  <input id="filter-value2" type="text" placeholder="Значение фильтра 2">
250
 
251
  <button id="filter-clear">Очистить фильтр</button>
252
+ <button id="download-xlsx">Скачать в XLSX</button>
253
+ <button id="download-json">Download JSON</button>
254
+ <button id="download-rass">Рассылка по выбранным</button>
255
  <button id="take-for-yourself">Взять себе</button> <!-- Добавлена вторая кнопка -->
256
  </div>
257
  <div id="example-table"></div>
 
259
  <script>
260
  vkBridge.send('VKWebAppInit');
261
  document.addEventListener('DOMContentLoaded', function() {
262
+ fetch('https://dmtuit-psy2.hf.space/data_gc_tab_out?api_sys=fasSd345D')
263
  .then(response => response.json())
264
  .then(data => {
265
  console.log('Data received:', data); // Логирование данных
 
328
 
329
 
330
 
331
+ {title:"Телеграм", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
332
+ var chat_id = cell.getValue();
333
+ var imageUrltg1 = "https://i.ibb.co/3S4Wt7m/3-2.png";
334
+ var imageUrlntg2 = "https://i.ibb.co/rZrzQhb/3-1.png";
335
+ var linktg1 = `<a href="https://t.me" target="_blank">`;
336
+ var linktg2 = `<a href="https://t.me/${chat_id}" target="_blank">`;
337
+ if (chat_id === "0" || chat_id === "") {
338
+ return linktg1 + `<img src="${imageUrltg1}" alt="Image" style="width: 98px; height: 14px;">`;
339
+ } else {
340
+ return linktg2 + `<img src="${imageUrlntg2}" alt="Image" style="width: 98px; height: 14px;">`;
341
+ }
342
+ }},
343
+ {title:"GetCurse", field:"gc_url", formatter: function(cell, formatterParams, onRendered) {
344
+ var gc_url = cell.getValue();
345
+ var imageUrlvkgc1 = "https://i.ibb.co/F8825KY/1-2.png";
346
+ var imageUrlvkgc2 = "https://i.ibb.co/S3qwFKM/1-1.png";
347
+ var linkgc1 = `<a href="https://vk.com/getcourseru" target="_blank">`;
348
+ var linkgc2 = `<a href="${gc_url}" target="_blank">`;
349
+ if (gc_url === "0" || gc_url === "") {
350
+ return linkgc1 + `<img src="${imageUrlvkgc1}" alt="Image" style="width: 98px; height: 14px;">`;
351
+ } else {
352
+ return linkgc2 + `<img src="${imageUrlvkgc2}" alt="Image" style="width: 98px; height: 14px;">`;
353
+ }
354
+ }},
355
 
356
 
357
 
 
470
  document.getElementById("filter-value").addEventListener("keyup", updateFilter);
471
  document.getElementById("filter-field2").addEventListener("change", updateFilter);
472
  document.getElementById("filter-value2").addEventListener("keyup", updateFilter);
473
+
474
+
475
+
476
+
477
+ //trigger download of data.json file
478
+ document.getElementById("download-json").addEventListener("click", function(){
479
+ table.download("json", "data.json");
480
+ });
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
  //trigger download of data.xlsx file
491
  document.getElementById("download-xlsx").addEventListener("click", function(){
492
  table.download("xlsx", "data.xlsx", {sheetName:"My Data"});
 
500
  table.clearFilter();
501
  });
502
 
503
+ function handleDownloadRass() {
504
  var tableData = table.getData("active");
505
  var jsonData = JSON.stringify(tableData, null, 2);
506
  console.log("Данные для рассылки:", jsonData);
507
  }
508
 
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
  function handleTakeForYourself() {
518
  var tableData = table.getData("active");
519
  var jsonData = JSON.stringify(tableData, null, 2);
520
  console.log("Данные для себя:", jsonData);
521
  }
522
 
523
+ document.getElementById("download-rass").addEventListener("click", handleDownloadRass);
524
  document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
525
  })
526
  .catch(error => console.error('Error fetching data:', error));