<?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."functions/indonesian_date.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 
						$select = "SELECT * FROM exhibitor_list ";
						if ($hasil = mysql_query($select)) {
							while ($data = mysql_fetch_array ($hasil )) {
								$sql2  = "SELECT * FROM exhibitor_list_hallstand 
								WHERE to_exhibitor_id = '" . $data["exhibitorID"] . "' ";
								
								if ($hasil2 = mysql_query($sql2)) {
									if (mysql_num_rows($hasil2) == 0) {
										$sql3  =  "
										INSERT INTO exhibitor_list_hallstand 
										(hallStandID, to_exhibitor_id, to_hall_id, standNumber)
										values (null, '".$data["exhibitorID"]."', '1', 123456)";
										if ($hasil3 = mysql_query($sql3)) {}									}
									
								}
								
							}	
						}
						
						$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>';

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

						$action = $_POST["action"];
						if ($action == "GenerateReport") {
							$laporan = $_POST["laporan"];
							$date_start = $_POST["data_start"];
							$date_end = $_POST["data_end"];
							include ($laporan);
						} else {
							echo '						
							<form name="formLaporan" id="formLaporan" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" method="post">
								<div style="padding-bottom:5px">
									<strong>Pilih Laporan</strong>
								</div>';
								$sql = 
								"SELECT * FROM kd_laporan ";
								if ($hasil = mysql_query($sql)) {
									if (mysql_num_rows($hasil) > 0) {
										echo '
										<select name="laporan" id="laporan">
											<option value=""> - Select Report - </option>';
											while ($data = mysql_fetch_array($hasil)) {
												echo '
												<option value="'.$data["laporanTarget"].'">'.$data["laporanNama"].'</option>';
											}
											echo '
										</select>';
									}
								}
								echo '
								<div style="padding-top:20px; padding-bottom:5px">
									<strong>Pilih Tanggals</strong>
								</div>';
								$sql = 
								"SELECT * FROM kontak_dagang_tanggal ";
								if ($hasil = mysql_query($sql)) {
									if (mysql_num_rows($hasil) > 0) {
										echo 'Dari: 
										<select name="data_start" id="data_start">
											<option value=""> - Select Date - </option>';
											while ($data = mysql_fetch_array($hasil)) {
												echo '
												<option value="'.$data["tglNAMA"].'">'.indonesian_date($data["tglNAMA"]).'</option>';
											}
											echo '
										</select>';
									}
								}
								$sql = 
								"SELECT * FROM kontak_dagang_tanggal ";
								if ($hasil = mysql_query($sql)) {
									if (mysql_num_rows($hasil) > 0) {
										echo '  &nbsp; Sampai: 
										<select name="data_end" id="data_end">
											<option value=""> - Select Date - </option>';
											while ($data = mysql_fetch_array($hasil)) {
												echo '
												<option value="'.$data["tglNAMA"].'">'.indonesian_date($data["tglNAMA"]).'</option>';
											}
											echo '
										</select>';
									}
								}
								echo '
								<div style="display:block; margin-top:25px">
									<div id="submitformLaporan" class="hvr-sweep-to-right" style="padding:10px 30px; cursor:pointer;">
										<font style="color:#ffffff; text-align:center"	>
											Generate Report >>
										</font>
									</div>
									<input type="hidden" name="action" id="action" value="GenerateReport" />
								</div>
							</form>';
						}
						?>
					</td>
				</tr>
			</table>
		</center>
	</body>
</html>	