    <?php
	
	
	$idEvent = "CompletingForm";
	$kontak_dagang_header = kontak_dagang_header($exhibitorID, $idEvent);
	
	//var_dump($kontak_dagang_header);	
	
	$tgl_transaksi = $kontak_dagang_header["tgl_transaksi"];
	$header_id = $kontak_dagang_header["header_id"];
	//echo "<br>header_id: ".$header_id;	
	
	//echo "<br>header_id: ".$header_id;
	
	
	
	$button_label = "Input Kelengkapan Data";
	if ($tglNAMA ==  $tgl_transaksi) {
		$button_label = "Edit Kelengkapan Data";
	}
	?>
    
    <?php
	echo '
	<br>
	<div class="tabel font15">
		<div style="padding-bottom:7px">
			<strong>'.strtoupper("Data Perusahaan").'</strong>
		</div>
		<div class="content-column nopointer border-top border-bottom border-left border-right" style="margin-top:0">
			<div class="tabel25 padding10 alignCenter">
				<strong>Nama Exhibitor</strong>
			</div>
			<div class="tabel75 border-left padding10">
				'.strtoupper($kontak_dagang_header["companyName"]).'
			</div>
		</div>	
		<div class="content-column nopointer border-bottom border-left border-right">
			<div class="tabel25 padding10 alignCenter">
				<strong>Hall & Nomor Stand</strong>
			</div>
			<div class="tabel75 border-left padding10">';
				foreach($kontak_dagang_header["hallName"] as $value) {
					if ($ctr > 0) echo "<br>";
					echo $value;
					$ctr = 0;
					foreach($kontak_dagang_header["standNumber"] as $value) {
						if ($ctr == 0) echo " &nbsp; | &nbsp; No. Stand: ";
						else ", ";
						echo $value;
						$ctr++;
					}
				}
			echo '
			</div>
		</div>
		<div class="content-column nopointer border-bottom border-left border-right">
			<div class="tabel25 padding10 alignCenter">
				<strong>Tanggal Transaksi</strong>
			</div>
			<div class="tabel75 border-left padding10">
				'.indonesian_date($tglNAMA).'
			</div>
		</div>';
		if ($tglNAMA == $tgl_transaksi && !$button_action) {
			echo '
			<br><br>
			<div style="padding-bottom:7px">
				<strong>'.strtoupper("Kelengkapan Data").'</strong>
			</div>
			<div class="content-column nopointer border-top border-bottom border-left border-right" style="margin-top:0">
				<div class="tabel25 padding10">
					<strong>Produk yang paling dicari buyer hari ini</strong>
				</div>
				<div class="tabel75 border-left padding10">
					'.$kontak_dagang_header["ValueFromForm"]["formValue"]["product_fav_hari_ini"].'
				</div>
			</div>
			<div class="content-column nopointer border-bottom border-left border-right" style="margin-top:0">
				<div class="tabel25 padding10">
					<strong>Saran</strong>
				</div>
				<div class="tabel75 border-left padding10">
					'.$kontak_dagang_header["ValueFromForm"]["formValue"]["saran"].'
				</div>
			</div>
			<div class="content-column nopointer border-bottom border-left border-right" style="margin-top:0">
				<div class="tabel25 padding10">
					<strong>TTD Exhibitor</strong>
				</div>
				<div class="tabel75 border-left padding10">
					'.$kontak_dagang_header["ValueFromForm"]["formValue"]["ttd_exhibitor"].'
				</div>
			</div>
			<div class="content-column nopointer border-bottom border-left border-right" style="margin-top:0">
				<div class="tabel25 padding10">
					<strong>TTD Organizer</strong>
				</div>
				<div class="tabel75 border-left padding10">
					'.$kontak_dagang_header["ValueFromForm"]["formValue"]["ttd_organizer"].'
				</div>
			</div>';
		} 
		echo '
	</div>
	<p align="center" class="columntext15" style="margin:0; padding:0; color:#ffffff; text-align:center">
		<div style="display:block;">
			<div style="display:inline-block; text-align:left">
				<form name="formBackToMain" id="formBackToMain" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">
					<div id="submitformBackToMain" class="hvr-sweep-to-right" style="padding:10px 30px; cursor:pointer;">
						<font style="color:#ffffff; text-align:center">
							<< Back to list
						</font>
					</div>
					<input type="hidden" name="action" id="action" value="" />
				</form> 
			</div>
			<div style="display:inline-block; text-align:left">
				<form name="formEntryForm" id="formEntryForm" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">
					<div id="submitformEntryForm" class="hvr-sweep-to-right" style="padding:10px 30px; cursor:pointer;">
						<font style="color:#ffffff; text-align:center">
							'.$button_label.' >>
						</font>
					</div>
					<input type="hidden" name="action" id="action" value="'.$button_label.'" />
					<input type="hidden" name="tglNAMA" id="tglNAMA" value="'.$tglNAMA.'"/>
					<input type="hidden" name="exhibitorID" id="exhibitorID" value="'.$exhibitorID.'"/>
					<input type="hidden" name="button_label" id="button_label" value="'.$button_label.'"/>
					<input type="hidden" name="header_id" id="header_id" value="'.$header_id.'" />
				</form> 
			</div>
		</div>
	</p>';
	
	if ($header_id) {
		$button_label = 'Add New Record';
		echo '
		<br>
			<div class="tabel font15">
				<div style="padding-bottom:7px; display:block;">
					<div style="display:inline-block; float:left">
						<strong>'.strtoupper("Data Komtak Dagang").'</strong>
					</div>
					<div style="display:inline-block; float:right">
						<form name="formNewTransaction" id="formNewTransaction" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">
							<div id="submitformNewTransaction" class="hvr-sweep-to-right" style="padding:10px 30px; cursor:pointer;">
								<font style="color:#ffffff; text-align:center"	>
									Add New Record
								</font>
							</div>
							<input type="hidden" name="action" id="action" value="'.$button_label.'" />
							<input type="hidden" name="tglNAMA" id="tglNAMA" value="'.$tglNAMA.'"/>
							<input type="hidden" name="exhibitorID" id="exhibitorID" value="'.$exhibitorID.'"/>
							<input type="hidden" name="button_label" id="button_label" value="'.$button_label.'"/>
							<input type="hidden" name="header_id" id="header_id" value="'.$header_id.'" />
						</form> 
					</div>
				</div>
				<div class="content-column nopointer border-top border-bottom border-left border-right" style="background-color:#666666; color:#ffffff;">
					<div class="tabel10 padding10 alignCenter">
						<strong>No</strong>
					</div>
					<div class="tabel25 padding10 border-left" style="border-color:#ffffff">
						<strong>Negara</strong>
					</div>
					<div class="tabel35 padding10 border-left" style="border-color:#ffffff">
						<strong>Produk</strong>
					</div>
					<div class="tabel20 padding10 alignRight border-left" style="border-color:#ffffff">
						<strong>Jumlah (US $)</strong>
					</div>
					<div class="tabel10 padding10 alignRight border-left" style="border-color:#ffffff">
						<strong>Action</strong>
					</div>
				</div>';
				$ctr = 0;
				$sql = 
				"SELECT * FROM kontak_dagang_transaksi " .
				"WHERE to_kontak_dagang_header = '".$header_id."'";
				//echo $sql;
				if ($hasil = mysql_query($sql)) {
					echo '
					<form name="formKontakDagang" id="formKontakDagang" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" method="post">';
					while ($data = mysql_fetch_array($hasil)) {
						$ctr++;
						if ($ctr % 2 == 0) 
							$bg = '#ffffff';
						else 
							$bg = '#e6e6e6';
						echo '
						<div id="'.$data["transaksiID"].'-kontakDagang'.'" style="background-color:'.$bg.'" class="content-column border-right border-bottom border-left">
							<div class="tabel10 padding10 alignCenter">
								'.$ctr.'
							</div>
							<div class="tabel25 padding10 border-left">';
								FindData($data["to_negara"], "form_element_value", $dataTitle, $dataRecord);
								echo $dataRecord;
								echo '
							</div>
							<div class="tabel35 padding10 border-left">';
								FindData($data["product_sub_category"], "form_element_value", $dataTitle, $dataRecord);
								echo $dataRecord;
								echo '	
							</div>
							<div class="tabel20 padding10 alignRight border-left">
								'.number_format($data["estimasi_kontrak"], 2) . '
							</div>
							<div class="tabel10 padding10 alignRight border-left">
								<a href="'.$thisPage.'adm1n/'.$curPage1.'?action12=deleteData&transaksiID='.$data["transaksiID"].'"> 
									Delete
								</a>
							</div>
						</div>';
						$total = $total + $data["estimasi_kontrak"];
					}
					if (mysql_num_rows($hasil) > 0) {
						echo '
						<div class="content-column nopointer border-bottom border-left border-right" style="background-color:#999999; color:#ffffff;">
							<div class="tabel80 padding10 alignRight border-left">
								Total kontak dagang hari ini
							</div>
							<div class="tabel20 padding10 alignRight border-left" style="border-color:#ffffff">
								'.number_format($total, 2) . '
							</div>
						</div>';
					}
					
				}
					
				echo '
					<input type="hidden" name="exhibitorID" id="exhibitorID" value="'.$exhibitorID.'"/>
					<input type="hidden" name="header_id" id="header_id" value="'.$header_id.'" />
					<input type="hidden" name="transaksiID" id="transaksiID" value="'.$transaksiID.'" />
				</form>
			</div>
		<p>&nbsp;</p>		
		';
	}
	?>
	
