DmitrMakeev
commited on
Commit
•
d30ce5e
1
Parent(s):
5a5bd38
Update data_gc_tab.html
Browse files- data_gc_tab.html +224 -230
data_gc_tab.html
CHANGED
@@ -15,6 +15,8 @@
|
|
15 |
|
16 |
|
17 |
|
|
|
|
|
18 |
|
19 |
|
20 |
|
@@ -29,184 +31,138 @@
|
|
29 |
|
30 |
|
31 |
|
32 |
-
|
33 |
-
<
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
margin: 0;
|
45 |
-
padding: 0;
|
46 |
-
}
|
47 |
-
h1 {
|
48 |
-
background-color: #4CAF50;
|
49 |
-
color: white;
|
50 |
-
padding: 20px;
|
51 |
-
margin: 0;
|
52 |
-
border-bottom: 2px solid #388E3C;
|
53 |
-
font-size: 28px;
|
54 |
-
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
55 |
-
}
|
56 |
-
button[type="submit"] {
|
57 |
-
color: white;
|
58 |
-
background-color: #4CAF50;
|
59 |
-
border: none;
|
60 |
-
cursor: pointer;
|
61 |
-
padding: 10px 20px;
|
62 |
-
font-size: 16px;
|
63 |
-
border-radius: 5px;
|
64 |
-
margin-top: 20px;
|
65 |
-
transition: background-color 0.3s ease;
|
66 |
-
}
|
67 |
-
button[type="submit"]:hover {
|
68 |
-
background-color: #388E3C;
|
69 |
-
}
|
70 |
-
#mediaContainer {
|
71 |
-
margin-top: 20px;
|
72 |
-
display: flex;
|
73 |
-
justify-content: center;
|
74 |
-
align-items: center;
|
75 |
-
flex-direction: column;
|
76 |
-
max-width: 100%;
|
77 |
-
height: auto;
|
78 |
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
79 |
-
border-radius: 10px;
|
80 |
-
padding: 20px;
|
81 |
-
background-color: white;
|
82 |
-
}
|
83 |
-
#mediaContainer img, #mediaContainer video {
|
84 |
-
max-width: 100%;
|
85 |
-
height: auto;
|
86 |
-
object-fit: contain;
|
87 |
-
border-radius: 10px;
|
88 |
-
}
|
89 |
-
#imageUrl {
|
90 |
-
margin-top: 20px;
|
91 |
-
font-size: 16px;
|
92 |
-
color: #333;
|
93 |
-
cursor: pointer;
|
94 |
-
text-decoration: underline;
|
95 |
-
transition: color 0.3s ease;
|
96 |
-
}
|
97 |
-
#imageUrl:hover {
|
98 |
-
color: #4CAF50;
|
99 |
-
}
|
100 |
-
#progressBarContainer {
|
101 |
-
width: 80%;
|
102 |
-
margin: 20px auto;
|
103 |
-
background-color: #ddd;
|
104 |
-
border-radius: 13px;
|
105 |
-
padding: 3px;
|
106 |
-
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
|
107 |
-
}
|
108 |
-
#progressBar {
|
109 |
-
width: 0%;
|
110 |
-
height: 20px;
|
111 |
-
background-color: #4CAF50;
|
112 |
-
border-radius: 10px;
|
113 |
-
text-align: center;
|
114 |
-
line-height: 20px;
|
115 |
-
color: white;
|
116 |
-
transition: width 0.3s ease;
|
117 |
-
}
|
118 |
-
#filter-field, #filter-type, #filter-value, #filter-clear , #download-json{
|
119 |
-
padding: 10px;
|
120 |
-
font-size: 16px;
|
121 |
-
margin: 5px;
|
122 |
-
}
|
123 |
-
#filter-value {
|
124 |
-
width: 200px;
|
125 |
-
}
|
126 |
-
#filter-clear {
|
127 |
-
padding: 10px 20px;
|
128 |
-
}
|
129 |
-
#filter-field, #filter-type, #filter-value, #filter-clear, #download-json {
|
130 |
-
padding: 10px;
|
131 |
-
font-size: 16px;
|
132 |
-
margin: 5px;
|
133 |
-
border-radius: 5px;
|
134 |
-
border: 1px solid #ccc;
|
135 |
-
}
|
136 |
-
#filter-value {
|
137 |
-
width: 200px;
|
138 |
-
background-color: #f0f0f0;
|
139 |
-
}
|
140 |
-
#filter-clear {
|
141 |
-
padding: 10px 20px;
|
142 |
-
background-color: #4CAF50;
|
143 |
-
color: white;
|
144 |
-
border: none;
|
145 |
-
cursor: pointer;
|
146 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
147 |
-
transition: background-color 0.3s ease;
|
148 |
-
}
|
149 |
-
#filter-clear:hover {
|
150 |
-
background-color: #388E3C;
|
151 |
-
}
|
152 |
-
#download-json {
|
153 |
-
padding: 10px 20px;
|
154 |
-
background-color: #4CAF50;
|
155 |
-
color: white;
|
156 |
-
border: none;
|
157 |
-
cursor: pointer;
|
158 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
159 |
-
transition: background-color 0.3s ease;
|
160 |
-
}
|
161 |
-
#download-json:hover {
|
162 |
-
background-color: #388E3C;
|
163 |
-
}
|
164 |
-
#take-for-yourself {
|
165 |
padding: 10px 20px;
|
166 |
font-size: 16px;
|
167 |
-
margin: 5px;
|
168 |
border-radius: 5px;
|
169 |
-
|
170 |
-
background-color: #4CAF50;
|
171 |
-
color: white;
|
172 |
-
cursor: pointer;
|
173 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
174 |
transition: background-color 0.3s ease;
|
175 |
}
|
176 |
-
|
|
|
177 |
background-color: #388E3C;
|
178 |
-
}
|
179 |
-
</style>
|
180 |
-
|
181 |
-
<style>
|
182 |
-
.swal-button-custom {
|
183 |
-
background-color: #4CAF50;
|
184 |
-
font-size: 16px;
|
185 |
-
padding: 10px 20px;
|
186 |
-
}
|
187 |
-
.swal-title-custom {
|
188 |
-
font-size: 24px;
|
189 |
-
color: #333;
|
190 |
-
}
|
191 |
-
.swal-content-custom {
|
192 |
-
font-size: 16px;
|
193 |
-
color: #666;
|
194 |
-
}
|
195 |
-
</style>
|
196 |
-
</head>
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
|
|
|
|
|
|
|
|
|
199 |
|
|
|
|
|
|
|
|
|
200 |
|
|
|
|
|
|
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
|
|
|
|
|
|
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
|
|
|
|
|
|
|
|
|
|
|
208 |
|
|
|
|
|
|
|
|
|
209 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
<body>
|
212 |
<div id="header">
|
@@ -250,6 +206,33 @@
|
|
250 |
|
251 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
<button id="filter-clear">Очистить фильтр</button>
|
254 |
|
255 |
<button id="download-json">Рассылка по выбранным</button>
|
@@ -257,12 +240,8 @@
|
|
257 |
</div>
|
258 |
<div id="example-table"></div>
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
<script>
|
265 |
-
|
266 |
document.addEventListener('DOMContentLoaded', function() {
|
267 |
fetch('https://irdelsol-psy.hf.space/data_gc_tab_out?api_sys=fasSd345D')
|
268 |
.then(response => response.json())
|
@@ -284,31 +263,50 @@
|
|
284 |
columns: [
|
285 |
{title:"Номер в списке", field:"id"},
|
286 |
{title:"Имя", field:"name", width:100},
|
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 |
{title:"Куратор", field:"curator", formatter: linkFormatter},
|
313 |
{title:"Статус покупки", field:"shop_st", formatter: function(cell, formatterParams, onRendered) {
|
314 |
var status = cell.getValue();
|
@@ -343,21 +341,20 @@
|
|
343 |
}
|
344 |
return `<a href="https://t.me/${chatId}" target="_blank">${chatId}</a>`;
|
345 |
}},
|
346 |
-
|
347 |
-
{title:"
|
348 |
-
{title:"
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
}, width:100},
|
359 |
|
360 |
-
{title:"Прогрес по воронке", field:"fin_prog", formatter:"progress", formatterParams:{color:["#
|
361 |
{title:"pr1", field:"pr1"},
|
362 |
{title:"pr2", field:"pr2"},
|
363 |
{title:"pr3", field:"pr3"},
|
@@ -368,66 +365,63 @@
|
|
368 |
{title:"Дата", field:"data_t", width:150}
|
369 |
],
|
370 |
});
|
|
|
|
|
371 |
var fieldEl = document.getElementById("filter-field");
|
372 |
var typeEl = document.getElementById("filter-type");
|
373 |
var valueEl = document.getElementById("filter-value");
|
|
|
|
|
|
|
374 |
function updateFilter() {
|
375 |
-
var
|
376 |
-
var
|
377 |
-
|
378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
}
|
380 |
}
|
|
|
381 |
document.getElementById("filter-field").addEventListener("change", updateFilter);
|
382 |
document.getElementById("filter-type").addEventListener("change", updateFilter);
|
383 |
document.getElementById("filter-value").addEventListener("keyup", updateFilter);
|
|
|
|
|
|
|
384 |
document.getElementById("filter-clear").addEventListener("click", function() {
|
385 |
fieldEl.value = "";
|
386 |
typeEl.value = "=";
|
387 |
valueEl.value = "";
|
|
|
|
|
388 |
table.clearFilter();
|
389 |
});
|
|
|
390 |
function handleDownloadJson() {
|
391 |
var tableData = table.getData("active");
|
392 |
var jsonData = JSON.stringify(tableData, null, 2);
|
393 |
console.log("Данные для рассылки:", jsonData);
|
394 |
}
|
|
|
395 |
function handleTakeForYourself() {
|
396 |
var tableData = table.getData("active");
|
397 |
var jsonData = JSON.stringify(tableData, null, 2);
|
398 |
console.log("Данные для себя:", jsonData);
|
399 |
}
|
|
|
400 |
document.getElementById("download-json").addEventListener("click", handleDownloadJson);
|
401 |
document.getElementById("take-for-yourself").addEventListener("click", handleTakeForYourself);
|
402 |
})
|
403 |
.catch(error => console.error('Error fetching data:', error));
|
404 |
});
|
405 |
</script>
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
</body>
|
411 |
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
</html>
|
|
|
15 |
|
16 |
|
17 |
|
18 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
19 |
+
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
20 |
|
21 |
|
22 |
|
|
|
31 |
|
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">
|
|
|
206 |
|
207 |
<input id="filter-value" type="text" placeholder="Значение фильтра">
|
208 |
|
209 |
+
<select id="filter-field2">
|
210 |
+
<option></option>
|
211 |
+
<option value="id">Номер в списке</option>
|
212 |
+
<option value="name">Имя</option>
|
213 |
+
<option value="phone">WhatsApp</option>
|
214 |
+
<option value="email">Email</option>
|
215 |
+
<option value="b_mess">Реплики</option>
|
216 |
+
<option value="curator">Куратор</option>
|
217 |
+
<option value="shop_st">Статус покупки</option>
|
218 |
+
<option value="ad_url">Ссылка на пользователя в GC</option>
|
219 |
+
<option value="vk_id">Ссылка на VK</option>
|
220 |
+
<option value="chat_id">Ссылка на Tg</option>
|
221 |
+
<option value="ws_stop">Стутус подписки</option>
|
222 |
+
<option value="web_st">Вебинары</option>
|
223 |
+
<option value="fin_prog">Прогрес по воронке</option>
|
224 |
+
<option value="pr1">pr1</option>
|
225 |
+
<option value="pr2">pr2</option>
|
226 |
+
<option value="pr3">pr3</option>
|
227 |
+
<option value="pr4">Канал трафика</option>
|
228 |
+
<option value="pr5">Дата</option>
|
229 |
+
<option value="key_pr">Ключ PR</option>
|
230 |
+
<option value="canal">Канал</option>
|
231 |
+
<option value="data_t">Дата</option>
|
232 |
+
</select>
|
233 |
+
|
234 |
+
<input id="filter-value2" type="text" placeholder="Значение фильтра 2">
|
235 |
+
|
236 |
<button id="filter-clear">Очистить фильтр</button>
|
237 |
|
238 |
<button id="download-json">Рассылка по выбранным</button>
|
|
|
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())
|
|
|
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();
|
|
|
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"},
|
|
|
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>
|