PK

ADDRLIN : /home/anibklip/adhocacademy.com/admin/news/
FLL :
Current File : /home/anibklip/adhocacademy.com/admin/news/news_form.php

<?php
	session_start();
	include_once('../../include/common.php');
	include_once('../../include/session.php');
	include_once('../../include/connection.php');
?>

<!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=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="../../css/style.css" />
<script language="javascript">

function emptyfield()
	{
		var news=document.getElementById("news");
		if(news.value=='')
		{
			alert("Enter your News");
			news.focus();
			return false;
		}
	}
</script>
</head>

<body>
<form action="news_action.php" method="post">

<?php
	$act='add';
	if($_GET['action']=='edit')
		{
			$edit="SELECT * FROM news where id='".$_GET['id']."'";
			$result=mysql_query($edit);
			$editrow=mysql_fetch_array($result);
			//extract($editrow);
			$act='edit';
			($editrow['status']==1 ? $enable='checked="checked"' : $disable='checked="checked"');
		}
		
?>

<table border="0px" width="100%" align="center" cellpadding="0" cellspacing="0">
<!--header-->
	<tr>
		<td><?php include_once '../../include/adminheader.php'; ?></td>
	</tr>
<!--end header-->

<!--middle-->
	<tr>
		<td>
			<table align="center" border="0px" height="250px" width="500px">
					
                    <tr>
						<td align="center">
							<fieldset style="border:4px solid;-moz-border-radius:15px;color:#F4A933;">
								<legend style="font-family:Arial; font-size:16px;">Enter News</legend>
								<textarea rows="3" cols="50" name="news" id="news" /><?=$editrow['news']; ?></textarea><br /><br />
                                Enable<input type="radio"  name="status" value="1" <?php echo $enable; ?>/> Disable<input type="radio" name="status" value="0"  <?php echo $disable; ?>/>
								<br />
                                 <input type="hidden" name="action" value="<?=$act; ?>" />
                                 <input type="hidden" name="id" value="<?=$editrow['id']; ?>" /><br />
								<input type="submit" value="Submit" onclick="return emptyfield();" class="submit"  />
                               
							</fieldset>
						</td>
					</tr>
			</table>
		</td>
	</tr>
<!--end middle-->

<!--footer-->
	<tr>
		<td><?php include_once '../../include/adminfooter.php'; ?></td>
	</tr>
<!--end footer-->
</table>
</form>
</body>
</html>


PK 99