Update data_gc_tab.html
Browse files- data_gc_tab.html +113 -123
data_gc_tab.html
CHANGED
|
@@ -146,39 +146,39 @@
|
|
| 146 |
<h1>GetCurse - WhatsCRM</h1>
|
| 147 |
</div>
|
| 148 |
<div>
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
-
|
| 156 |
-
</div>
|
| 157 |
-
<select id="filter-field">
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
</select>
|
| 182 |
|
| 183 |
<select id="filter-type">
|
| 184 |
<option value="=">=</option>
|
|
@@ -210,68 +210,69 @@
|
|
| 210 |
var curatorLink = cell.getData().curator_link;
|
| 211 |
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
| 212 |
};
|
| 213 |
-
var table = new Tabulator("#example-table", {
|
| 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 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
|
|
|
| 275 |
// Define variables for input elements
|
| 276 |
var fieldEl = document.getElementById("filter-field");
|
| 277 |
var typeEl = document.getElementById("filter-type");
|
|
@@ -295,37 +296,26 @@ var table = new Tabulator("#example-table", {
|
|
| 295 |
valueEl.value = "";
|
| 296 |
table.clearFilter();
|
| 297 |
});
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
|
| 302 |
table.on("rowSelectionChanged", function(data, rows){
|
| 303 |
-
|
| 304 |
-
});
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
//deselect row on "deselect all" button click
|
| 322 |
-
document.getElementById("deselect-all").addEventListener("click", function(){
|
| 323 |
-
table.deselectRow();
|
| 324 |
-
});
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
|
| 330 |
// Переопределяем метод table.download
|
| 331 |
table.download = function(type, filename, options) {
|
|
|
|
| 146 |
<h1>GetCurse - WhatsCRM</h1>
|
| 147 |
</div>
|
| 148 |
<div>
|
| 149 |
+
<div>
|
| 150 |
+
<button id="select-row">Select "Oli Bob"</button>
|
| 151 |
+
<button id="deselect-row">Deselect "Oli Bob"</button>
|
| 152 |
+
<button id="select-all">Select All</button>
|
| 153 |
+
<button id="deselect-all">Deselect All</button>
|
| 154 |
|
| 155 |
+
<span id="select-stats"></span>
|
| 156 |
+
</div>
|
| 157 |
+
<select id="filter-field">
|
| 158 |
+
<option></option>
|
| 159 |
+
<option value="id">Номер в списке</option>
|
| 160 |
+
<option value="name">Имя</option>
|
| 161 |
+
<option value="phone">Телефон</option>
|
| 162 |
+
<option value="email">Email</option>
|
| 163 |
+
<option value="curator">Куратор</option>
|
| 164 |
+
<option value="shop_statys_full">Статус покупки</option>
|
| 165 |
+
<option value="ad_url">Ссылка на пользователя в GC</option>
|
| 166 |
+
<option value="vk_id">Ссылка на VK</option>
|
| 167 |
+
<option value="chat_id">Ссылка на Tg</option>
|
| 168 |
+
<option value="ws_statys">Статус WhatsApp</option>
|
| 169 |
+
<option value="ws_stop">Стутус подписки</option>
|
| 170 |
+
<option value="web_statys">Вебинары</option>
|
| 171 |
+
<option value="fin_progress">Прогрес по воронке</option>
|
| 172 |
+
<option value="pr1">pr1</option>
|
| 173 |
+
<option value="pr2">pr2</option>
|
| 174 |
+
<option value="pr3">pr3</option>
|
| 175 |
+
<option value="pr4">pr4</option>
|
| 176 |
+
<option value="pr5">pr5</option>
|
| 177 |
+
<option value="key_pr">Ключ предлож.</option>
|
| 178 |
+
<option value="canal">Канал</option>
|
| 179 |
+
<option value="data_t">Дата</option>
|
| 180 |
+
<option value="n_con">n_con</option> <!-- Добавлено новое поле -->
|
| 181 |
+
</select>
|
| 182 |
|
| 183 |
<select id="filter-type">
|
| 184 |
<option value="=">=</option>
|
|
|
|
| 210 |
var curatorLink = cell.getData().curator_link;
|
| 211 |
return `<a href="${curatorLink}" target="_blank">${curator}</a>`;
|
| 212 |
};
|
| 213 |
+
var table = new Tabulator("#example-table", {
|
| 214 |
+
data: data, // set table data
|
| 215 |
+
layout: "fitColumns", // fit columns to width of table
|
| 216 |
+
pagination: "local", // enable local pagination
|
| 217 |
+
paginationSize: 50, // number of rows per page
|
| 218 |
+
selectable: true, // enable row selection
|
| 219 |
+
columns: [
|
| 220 |
+
{title:"Номер в списке", field:"id"},
|
| 221 |
+
{title:"Имя", field:"name"},
|
| 222 |
+
{title:"Телефон", field:"phone"},
|
| 223 |
+
{title:"Email", field:"email"},
|
| 224 |
+
{title:"Куратор", field:"curator", formatter: linkFormatter},
|
| 225 |
+
{title:"Статус покупки", field:"shop_statys_full", formatter: function(cell, formatterParams, onRendered) {
|
| 226 |
+
var status = cell.getValue();
|
| 227 |
+
var color;
|
| 228 |
+
switch (status) {
|
| 229 |
+
case 'green':
|
| 230 |
+
color = 'green';
|
| 231 |
+
break;
|
| 232 |
+
case 'red':
|
| 233 |
+
color = 'red';
|
| 234 |
+
break;
|
| 235 |
+
case 'yellow':
|
| 236 |
+
color = 'yellow';
|
| 237 |
+
break;
|
| 238 |
+
default:
|
| 239 |
+
color = 'gray';
|
| 240 |
+
}
|
| 241 |
+
return `<div style="width: 20px; height: 20px; background-color: ${color};"></div>`;
|
| 242 |
+
}},
|
| 243 |
+
{title:"Ссылка на пользователя в GC", field:"ad_url", formatter: function(cell, formatterParams, onRendered) {
|
| 244 |
+
var ad_url = cell.getValue();
|
| 245 |
+
return `<a href="${ad_url}" target="_blank">${ad_url}</a>`;
|
| 246 |
+
}},
|
| 247 |
+
{title:"Ссылка на VK", field:"vk_id", formatter: function(cell, formatterParams, onRendered) {
|
| 248 |
+
var vk_id = cell.getValue();
|
| 249 |
+
return `<a href="https://vk.com/id${vk_id}" target="_blank">${vk_id}</a>`;
|
| 250 |
+
}},
|
| 251 |
+
{title:"Ссылка на Tg", field:"chat_id", formatter: function(cell, formatterParams, onRendered) {
|
| 252 |
+
var chatId = cell.getValue();
|
| 253 |
+
if (chatId.startsWith('@')) {
|
| 254 |
+
chatId = chatId.substring(1); // Удаление символа @ в начале
|
| 255 |
+
}
|
| 256 |
+
return `<a href="https://t.me/${chatId}" target="_blank">${chatId}</a>`;
|
| 257 |
+
}},
|
| 258 |
+
{title:"Ссылка на WhatsApp", field:"phone", formatter: function(cell, formatterParams, onRendered) {
|
| 259 |
+
var phone = cell.getValue();
|
| 260 |
+
return `<a href="https://web.whatsapp.com/send?phone=${phone}" target="_blank">${phone}</a>`;
|
| 261 |
+
}},
|
| 262 |
+
{title:"Статус WhatsApp", field:"ws_statys"},
|
| 263 |
+
{title:"Стутус подписки", field:"ws_stop"},
|
| 264 |
+
{title:"Вебинары", field:"web_statys", formatter:"star", formatterParams:{stars:7}, hozAlign:"center", width:120},
|
| 265 |
+
{title:"Прогрес по воронке", field:"fin_progress", formatter:"progress", formatterParams:{color:["#00dd00", "orange", "rgb(255,0,0)"]}, sorter:"number", width:100},
|
| 266 |
+
{title:"pr1", field:"pr1"},
|
| 267 |
+
{title:"pr2", field:"pr2"},
|
| 268 |
+
{title:"pr3", field:"pr3"},
|
| 269 |
+
{title:"pr4", field:"pr4"},
|
| 270 |
+
{title:"pr5", field:"pr5"},
|
| 271 |
+
{title:"Ключ предлож.", field:"key_pr"},
|
| 272 |
+
{title:"n_con", field:"n_con"}, // Поменять местами с `data_t`
|
| 273 |
+
{title:"Дата", field:"data_t"} // Поменять местами с `n_con`
|
| 274 |
+
],
|
| 275 |
+
});
|
| 276 |
// Define variables for input elements
|
| 277 |
var fieldEl = document.getElementById("filter-field");
|
| 278 |
var typeEl = document.getElementById("filter-type");
|
|
|
|
| 296 |
valueEl.value = "";
|
| 297 |
table.clearFilter();
|
| 298 |
});
|
|
|
|
|
|
|
|
|
|
| 299 |
|
| 300 |
table.on("rowSelectionChanged", function(data, rows){
|
| 301 |
+
document.getElementById("select-stats").innerHTML = data.length;
|
| 302 |
+
});
|
| 303 |
+
//select row on "select" button click
|
| 304 |
+
document.getElementById("select-row").addEventListener("click", function(){
|
| 305 |
+
table.selectRow("Oli Bob");
|
| 306 |
+
});
|
| 307 |
+
//deselect row on "deselect" button click
|
| 308 |
+
document.getElementById("deselect-row").addEventListener("click", function(){
|
| 309 |
+
table.deselectRow("Oli Bob");
|
| 310 |
+
});
|
| 311 |
+
//select row on "select all" button click
|
| 312 |
+
document.getElementById("select-all").addEventListener("click", function(){
|
| 313 |
+
table.selectRow();
|
| 314 |
+
});
|
| 315 |
+
//deselect row on "deselect all" button click
|
| 316 |
+
document.getElementById("deselect-all").addEventListener("click", function(){
|
| 317 |
+
table.deselectRow();
|
| 318 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
|
| 320 |
// Переопределяем метод table.download
|
| 321 |
table.download = function(type, filename, options) {
|