<title>Notification</title>
<div id="pagetitle">NOTIFICATION</div>
<div id="batascontent">
	<div id="tomboltambah">
		<a href="?m=notification_read" class="addbutton">Mark as Read</a>
		<a href="?m=notification_hapus" class="addbutton">Remove All</a>
	</div>
	<div id="tableres">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="example">
			<thead>
				<tr align="left">
					<th>NO</th>
					<th>USER</th>
					<th>ACTION</th>
					<th>DESCRIPTION</th>
					<th>DATE</th>
					<th>IP</th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<?php
					$nomor = 1;
					$db = mysqli_query($koneksi, "SELECT * FROM cmas_notification ORDER BY notification_id DESC");
					while($dt = mysqli_fetch_array($db)) {
				?>
					<tr>
						<td align="center" width="1%">
							<?php echo $nomor; ?>
						</td>
						<?php if ($dt['notification_read'] != 0) { ?>
							<td width="15%">
								<a href="?m=notification_details&id=<?php echo $dt['notification_id']; ?>">
									<b><?php echo $dt["posted_nama"]; ?></b>
								</a>
							</td>
							<td width="15%">
								<b><?php echo $dt['notification_status']; ?></b>
							</td>
							<td>
								<b><?php echo $dt['notification_description']; ?></b>
							</td>
							<td width="15%">
								<b><?php echo date_format(date_create($dt['postdated']), 'd/m/Y H:i:s'); ?></b>
							</td>
							<td>
								<b><?php echo $dt['notification_ip']; ?></b>
							</td>
						<?php } else { ?>
							<td width="15%">
								<a href="?m=notification_details&id=<?php echo $dt['notification_id']; ?>">
									<?php echo $dt["posted_nama"]; ?>
								</a>
							</td>
							<td width="15%">
								<?php echo $dt['notification_status']; ?>
							</td>
							<td>
								<?php echo $dt['notification_description']; ?>
							</td>
							<td width="15%">
								<?php echo date_format(date_create($dt['postdated']), 'd/m/Y H:i:s'); ?>
							</td>
							<td>
								<?php echo $dt['notification_ip']; ?>
							</td>
						<?php } ?>
						<td width="1%">
							<a href="?m=notification_details&id=<?php echo $dt['notification_id']; ?>">
								<img src="assets/images/icons/icon_view.png" width="20" title="Lihat Data">
							</a> 
						</td>
					</tr>
				<?php $nomor++;	} ?>
			</tbody>
		</table>
	</div>
</div>