'.$act_arr[$i].'
</p>';


$table .= '<table class="zebra" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td style="text-align: center;"><strong>Контингент</strong></td>

<td style="text-align: center;"><strong>Тема</strong></td>

<td style="text-align: center;"><strong>Сроки</strong></td>

<td style="text-align: center;"><strong>Ответственные</strong></td>

<td style="text-align: center;"><strong>Анонс<br />Итоги</strong></td>

</tr>

<tr>

<td colspan="5" style="text-align: center;"><strong>'.$act_arr[$i].'</strong></td>

</tr>';

foreach ($model as $item) {

if ($item['type_id'] == $i) {

$act_link='https://ez.iro51.ru/activity/registration/'.$item['type'].'/'.$item['id'];

$an_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['an_id'];

$it_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['it_id'];

$sdate = new DateTime($item['act_date']);

$stime = new DateTime($item['act_time']);

$table .= '<tr>

<td>' . $item['audienc'] . '</td><td>';

if (!empty($item['act_period'])) {


$table .= $item['theme'];

$table .= '</td><td style="text-align: center;">' . $item['act_period'] . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

} else {

$table .= '<a target="_blank" href="' . $act_link . '">' . $item['theme'] . '</a>';

$table .= '</td><td style="text-align: center;">' . $sdate->format('d.m.Y') . ',<br />' . $stime->format('H:i') . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

}


if (empty($item['an_id'])) {


$table .= 'Анонс';

} else {

$table .= '<a target="_blank" href="' . $an_link . '">Анонс</a>';

}

$table .= '<br />';

if (empty($item['it_id'])) {


$table .= 'Итоги';

} else {

$table .= '<a target="_blank" href="' . $it_link . '">Итоги</a>';

}


$table .= '</td></tr>';

}

}


$table .= '</tbody>

</table>';

}

//Круглый стол

if($i===2) {


$table .= '<p>
'.$act_arr[$i].'
</p>';


$table .= '<table class="zebra" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td style="text-align: center;"><strong>Контингент</strong></td>

<td style="text-align: center;"><strong>Тема</strong></td>

<td style="text-align: center;"><strong>Сроки</strong></td>

<td style="text-align: center;"><strong>Ответственные</strong></td>

<td style="text-align: center;"><strong>Анонс<br />Итоги</strong></td>

</tr>

<tr>

<td colspan="5" style="text-align: center;"><strong>'.$act_arr[$i].'</strong></td>

</tr>';

foreach ($model as $item) {

if ($item['type_id'] == $i) {

$act_link='https://ez.iro51.ru/activity/registration/'.$item['type'].'/'.$item['id'];

$an_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['an_id'];

$it_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['it_id'];

$sdate = new DateTime($item['act_date']);

$stime = new DateTime($item['act_time']);

$table .= '<tr>

<td>' . $item['audienc'] . '</td><td>';

if (empty($act_link)) {


$table .= $item['theme'];

} else {

$table .= '<a target="_blank" href="' . $act_link . '">' . $item['theme'] . '</a>';

}


if (!empty($item['act_period'])) {

$table .= '</td><td style="text-align: center;">' . $item['act_period'] . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

} else {

$table .= '</td><td style="text-align: center;">' . $sdate->format('d.m.Y') . ',<br />' . $stime->format('H:i') . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

}


if (empty($item['an_id'])) {


$table .= 'Анонс';

} else {

$table .= '<a target="_blank" href="' . $an_link . '">Анонс</a>';

}

$table .= '<br />';

if (empty($item['it_id'])) {


$table .= 'Итоги';

} else {

$table .= '<a target="_blank" href="' . $it_link . '">Итоги</a>';

}


$table .= '</td></tr>';

}

}


$table .= '</tbody>

</table>';

}

//Мастерклас

