whoami7 - Manager
:
/
home
/
gracious
/
hris.graciousphils.com
/
backup hris employee
/
Upload File:
files >> /home/gracious/hris.graciousphils.com/backup hris employee/bulletinboard.php
<?php session_start(); include('includes/config.php'); error_reporting(0); include('includes/config.php'); if (empty($_SESSION['emplogin'])) { header('location:index.php'); exit; // Always exit after a header redirect } else { ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>Bulletin Board</title> <!-- Bootstrap core CSS --> <link rel="stylesheet" href="includes/assets/bootstrap.min.css"> <!-- Custom styles for this template --> <!--<link href="css/modern-business.css" rel="stylesheet"> --> </head> <body> <!-- Navigation --> <?php include('includes/sidebar.php');?> <!-- Page Content --> <div class="container-fluid" style="padding-top: 25px;"> <div class="row" style="margin-top: 4%"> <!-- Blog Entries Column --> <div class="col-md-8"> <div class="card"> <div class="card-header bg-primary text-white"> <h3><img src="https://img.icons8.com/stickers/50/null/magazine.png"/>Bulletin Board / News Board</h3> </div> <div class="card-body"> <div class="row"> <?php /*/ if (isset($_GET['pageno'])) { $pageno = $_GET['pageno']; } else { $pageno = 1; } $no_of_records_per_page = 8; $offset = ($pageno-1) * $no_of_records_per_page; $total_pages_sql = "SELECT COUNT(*) FROM tblposts"; $result = $dbh->prepare($total_pages_sql); $total_rows=$result->fetchAll(PDO::FETCH_OBJ); //$result = mysqli_query($dbh,$total_pages_sql); //$total_rows = mysqli_fetch_array($result)[0]; $total_pages = ceil($total_rows)/8; /*/ $sql = "SELECT tblposts.id as pid,tblposts.PostTitle as posttitle,tblposts.PostImage,tblcategory.CategoryName as category,tblcategory.id as cid ,tblsubcategory.Subcategory as subcategory,tblposts.PostDetails as postdetails,tblposts.PostingDate as postingdate,tblposts.PostUrl as url from tblposts left join tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on tblsubcategory.SubCategoryId=tblposts.SubCategoryId where tblposts.Is_Active= '1' order by tblposts.id desc limit 12"; $query = $dbh->prepare($sql); $query-> execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { foreach ($results as $result) { ?> <div class="col-md-4"> <div class="card mt-2" style="height: 100%; width: 100%;"> <div class="card-header bg-primary"></div> <div class="card-header bg-white"> <img class="card-img-top" src="hradmin/postimages/<?php echo htmlentities($result->PostImage);?>" alt="<?php echo htmlentities($result->posttitle);?>" style="height: 100%; width: 100%;"> </div> <div class="card-body text-dark bg-white"> <b><h2 class="card-title"><?php echo htmlentities($result->posttitle);?></h2></b> <p><!--category--> <a class="badge bg-primary text-decoration-none link-light" href="category.php?catid=<?php echo htmlentities($result->cid)?>" style="color:#fff"><?php echo htmlentities($result->category);?></a> <!--Subcategory---> <a class="badge bg-primary text-decoration-none link-light" style="color:#fff"><?php echo htmlentities($result->subcategory);?></a></p> <a href="news-details.php?nid=<?php echo htmlentities($result->pid)?>" class="btn btn-primary">Read More →</a> </div> <div class="card-footer bg-primary text-white"> Posted on <?php echo htmlentities($result->postingdate);?> </div> </div> </div> <?php }} ?> </div> </div> </div> </div> <!-- Sidebar Widgets Column --> <div class="col-md-4"> <div class="card md-4 border-primary"> <h5 class="card-header bg-primary text-white"><img src="https://img.icons8.com/stickers/40/null/category.png"/> Categories</h5> <div class="card-body bg-white"> <div class="row"> <div class="col-lg-6"> <ul class="list-unstyled mb-0"> <?php $sql = "SELECT * FROM tblcategory"; $query = $dbh->prepare($sql); $query-> execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { foreach ($results as $category) { ?> <li> <a class="text-info" href="category.php?catid=<?php echo htmlentities($category->id)?>"><?php echo htmlentities($category->CategoryName);?></a> </li> <?php }} ?> </ul> </div> </div> </div> </div> <div class="card md-4 mt-2 border-primary"> <h5 class="card-header bg-primary text-white"><img src="https://img.icons8.com/stickers/40/null/news--v1.png"/> Recent News</h5> <div class="card-body bg-white"> <ul class="mb-0"> <?php $sql = "SELECT tblposts.id as pid,tblposts.PostTitle as posttitle from tblposts left join tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on tblsubcategory.SubCategoryId=tblposts.SubCategoryId limit 8"; $query = $dbh->prepare($sql); $query-> execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { foreach ($results as $subcategory) { ?> <li> <a class="text-info" href="news-details.php?nid=<?php echo htmlentities($subcategory->pid)?>"><?php echo htmlentities($subcategory->posttitle);?></a> </li> <?php }} ?> </ul> </div> </div> <div class="card md-4 mt-2 border-primary"> <h5 class="card-header bg-primary text-white"><img src="https://img.icons8.com/stickers/40/null/radio-2.png"/> Popular News</h5> <div class="card-body bg-white"> <ul> <?php $sql = "SELECT tblposts.id as pid,tblposts.PostTitle as posttitle from tblposts left join tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on tblsubcategory.SubCategoryId=tblposts.SubCategoryId order by viewCounter desc limit 5"; $query = $dbh->prepare($sql); $query-> execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { foreach ($results as $result) { ?> <li> <a class="text-info" href="news-details.php?nid=<?php echo htmlentities($result->pid)?>"><?php echo htmlentities($result->posttitle);?></a> </li> <?php }} ?> </ul> </div> </div> <!-- ============================================= Search Option ============================================= <div class="card mb-4"> <h5 class="card-header bg-warning text-white">Search</h5> <div class="card-body"> <form name="search" action="search.php" method="post"> <div class="input-group"> <input type="text" name="searchtitle" class="form-control" placeholder="Search for..." required> <span class="input-group-btn"> <button class="btn btn-info" type="submit">Go!</button> </span> </div> </form> </div> </div> ============================================= Search Option ============================================= --> </div> <!-- Sidebar Widgets Column --> </div> <!-- /.row --> </div> <!-- /.container --> <!-- Footer --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </head> </body> </html> <?php }?>
Copyright ©2021 || Defacer Indonesia