<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* admin/student/learners.html.twig */
class __TwigTemplate_8d3cd4902ac0441df347031e81d3c7b5 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'content' => [$this, 'block_content'],
'addJs' => [$this, 'block_addJs'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "admin/base.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "admin/student/learners.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "admin/student/learners.html.twig"));
$this->parent = $this->loadTemplate("admin/base.html.twig", "admin/student/learners.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_title($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
yield "Учищиеся";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 6
public function block_content($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 7
yield " <!-- Page Heading -->
<h1 class=\"h3 mb-2 text-gray-800\">Просмотр учащихся</h1>
";
// line 12
yield "
<!-- DataTales Example -->
<div class=\"card shadow mb-4 mt-4\">
<div class=\"card-header py-3\">
<h6 class=\"m-0 font-weight-bold text-primary\">Учащиеся</h6>
</div>
<div class=\"card-body\">
";
// line 19
if (($this->extensions['App\Twig\AppExtension']->getUser() && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['App\Twig\AppExtension']->getUser(), "getSettings", [], "method", false, false, false, 19), "isCanEditStudents", [], "method", false, false, false, 19))) {
// line 20
yield " ";
yield from $this->loadTemplate("components/add_item_button.html.twig", "admin/student/learners.html.twig", 20)->unwrap()->yield(CoreExtension::merge($context, ["options" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("moderator_learner_edit"), "title" => "Новый учащийся"]]));
// line 24
yield " ";
}
// line 25
yield "
<div id=\"students-table-filters\" class=\"mb-4 d-flex align-items-center\" style=\"gap: 20px; flex-wrap: wrap;\">
";
// line 27
yield from $this->loadTemplate("components/table_filter.html.twig", "admin/student/learners.html.twig", 27)->unwrap()->yield(CoreExtension::merge($context, ["options" => ["labelText" => "Уровень", "dropdownIdPrefix" => "level", "allItemsButtonText" => "Все уровни"]]));
// line 32
yield "
";
// line 33
yield from $this->loadTemplate("components/table_filter.html.twig", "admin/student/learners.html.twig", 33)->unwrap()->yield(CoreExtension::merge($context, ["options" => ["labelText" => "Статус", "dropdownIdPrefix" => "status", "allItemsButtonText" => "Все статусы"]]));
// line 38
yield "
";
// line 39
yield from $this->loadTemplate("components/table_filter.html.twig", "admin/student/learners.html.twig", 39)->unwrap()->yield(CoreExtension::merge($context, ["options" => ["labelText" => "Контакт Telegram найден", "dropdownIdPrefix" => "telegramUserIdSet", "allItemsButtonText" => "Не выбрано"]]));
// line 44
yield "
";
// line 46
yield " ";
yield from $this->loadTemplate("components/table_filter.html.twig", "admin/student/learners.html.twig", 46)->unwrap()->yield(CoreExtension::merge($context, ["options" => ["labelText" => "Область", "dropdownIdPrefix" => "cityRegion", "allItemsButtonText" => "Все области"]]));
// line 51
yield "
";
// line 52
if (($this->extensions['App\Twig\AppExtension']->getUser() && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['App\Twig\AppExtension']->getUser(), "settings", [], "any", false, false, false, 52), "canUseTestFeatures", [], "any", false, false, false, 52))) {
// line 64
yield " ";
// line 65
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["calendarEvents"]) || array_key_exists("calendarEvents", $context) ? $context["calendarEvents"] : (function () { throw new RuntimeError('Variable "calendarEvents" does not exist.', 65, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["ceId"] => $context["ce"]) {
// line 66
yield " ";
yield from $this->loadTemplate("components/table_filter.html.twig", "admin/student/learners.html.twig", 66)->unwrap()->yield(CoreExtension::merge($context, ["options" => ["labelText" => ("Зарегистрирован: " . CoreExtension::getAttribute($this->env, $this->source, // line 67
$context["ce"], "getText", [], "method", false, false, false, 67)), "dropdownIdPrefix" => ("calendarEvent_" . // line 68
$context["ceId"]), "allItemsButtonText" => "Не выбрано", "multipleSelect" => false, "itemsHtml" => "<a class=\"dropdown-item\" href=\"#\" data-filter=\"Да\">Да</a><a class=\"dropdown-item\" href=\"#\" data-filter=\"Нет\">Нет</a>"]]));
// line 74
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['ceId'], $context['ce'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 77
yield " ";
}
// line 79
yield " </div>
<div class=\"border p-3 rounded\">
<h4>Общая статистика:</h4>
<div class=\"d-flex\">
<div class=\"p-2\">
";
// line 85
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["itemsByStatusCount"]) || array_key_exists("itemsByStatusCount", $context) ? $context["itemsByStatusCount"] : (function () { throw new RuntimeError('Variable "itemsByStatusCount" does not exist.', 85, $this->source); })()));
foreach ($context['_seq'] as $context["status"] => $context["itemsByStatusCountItem"]) {
// line 86
yield " <div>
<label>
<input type=\"checkbox\" data-calc-item-name=\"";
// line 88
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["status"], "html", null, true);
yield "\" data-calc-item-value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["itemsByStatusCountItem"], "count", [], "any", false, false, false, 88), "html", null, true);
yield "\">
Всего со статусом <b>\"";
// line 89
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["itemsByStatusCountItem"], "statusText", [], "any", false, false, false, 89), "html", null, true);
yield "\"</b>: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["itemsByStatusCountItem"], "count", [], "any", false, false, false, 89), "html", null, true);
yield "
</label>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['status'], $context['itemsByStatusCountItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 93
yield " </div>
<div class=\"p-2\">
";
// line 96
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["itemsByStudentLevelCount"]) || array_key_exists("itemsByStudentLevelCount", $context) ? $context["itemsByStudentLevelCount"] : (function () { throw new RuntimeError('Variable "itemsByStudentLevelCount" does not exist.', 96, $this->source); })()));
foreach ($context['_seq'] as $context["level"] => $context["itemsByStudentLevelCountItem"]) {
// line 97
yield " <div>
<label>
<input type=\"checkbox\" data-calc-item-name=\"level_";
// line 99
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["level"], "html", null, true);
yield "\" data-calc-item-value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["itemsByStudentLevelCountItem"], "count", [], "any", false, false, false, 99), "html", null, true);
yield "\">
Всего c уровнем <b>\"";
// line 100
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["itemsByStudentLevelCountItem"], "level", [], "any", false, false, false, 100), "html", null, true);
yield "\"</b>: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["itemsByStudentLevelCountItem"], "count", [], "any", false, false, false, 100), "html", null, true);
yield "
</label>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['level'], $context['itemsByStudentLevelCountItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 104
yield " </div>
</div>
<div class=\"p-2\">
<div>Всего учеников: ";
// line 108
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["allStudentsCount"]) || array_key_exists("allStudentsCount", $context) ? $context["allStudentsCount"] : (function () { throw new RuntimeError('Variable "allStudentsCount" does not exist.', 108, $this->source); })()), "html", null, true);
yield "</div>
<div>Всего числящихся учеников: ";
// line 109
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["itemsWithCanSendCampaignStatusCount"]) || array_key_exists("itemsWithCanSendCampaignStatusCount", $context) ? $context["itemsWithCanSendCampaignStatusCount"] : (function () { throw new RuntimeError('Variable "itemsWithCanSendCampaignStatusCount" does not exist.', 109, $this->source); })()), "html", null, true);
yield "</div>
<div>Всего подписчиков: ";
// line 110
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["itemsByStatusCount"]) || array_key_exists("itemsByStatusCount", $context) ? $context["itemsByStatusCount"] : (function () { throw new RuntimeError('Variable "itemsByStatusCount" does not exist.', 110, $this->source); })()), "subscriber_virtual_status", [], "array", false, false, false, 110), "count", [], "array", false, false, false, 110), "html", null, true);
yield "</div>
<div>Всего выбывших: ";
// line 111
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["allLeavedStudentsCount"]) || array_key_exists("allLeavedStudentsCount", $context) ? $context["allLeavedStudentsCount"] : (function () { throw new RuntimeError('Variable "allLeavedStudentsCount" does not exist.', 111, $this->source); })()), "html", null, true);
yield "</div>
<br>
<div>
Калькулятор: <span class=\"calc-result\"><b>выберите значения</b></span>
</div>
</div>
</div>
<br>
";
// line 135
yield "
";
// line 143
yield "
";
// line 151
yield "
";
// line 154
yield "
";
// line 157
yield "
";
// line 167
yield "
<div class=\"mb-4 d-flex justify-content-end\">
<button id=\"compare-table-btn\" class=\"btn btn-primary mb-3\">Поиск по списку ФИО</button>
</div>
<div class=\"table-responsive\">
<table class=\"table table-bordered\" id=\"students-data-table\">
<thead>
<tr>
<th data-table-type=\"num\">Номер п/п</th>
<th>Имя</th>
<th>Город</th>
<th data-table-dropdown-id=\"cityRegionDropdown\"
data-table-badge-id=\"cityRegionBadge\"
data-table-dropdown-text-for-all=\"Все области\">Область</th>
<th>Телефон</th>
<th>E-mail</th>
<th data-table-dropdown-id=\"levelDropdown\"
data-table-badge-id=\"levelBadge\"
data-table-dropdown-text-for-all=\"Все уровни\">Уровень</th>
<th data-export-exclude-col>Статус</th>
<th data-table-hide-col data-table-dropdown-id=\"statusDropdown\"
data-table-badge-id=\"statusBadge\"
data-table-dropdown-text-for-all=\"Все статусы\">Статус (текст)</th>
<th data-export-exclude-col>Фото</th>
<th data-table-type=\"date-d-m-Y-asc\">Дата последнего прохождния курса уровня</th>
<th>Комментарий</th>
";
// line 196
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["calendarEvents"]) || array_key_exists("calendarEvents", $context) ? $context["calendarEvents"] : (function () { throw new RuntimeError('Variable "calendarEvents" does not exist.', 196, $this->source); })()));
foreach ($context['_seq'] as $context["ceId"] => $context["ce"]) {
// line 197
yield " <th data-table-hide-col
data-table-dropdown-id=\"calendarEvent_";
// line 198
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["ceId"], "html", null, true);
yield "Dropdown\"
data-table-badge-id=\"calendarEvent_";
// line 199
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["ceId"], "html", null, true);
yield "Badge\"
data-table-dropdown-text-for-all=\"Не выбрано\"
data-export-exclude-col>";
// line 201
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["ce"], "getText", [], "method", false, false, false, 201), "html", null, true);
yield "</th>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['ceId'], $context['ce'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 203
yield "
<th data-table-hide-col data-export-exclude-col>Идентификатор пользователя Telegram</th>
<th data-table-hide-col data-export-exclude-col
data-table-dropdown-id=\"telegramUserIdSetDropdown\"
data-table-badge-id=\"telegramUserIdSetBadge\"
data-table-dropdown-text-for-all=\"Не выбрано\"
>Идентификатор пользователя Telegram установлен (да/нет)</th>
<th>Сведения</th>
<th data-export-exclude-col>Действия</th>
<th data-table-type=\"num\" data-table-hide-col data-table-col-id=\"id\">#</th>
<th data-table-hide-col>Дополнить комментарий учащегося</th>
</tr>
</thead>
";
// line 222
yield " <tbody>
";
// line 223
$context["studentIndex"] = -1;
// line 224
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["items"]) || array_key_exists("items", $context) ? $context["items"] : (function () { throw new RuntimeError('Variable "items" does not exist.', 224, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 225
yield " ";
$context["studentIndex"] = ((isset($context["studentIndex"]) || array_key_exists("studentIndex", $context) ? $context["studentIndex"] : (function () { throw new RuntimeError('Variable "studentIndex" does not exist.', 225, $this->source); })()) + 1);
// line 226
yield " ";
$context["earnLevelCandidate"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["earnLevelCandidates"]) || array_key_exists("earnLevelCandidates", $context) ? $context["earnLevelCandidates"] : (function () { throw new RuntimeError('Variable "earnLevelCandidates" does not exist.', 226, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 226), [], "array", false, false, false, 226);
// line 227
yield " <tr>
<td>";
// line 228
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((isset($context["studentIndex"]) || array_key_exists("studentIndex", $context) ? $context["studentIndex"] : (function () { throw new RuntimeError('Variable "studentIndex" does not exist.', 228, $this->source); })()) + 1), "html", null, true);
yield "</td>
<td>";
// line 229
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['App\Twig\AppExtension']->getFirstLastNameWithOld($context["item"], false, true), "html", null, true);
yield "</td>
<td>";
// line 230
((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "city", [], "any", false, false, false, 230)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "city", [], "any", false, false, false, 230), "name", [], "any", false, false, false, 230), "html", null, true)) : (yield "город не указан"));
yield "</td>
<td>";
// line 231
(((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "city", [], "any", false, false, false, 231) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "city", [], "any", false, false, false, 231), "region", [], "any", false, false, false, 231))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "city", [], "any", false, false, false, 231), "region", [], "any", false, false, false, 231), "name", [], "any", false, false, false, 231), "html", null, true)) : (yield "область не указана"));
yield "</td>
<td>";
// line 232
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "phone", [], "any", false, false, false, 232), "html", null, true);
yield "</td>
<td>";
// line 233
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "email", [], "any", false, false, false, 233), "html", null, true);
yield "</td>
<td>";
// line 234
(((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 234) && (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 234), "level", [], "any", false, false, false, 234) > -1))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 234), "level", [], "any", false, false, false, 234), "html", null, true)) : (yield "нет уровня"));
yield "</td>
<td>
<span href=\"#\" class=\"btn btn-";
// line 236
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "virtualStudentStatusCssClass", [], "any", false, false, false, 236), "html", null, true);
yield " btn-icon-split w-max cursor-default\">
<span class=\"icon text-white-50\">
<i class=\"fas fa-tag\"></i>
</span>
<span class=\"text\">";
// line 240
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "virtualStudentStatusText", [], "any", false, false, false, 240), "html", null, true);
yield "</span>
</span>
</td>
<td>";
// line 243
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "virtualStudentStatusText", [], "any", false, false, false, 243), "html", null, true);
yield "</td>
<td>
";
// line 256
yield " </td>
<td>
";
// line 259
$context["outputEarnLevelCandidate"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 259) && (isset($context["earnLevelCandidate"]) || array_key_exists("earnLevelCandidate", $context) ? $context["earnLevelCandidate"] : (function () { throw new RuntimeError('Variable "earnLevelCandidate" does not exist.', 259, $this->source); })())) && (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["earnLevelCandidate"]) || array_key_exists("earnLevelCandidate", $context) ? $context["earnLevelCandidate"] : (function () { throw new RuntimeError('Variable "earnLevelCandidate" does not exist.', 259, $this->source); })()), "calendarEvent", [], "any", false, false, false, 259), "earnLevel", [], "any", false, false, false, 259) == CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 259), "level", [], "any", false, false, false, 259)));
// line 260
yield " ";
if ((isset($context["outputEarnLevelCandidate"]) || array_key_exists("outputEarnLevelCandidate", $context) ? $context["outputEarnLevelCandidate"] : (function () { throw new RuntimeError('Variable "outputEarnLevelCandidate" does not exist.', 260, $this->source); })())) {
// line 261
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["earnLevelCandidate"]) || array_key_exists("earnLevelCandidate", $context) ? $context["earnLevelCandidate"] : (function () { throw new RuntimeError('Variable "earnLevelCandidate" does not exist.', 261, $this->source); })()), "calendarEvent", [], "any", false, false, false, 261), "startDate", [], "any", false, false, false, 261), "d.m.Y"), "html", null, true);
yield "
";
} else {
// line 263
yield " –
";
}
// line 265
yield " </td>
<td>";
// line 267
((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "comment", [], "any", false, false, false, 267)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "comment", [], "any", false, false, false, 267), "html", null, true)) : (yield "–"));
yield "</td>
";
// line 270
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["calendarEvents"]) || array_key_exists("calendarEvents", $context) ? $context["calendarEvents"] : (function () { throw new RuntimeError('Variable "calendarEvents" does not exist.', 270, $this->source); })()));
foreach ($context['_seq'] as $context["ceId"] => $context["ce"]) {
// line 271
yield " ";
$context["registered"] = (CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 271) && (CoreExtension::getAttribute($this->env, $this->source, ($context["candidatesByStudentAndCalendarEvent"] ?? null), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 271), "id", [], "any", false, false, false, 271), [], "array", true, true, false, 271) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["candidatesByStudentAndCalendarEvent"] ?? null), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "student", [], "any", false, false, false, 271), "id", [], "any", false, false, false, 271), [], "array", false, true, false, 271), $context["ceId"], [], "array", true, true, false, 271)));
// line 272
yield " <td>";
yield (((isset($context["registered"]) || array_key_exists("registered", $context) ? $context["registered"] : (function () { throw new RuntimeError('Variable "registered" does not exist.', 272, $this->source); })())) ? ("Да") : ("Нет"));
yield "</td>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['ceId'], $context['ce'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 274
yield "
<td>";
// line 275
((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "telegramUserId", [], "any", false, false, false, 275)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "telegramUserId", [], "any", false, false, false, 275), "html", null, true)) : (yield "–"));
yield "</td>
<td>
";
// line 277
$context["statusAdditon"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "canSendTelegramCampaigns", [], "any", false, false, false, 277)) ? ("") : (" (Рассылка Telegram отключена!)"));
// line 278
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "telegramUserId", [], "any", false, false, false, 278)) ? (("Да" . (isset($context["statusAdditon"]) || array_key_exists("statusAdditon", $context) ? $context["statusAdditon"] : (function () { throw new RuntimeError('Variable "statusAdditon" does not exist.', 278, $this->source); })()))) : (("Нет" . (isset($context["statusAdditon"]) || array_key_exists("statusAdditon", $context) ? $context["statusAdditon"] : (function () { throw new RuntimeError('Variable "statusAdditon" does not exist.', 278, $this->source); })())))), "html", null, true);
yield "
</td>
<td>
<b>Дата рождения</b>: ";
// line 281
((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "birthday", [], "any", false, false, false, 281)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "birthday", [], "any", false, false, false, 281), "d.m.Y"), "html", null, true)) : (yield "–"));
yield "
<br><br>
<b>Род деятельности</b>: ";
// line 283
((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "job", [], "any", false, false, false, 283)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "job", [], "any", false, false, false, 283), "name", [], "any", false, false, false, 283), "html", null, true)) : (yield "–"));
yield "
</td>
<td>
<a title=\"Редактировать\" href=\"";
// line 286
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("moderator_learner_edit", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 286)]), "html", null, true);
yield "\" class=\"btn btn-primary btn-circle\">
<i class=\"fas fa-edit\"></i>
</a>
";
// line 290
if (($this->extensions['App\Twig\AppExtension']->getUser() && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['App\Twig\AppExtension']->getUser(), "getSettings", [], "method", false, false, false, 290), "isCanEditStudents", [], "method", false, false, false, 290))) {
// line 291
yield " <a title=\"Удалить\" href=\"javascript:void(0);\" class=\"btn btn-danger btn-circle\"
onclick='(async ()=>{
let msg = \"Удалить учащегося ";
// line 293
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 293), "js"), "html", null, true);
yield "?\";
let answer = await showWindowModal(\"Подтверждение\", msg, \"Удалить\", \"Отмена\");
if (answer === MODAL_WINDOW_BUTTON.BUTTON_1) {
window.location = \"";
// line 296
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("moderator_student_delete", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 296)]), "html", null, true);
yield "\";
}
})()'>
<i class=\"fas fa-trash\"></i>
</a>
";
}
// line 302
yield " </td>
<td>";
// line 303
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 303), "html", null, true);
yield "</td>
<td></td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 307
yield " </tbody>
</table>
";
// line 310
$context["galleryItems"] = (isset($context["items"]) || array_key_exists("items", $context) ? $context["items"] : (function () { throw new RuntimeError('Variable "items" does not exist.', 310, $this->source); })());
// line 311
yield " ";
yield from $this->loadTemplate("admin/student/learners.html.twig", "admin/student/learners.html.twig", 311, "630547325")->unwrap()->yield(CoreExtension::merge($context, ["options" => ["modalId" => "studentsPhotoGalleryModal", "modalTitle" => "Галерея учащихся", "elementClickTriggerSelector" => "#students-data-table img.gallery-trigger"]]));
// line 337
yield "
";
// line 339
yield " <div class=\"mt-4 d-flex\">
<button id=\"download-csv-btn\" class=\"btn btn-primary\">Скачать таблицу</button>
</div>
";
// line 343
yield " </div>
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 348
public function block_addJs($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "addJs"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "addJs"));
// line 349
yield " <script>
let studentsDataTableOptions = {
// \"scrollY\": \"500px\",
\"lengthMenu\": [[10, 20, 50, 100, 200, 300, 500, 700, -1], [10, 20, 50, 100, 200, 300, 500, 700, \"Все\"]],
drawRowNumbersForColIndex: 0,
};
let table = new CustomDataTable('#students-data-table', studentsDataTableOptions);
table.initDataTable();
// compare table button - collect filtered table data and run compare
\$('#compare-table-btn').click(async () => {
let result = await showTableCompareModal();
if (result !== null) {
let compareList = result.compareList;
let tableData = table.getAllFilteredTableData();
let tableList = \"\";
for (let i = 0; i < tableData.length; i++) {
tableList += tableData[i][1] + \"\\n\";
}
let compareResult = await compareData(tableList, compareList);
const modalContent = getCompareTableHtml(tableData, compareResult, \"students-data-table\",
\"#students-table-filters\", studentsDataTableOptions);
let answer = await showWindowModal('Результаты поиска в таблице по списку ФИО', modalContent, \"Ок\", \"Отмена\",
\"max-width: 95%;\");
}
});
\$('#download-csv-btn').click(() => {
table.downloadCsv()
});
let galleries = [];
\$('.gallery-modal').each(function() {
let modalId = \$(this).attr('id');
let options = {};
if (\$(this).is(\"#studentsPhotoGalleryModal\")) {
options = {
...options,
slideIdAttrName: 'data-student-id',
dataTableInstance: table,
}
}
let gallery = new GalleryCarousel(modalId, options);
galleries.push(gallery);
});
function updateCalc() {
const \$span = \$('.calc-result');
const \$inputs = \$('input[data-calc-item-name]');
let total = 0;
let anyChecked = false;
\$inputs.each(function() {
const \$el = \$(this);
if (\$el.is(':checked')) {
anyChecked = true;
const raw = \$el.attr('data-calc-item-value');
const n = Number(String(raw).replace(/[^0-9.-]+/g, ''));
if (!isNaN(n)) total += n;
}
});
if (!anyChecked) {
\$span.html('<b>выберите значения</b>');
} else {
\$span.html('<b>' + total + '</b>');
}
}
// Привязываем событие и инициализируем при загрузке
\$(document).ready(function() {
\$(document).on('change', 'input[data-calc-item-name]', updateCalc);
updateCalc();
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "admin/student/learners.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 584 => 349, 574 => 348, 560 => 343, 555 => 339, 552 => 337, 549 => 311, 547 => 310, 542 => 307, 532 => 303, 529 => 302, 520 => 296, 514 => 293, 510 => 291, 508 => 290, 501 => 286, 495 => 283, 490 => 281, 483 => 278, 481 => 277, 476 => 275, 473 => 274, 464 => 272, 461 => 271, 456 => 270, 451 => 267, 447 => 265, 443 => 263, 437 => 261, 434 => 260, 432 => 259, 427 => 256, 422 => 243, 416 => 240, 409 => 236, 404 => 234, 400 => 233, 396 => 232, 392 => 231, 388 => 230, 384 => 229, 380 => 228, 377 => 227, 374 => 226, 371 => 225, 366 => 224, 364 => 223, 361 => 222, 346 => 203, 338 => 201, 333 => 199, 329 => 198, 326 => 197, 321 => 196, 291 => 167, 288 => 157, 285 => 154, 282 => 151, 279 => 143, 276 => 135, 264 => 111, 260 => 110, 256 => 109, 252 => 108, 246 => 104, 234 => 100, 228 => 99, 224 => 97, 220 => 96, 215 => 93, 203 => 89, 197 => 88, 193 => 86, 189 => 85, 181 => 79, 178 => 77, 164 => 74, 162 => 68, 161 => 67, 159 => 66, 141 => 65, 139 => 64, 137 => 52, 134 => 51, 131 => 46, 128 => 44, 126 => 39, 123 => 38, 121 => 33, 118 => 32, 116 => 27, 112 => 25, 109 => 24, 106 => 20, 104 => 19, 95 => 12, 91 => 7, 81 => 6, 61 => 3, 38 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'admin/base.html.twig' %}
{% block title %}Учищиеся{% endblock %}
{% block content %}
<!-- Page Heading -->
<h1 class=\"h3 mb-2 text-gray-800\">Просмотр учащихся</h1>
{# <p class=\"mb-4\">DataTables is a third party plugin that is used to generate the demo table below.
For more information about DataTables, please visit the <a target=\"_blank\"
href=\"https://datatables.net\">official DataTables documentation</a>.</p> #}
<!-- DataTales Example -->
<div class=\"card shadow mb-4 mt-4\">
<div class=\"card-header py-3\">
<h6 class=\"m-0 font-weight-bold text-primary\">Учащиеся</h6>
</div>
<div class=\"card-body\">
{% if getUser() and getUser().getSettings().isCanEditStudents() %}
{% include 'components/add_item_button.html.twig' with { options: {
url: path('moderator_learner_edit'),
title: 'Новый учащийся'
} } %}
{% endif %}
<div id=\"students-table-filters\" class=\"mb-4 d-flex align-items-center\" style=\"gap: 20px; flex-wrap: wrap;\">
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Уровень',
dropdownIdPrefix: 'level',
allItemsButtonText: 'Все уровни',
}} %}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Статус',
dropdownIdPrefix: 'status',
allItemsButtonText: 'Все статусы',
}} %}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Контакт Telegram найден',
dropdownIdPrefix: 'telegramUserIdSet',
allItemsButtonText: 'Не выбрано',
}} %}
{# Добавлен фильтр по области (city.region) #}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Область',
dropdownIdPrefix: 'cityRegion',
allItemsButtonText: 'Все области',
}} %}
{% if getUser() and getUser().settings.canUseTestFeatures %}
{# <div>#}
{# {% embed 'components/dropdown.html.twig' with { options: {#}
{# labelAttrs: 'style=\"display: block\"',#}
{# dropdownMenuAttrs: 'style=\"width: 500px; max-height: 600px; overflow-y: auto;\"',#}
{# defaultItemText: \"Выбрать\",#}
{# labelText: \"Зарегистрирован на мероприятие:\",#}
{# buttonClass: 'btn-primary btn',#}
{# preventDropdownClose: true,#}
{# } } %}#}
{# {% block beforeDropdownItems %}#}
{# <li class=\"px-3 py-2\">#}
{# Перечисляем фильтры для каждого календарного события: статичные элементы Да/Нет #}
{% for ceId, ce in calendarEvents %}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Зарегистрирован: ' ~ ce.getText(),
dropdownIdPrefix: 'calendarEvent_' ~ ceId,
allItemsButtonText: 'Не выбрано',
multipleSelect: false,
itemsHtml: '<a class=\"dropdown-item\" href=\"#\" data-filter=\"Да\">Да</a><a class=\"dropdown-item\" href=\"#\" data-filter=\"Нет\">Нет</a>',
}} %}
{# <br>#}
{% endfor %}
{# {% endblock %}#}
{# {% endembed %}#}
{% endif %}
{# </div>#}
</div>
<div class=\"border p-3 rounded\">
<h4>Общая статистика:</h4>
<div class=\"d-flex\">
<div class=\"p-2\">
{% for status, itemsByStatusCountItem in itemsByStatusCount %}
<div>
<label>
<input type=\"checkbox\" data-calc-item-name=\"{{ status }}\" data-calc-item-value=\"{{ itemsByStatusCountItem.count }}\">
Всего со статусом <b>\"{{ itemsByStatusCountItem.statusText }}\"</b>: {{ itemsByStatusCountItem.count }}
</label>
</div>
{% endfor %}
</div>
<div class=\"p-2\">
{% for level, itemsByStudentLevelCountItem in itemsByStudentLevelCount %}
<div>
<label>
<input type=\"checkbox\" data-calc-item-name=\"level_{{ level }}\" data-calc-item-value=\"{{ itemsByStudentLevelCountItem.count }}\">
Всего c уровнем <b>\"{{ itemsByStudentLevelCountItem.level }}\"</b>: {{ itemsByStudentLevelCountItem.count }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class=\"p-2\">
<div>Всего учеников: {{ allStudentsCount }}</div>
<div>Всего числящихся учеников: {{ itemsWithCanSendCampaignStatusCount }}</div>
<div>Всего подписчиков: {{ itemsByStatusCount['subscriber_virtual_status']['count'] }}</div>
<div>Всего выбывших: {{ allLeavedStudentsCount }}</div>
<br>
<div>
Калькулятор: <span class=\"calc-result\"><b>выберите значения</b></span>
</div>
</div>
</div>
<br>
{# <div>#}
{# Тексты писем:#}
{# </div>#}
{# <script>#}
{# let msg = null;#}
{# </script>#}
{# {% set i = -1 %}#}
{# {% set emails = \"hh099@ya.ru\\n\" %}#}
{# {% for item in items %}#}
{# {% set i = i + 1 %}#}
{# {% if item.virtualStudentStatus != \"subscriber\" %}#}
{# <div>#}
{# <button class=\"copy-to-buffer\" data-name=\"{{ item.name }}\"#}
{# data-email=\"{{ item.email }}\"#}
{# >{{ i + 1 }} - id: {{ item.id}} - {{ item.name }} {{ item.email }} - {{ item.virtualStudentStatus }}</button>#}
{# </div>#}
{# <br>#}
{# {% if item.id >= 328 and item.email %}#}
{# {% set emails = emails ~ item.email ~ \"\\n\" %}#}
{# {% endif %}#}
{# {% endif %}#}
{# {% endfor %}#}
{# <textarea id=\"emails-textarea\" class=\"form-control\" rows=\"10\" placeholder=\"Сюда будут скопированы все email обучающихся, не являющихся подписчиками, при нажатии на кнопку выше\">{{ emails }}</textarea>#}
{# <script>#}
{# \$('.copy-to-buffer').click(function () {#}
{# let btn = \$(this)[0];#}
{# let name = \$(this).data('name');#}
{# let email = \$(this).data('email');#}
{# let msg = `\${name}, добрый день! Отправляю информацию чтобы Телеграм работал.#}
{#Ссылка для телефонов Android (Samsung, Xiaomi, Huawei и др.):#}
{#https://play.google.com/store/apps/details?id=com.adguard.vpn#}
{#Программа для компьютера Windows AdGuard прикреплена к письму.`;#}
{# msg = email;#}
{# navigator.clipboard.writeText(msg).then(() => {#}
{# // alert('Текст скопирован в буфер обмена');#}
{# //change button class to primarey#}
{# \$(btn).removeClass('btn-secondary').addClass('btn-primary');#}
{# }).catch(err => {#}
{# alert('Ошибка при копировании текста: ' + err);#}
{# });#}
{# });#}
{# </script>#}
<div class=\"mb-4 d-flex justify-content-end\">
<button id=\"compare-table-btn\" class=\"btn btn-primary mb-3\">Поиск по списку ФИО</button>
</div>
<div class=\"table-responsive\">
<table class=\"table table-bordered\" id=\"students-data-table\">
<thead>
<tr>
<th data-table-type=\"num\">Номер п/п</th>
<th>Имя</th>
<th>Город</th>
<th data-table-dropdown-id=\"cityRegionDropdown\"
data-table-badge-id=\"cityRegionBadge\"
data-table-dropdown-text-for-all=\"Все области\">Область</th>
<th>Телефон</th>
<th>E-mail</th>
<th data-table-dropdown-id=\"levelDropdown\"
data-table-badge-id=\"levelBadge\"
data-table-dropdown-text-for-all=\"Все уровни\">Уровень</th>
<th data-export-exclude-col>Статус</th>
<th data-table-hide-col data-table-dropdown-id=\"statusDropdown\"
data-table-badge-id=\"statusBadge\"
data-table-dropdown-text-for-all=\"Все статусы\">Статус (текст)</th>
<th data-export-exclude-col>Фото</th>
<th data-table-type=\"date-d-m-Y-asc\">Дата последнего прохождния курса уровня</th>
<th>Комментарий</th>
{# Для каждого календарного события добавляем скрытый столбец (значение Да/Нет). #}
{% for ceId, ce in calendarEvents %}
<th data-table-hide-col
data-table-dropdown-id=\"calendarEvent_{{ ceId }}Dropdown\"
data-table-badge-id=\"calendarEvent_{{ ceId }}Badge\"
data-table-dropdown-text-for-all=\"Не выбрано\"
data-export-exclude-col>{{ ce.getText() }}</th>
{% endfor %}
<th data-table-hide-col data-export-exclude-col>Идентификатор пользователя Telegram</th>
<th data-table-hide-col data-export-exclude-col
data-table-dropdown-id=\"telegramUserIdSetDropdown\"
data-table-badge-id=\"telegramUserIdSetBadge\"
data-table-dropdown-text-for-all=\"Не выбрано\"
>Идентификатор пользователя Telegram установлен (да/нет)</th>
<th>Сведения</th>
<th data-export-exclude-col>Действия</th>
<th data-table-type=\"num\" data-table-hide-col data-table-col-id=\"id\">#</th>
<th data-table-hide-col>Дополнить комментарий учащегося</th>
</tr>
</thead>
{# <tfoot>
<tr>
<th>Имя</th>
<th>Уровень</th>
</tr>
</tfoot> #}
<tbody>
{% set studentIndex = -1 %}
{% for item in items %}
{% set studentIndex = studentIndex + 1 %}
{% set earnLevelCandidate = earnLevelCandidates[item.id] %}
<tr>
<td>{{ studentIndex + 1 }}</td>
<td>{{ getFirstLastNameWithOld(item, false, true) }}</td>
<td>{{ item.city ? item.city.name : \"город не указан\" }}</td>
<td>{{ item.city and item.city.region ? item.city.region.name : \"область не указана\" }}</td>
<td>{{ item.phone }}</td>
<td>{{ item.email }}</td>
<td>{{ item.student and item.student.level > -1 ? item.student.level : \"нет уровня\" }}</td>
<td>
<span href=\"#\" class=\"btn btn-{{ item.virtualStudentStatusCssClass }} btn-icon-split w-max cursor-default\">
<span class=\"icon text-white-50\">
<i class=\"fas fa-tag\"></i>
</span>
<span class=\"text\">{{ item.virtualStudentStatusText }}</span>
</span>
</td>
<td>{{ item.virtualStudentStatusText }}</td>
<td>
{# {% if item.image %}#}
{# <img src=\"{{ path('image_view', {id: item.image.id}) }}\"#}
{# alt=\"Фото {{ item.name }}\"#}
{# class=\"cursor-pointer gallery-trigger\"#}
{# style=\"max-width: 100px; max-height: 100px;\"#}
{# data-gallery-index=\"{{ studentIndex }}\"#}
{# data-gallery-modal-id=\"studentsPhotoGalleryModal\"#}
{# >#}
{# {% else %}#}
{# –#}
{# {% endif %}#}
</td>
<td>
{% set outputEarnLevelCandidate = item.student and earnLevelCandidate and earnLevelCandidate.calendarEvent.earnLevel == item.student.level %}
{% if outputEarnLevelCandidate %}
{{ earnLevelCandidate.calendarEvent.startDate|date('d.m.Y') }}
{% else %}
–
{% endif %}
</td>
<td>{{ item.comment ?: \"–\" }}</td>
{# Для каждого события выводим 'Да' если есть кандидат для пары студент-событие, иначе 'Нет' #}
{% for ceId, ce in calendarEvents %}
{% set registered = item.student and ((candidatesByStudentAndCalendarEvent[item.student.id] is defined) and (candidatesByStudentAndCalendarEvent[item.student.id][(ceId)] is defined)) %}
<td>{{ registered ? 'Да' : 'Нет' }}</td>
{% endfor %}
<td>{{ item.telegramUserId ?: \"–\" }}</td>
<td>
{% set statusAdditon = item.canSendTelegramCampaigns ? \"\" : \" (Рассылка Telegram отключена!)\" %}
{{ item.telegramUserId ? 'Да' ~ statusAdditon : 'Нет' ~ statusAdditon }}
</td>
<td>
<b>Дата рождения</b>: {{ item.birthday ? item.birthday|date('d.m.Y') : \"–\" }}
<br><br>
<b>Род деятельности</b>: {{ item.job ? item.job.name : \"–\" }}
</td>
<td>
<a title=\"Редактировать\" href=\"{{ path('moderator_learner_edit', {id: item.id}) }}\" class=\"btn btn-primary btn-circle\">
<i class=\"fas fa-edit\"></i>
</a>
{% if getUser() and getUser().getSettings().isCanEditStudents() %}
<a title=\"Удалить\" href=\"javascript:void(0);\" class=\"btn btn-danger btn-circle\"
onclick='(async ()=>{
let msg = \"Удалить учащегося {{ (item.name)|e('js') }}?\";
let answer = await showWindowModal(\"Подтверждение\", msg, \"Удалить\", \"Отмена\");
if (answer === MODAL_WINDOW_BUTTON.BUTTON_1) {
window.location = \"{{ path('moderator_student_delete', {id: item.id}) }}\";
}
})()'>
<i class=\"fas fa-trash\"></i>
</a>
{% endif %}
</td>
<td>{{ item.id }}</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
{% set galleryItems = items %}
{% embed 'components/image_carousel_modal/image_carousel_modal.html.twig' with { options: {
modalId: 'studentsPhotoGalleryModal',
modalTitle: 'Галерея учащихся',
elementClickTriggerSelector: '#students-data-table img.gallery-trigger',
} } %}
{% block slides %}
{% set galleryIndex = -1 %}
{% for galleryItem in galleryItems %}
{% set galleryIndex = galleryIndex + 1 %}
{# {% set slideText = 'Фото: ' ~ galleryItem.name %}#}
{# {% embed 'components/image_carousel_modal/gallery_slide.html.twig' with { options: {#}
{# imageIndex: galleryIndex,#}
{# imageUrl: galleryItem.image ? path('image_view', {id: galleryItem.image.id}),#}
{# attrs: 'data-student-id=\"' ~ galleryItem.id ~ '\"',#}
{# } } %}#}
{# {% block text %}#}
{# <div><b>Имя:</b> {{ galleryItem.name }}</div>#}
{# <div><b>Город:</b> {{ galleryItem.city ? galleryItem.cityText : '–' }}</div>#}
{# <div><b>Уровень:</b> {{ galleryItem.student ? galleryItem.student.levelText : \"нет уровня\" }}</div>#}
{# <div class=\"mb-0\"><b>Телефон:</b> {{ galleryItem.phone ?: '–' }}</div>#}
{# <div class=\"mb-1\"><b>E-mail:</b> {{ galleryItem.email ?: '–' }}</div>#}
{# {% endblock %}#}
{# {% endembed %}#}
{% endfor %}
{% endblock %}
{% endembed %}
{# {% if getUser() and (getUser().getSettings().canUseTestFeatures()) %}#}
<div class=\"mt-4 d-flex\">
<button id=\"download-csv-btn\" class=\"btn btn-primary\">Скачать таблицу</button>
</div>
{# {% endif %}#}
</div>
</div>
</div>
{% endblock %}
{% block addJs %}
<script>
let studentsDataTableOptions = {
// \"scrollY\": \"500px\",
\"lengthMenu\": [[10, 20, 50, 100, 200, 300, 500, 700, -1], [10, 20, 50, 100, 200, 300, 500, 700, \"Все\"]],
drawRowNumbersForColIndex: 0,
};
let table = new CustomDataTable('#students-data-table', studentsDataTableOptions);
table.initDataTable();
// compare table button - collect filtered table data and run compare
\$('#compare-table-btn').click(async () => {
let result = await showTableCompareModal();
if (result !== null) {
let compareList = result.compareList;
let tableData = table.getAllFilteredTableData();
let tableList = \"\";
for (let i = 0; i < tableData.length; i++) {
tableList += tableData[i][1] + \"\\n\";
}
let compareResult = await compareData(tableList, compareList);
const modalContent = getCompareTableHtml(tableData, compareResult, \"students-data-table\",
\"#students-table-filters\", studentsDataTableOptions);
let answer = await showWindowModal('Результаты поиска в таблице по списку ФИО', modalContent, \"Ок\", \"Отмена\",
\"max-width: 95%;\");
}
});
\$('#download-csv-btn').click(() => {
table.downloadCsv()
});
let galleries = [];
\$('.gallery-modal').each(function() {
let modalId = \$(this).attr('id');
let options = {};
if (\$(this).is(\"#studentsPhotoGalleryModal\")) {
options = {
...options,
slideIdAttrName: 'data-student-id',
dataTableInstance: table,
}
}
let gallery = new GalleryCarousel(modalId, options);
galleries.push(gallery);
});
function updateCalc() {
const \$span = \$('.calc-result');
const \$inputs = \$('input[data-calc-item-name]');
let total = 0;
let anyChecked = false;
\$inputs.each(function() {
const \$el = \$(this);
if (\$el.is(':checked')) {
anyChecked = true;
const raw = \$el.attr('data-calc-item-value');
const n = Number(String(raw).replace(/[^0-9.-]+/g, ''));
if (!isNaN(n)) total += n;
}
});
if (!anyChecked) {
\$span.html('<b>выберите значения</b>');
} else {
\$span.html('<b>' + total + '</b>');
}
}
// Привязываем событие и инициализируем при загрузке
\$(document).ready(function() {
\$(document).on('change', 'input[data-calc-item-name]', updateCalc);
updateCalc();
});
</script>
{% endblock %}
", "admin/student/learners.html.twig", "/home/sariato/www/dev.centr.sariato.ru/templates/admin/student/learners.html.twig");
}
}
/* admin/student/learners.html.twig */
class __TwigTemplate_8d3cd4902ac0441df347031e81d3c7b5___630547325 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'slides' => [$this, 'block_slides'],
];
}
protected function doGetParent(array $context)
{
// line 311
return "components/image_carousel_modal/image_carousel_modal.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "admin/student/learners.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "admin/student/learners.html.twig"));
$this->parent = $this->loadTemplate("components/image_carousel_modal/image_carousel_modal.html.twig", "admin/student/learners.html.twig", 311);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 316
public function block_slides($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "slides"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "slides"));
// line 317
yield " ";
$context["galleryIndex"] = -1;
// line 318
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["galleryItems"]) || array_key_exists("galleryItems", $context) ? $context["galleryItems"] : (function () { throw new RuntimeError('Variable "galleryItems" does not exist.', 318, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["galleryItem"]) {
// line 319
yield " ";
$context["galleryIndex"] = ((isset($context["galleryIndex"]) || array_key_exists("galleryIndex", $context) ? $context["galleryIndex"] : (function () { throw new RuntimeError('Variable "galleryIndex" does not exist.', 319, $this->source); })()) + 1);
// line 334
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['galleryItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 335
yield " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "admin/student/learners.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 1204 => 335, 1198 => 334, 1195 => 319, 1190 => 318, 1187 => 317, 1177 => 316, 1154 => 311, 584 => 349, 574 => 348, 560 => 343, 555 => 339, 552 => 337, 549 => 311, 547 => 310, 542 => 307, 532 => 303, 529 => 302, 520 => 296, 514 => 293, 510 => 291, 508 => 290, 501 => 286, 495 => 283, 490 => 281, 483 => 278, 481 => 277, 476 => 275, 473 => 274, 464 => 272, 461 => 271, 456 => 270, 451 => 267, 447 => 265, 443 => 263, 437 => 261, 434 => 260, 432 => 259, 427 => 256, 422 => 243, 416 => 240, 409 => 236, 404 => 234, 400 => 233, 396 => 232, 392 => 231, 388 => 230, 384 => 229, 380 => 228, 377 => 227, 374 => 226, 371 => 225, 366 => 224, 364 => 223, 361 => 222, 346 => 203, 338 => 201, 333 => 199, 329 => 198, 326 => 197, 321 => 196, 291 => 167, 288 => 157, 285 => 154, 282 => 151, 279 => 143, 276 => 135, 264 => 111, 260 => 110, 256 => 109, 252 => 108, 246 => 104, 234 => 100, 228 => 99, 224 => 97, 220 => 96, 215 => 93, 203 => 89, 197 => 88, 193 => 86, 189 => 85, 181 => 79, 178 => 77, 164 => 74, 162 => 68, 161 => 67, 159 => 66, 141 => 65, 139 => 64, 137 => 52, 134 => 51, 131 => 46, 128 => 44, 126 => 39, 123 => 38, 121 => 33, 118 => 32, 116 => 27, 112 => 25, 109 => 24, 106 => 20, 104 => 19, 95 => 12, 91 => 7, 81 => 6, 61 => 3, 38 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'admin/base.html.twig' %}
{% block title %}Учищиеся{% endblock %}
{% block content %}
<!-- Page Heading -->
<h1 class=\"h3 mb-2 text-gray-800\">Просмотр учащихся</h1>
{# <p class=\"mb-4\">DataTables is a third party plugin that is used to generate the demo table below.
For more information about DataTables, please visit the <a target=\"_blank\"
href=\"https://datatables.net\">official DataTables documentation</a>.</p> #}
<!-- DataTales Example -->
<div class=\"card shadow mb-4 mt-4\">
<div class=\"card-header py-3\">
<h6 class=\"m-0 font-weight-bold text-primary\">Учащиеся</h6>
</div>
<div class=\"card-body\">
{% if getUser() and getUser().getSettings().isCanEditStudents() %}
{% include 'components/add_item_button.html.twig' with { options: {
url: path('moderator_learner_edit'),
title: 'Новый учащийся'
} } %}
{% endif %}
<div id=\"students-table-filters\" class=\"mb-4 d-flex align-items-center\" style=\"gap: 20px; flex-wrap: wrap;\">
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Уровень',
dropdownIdPrefix: 'level',
allItemsButtonText: 'Все уровни',
}} %}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Статус',
dropdownIdPrefix: 'status',
allItemsButtonText: 'Все статусы',
}} %}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Контакт Telegram найден',
dropdownIdPrefix: 'telegramUserIdSet',
allItemsButtonText: 'Не выбрано',
}} %}
{# Добавлен фильтр по области (city.region) #}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Область',
dropdownIdPrefix: 'cityRegion',
allItemsButtonText: 'Все области',
}} %}
{% if getUser() and getUser().settings.canUseTestFeatures %}
{# <div>#}
{# {% embed 'components/dropdown.html.twig' with { options: {#}
{# labelAttrs: 'style=\"display: block\"',#}
{# dropdownMenuAttrs: 'style=\"width: 500px; max-height: 600px; overflow-y: auto;\"',#}
{# defaultItemText: \"Выбрать\",#}
{# labelText: \"Зарегистрирован на мероприятие:\",#}
{# buttonClass: 'btn-primary btn',#}
{# preventDropdownClose: true,#}
{# } } %}#}
{# {% block beforeDropdownItems %}#}
{# <li class=\"px-3 py-2\">#}
{# Перечисляем фильтры для каждого календарного события: статичные элементы Да/Нет #}
{% for ceId, ce in calendarEvents %}
{% include 'components/table_filter.html.twig' with { options: {
labelText: 'Зарегистрирован: ' ~ ce.getText(),
dropdownIdPrefix: 'calendarEvent_' ~ ceId,
allItemsButtonText: 'Не выбрано',
multipleSelect: false,
itemsHtml: '<a class=\"dropdown-item\" href=\"#\" data-filter=\"Да\">Да</a><a class=\"dropdown-item\" href=\"#\" data-filter=\"Нет\">Нет</a>',
}} %}
{# <br>#}
{% endfor %}
{# {% endblock %}#}
{# {% endembed %}#}
{% endif %}
{# </div>#}
</div>
<div class=\"border p-3 rounded\">
<h4>Общая статистика:</h4>
<div class=\"d-flex\">
<div class=\"p-2\">
{% for status, itemsByStatusCountItem in itemsByStatusCount %}
<div>
<label>
<input type=\"checkbox\" data-calc-item-name=\"{{ status }}\" data-calc-item-value=\"{{ itemsByStatusCountItem.count }}\">
Всего со статусом <b>\"{{ itemsByStatusCountItem.statusText }}\"</b>: {{ itemsByStatusCountItem.count }}
</label>
</div>
{% endfor %}
</div>
<div class=\"p-2\">
{% for level, itemsByStudentLevelCountItem in itemsByStudentLevelCount %}
<div>
<label>
<input type=\"checkbox\" data-calc-item-name=\"level_{{ level }}\" data-calc-item-value=\"{{ itemsByStudentLevelCountItem.count }}\">
Всего c уровнем <b>\"{{ itemsByStudentLevelCountItem.level }}\"</b>: {{ itemsByStudentLevelCountItem.count }}
</label>
</div>
{% endfor %}
</div>
</div>
<div class=\"p-2\">
<div>Всего учеников: {{ allStudentsCount }}</div>
<div>Всего числящихся учеников: {{ itemsWithCanSendCampaignStatusCount }}</div>
<div>Всего подписчиков: {{ itemsByStatusCount['subscriber_virtual_status']['count'] }}</div>
<div>Всего выбывших: {{ allLeavedStudentsCount }}</div>
<br>
<div>
Калькулятор: <span class=\"calc-result\"><b>выберите значения</b></span>
</div>
</div>
</div>
<br>
{# <div>#}
{# Тексты писем:#}
{# </div>#}
{# <script>#}
{# let msg = null;#}
{# </script>#}
{# {% set i = -1 %}#}
{# {% set emails = \"hh099@ya.ru\\n\" %}#}
{# {% for item in items %}#}
{# {% set i = i + 1 %}#}
{# {% if item.virtualStudentStatus != \"subscriber\" %}#}
{# <div>#}
{# <button class=\"copy-to-buffer\" data-name=\"{{ item.name }}\"#}
{# data-email=\"{{ item.email }}\"#}
{# >{{ i + 1 }} - id: {{ item.id}} - {{ item.name }} {{ item.email }} - {{ item.virtualStudentStatus }}</button>#}
{# </div>#}
{# <br>#}
{# {% if item.id >= 328 and item.email %}#}
{# {% set emails = emails ~ item.email ~ \"\\n\" %}#}
{# {% endif %}#}
{# {% endif %}#}
{# {% endfor %}#}
{# <textarea id=\"emails-textarea\" class=\"form-control\" rows=\"10\" placeholder=\"Сюда будут скопированы все email обучающихся, не являющихся подписчиками, при нажатии на кнопку выше\">{{ emails }}</textarea>#}
{# <script>#}
{# \$('.copy-to-buffer').click(function () {#}
{# let btn = \$(this)[0];#}
{# let name = \$(this).data('name');#}
{# let email = \$(this).data('email');#}
{# let msg = `\${name}, добрый день! Отправляю информацию чтобы Телеграм работал.#}
{#Ссылка для телефонов Android (Samsung, Xiaomi, Huawei и др.):#}
{#https://play.google.com/store/apps/details?id=com.adguard.vpn#}
{#Программа для компьютера Windows AdGuard прикреплена к письму.`;#}
{# msg = email;#}
{# navigator.clipboard.writeText(msg).then(() => {#}
{# // alert('Текст скопирован в буфер обмена');#}
{# //change button class to primarey#}
{# \$(btn).removeClass('btn-secondary').addClass('btn-primary');#}
{# }).catch(err => {#}
{# alert('Ошибка при копировании текста: ' + err);#}
{# });#}
{# });#}
{# </script>#}
<div class=\"mb-4 d-flex justify-content-end\">
<button id=\"compare-table-btn\" class=\"btn btn-primary mb-3\">Поиск по списку ФИО</button>
</div>
<div class=\"table-responsive\">
<table class=\"table table-bordered\" id=\"students-data-table\">
<thead>
<tr>
<th data-table-type=\"num\">Номер п/п</th>
<th>Имя</th>
<th>Город</th>
<th data-table-dropdown-id=\"cityRegionDropdown\"
data-table-badge-id=\"cityRegionBadge\"
data-table-dropdown-text-for-all=\"Все области\">Область</th>
<th>Телефон</th>
<th>E-mail</th>
<th data-table-dropdown-id=\"levelDropdown\"
data-table-badge-id=\"levelBadge\"
data-table-dropdown-text-for-all=\"Все уровни\">Уровень</th>
<th data-export-exclude-col>Статус</th>
<th data-table-hide-col data-table-dropdown-id=\"statusDropdown\"
data-table-badge-id=\"statusBadge\"
data-table-dropdown-text-for-all=\"Все статусы\">Статус (текст)</th>
<th data-export-exclude-col>Фото</th>
<th data-table-type=\"date-d-m-Y-asc\">Дата последнего прохождния курса уровня</th>
<th>Комментарий</th>
{# Для каждого календарного события добавляем скрытый столбец (значение Да/Нет). #}
{% for ceId, ce in calendarEvents %}
<th data-table-hide-col
data-table-dropdown-id=\"calendarEvent_{{ ceId }}Dropdown\"
data-table-badge-id=\"calendarEvent_{{ ceId }}Badge\"
data-table-dropdown-text-for-all=\"Не выбрано\"
data-export-exclude-col>{{ ce.getText() }}</th>
{% endfor %}
<th data-table-hide-col data-export-exclude-col>Идентификатор пользователя Telegram</th>
<th data-table-hide-col data-export-exclude-col
data-table-dropdown-id=\"telegramUserIdSetDropdown\"
data-table-badge-id=\"telegramUserIdSetBadge\"
data-table-dropdown-text-for-all=\"Не выбрано\"
>Идентификатор пользователя Telegram установлен (да/нет)</th>
<th>Сведения</th>
<th data-export-exclude-col>Действия</th>
<th data-table-type=\"num\" data-table-hide-col data-table-col-id=\"id\">#</th>
<th data-table-hide-col>Дополнить комментарий учащегося</th>
</tr>
</thead>
{# <tfoot>
<tr>
<th>Имя</th>
<th>Уровень</th>
</tr>
</tfoot> #}
<tbody>
{% set studentIndex = -1 %}
{% for item in items %}
{% set studentIndex = studentIndex + 1 %}
{% set earnLevelCandidate = earnLevelCandidates[item.id] %}
<tr>
<td>{{ studentIndex + 1 }}</td>
<td>{{ getFirstLastNameWithOld(item, false, true) }}</td>
<td>{{ item.city ? item.city.name : \"город не указан\" }}</td>
<td>{{ item.city and item.city.region ? item.city.region.name : \"область не указана\" }}</td>
<td>{{ item.phone }}</td>
<td>{{ item.email }}</td>
<td>{{ item.student and item.student.level > -1 ? item.student.level : \"нет уровня\" }}</td>
<td>
<span href=\"#\" class=\"btn btn-{{ item.virtualStudentStatusCssClass }} btn-icon-split w-max cursor-default\">
<span class=\"icon text-white-50\">
<i class=\"fas fa-tag\"></i>
</span>
<span class=\"text\">{{ item.virtualStudentStatusText }}</span>
</span>
</td>
<td>{{ item.virtualStudentStatusText }}</td>
<td>
{# {% if item.image %}#}
{# <img src=\"{{ path('image_view', {id: item.image.id}) }}\"#}
{# alt=\"Фото {{ item.name }}\"#}
{# class=\"cursor-pointer gallery-trigger\"#}
{# style=\"max-width: 100px; max-height: 100px;\"#}
{# data-gallery-index=\"{{ studentIndex }}\"#}
{# data-gallery-modal-id=\"studentsPhotoGalleryModal\"#}
{# >#}
{# {% else %}#}
{# –#}
{# {% endif %}#}
</td>
<td>
{% set outputEarnLevelCandidate = item.student and earnLevelCandidate and earnLevelCandidate.calendarEvent.earnLevel == item.student.level %}
{% if outputEarnLevelCandidate %}
{{ earnLevelCandidate.calendarEvent.startDate|date('d.m.Y') }}
{% else %}
–
{% endif %}
</td>
<td>{{ item.comment ?: \"–\" }}</td>
{# Для каждого события выводим 'Да' если есть кандидат для пары студент-событие, иначе 'Нет' #}
{% for ceId, ce in calendarEvents %}
{% set registered = item.student and ((candidatesByStudentAndCalendarEvent[item.student.id] is defined) and (candidatesByStudentAndCalendarEvent[item.student.id][(ceId)] is defined)) %}
<td>{{ registered ? 'Да' : 'Нет' }}</td>
{% endfor %}
<td>{{ item.telegramUserId ?: \"–\" }}</td>
<td>
{% set statusAdditon = item.canSendTelegramCampaigns ? \"\" : \" (Рассылка Telegram отключена!)\" %}
{{ item.telegramUserId ? 'Да' ~ statusAdditon : 'Нет' ~ statusAdditon }}
</td>
<td>
<b>Дата рождения</b>: {{ item.birthday ? item.birthday|date('d.m.Y') : \"–\" }}
<br><br>
<b>Род деятельности</b>: {{ item.job ? item.job.name : \"–\" }}
</td>
<td>
<a title=\"Редактировать\" href=\"{{ path('moderator_learner_edit', {id: item.id}) }}\" class=\"btn btn-primary btn-circle\">
<i class=\"fas fa-edit\"></i>
</a>
{% if getUser() and getUser().getSettings().isCanEditStudents() %}
<a title=\"Удалить\" href=\"javascript:void(0);\" class=\"btn btn-danger btn-circle\"
onclick='(async ()=>{
let msg = \"Удалить учащегося {{ (item.name)|e('js') }}?\";
let answer = await showWindowModal(\"Подтверждение\", msg, \"Удалить\", \"Отмена\");
if (answer === MODAL_WINDOW_BUTTON.BUTTON_1) {
window.location = \"{{ path('moderator_student_delete', {id: item.id}) }}\";
}
})()'>
<i class=\"fas fa-trash\"></i>
</a>
{% endif %}
</td>
<td>{{ item.id }}</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
{% set galleryItems = items %}
{% embed 'components/image_carousel_modal/image_carousel_modal.html.twig' with { options: {
modalId: 'studentsPhotoGalleryModal',
modalTitle: 'Галерея учащихся',
elementClickTriggerSelector: '#students-data-table img.gallery-trigger',
} } %}
{% block slides %}
{% set galleryIndex = -1 %}
{% for galleryItem in galleryItems %}
{% set galleryIndex = galleryIndex + 1 %}
{# {% set slideText = 'Фото: ' ~ galleryItem.name %}#}
{# {% embed 'components/image_carousel_modal/gallery_slide.html.twig' with { options: {#}
{# imageIndex: galleryIndex,#}
{# imageUrl: galleryItem.image ? path('image_view', {id: galleryItem.image.id}),#}
{# attrs: 'data-student-id=\"' ~ galleryItem.id ~ '\"',#}
{# } } %}#}
{# {% block text %}#}
{# <div><b>Имя:</b> {{ galleryItem.name }}</div>#}
{# <div><b>Город:</b> {{ galleryItem.city ? galleryItem.cityText : '–' }}</div>#}
{# <div><b>Уровень:</b> {{ galleryItem.student ? galleryItem.student.levelText : \"нет уровня\" }}</div>#}
{# <div class=\"mb-0\"><b>Телефон:</b> {{ galleryItem.phone ?: '–' }}</div>#}
{# <div class=\"mb-1\"><b>E-mail:</b> {{ galleryItem.email ?: '–' }}</div>#}
{# {% endblock %}#}
{# {% endembed %}#}
{% endfor %}
{% endblock %}
{% endembed %}
{# {% if getUser() and (getUser().getSettings().canUseTestFeatures()) %}#}
<div class=\"mt-4 d-flex\">
<button id=\"download-csv-btn\" class=\"btn btn-primary\">Скачать таблицу</button>
</div>
{# {% endif %}#}
</div>
</div>
</div>
{% endblock %}
{% block addJs %}
<script>
let studentsDataTableOptions = {
// \"scrollY\": \"500px\",
\"lengthMenu\": [[10, 20, 50, 100, 200, 300, 500, 700, -1], [10, 20, 50, 100, 200, 300, 500, 700, \"Все\"]],
drawRowNumbersForColIndex: 0,
};
let table = new CustomDataTable('#students-data-table', studentsDataTableOptions);
table.initDataTable();
// compare table button - collect filtered table data and run compare
\$('#compare-table-btn').click(async () => {
let result = await showTableCompareModal();
if (result !== null) {
let compareList = result.compareList;
let tableData = table.getAllFilteredTableData();
let tableList = \"\";
for (let i = 0; i < tableData.length; i++) {
tableList += tableData[i][1] + \"\\n\";
}
let compareResult = await compareData(tableList, compareList);
const modalContent = getCompareTableHtml(tableData, compareResult, \"students-data-table\",
\"#students-table-filters\", studentsDataTableOptions);
let answer = await showWindowModal('Результаты поиска в таблице по списку ФИО', modalContent, \"Ок\", \"Отмена\",
\"max-width: 95%;\");
}
});
\$('#download-csv-btn').click(() => {
table.downloadCsv()
});
let galleries = [];
\$('.gallery-modal').each(function() {
let modalId = \$(this).attr('id');
let options = {};
if (\$(this).is(\"#studentsPhotoGalleryModal\")) {
options = {
...options,
slideIdAttrName: 'data-student-id',
dataTableInstance: table,
}
}
let gallery = new GalleryCarousel(modalId, options);
galleries.push(gallery);
});
function updateCalc() {
const \$span = \$('.calc-result');
const \$inputs = \$('input[data-calc-item-name]');
let total = 0;
let anyChecked = false;
\$inputs.each(function() {
const \$el = \$(this);
if (\$el.is(':checked')) {
anyChecked = true;
const raw = \$el.attr('data-calc-item-value');
const n = Number(String(raw).replace(/[^0-9.-]+/g, ''));
if (!isNaN(n)) total += n;
}
});
if (!anyChecked) {
\$span.html('<b>выберите значения</b>');
} else {
\$span.html('<b>' + total + '</b>');
}
}
// Привязываем событие и инициализируем при загрузке
\$(document).ready(function() {
\$(document).on('change', 'input[data-calc-item-name]', updateCalc);
updateCalc();
});
</script>
{% endblock %}
", "admin/student/learners.html.twig", "/home/sariato/www/dev.centr.sariato.ru/templates/admin/student/learners.html.twig");
}
}