	<script type="text/javascript" src="<?php echo $thisPage; ?>js/messages.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo $thisPage; ?>css/messages.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $thisPage; ?>css/captcha.css" />
    <?php
	$idEvent = "ExhibitorAddProduct";
	echo "<script>";
		echo "function validate(form) {";	
		$sql = "select designName from form_label, form_design where labelType='".$idEvent."' and labelID=labelParentID and validasi='YES' order by designORDER asc";
		//echo "<br> sql : ".$sql; 
		if ($hasil = mysql_query($sql)) {
			while ($rec = mysql_fetch_array($hasil)) {
				if ($rec["designName"] != "website") {
					echo "var ".$rec["designName"]." = form.".$rec["designName"].".value;";
					echo '
						if('.$rec["designName"].' == "") {
							inlineMsg("'.$rec["designName"].'","Field can not be empty.",2);
							return false;
					  	} else {
							var targetdiv = document.getElementById("'.$rec["designName"].'"); 
					  		targetdiv.style.backgroundColor = "white";
					  	}
					';	
				}
			}
		}	
		echo "
				return true;
			}
		";

	echo "</script>";


	$addProduct = $_POST["addProduct"];
	$ctr = 0;

	$id = $_REQUEST["id"];
	$idproduct = $_REQUEST["idproduct"];
	//echo "<br>id: ".$id;

	$sql = "SELECT * FROM exhibitor_list WHERE exhibitorID = '$id'";
	$max = mysql_num_rows(mysql_query($sql));
	if ($hasil = mysql_query($sql)) {
		if ($max > 0) {
			echo '
			<h3>Manage Products</h3>
			<div class="tabel font15">
				<h4>Company Info</h4>';
				while ($data = mysql_fetch_array($hasil)) {
					$exhibitorID = $data["exhibitorID"];
					echo '
					<div class="content-column nopointer border-top border-bottom border-left border-right">
						<div class="tabel25 padding10 alignCenter">
							<strong>Company Name</strong>
						</div>
						<div class="tabel75 border-left padding10">
							'.strtoupper($data["companyName"]).'
						</div>
					</div>
					<div class="content-column nopointer border-bottom border-left border-right">
						<div class="tabel25 padding10 alignCenter">
							<strong>Hall & Stand Number</strong>
						</div>
						<div class="tabel75 border-left padding10">';
							$sql2 = "SELECT * FROM exhibitor_list_hallstand WHERE to_exhibitor_id = '".$data["exhibitorID"]."' order by hallStandID";
							if (mysql_num_rows(mysql_query($sql2))) {
								echo '
								<ul class="list">';
								if ($hasil2 = mysql_query($sql2)) {
									while ($data2 = mysql_fetch_array($hasil2)) {
										echo '
										<li>';
											FindData($data2["to_hall_id"], "form_element_value", $dataTitle, $dataRecord);												
											echo $dataRecord." | ";
											echo "Stand number: ".$data2["standNumber"];
										echo '
										</li>
										';	
									}
								}
								echo '
								</ul>';
							}
						echo '
						</div>
					</div>
					';
				}
			echo '
			</div>';
			if (!$addProduct && !$idproduct) {
				echo '
				<form name="form" id="form" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">
					<div align="center" style="margin-top:20px">
						<input type="hidden" name="exhibitorID" id="exhibitorID" value="'.$exhibitorID.'">
						<input type="submit" name="action" id="action" class="button" value="Manage Company Info">
					</div>
				</form>';
			}
		}
	}
	
	if ($addProduct == "Manage Products" || $idproduct) {		
		include ("add_products_data.php");
	} else {
		echo '
		<form name="form" id="form" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">
			<div class="tabel font15">
				<h4>Products</h4>
			</div>
			<div align="right" style="margin-bottom:10px">
				<input type="hidden" name="action" id="action" value="addProduct" />
				<input type="hidden" name="addProduct" id="addProduct" value="Manage Products">
				<input type="hidden" name="id" id="id" value="'.$id.'" />
				<input type="submit" name="addProductData" id="addProductData" class="button" value="Add Product">
			</div>
			<div class="tabel font15">
				<div class="head-column border-both">
					<div class="tabel5 padding10 alignCenter">
						<strong>No</strong>
					</div>
					<div class="tabel35 border-left padding10">
						<strong>Category</strong>
					</div>
					<div class="tabel25 border-left padding10">
						<strong>Sub Category</strong>
					</div>
					<div class="tabel30 border-left padding10">
						<strong>Product</strong>
					</div>
					<div class="tabel5 border-left alignCenter padding10">
					</div>
				</div>
				<div style="clear:both"></div>';
				$sql = "SELECT * FROM exhibitor_list_products WHERE exhibitor_id = '$id'";
				//echo $sql; 
				$nomor = 0;
				if ($hasil = mysql_query($sql)) {
					while ($data = mysql_fetch_array($hasil)) {
						$nomor ++;
						$tablink  = 'onclick="';
						$tablink .= "location='".$thisPage."adm1n/pages/product-services/?action=editProduct&id=".$data["exhibitor_id"]."&idproduct=".$data["listProductID"]."'";
						$tablink .= '"';
						echo '
						<div '.$tablink.' class="content-column border-right border-bottom border-left">
							<div class="tabel5 padding10 alignCenter">
								'.$nomor.'
							</div>
							<div class="tabel35 border-left padding10">
								'.FindDataSingle("form_element_sub", "elementSubID", $data["product_category"], 'elementSubDescription').'
							</div>
							<div class="tabel25 border-left padding10">
								'.FindDataSingle("form_element_value", "valueID", $data["product_sub_category"], 'valueName').'
							</div>
							<div class="tabel30 border-left padding10">
								'.$data["product_name"].'
							</div>
							<div class="tabel5 border-left alignCenter padding10">
								<img width="15" src="'.$thisPage.'/images/icons/delete-icon.png" border="0">
							</div>
						</div>';
					}
				}
				echo '
			</div>
		</form>
		<p>&nbsp;</p>';
	}
	?>





