<?php $data = new data(); $id = $_SESSION['user']['id'] ? $_SESSION['user']['id'] : $_COOKIE['user_id']; $result = $data->vipnews($id, 6); $result1 = $data->gennews($id, 6); if (isset($_SESSION['idnews'])) { $idnews = $_SESSION['idnews']; } if (Route::dispatcher() == "vip-news") { $result = $data->vipnews($id, 0); ?> <div class = "news-page-title">VIP-Новости</div> <div><?php echo $result; ?> </div> <div class = "clear"></div> <?php } elseif (Route::dispatcher() == "gen-news") { $result2 = $data->gennews($id, 0); ?> <div class = "news-page-title">Новости</div> <div><?php echo $result2; ?> </div> <div class = "clear"></div>
<?php $data = new data(); if (isset($_SESSION['idnews'])) { $idnews = $_SESSION['idnews']; } ?> <?php if (Route::dispatcher() == "gen-news") { ?> <?php $result1 = $data->gennews(0); ?> <div class = "news-page-title">Новости</div> <div><?php echo $result1; ?> </div> <div class = "clear"></div> <?php } elseif (Route::dispatcher() == "view-news") { ?> <?php $result = $data->viewnews($idnews); ?> <?php echo $result; ?>