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