DmitrMakeev
commited on
Commit
•
02ce3ca
1
Parent(s):
41a6c80
Update data_gc_tab.html
Browse files- 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 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
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 |
-
|
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 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
var
|
270 |
-
var
|
271 |
-
var
|
272 |
-
var
|
273 |
-
var
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
} else
|
282 |
-
|
283 |
-
return link + `<img src="${
|
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 |
-
|
349 |
-
|
350 |
-
|
351 |
-
}
|
352 |
-
|
353 |
-
}
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
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 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
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>
|