<?php
if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__)){
echo "<p align=center><br><br><br><br><br><br><font size=\"6\" color=\"#FF0000\">ILLEGAL ACCESS !!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=../index.php\">";
exit();} 
?>

 <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Notification
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Notification</li>
      </ol>
    </section>


    <section class="content">



 <div class="row">

          <div class="col-lg-12 col-12">
            <div class="box">
				<div class="box-header with-border">
              		<h5 class="box-title">Recent posts</h5>
				</div>
				<div class="box-body p-0">
				  <div class="media-list media-list-hover media-list-divided">
				
             <?php
            $querymnmg = "SELECT * FROM notifikasi WHERE username ='$user_session' order by tgl desc limit 4"; 
            $resultmnmg = mysql_query($querymnmg) or die(mysql_error());
            while($rowmnmg = mysql_fetch_array($resultmnmg)){
			$kd88 = $rowmnmg['kode'];
			$judulnotif = $rowmnmg['judul'];
			$isinotif = $rowmnmg['isi'];
			$badgene = $rowmnmg['badge'];
			$fawesom = $rowmnmg['jn'];
			$tglen = formatgl($rowmnmg['tgl']);
			$srttglmmg = strtotime($rowmnmg['tgl']);
            $srttglendg = strtotime($clientdate);
			$jlneeg = floor(abs($srttglendg - $srttglmmg));
			
			if($jlneeg < 60){
			$jlnxg = "just now";
			
			}else if($jlneeg > 60 && $jlneeg < 3600){
			$jlnxg = floor(abs($jlneeg/60))." minutes";
			
			}else if($jlneeg > 3600 && $jlneeg < 86400){
			$jlnxg = floor(abs($jlneeg/3600))." hours";
			
			}else if($jlneeg > 86400 && $jlneeg < 604800){
			$jlnxg = floor(abs($jlneeg/86400))." days";
			
			}else if($jlneeg > 604800 && $jlneeg < 2592000){
			$jlnxg = floor(abs($jlneeg/604800))." week";
			
			}else if($jlneeg > 2592000){
			$jlnxg = floor(abs($jlneeg/2592000))." month";
			
			}else{}
		
?> 
                    
                 	
                      <a class="media media-single" href="#">
					  <span class="avatar avatar-sm bg-blue"><i class="fa fa-info"></i></span>
					  <div class="media-body">
						<p><strong><?php echo $judulnotif; ?></strong><br /><?php echo $isinotif; ?></p>
						<time datetime="2017-07-14 20:00"><?php echo $tglen; ?></time>
					  </div>
					</a>
                    
                               
        
	<?
		}
	?>
                
                
                
                    
                    
                    
                    
				  </div>
				</div>
             
            </div>
          </div>



</div>
</section>