public function notificationNewSeries() { $subject = "http://" . $_SERVER['SERVER_NAME'] . " Здравствуйте, у нас есть обновления по вашим подпискам"; $headers = "Content-type: text/html; charset=utf-8 \r\n"; $headers .= "From: support@cpiki.com"; $users = UsersModel::model()->where(" `subscribe_new_series` = '1' ")->findAll(); foreach ($users as $user) { echo $to = $user->email; $body = "<table width='700'><tr><td style='background-color: black;color: white;font-size: 22px;line-height: 40px; color:#fff; padding-left: 20px;'>cpiki</td></tr><tr><td style=' font-size: 20px; line-height: 100px;padding-left: 50px;'>Здравствуйте, у нас есть обновления по вашим подпискам</td></tr><tr><td>"; $body .= "<table>"; $num = 0; $serials = UserSubscribeModel::model()->where("`user_id` = {$user->id} ")->findAll(); foreach ($serials as $serial) { $movie = MoviesModel::model()->where("`id` = {$serial->serial_id} ")->findRow(); $seasons = SeasonModel::model()->where("`serial_id` = '{$movie->id}'")->findAll(); foreach ($seasons as $season) { $series = SeriesModel::model()->where(" `season_id` = {$season->id} ")->findAll(); foreach ($series as $single) { if (SeriesModel::isNewSeries($single->date)) { $sdSrc = $movie->poster; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $sdSrc)) { $sdSrc = "/assets/images/templates/no_image.png"; } $body .= "<tr><td style=' line-height: 40px;'><img width='150' src='http://" . $_SERVER['SERVER_NAME'] . $sdSrc . "' /></td>"; $body .= "<td style=' vertical-align: top; padding-left: 20px;' ><p style=' line-height: 80px; font-size: 20px;'><a href='http://" . $_SERVER['SERVER_NAME'] . "/serials/" . $movie->seo_url . "' >" . $movie->en_name . "</a></p>"; $body .= "<p style=' font-size: 16px; color: rgb(126, 126, 126);'>" . $single->sort . " серия " . $season->sort . "-го сезона </p></td></tr>"; $num++; } } } } $body .= "</table></td></tr></table>"; echo $body . "<br/>"; if ($num > 0) { mail($to, $subject, $body, $headers); } } }
$sdWordCount = MovieWordModel::model()->where("`movie_id`='{$movie->id}' AND `series_id`='{$single->id}'")->countAll(); if ($user_major || $single->is_free == 1 || $_SESSION['user']['admin'] == 1) { $userSingleAdminS = 0; } else { $userSingleAdminS = 1; } $onclickSeriesPlay = "scriptNextSeriesPlayUpdate2(" . $single->id . "); scrPlayPr(); playVideo('" . $single->url . "', '" . $single->en_sub . "', '" . $single->ru_sub . "','" . $single->sort . "'," . $season->sort . ",'" . $sdSrc . "','" . $single->id . "'," . $single->season_id . "," . $movie->id . ", '" . $sdWordCount . "', '" . $explanationCount . "'," . $userSingleAdminS . "," . $user->id . ");"; ?> <div class="film-item <?php if (!empty($userSeriesViewsed->id)) { echo 'viewed'; } ?> <?php if (SeriesModel::isNewSeries($single->date) && empty($userSeriesViewsed->id)) { echo 'new'; } ?> " style="background-image: url(<?php echo $sdSrc; ?> )"> <a href="#" class="series-link-to-play <?php echo $sdIdFirst; ?> single_id-<?php echo $single->id; ?> " series_id="<?php echo $sdNum;