if($i===3) {


$table .= '<p>
'.$act_arr[$i].'
</p>';


$table .= '<table class="zebra" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td style="text-align: center;"><strong>Контингент</strong></td>

<td style="text-align: center;"><strong>Тема</strong></td>

<td style="text-align: center;"><strong>Сроки</strong></td>

<td style="text-align: center;"><strong>Ответственные</strong></td>

<td style="text-align: center;"><strong>Анонс<br />Итоги</strong></td>

</tr>

<tr>

<td colspan="5" style="text-align: center;"><strong>'.$act_arr[$i].'</strong></td>

</tr>';

foreach ($model as $item) {

if ($item['type_id'] == $i) {

$act_link='https://ez.iro51.ru/activity/registration/'.$item['type'].'/'.$item['id'];

$an_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['an_id'];

$it_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['it_id'];

$sdate = new DateTime($item['act_date']);

$stime = new DateTime($item['act_time']);

$table .= '<tr>

<td>' . $item['audienc'] . '</td><td>';

if (empty($act_link)) {


$table .= $item['theme'];

} else {

$table .= '<a target="_blank" href="' . $act_link . '">' . $item['theme'] . '</a>';

}


if (!empty($item['act_period'])) {

$table .= '</td><td style="text-align: center;">' . $item['act_period'] . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

} else {

$table .= '</td><td style="text-align: center;">' . $sdate->format('d.m.Y') . ',<br />' . $stime->format('H:i') . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

}


if (empty($item['an_id'])) {


$table .= 'Анонс';

} else {

$table .= '<a target="_blank" href="' . $an_link . '">Анонс</a>';

}

$table .= '<br />';

if (empty($item['it_id'])) {


$table .= 'Итоги';

} else {

$table .= '<a target="_blank" href="' . $it_link . '">Итоги</a>';

}


$table .= '</td></tr>';

}

}


$table .= '</tbody>

</table>';

}

//Семинары

if($i===4) {


$table .= '<p>
'.$act_arr[$i].'
</p>';


$table .= '<table class="zebra" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td style="text-align: center;"><strong>Контингент</strong></td>

<td style="text-align: center;"><strong>Тема</strong></td>

<td style="text-align: center;"><strong>Сроки</strong></td>

<td style="text-align: center;"><strong>Ответственные</strong></td>

<td style="text-align: center;"><strong>Анонс<br />Итоги</strong></td>

</tr>

<tr>

<td colspan="5" style="text-align: center;"><strong>'.$act_arr[$i].'</strong></td>

</tr>';

foreach ($model as $item) {

if ($item['type_id'] == $i) {

$act_link='https://ez.iro51.ru/activity/registration/'.$item['type'].'/'.$item['id'];

$an_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['an_id'];

$it_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['it_id'];

$sdate = new DateTime($item['act_date']);

$stime = new DateTime($item['act_time']);

$table .= '<tr>

<td>' . $item['audienc'] . '</td><td>';

if (empty($act_link)) {


$table .= $item['theme'];

} else {

$table .= '<a target="_blank" href="' . $act_link . '">' . $item['theme'] . '</a>';

}


if (!empty($item['act_period'])) {

$table .= '</td><td style="text-align: center;">' . $item['act_period'] . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

} else {

$table .= '</td><td style="text-align: center;">' . $sdate->format('d.m.Y') . ',<br />' . $stime->format('H:i') . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

}


if (empty($item['an_id'])) {


$table .= 'Анонс';

} else {

$table .= '<a target="_blank" href="' . $an_link . '">Анонс</a>';

}

$table .= '<br />';

if (empty($item['it_id'])) {


$table .= 'Итоги';

} else {

$table .= '<a target="_blank" href="' . $it_link . '">Итоги</a>';

}


$table .= '</td></tr>';

}

}


$table .= '</tbody>

</table>';

}

//Тренинг

