DmitrMakeev commited on
Commit
02ce3ca
1 Parent(s): 41a6c80

Update data_gc_tab.html

Browse files
Files changed (1) hide show
  1. data_gc_tab.html +217 -309
data_gc_tab.html CHANGED
@@ -32,141 +32,56 @@
32
 
33
 
34
  <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
 
35
  <style>
36
- body {
37
- font-family: Arial, sans-serif;
38
- text-align: center;
39
- background-color: #f0f0f0;
40
- margin: 0;
41
- padding: 0;
42
- }
43
-
44
- h1 {
45
- background-color: #4CAF50;
46
- color: white;
47
- padding: 20px;
48
- margin: 0;
49
- border-bottom: 2px solid #388E3C;
50
- font-size: 28px;
51
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
52
- }
53
-
54
- button, #filter-clear, #download-json, #take-for-yourself {
55
- color: white;
56
- background-color: #4CAF50;
57
- border: none;
58
- cursor: pointer;
59
- padding: 10px 20px;
60
- font-size: 16px;
61
- border-radius: 5px;
62
- margin: 5px;
63
- transition: background-color 0.3s ease;
64
- }
65
-
66
- button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hover {
67
- background-color: #388E3C;
68
- }
69
-
70
- #filter-field, #filter-type, #filter-value, #filter-field2, #filter-value2 {
71
- padding: 10px;
72
- font-size: 16px;
73
- margin: 5px;
74
- border-radius: 5px;
75
- border: 1px solid #ccc;
76
- background-color: #f0f0f0;
77
- transition: border-color 0.3s ease, box-shadow 0.3s ease;
78
- }
79
-
80
- #filter-field:focus, #filter-type:focus, #filter-value:focus, #filter-field2:focus, #filter-value2:focus {
81
- border-color: #4CAF50;
82
- box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
83
- }
84
-
85
- #filter-field option, #filter-type option, #filter-field2 option {
86
- background-color: #f0f0f0;
87
- color: #333;
88
- }
89
-
90
- #filter-field:hover, #filter-type:hover, #filter-value:hover, #filter-field2:hover, #filter-value2:hover {
91
- border-color: #4CAF50;
92
- }
93
-
94
- #mediaContainer {
95
- margin-top: 20px;
96
- display: flex;
97
- justify-content: center;
98
- align-items: center;
99
- flex-direction: column;
100
- max-width: 100%;
101
- height: auto;
102
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
103
- border-radius: 10px;
104
- padding: 20px;
105
- background-color: white;
106
- }
107
-
108
- #mediaContainer img, #mediaContainer video {
109
- max-width: 100%;
110
- height: auto;
111
- object-fit: contain;
112
- border-radius: 10px;
113
- }
114
-
115
- #imageUrl {
116
- margin-top: 20px;
117
- font-size: 16px;
118
- color: #333;
119
- cursor: pointer;
120
- text-decoration: underline;
121
- transition: color 0.3s ease;
122
- }
123
-
124
- #imageUrl:hover {
125
- color: #4CAF50;
126
- }
127
-
128
- #progressBarContainer {
129
- width: 80%;
130
- margin: 20px auto;
131
- background-color: #ddd;
132
- border-radius: 13px;
133
- padding: 3px;
134
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
135
- }
136
-
137
- #progressBar {
138
- width: 0%;
139
- height: 20px;
140
- background-color: #4CAF50;
141
- border-radius: 10px;
142
- text-align: center;
143
- line-height: 20px;
144
- color: white;
145
- transition: width 0.3s ease;
146
- }
147
-
148
- .swal-button-custom {
149
- background-color: #4CAF50;
150
- font-size: 16px;
151
- padding: 10px 20px;
152
- }
153
-
154
- .swal-title-custom {
155
- font-size: 24px;
156
- color: #333;
157
- }
158
-
159
- .swal-content-custom {
160
- font-size: 16px;
161
- color: #666;
162
- }
163
-
164
- </style>
165
  </head>
166
-
167
  <body>
168
  <div id="header">
169
- <h1>WhatsCRM - Автопилот + Tilda + Бизон 365 + GetCurse</h1>
170
  </div>
171
  <div>
172
  <select id="filter-field">
@@ -240,188 +155,181 @@ button:hover, #filter-clear:hover, #download-json:hover, #take-for-yourself:hove
240
  </div>
241
  <div id="example-table"></div>
242
 
