<?php session_start();
	include_once("../../functions/init.php"); 

	$tmp = $thisUrl."adm1n/functions/access.php";
	include ($tmp);

	$tmp = $thisUrl."adm1n/functions/koneksi.php";
	include_once ($tmp);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<?php
		$tmp = $thisUrl."adm1n/functions/head_section.php";
		include ($tmp);
		?>
    </head>	
	<body>
    	<div class="se-pre-con"></div>
		<center>
			<table width="1024">
				<tr valign="top">
					<td width="207" class="bg">
						<?php 
						$tmp = $thisUrl."adm1n/functions/kiri.php";
						include ($tmp);
						?>
					</td>
					<td width="10"></td>
					<td width="807">
						<?php 
						$tmp = $thisUrl."adm1n/functions/logo.php";
						include ($tmp);
						
						$tmp = $thisUrl."adm1n/functions/getUrl.php";
						include ($tmp);
						
						$tmp = $thisUrl."adm1n/functions/php_functions.php";
						include ($tmp);

						echo '<div>'.$txt_legend.'</div>';

						$action = $_REQUEST["action"];
						$exhibitorID = $_POST["exhibitorID"];
						
						if ($action == "addRecord"){
							include ("add_record.php");
						} else if ($action == "Manage Company Info"){
							include ("edit_record.php");
						} else if ($action == "addProduct"){
							include ("add_product.php");	
						} else if ($action == "delete"){
						} else {
							$addRecord = "location='?action=addRecord'";
							echo '						
							<div align="right" style="margin-bottom:10px">
								<div id="tab1`" class="button" onClick="'.$addRecord.'">Add Record</div>
							</div>
							<div class="tabel font15">
								<div class="head-column border-both">
									<div class="tabel5 padding10 alignCenter">
										<strong>No</strong>
									</div>
									<div class="tabel65 border-left padding10">
										<strong>Company Name</strong>
									</div>
									<div class="tabel20 border-left alignCenter padding10">
										<strong>Action</strong>
									</div>
								</div>
							
							';
							$sql  = "select * from exhibitor_list order by exhibitorID";
							if ($hasil = mysql_query($sql)) {
								$counter = 0;
								while ($data = mysql_fetch_array($hasil)) {
									$counter++;
									$addProduct  = 'onclick="';
									$addProduct .= "location='?action=addProduct&id=".$data["exhibitorID"]."'";
									$addProduct .= '"';
									echo '
									<div '.$addProduct.' class="content-column border-right border-bottom border-left">
										<div class="tabel5 padding10 alignCenter">
											'.$counter.'
										</div>
										<div class="tabel65 border-left padding10">
											'.$data["companyName"].'
										</div>
										<div class="tabel20 border-left padding10 alignCenter">
											Delete
										</div>
									</div>
									';
								}
							}
							echo '
							</div>';
						}

						?>
					</td>
				</tr>
			</table>
		</center>
	</body>
</html>	