if($i===5) {


$table .= '<p>
'.$act_arr[$i].'
</p>';


$table .= '<table class="zebra" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td style="text-align: center;"><strong>Контингент</strong></td>

<td style="text-align: center;"><strong>Тема</strong></td>

<td style="text-align: center;"><strong>Сроки</strong></td>

<td style="text-align: center;"><strong>Ответственные</strong></td>

<td style="text-align: center;"><strong>Анонс<br />Итоги</strong></td>

</tr>

<tr>

<td colspan="5" style="text-align: center;"><strong>'.$act_arr[$i].'</strong></td>

</tr>';

foreach ($model as $item) {

if ($item['type_id'] == $i) {

$act_link='https://ez.iro51.ru/activity/registration/'.$item['type'].'/'.$item['id'];

$an_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['an_id'];

$it_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['it_id'];

$sdate = new DateTime($item['act_date']);

$stime = new DateTime($item['act_time']);

$table .= '<tr>

<td>' . $item['audienc'] . '</td><td>';

if (empty($act_link)) {


$table .= $item['theme'];

} else {

$table .= '<a target="_blank" href="' . $act_link . '">' . $item['theme'] . '</a>';

}


if (!empty($item['act_period'])) {

$table .= '</td><td style="text-align: center;">' . $item['act_period'] . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

} else {

$table .= '</td><td style="text-align: center;">' . $sdate->format('d.m.Y') . ',<br />' . $stime->format('H:i') . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

}


if (empty($item['an_id'])) {


$table .= 'Анонс';

} else {

$table .= '<a target="_blank" href="' . $an_link . '">Анонс</a>';

}

$table .= '<br />';

if (empty($item['it_id'])) {


$table .= 'Итоги';

} else {

$table .= '<a target="_blank" href="' . $it_link . '">Итоги</a>';

}


$table .= '</td></tr>';

}

}


$table .= '</tbody>

</table>';

}

//ВКС

if($i===6) {


$table .= '<p>
'.$act_arr[$i].'
</p>';


$table .= '<table class="zebra" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td style="text-align: center;"><strong>Контингент</strong></td>

<td style="text-align: center;"><strong>Тема</strong></td>

<td style="text-align: center;"><strong>Сроки</strong></td>

<td style="text-align: center;"><strong>Ответственные</strong></td>

<td style="text-align: center;"><strong>Анонс<br />Итоги</strong></td>

</tr>

<tr>

<td colspan="5" style="text-align: center;"><strong>'.$act_arr[$i].'</strong></td>

</tr>';

foreach ($model as $item) {

if ($item['type_id'] == $i) {

$act_link='https://ez.iro51.ru/activity/registration/'.$item['type'].'/'.$item['id'];

$an_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['an_id'];

$it_link='https://iro51.ru/index.php?option=com_content&view=article&id='.$item['it_id'];

$sdate = new DateTime($item['act_date']);

$stime = new DateTime($item['act_time']);

$table .= '<tr>

<td>' . $item['audienc'] . '</td><td>';

if (empty($act_link)) {


$table .= $item['theme'];

} else {

$table .= '<a target="_blank" href="' . $act_link . '">' . $item['theme'] . '</a>';

}


if (!empty($item['act_period'])) {

$table .= '</td><td style="text-align: center;">' . $item['act_period'] . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

} else {

$table .= '</td><td style="text-align: center;">' . $sdate->format('d.m.Y') . ',<br />' . $stime->format('H:i') . '</td>

<td>' . $item['curators'] . '</td>

<td style="text-align: center;">';

}


if (empty($item['an_id'])) {


$table .= 'Анонс';

} else {

$table .= '<a target="_blank" href="' . $an_link . '">Анонс</a>';

}

$table .= '<br />';

if (empty($item['it_id'])) {


$table .= 'Итоги';

} else {

$table .= '<a target="_blank" href="' . $it_link . '">Итоги</a>';

}


$table .= '</td></tr>';

}

}


$table .= '</tbody>

</table>';

}


}


$table.='<p>