<?php
	include("../session.php");
	include("../connect.php");
	$user=$_SESSION['company'];
	$query=mysql_query("select * from company where id='$user'");
	$asd = mysql_fetch_array($query);
	
	$cName = $asd['cName'];
	$cAddress = $asd['address'];
	$cpostcode = $asd['postcode'];
	$ccountry = $asd['country'];
	$countryCode = $asd['countryCode'];
	$cTelno = $asd['telNo'];
	$cEmail = $asd['email'];
	$cPerson = $asd['cPerson'];
	$cRegister = $asd['registerDate'];
	$cExpire = $asd['expireDate'];
	
	$cagent = $asd['agentID'];
	$agentquery=mysql_query("select * from agent where agentID='$cagent'");
	$asdf = mysql_fetch_array($agentquery);
	$cagentName = $asdf['name'];
?>
<html>
<head>
<title>User Page(Company profile)</title>
<link href="header.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>

<style type="text/css"> 
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
p.flip2,div.panel2,p.flip3,div.panel3
{
margin:0px;
padding:5px;
text-align:left;
background:#FFFFFF;
border:solid 1px #c3c3c3;
}
div.panel
{
height:70px;
display:none;
}
div.panel2,div.panel3
{
height:70px;
}
td.asd1
{
background:#F781BE;
}
td.asd2
{
background:#F5A9F2;
}
</style>
</head>
<body>
<center>
<table class=corners cellspacing=1 cellpadding=10 width=700 align=center>
<tr>
<td>
<form action="<?php echo "editInfo2.php"?>" method="POST">
<fieldset>
<legend><h3>Company Profile</h3></legend>
	<table align=center width=600 cellpadding=5 cellspacing=3 border=0>
		<tr>
			<th colspan = "2" align = "center"><h2><font color="#000000"><?php echo $user?></font></h2></th>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>Company Name : </b></td>
			<td align = "left" class=asd2><?php echo $cName?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>Company Address : </b></td>
			<td align = "left" class=asd2><?php echo $cAddress?></br><?php echo $cpostcode?></br><?php echo $ccountry?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>Contact Number : </b></td>
			<td align = "left" class=asd2><?php echo $countryCode?> - <?php echo $cTelno?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>Contact Person : </b></td>
			<td align = "left" class=asd2><?php echo $cPerson?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>Email Address: </b></td>
			<td align = "left" class=asd2><?php echo $cEmail?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>License Register Date : </b></td>
			<td align = "left" class=asd2><?php echo $cRegister?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>License Expire Date : </b></td>
			<td align = "left" class=asd2><?php echo $cExpire?> </td>
		</tr>
		<tr>
			<td align = "right" width="35%" class=asd1><b>Agent Name: </b></td>
			<td align = "left" class=asd2><?php echo $cagentName?> </td>
		</tr>
		<tr>
			<td colspan="2" align="center"><input type="submit" value="Edit Profile"/></td>
		</tr>
	</table>
	</fieldset>
	</form>
		</td>
		</tr>
	</table>
		
	</center>
</body>
</html>
<?php 
include("../closeconnection.php");
?>