243
- <script>
244
- vkBridge.send('VKWebAppInit');
245
- document.addEventListener('DOMContentLoaded', function() {
246
- fetch('https://irdelsol-psy.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;
255
- return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
256
- };
257
- var table = new Tabulator("#example-table", {
258
- data: data, // set table data
259
- layout: "fitColumns", // fit columns to width of table
260
- pagination: "local", // enable local pagination
261
- paginationSize: 50, // number of rows per page
262
- selectable: true, // enable row selection
263
- columns: [
264
- {title:"Номер в списке", field:"id"},
265
- {title:"Имя", field:"name", width:100},
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://i.ibb.co/YBvwFR6/whatsapp-2.png"; // Замените на URL первой картинки
273
- var imageUrl2 = "https://i.ibb.co/LZx71cM/1.png"; // Замените на URL второй картинки
274
- var imageUrl3 = "https://i.ibb.co/Cvn3QsK/whatsapp-3.png"; // Замените на URL второй картинки
275
- var link = `<a href="https://web.whatsapp.com/send?phone=${phone}" target="_blank">`;
276
- // Проверка условий
277
- if (ws_stop !== "1" && ws_st === "1") {
278
- console.log("Первая переменная не равна единице, вторая равна единице");
279
- return link + `<img src="${imageUrl2}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
280
-
281
- } else if (ws_stop === "1" && ws_st === "1") {
282
- console.log("Обе переменные равны единице");
283
- return link + `<img src="${imageUrl3}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
284
-
285
- } else {
286
- console.log("Остальные случаи");
287
- return link + `<img src="${imageUrl1}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
288
- }
289
- }},
290
-
291
-
292
- {title:"Город", field:"b_city", width:95},
293
- {title:"Email", field:"email", width:95},
294
- {title:"Реплики", field:"b_mess", width:95, cellClick:function(e, cell){
295
- var data = cell.getData();
296
- Swal.fire({
297
- title: 'Детали пользователя',
298
- html: `
299
- <strong>Имя:</strong> ${data.name}<br>
300
- <strong>WhatsApp:</strong> <a href="https://web.whatsapp.com/send?phone=${data.phone}" target="_blank">${data.phone}</a><br>
301
- <strong>Реплики:</strong> ${data.b_mess}`,
302
- icon: 'success',
303
- confirmButtonText: 'Закрыть',
304
- confirmButtonColor: '#4CAF50',
305
- customClass: {
306
- confirmButton: 'button is-success',
307
- title: 'title-custom',
308
- content: 'content-custom'}});}},
309
-
310
- {title:"Куратор", field:"curator", formatter: linkFormatter},
311
- {title:"Статус покупки", field:"shop_st", formatter: function(cell, formatterParams, onRendered) {
312
- var status = cell.getValue();
313
- var color;
314
- switch (status) {
315
- case 'green':
316
- color = 'green';
317
- break;
318
- case 'red':
319
- color = 'red';
320
- break;
321
- case 'yellow':
322
- color = 'yellow';
323
- break;
324
- default:
325
- color = 'gray';
326
- }
327
- return `<div style="width: 20px; height: 20px; background-color: ${color};"></div>`;
328
- }},
329
- {title:"Ссылка на пользователя в GC", field:"ad_url", formatter: function(cell, formatterParams, onRendered) {
330
- var ad_url = cell.getValue();
331
- return `<a href="${ad_url}" target="_blank">${ad_url}</a>`;
332
- }},
333
- {title:"Ссылка на VK", field:"vk_id", formatter: function(cell, formatterParams, onRendered) {
334
- var vk_id = cell.getValue();
335
- return `<a href="https://vk.com/id${vk_id}" target="_blank">${vk_id}</a>`;
336
- }},
337
- {title:"Ссылка на Tg", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
338
- var chatId = cell.getValue();
339
- if (chatId.startsWith('@')) {
340
- chatId = chatId.substring(1); // Удаление символа @ в начале
341
- }
342
- return `<a href="https://t.me/${chatId}" target="_blank">${chatId}</a>`;
343
- }},
344
-
345
- {title:"Вебинары-присутствовал", field:"web_st", formatter:"star", formatterParams:{stars:7}, hozAlign:"center", width:70},
346
- {title:"Вебинары-досмотрел до конца", field:"b_fin", formatter:function(cell, formatterParams, onRendered){
347
- var value = cell.getValue();
348
- var icon;
349
- if (value === 'True') {
350
- icon = ' <img src="https://i.ibb.co/9sqNhYz/4-2.png" width="98" height="14" />'; // Иконка для активного статуса
351
- } else {
352
- icon = ''; // Пустая строка для неактивного статуса или если значение не определено
353
- }
354
- return icon;
355
- }},
356
-
357
- {title:"Прогрес по воронке", field:"fin_prog", formatter:"progress", formatterParams:{color:["#ff0000", "orange", "#00dd00"]}, sorter:"number", width:100},
358
- {title:"pr1", field:"pr1"},
359
- {title:"pr2", field:"pr2"},
360
- {title:"pr3", field:"pr3"},
361
- {title:"Канал трафика", field:"pr4"},
362
- {title:"Дата", field:"pr5"},
363
- {title:"Ключ PR", field:"key_pr"},
364
- {title:"Канал", field:"canal"},
365
- {title:"Дата", field:"data_t", width:150}
366
- ],
367
- });
368
-
369
-
370
- var fieldEl = document.getElementById("filter-field");
371
- var typeEl = document.getElementById("filter-type");
372
- var valueEl = document.getElementById("filter-value");
373
- var fieldEl2 = document.getElementById("filter-field2");
374
- var valueEl2 = document.getElementById("filter-value2");
375
-
376
- function updateFilter() {
377
- var filterVal1 = fieldEl.value;
378
- var typeVal1 = typeEl.value;
379
- var valueVal1 = valueEl.value;
380
-
381
- var filterVal2 = fieldEl2.value;
382
- var valueVal2 = valueEl2.value;
383
-
384
- if (filterVal1 && filterVal2) {
385
- table.setFilter([
386
- { field: filterVal1, type: typeVal1, value: valueVal1 },
387
- { field: filterVal2, type: "=", value: valueVal2 }
388
- ]);
389
  }
390
- }
391
-
392
- document.getElementById("filter-field").addEventListener("change", updateFilter);
393
- document.getElementById("filter-type").addEventListener("change", updateFilter);
394
- document.getElementById("filter-value").addEventListener("keyup", updateFilter);
395
- document.getElementById("filter-field2").addEventListener("change", updateFilter);
396
- document.getElementById("filter-value2").addEventListener("keyup", updateFilter);
397
 
398
- document.getElementById("filter-clear").addEventListener("click", function() {
399
- fieldEl.value = "";
400
- typeEl.value = "=";
401
- valueEl.value = "";
402
- fieldEl2.value = "";
403
- valueEl2.value = "";
404
- table.clearFilter();
405
- });
406
-
407
- function handleDownloadJson() {
408
- var tableData = table.getData("active");
409
- var jsonData = JSON.stringify(tableData, null, 2);
410
- console.log("Данные для рассылки:", jsonData);
411
- }
 
 
 
 
 
 
412
 
413
- function handleTakeForYourself() {
414
- var tableData = table.getData("active");
415
- var jsonData = JSON.stringify(tableData, null, 2);
416
- console.log("Данные для себя:", jsonData);
417
- }
418
 
419
- document.getElementById("download-json").addEventListener("click", handleDownloadJson);
420
- document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
421
- })
422
- .catch(error => console.error('Error fetching data:', error));
423
- });
424
- </script>
425
  </body>
426
 
427
  </html>
 
32
 
33
 
34
  <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
35
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
36
  <style>
37
+ body {
38
+ font-family: Arial, sans-serif;
39
+ text-align: center;
40
+ background-color: #f0f0f0;
41
+ margin: 0;
42
+ padding: 0;
43
+ }
44
+ #header {
45
+ background-color: #4CAF50;
46
+ color: white;
47
+ padding: 20px;
48
+ margin: 0;
49
+ border-bottom: 2px solid #388E3C;
50
+ font-size: 28px;
51
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
52
+ }
53
+ select, input {
54
+ width: 100%;
55
+ padding: 12px;
56
+ font-size: 16px;
57
+ border: 1px solid #ccc;
58
+ border-radius: 5px;
59
+ box-sizing: border-box;
60
+ margin-bottom: 20px;
61
+ }
62
+ button {
63
+ color: white;
64
+ background-color: #4CAF50;
65
+ border: none;
66
+ cursor: pointer;
67
+ padding: 12px 24px;
68
+ font-size: 16px;
69
+ border-radius: 5px;
70
+ transition: background-color 0.3s ease;
71
+ margin: 10px;
72
+ }
73
+ button:hover {
74
+ background-color: #388E3C;
75
+ }
76
+ #example-table {
77
+ margin-top: 20px;
78
+ margin-bottom: 20px;
79
+ }
80
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  </head>
 
82
  <body>
83
  <div id="header">
84
+ WhatsCRM - Автопилот + Tilda + Бизон 365 + GetCurse
85
  </div>
86
  <div>
87
  <select id="filter-field">
 
155
  </div>
156
  <div id="example-table"></div>
157
 
158
+ <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
159
+ <script>
160
+ document.addEventListener('DOMContentLoaded', function() {
161
+ fetch('https://irdelsol-psy.hf.space/data_gc_tab_out?api_sys=fasSd345D')
162
+ .then(response => response.json())
163
+ .then(data => {
164
+ console.log('Data received:', data); // Логирование данных
165
+ // Переворачиваем массив данных
166
+ data.reverse();
167
+ var linkFormatter = function(cell, formatterParams, onRendered) {
168
+ var curator = cell.getValue();
169
+ var curatorLink = cell.getData().curator_link;
170
+ return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
171
+ };
172
+ var table = new Tabulator("#example-table", {
173
+ data: data, // set table data
174
+ layout: "fitColumns", // fit columns to width of table
175
+ pagination: "local", // enable local pagination
176
+ paginationSize: 50, // number of rows per page
177
+ selectable: true, // enable row selection
178
+ columns: [
179
+ {title:"Номер в списке", field:"id"},
180
+ {title:"Имя", field:"name", width:100},
181
+ {title:"WhatsApp", field:"phone", formatter: function(cell, formatterParams, onRendered) {
182
+ var phone = cell.getValue();
183
+ var ws_stop = cell.getData().ws_stop;
184
+ var ws_st = cell.getData().ws_st;
185
+ var imageUrl1 = "https://i.ibb.co/YBvwFR6/whatsapp-2.png"; // Замените на URL первой картинки
186
+ var imageUrl2 = "https://i.ibb.co/LZx71cM/1.png"; // Замените на URL второй картинки
187
+ var imageUrl3 = "https://i.ibb.co/Cvn3QsK/whatsapp-3.png"; // Замените на URL второй картинки
188
+ var link = `<a href="https://web.whatsapp.com/send?phone=${phone}" target="_blank">`;
189
+ // Проверка условий
190
+ if (ws_stop !== "1" && ws_st === "1") {
191
+ console.log("Первая переменная не равна единице, вторая равна единице");
192
+ return link + `<img src="${imageUrl2}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
193
+ } else if (ws_stop === "1" && ws_st === "1") {
194
+ console.log("Обе переменные равны единице");
195
+ return link + `<img src="${imageUrl3}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
196
+ } else {
197
+ console.log("Остальные случаи");
198
+ return link + `<img src="${imageUrl1}" alt="WhatsApp" style="width: 98px; height: 14px;">`;
199
+ }
200
+ }},
201
+ {title:"Город", field:"b_city", width:95},
202
+ {title:"Email", field:"email", width:95},
203
+ {title:"Реплики", field:"b_mess", width:95, cellClick:function(e, cell){
204
+ var data = cell.getData();
205
+ Swal.fire({
206
+ title: 'Детали пользователя',
207
+ html: `
208
+ <strong>Имя:</strong> ${data.name}<br>
209
+ <strong>WhatsApp:</strong> <a href="https://web.whatsapp.com/send?phone=${data.phone}" target="_blank">${data.phone}</a><br>
210
+ <strong>Реплики:</strong> ${data.b_mess}`,
211
+ icon: 'info',
212
+ confirmButtonText: 'Закрыть',
213
+ confirmButtonColor: '#4CAF50',
214
+ customClass: {
215
+ confirmButton: 'button is-success',
216
+ title: 'title-custom',
217
+ content: 'content-custom'
218
+ }
219
+ });
220
+ }},
221
+ {title:"Куратор", field:"curator", formatter: linkFormatter},
222
+ {title:"Статус покупки", field:"shop_st", formatter: function(cell, formatterParams, onRendered) {
223
+ var status = cell.getValue();
224
+ var color;
225
+ switch (status) {
226
+ case 'green':
227
+ color = 'green';
228
+ break;
229
+ case 'red':
230
+ color = 'red';
231
+ break;
232
+ case 'yellow':
233
+ color = 'yellow';
234
+ break;
235
+ default:
236
+ color = 'gray';
237
+ }
238
+ return `<div style="width: 20px; height: 20px; background-color: ${color};"></div>`;
239
+ }},
240
+ {title:"Ссылка на пользователя в GC", field:"ad_url", formatter: function(cell, formatterParams, onRendered) {
241
+ var ad_url = cell.getValue();
242
+ return `<a href="${ad_url}" target="_blank">${ad_url}</a>`;
243
+ }},
244
+ {title:"Ссылка на VK", field:"vk_id", formatter: function(cell, formatterParams, onRendered) {
245
+ var vk_id = cell.getValue();
246
+ return `<a href="https://vk.com/id${vk_id}" target="_blank">${vk_id}</a>`;
247
+ }},
248
+ {title:"Ссылка на Tg", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
249
+ var chatId = cell.getValue();
250
+ if (chatId.startsWith('@')) {
251
+ chatId = chatId.substring(1); // Удаление символа @ в начале
252
+ }
253
+ return `<a href="https://t.me/${chatId}" target="_blank">${chatId}</a>`;
254
+ }},
255
+ {title:"Вебинары-присутствовал", field:"web_st", formatter:"star", formatterParams:{stars:7}, hozAlign:"center", width:70},
256
+ {title:"Вебинары-досмотрел до конца", field:"b_fin", formatter:function(cell, formatterParams, onRendered){
257
+ var value = cell.getValue();
258
+ var icon;
259
+ if (value === 'True') {
260
+ icon = ' <img src="https://i.ibb.co/9sqNhYz/4-2.png" width="98" height="14" />'; // Иконка для активного статуса
261
+ } else {
262
+ icon = ''; // Пустая строка для неактивного статуса или если значение не определено
263
+ }
264
+ return icon;
265
+ }},
266
+ {title:"Прогрес по воронке", field:"fin_prog", formatter:"progress", formatterParams:{color:["#ff0000", "orange", "#00dd00"]}, sorter:"number", width:100},
267
+ {title:"pr1", field:"pr1"},
268
+ {title:"pr2", field:"pr2"},
269
+ {title:"pr3", field:"pr3"},
270
+ {title:"Канал трафика", field:"pr4"},
271
+ {title:"Дата", field:"pr5"},
272
+ {title:"Ключ PR", field:"key_pr"},
273
+ {title:"Канал", field:"canal"},
274
+ {title:"Дата", field:"data_t", width:150}
275
+ ],
276
+ });
277
+
278
+ var fieldEl = document.getElementById("filter-field");
279
+ var typeEl = document.getElementById("filter-type");
280
+ var valueEl = document.getElementById("filter-value");
281
+ var fieldEl2 = document.getElementById("filter-field2");
282
+ var valueEl2 = document.getElementById("filter-value2");
283
+
284
+ function updateFilter() {
285
+ var filterVal1 = fieldEl.value;
286
+ var typeVal1 = typeEl.value;
287
+ var valueVal1 = valueEl.value;
288
+
289
+ var filterVal2 = fieldEl2.value;
290
+ var valueVal2 = valueEl2.value;
291
+
292
+ if (filterVal1 && filterVal2) {
293
+ table.setFilter([
294
+ { field: filterVal1, type: typeVal1, value: valueVal1 },
295
+ { field: filterVal2, type: "=", value: valueVal2 }
296
+ ]);
297
+ }
 
 
 
 
 
 
298
  }
 
 
 
 
 
 
 
299
 
300
+ document.getElementById("filter-field").addEventListener("change", updateFilter);
301
+ document.getElementById("filter-type").addEventListener("change", updateFilter);
302
+ document.getElementById("filter-value").addEventListener("keyup", updateFilter);
303
+ document.getElementById("filter-field2").addEventListener("change", updateFilter);
304
+ document.getElementById("filter-value2").addEventListener("keyup", updateFilter);
305
+
306
+ document.getElementById("filter-clear").addEventListener("click", function() {
307
+ fieldEl.value = "";
308
+ typeEl.value = "=";
309
+ valueEl.value = "";
310
+ fieldEl2.value = "";
311
+ valueEl2.value = "";
312
+ table.clearFilter();
313
+ });
314
+
315
+ function handleDownloadJson() {
316
+ var tableData = table.getData("active");
317
+ var jsonData = JSON.stringify(tableData, null, 2);
318
+ console.log("Данные для рассылки:", jsonData);
319
+ }
320
 
321
+ function handleTakeForYourself() {
322
+ var tableData = table.getData("active");
323
+ var jsonData = JSON.stringify(tableData, null, 2);
324
+ console.log("Данные для себя:", jsonData);
325
+ }
326
 
327
+ document.getElementById("download-json").addEventListener("click", handleDownloadJson);
328
+ document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
329
+ })
330
+ .catch(error => console.error('Error fetching data:', error));
331
+ });
332
+ </script>
333
  </body>
334
 
335
  </html>