<?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);
	$tmp = $thisUrl."adm1n/functions/php_functions.php";
	include ($tmp);
	$tmp = $thisUrl."adm1n/functions/getUrl.php";
	include ($tmp);

	$sql  = "select * from exhibitor_register order by date_register desc";
	$sql2 = "select distinct(country) from exhibitor_register";
	$maxCountry = mysql_num_rows(mysql_query($sql2));
	
	$max = mysql_num_rows(mysql_query($sql));
	
	$perhalaman = 15;
	$page = $_SESSION["page"];
	if ($page){
		$start=($page - 1) * $perhalaman;
	} else {
		$start=0;
	}

	$sql  .= " LIMIT $start, $perhalaman";
	
	if ($max > 0) {
		echo '
		<div id="tab-content-1">
			<h3>Exhibitor List</h3>
			<p>';
				echo '
				<div class="tabel font15">
					<div class="head-column border-both">
						<div class="tabel5 padding10 alignCenter">
							<strong>No</strong>
						</div>
						<div class="tabel25 border-left padding10">
							<strong>Date Register</strong>
						</div>
						<div class="tabel35 border-left padding10">
							<strong>Full Name</strong>
						</div>
						<div class="tabel35 border-left padding10">
							<strong>Company Name</strong>
						</div>
					</div>';
					$nomor = $start;
					if ($hasil = mysql_query($sql)) {
						while ($data = mysql_fetch_array($hasil)) {
							$nomor++;
							$tablink  = 'onclick="';
							$tablink .= "location='".$thisPage.'adm1n/pages/registered-exhibitor/?regID='.$data["exhibitorID"]."'";
							$tablink .= '"';
							echo '
							<div '.$tablink.' class="content-column border-right border-bottom border-left">
								<div class="tabel5 padding10 alignCenter">
									'.$nomor.'
								</div>
								<div class="tabel25 border-left padding10">
									'.date ("l, d-F-Y", strtotime($data["date_register"])).'
								</div>
								<div class="tabel35 border-left padding10">
									'.$data["fullName"].'
								</div>
								<div class="tabel35 border-left padding10">
									'.$data["perusahaan"].'
								</div>
							</div>
							';
						}
					}												
					echo '	
					<div align="center" style="margin:15px 0px 35px 0px">';
						$tmp = $thisUrl."functions/fungsi_paging.php";
						include($tmp);
						halaman($max, $perhalaman, 3, "?");
					echo '	
					</div>
				</div>
			</p>
		</div>';
	} 
	?>
