<?php
	include("inside/config.php");
	session_start();
	$user=$_SESSION['username'];
	if(empty($user))
	{
		echo "<script>window.location='login.php'</script>";
	}
	$currentpage = "career";
	$id=$_REQUEST['id'];
	$sql=mysql_query("select * from `career` where `id`='$id'");
	$row=mysql_fetch_array($sql);
	
	if($_REQUEST['action']=="delete")
	{
		$id=$_REQUEST['id'];
		$sqlDel=mysql_query("delete from `career` where `id`='$id'");
		$type = "ok";
		$msg = "Deletion Successful! ";
	}
?>
<!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>
			Career Uppertunity
		</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" style="margin-left:-10%;">
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head" style="width:147%">
						<h2 class="left">Career Subsmission</h2>
					</div>
					<!-- End Box Head -->	

					<!-- Table -->
					<div class="table">
					  <table width="150%" border="0" cellspacing="0" cellpadding="0">
					    <tr>
					      <th>Name</th>
					      <th>Phone</th>
					      <th>Email </th>
					      <th>Address</th>
					      <th>Education level</th>
					      <th>CV</th>
					      <th width="110" class="ac">Content Control</th>
				        </tr>
					   
<?php
					  		$sql2=mysql_query("select * from `career`");
					  		while($row2=mysql_fetch_array($sql2))
					  		{
					  		?>                        <tr>
  <td class="odd"><h3><?php echo $row2['name']; ?></h3></td>
					      <td><?php echo $row2['phone']; ?></td>
					      <td><a href="mailto:<?php echo $row2['email']; ?>?Subject=RE%20:%20Career%20Uppertunity"><?php echo $row2['email']; ?></a></td>
					      <td><?php echo $row2['address']; ?></td>
		        <td><?php echo $row2['education']; ?></td>
                <td><a href="../<?php echo $row2['cv']; ?>">Download</a></td>
					      <td><a  class="ico del" href="career.php?action=delete&id=<?php echo $row2['id'];?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
</td>
				        </tr>
                        <?php
					  		}
					  		?>
				      </table>
					  <!-- Pagging --><!-- End Pagging -->
						
					</div>
					<!-- Table -->
					
				</div>
				<!-- End Box -->
				
				<!-- Box --><!-- End Box -->

			</div>
			<!-- End Content -->
			
			<!-- Sidebar --><!-- End Sidebar -->
			
		  <div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->
<?php include("inside/footer.php"); ?>
</body>
</html>