<?php
	include("inside/config.php");
	session_start();
	$user=$_SESSION['username'];
	if(empty($user))
	{
		echo "<script>window.location='login.php'</script>";
	}
	$id=$_REQUEST['id'];
	$sql=mysql_query("select * from `articles` where `article_id`='$id'");
	$rs=mysql_fetch_array($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Admin Panel : Frontier Public High School</title>
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<?php include('inside/jsfunctions.php'); ?>
</head>
<body>
<?php include('inside/header.php'); ?>
<!-- Container -->
<div id="container">
	<div class="shell">
		
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Dashboard</a>
			<span>&gt;</span>
			Article Detail
		</div>
		<!-- End Small Nav -->
		<!-- Message OK -->		
		<?php if($type=="ok"){ ?>
        <div class="msg msg-ok" id="msgok">
			<p><strong><?php echo $msg; ?></strong></p>
			<a href="#" class="close" onclick="removeOk();">close</a>
		</div>
		<!-- End Message OK -->		
		<?php } ?>
		<!-- Message Error -->
		<?php if($type=="error"){ ?>
		<div class="msg msg-error" id="error">
			<p><strong><?php echo $msg; ?></strong></p>
			<a href="#" class="close" onclick="removeError();">close</a>
		</div>
        <?php } ?>
		<!-- End Message Error -->

		<br />
		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>
			
			<!-- Content -->
			<div id="content">
				
				<!-- Box --><!-- End Box -->
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2> Article Detail View</h2></div>
					<!-- End Box Head -->
					
					<form action="edit-article.php?action=update&id=<?php echo $id; ?>" method="post" enctype="multipart/form-data">
						
						<!-- Form -->
						<div class="form">
								<p>
								  <label>Article Title </label>
									<input name="ftitle" type="text" class="field size1" id="ftitle" value="<?php echo $rs['article_heading'];?> " disabled="disabled" />
								</p>	
						  <p class="inline-field">
									<span class="req"></span>
                              <label>Article Page</label>
							<select name="fpage" class="field size3a" id="fpage" disabled="disabled">
							  <option value="echo $rs['page_name'];"><?php echo $rs['page_name']; ?></option>
                            </select>
                          </p>
						  <p>
								  <label>Picture</label>
							<div style="width:748px;"><img src="<?php echo $rs['article_picture']; ?>" style="width:97%; height:100%;"  /></div>
						  </p>		
								<p>
								  <label>Content</label>
									<div style="background-color:#FFFFFF; border:1px solid #CCCCCC; font-family: Verdana, sans-serif; font-size:13px; padding:5px;"><p>
                                   
									<?php  echo nl2br($rs['article_content']);?></p></div>
						  </p>	
							
						</div>
						<!-- End Form -->
						
						<!-- Form Buttons -->
						<div class="buttons">
							<input type="button" class="button" value="Go Back!" onclick="window.location='index.php'" />
						</div>
						<!-- End Form Buttons -->
					</form>
				</div>
				<!-- End Box -->

			</div>
			<!-- End Content -->
			
			<!-- Sidebar -->
			<div id="sidebar">
				
				<!-- Box -->
			  <div class="box">
					
					<!-- Box Head -->
					<div class="box-head">
						<h2>Management</h2>
					</div>
					<!-- End Box Head-->
					
					<div class="box-content">
				</div>
				</div>
				<!-- End Box -->
			</div>
			<!-- End Sidebar -->
			
			<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->
<?php include("inside/footer.php"); ?>
</body>
</html>