<?php session_start();
	if (!$_SESSION['nama']){
		echo "<script language=JavaScript>";
		echo "location.href = 'login.php';";
		echo "</script>";
	}
	include ("../koneksi.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title> WEBSITE BACKOFFICE </title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<link href="style.css" rel="stylesheet" type="text/css">
		<script language="JavaScript" type="text/javascript" src="richtext.js"></script>
		<script language="JavaScript" type="text/javascript">
		<!--
		function submitForm() {
			//make sure hidden and iframe value are in sync before submitting form
			//to sync only 1 rte, use updateRTE(rte)
			//to sync all rtes, use updateRTEs
			updateRTE('deskripsi');
			//updateRTEs();
			//alert("rte1 = " + document.RTEDemo.content.value);
			
			//change the following line to true to submit form
			return true;
		}
		
		//Usage: initRTE(imagesPath, includesPath, cssFile)
		initRTE("images/", "", "");
		//-->
		</script>				
	</head>	
	<body>
		<center>
			<table width="1000">
				<tr valign="top">
					<td width="207" class="bg">
						<?php include("kiri.php"); ?>
					</td>
					<td width="10"></td>
					<td width="783">
						<!-- Begin Kanan -->
						<?php 
						include ("logo.php"); 
						if ($action=="add") {
						
						} else if ($action=="edit") {
						
						} else {
							?>
							<table width="100%" cellpadding="5" cellspacing="0" border="0">
								<tr><td><strong><?php echo $nama_menu; ?></strong></td></tr>
								<tr valign="top">
									<td>
										<div align="right"><a href="?menu=2&id=<?php echo $id?>&action=add"><strong>ADD News</strong></a></div>
										<table width="100%" cellpadding="6" cellspacing="1" bgcolor="#CCCCCC">
											<tr bgcolor="#EEEEEE">
												<td width="5%" align="center"><strong>ID</strong></td>
												<td width="20%"><strong>Date</strong></td>
												<td width="60%"><strong>Title</strong></td>
												<td width="15%" align="center"><strong>Action</strong></td>
											</tr>										
											<?php 
											if ($koneksi){
												$nomor = 0;
												$query="select * from content where kategori=12 order by tanggal desc ";
												if ($hasil=mysql_query($query)) {
													while($data=mysql_fetch_array($hasil)){													
														$nomor=$nomor+1;
														?>
														<tr bgcolor="#FFFFFF">
															<td align="center"><?php echo $nomor; ?> </td>
															<td><?php echo date("l, F  d,  Y", strtotime($data["tanggal"])); ?></td>
															<td><?php echo $data["title"]; ?></td>
															<td align="center">
																<a href="news.php?menu=2&id2=<?php echo $data["id"]?>&action=edit">Edit</a>
																&nbsp; | &nbsp; 
																<a href="news.php?menu=2&id=<?php echo $data["id"]?>&action=delete">Delete</a>
															</td>
														</tr>
														<?php
													}
												}
											}	
											?>
										</table>
									</td>
								</tr>
							</table>				
							<?php
						}
						?>
						<!-- Begin Kanan -->
					</td>
				</tr>
			</table>
		</center>
	</body>
</html>	