<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a> <a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a> </div> <div class="row"> <p class="hidden-sm"> </p> <div class="col-md-4 col-lg-4"> <h2>News</h2> <ul class="style3"> <?php $allNews = RJ_News::getShowingNews(); if ($allNews) { foreach ($allNews as $news) { ?> <li class="first"> <p class="date"><a href="<?php echo SITE_URL . "news/" . $news->news_id; ?> "><?php echo date('M', strtotime($news->news_created)); ?> <b><?php echo date('d', strtotime($news->news_created)); ?> </b></a></p>
function loadnews($id) { $news = RJ_News::get_news_show($id); return $news; }
public function delete($id) { if (ctype_digit($id)) { $news = RJ_News::find_by_id($id); if (file_exists("../public/images/" . $news->news_img)) { unlink("../public/images/" . $news->news_img); } if ($news->delete()) { $_SESSION['adminmessage'] = "Deleted successfully"; } else { $_SESSION['adminmessage'] = "An error occured, please try again"; } } else { $_SESSION['adminmessage'] = "Select the right file"; } return true; }