	<style>
	select.negara{
		-webkit-appearance: none;
		-moz-appearance: none;
		-ms-appearance: none;
		appearance: none;
		outline: 0;
		box-shadow: none;
		border: 0 !important;
		background: #EEEEEE;
		background-image: none;
	}
	/* Remove IE arrow */
	select.negara::-ms-expand {
		display: none;
	}
	/* Custom Select */
	.select {
		position: relative;
		display: flex;
		width: 20em;
		height: 3em;
		line-height: 3;
		background: #EEEEEE;
		overflow: hidden;
		border-radius: .25em;
	}
	select.negara {
		flex: 1;
		padding: 0 .5em;
		font-size:18px;
		color: #222222;
		cursor: pointer;
	}
	/* Arrow */
	.select::after {
		content: '\25BC';
		position: absolute;
		top: 0;
		right: 0;
		padding: 0 1em;
		background: #EEEEEE;
		cursor: pointer;
		pointer-events: none;
		-webkit-transition: .25s all ease;
		-o-transition: .25s all ease;
		transition: .25s all ease;
	}
	/* Transition */
	.select:hover::after {
		color: #f39c12;
	}
	</style>
	
	<?php
	$pilihNegara = (isset($_POST["pilihNegara"]) ? $_POST["pilihNegara"]: null);
	
	$str =
	" SELECT distinct idnegara, namanegara FROM atdag_itpc, dt_negara ".
	" WHERE active = 1 AND countryID = idnegara ".
	" ORDER BY namanegara ";
	if ($result = mysql_query($str)) {
		$selectedNegara = '';
		while ($row = mysql_fetch_array($result)) {
			if ($selectedNegara == '') {
				$selectedNegara = '
				<select class="negara" name="pilihNegara" id="pilihNegara" onchange="this.form.submit()">
					<option selected     fc disabled>Choose a country</option>';
			}
			$pilihan = '';
			if ($pilihNegara == $row["idnegara"]) $pilihan = ' selected ';
			$selectedNegara .= '
			<option '.$pilihan.' value="'.$row["idnegara"].'">
				'.$row["namanegara"].'
			</option>';
		}
		if ($selectedNegara) {
			$selectedNegara .= '
			</select>';
			echo '
			<div style="margin-top:8px">
				<form name="form" id="form" class="form" action="" method="post">
					<div class="select">
						'.$selectedNegara.'
					</div>
				</form>
			</div>';	
		}
	}
	
	$listpic = $listEmail = '';
	$kolom1 = $kolom2 = ''; $ctr = 0;
	
	$str =
	" SELECT * FROM atdag_itpc ".
	" WHERE active = 1 ";
	if ($pilihNegara) $str .= " AND countryID = ".$pilihNegara;
	$str .= 
	" ORDER BY urutan ";
	if ($result = mysql_query($str)) {
		while ($row = mysql_fetch_array($result)) {
			$email = explode(";", $row["email"]); $listEmail = '';
			foreach ($email as $value) {
				if ($listEmail) $listEmail .= '<br>';
				$listEmail .= '
				<a href="mailto:'.$value.'">'.$value.'</a>';
			}

			$ctr++;			
			${"kolom$ctr"} .= '
			<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
				<div class="col l-col12 m-col12 s-col12">
					<p style="line-height:normal">
						<h2 style="margin:28px 0px 5px 0px;" class="h4-teaser">
							'.$row["atdag_itpc"].'
						</h2>
					</p>
				</div>
			</div>';
			if ($row["pic"]) {
				${"kolom$ctr"} .= '
				<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
					<div class="col l-col3 m-col4 s-col4">
						<p style="line-height:normal">PIC</p>
					</div>
					<div class="col l-col9 m-col8 s-col8">';
						$title = explode(";", $row["title"]);
						$pic = explode(";", $row["pic"]); 
						if (count($pic) > 1) {
							${"kolom$ctr"} .= '
							<ul class="list" style="margin-top:0">';
								foreach ($pic as $key => $value) {
									${"kolom$ctr"} .= '
									<li style="line-height:normal">
										<p style="line-height:normal">
											<strong>'.$value.'</strong><br>'.$title[$key].'
										</p>
									</li>';
								}
								${"kolom$ctr"} .= '
							</ul>';
						} else if (count($pic) == 1) {
							${"kolom$ctr"} .= '
							<p style="line-height:normal">
							<strong>'.$pic[0].'</strong><br>'.$title[0].'</p>';
						}
						${"kolom$ctr"} .= '
					</div>
				</div>';
			}
			${"kolom$ctr"} .= '
			<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
				<div class="col l-col3 m-col4 s-col4">
					<p style="line-height:normal">Address</p>
				</div>
				<div class="col l-col9 m-col8 s-col8">
					<p style="line-height:normal">'.$row["address"].'</p>
				</div>
			</div>';
			if ($row["phone"]) {
				${"kolom$ctr"} .= '
				<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
					<div class="col l-col3 m-col4 s-col4">
						<p style="line-height:normal">Phone</p>
					</div>
					<div class="col l-col9 m-col8 s-col8">
						<p style="line-height:normal">';
							$phone = explode(";", $row["phone"]);
							foreach ($phone as $value) {
								${"kolom$ctr"} .= '
								'.$value.'<br>';
							}
							${"kolom$ctr"} .= '
						</p>
					</div>
				</div>';
			}
			if ($row["fax"]) {
				${"kolom$ctr"} .= '
				<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
					<div class="col l-col3 m-col4 s-col4">
						<p style="line-height:normal">Fax</p>
					</div>
					<div class="col l-col9 m-col8 s-col8">
						<p style="line-height:normal">';
							$fax = explode(";", $row["fax"]);
							foreach ($fax as $value) {
								${"kolom$ctr"} .= '
								'.$value.'<br>';
							}
							${"kolom$ctr"} .= '
						</p>
					</div>
				</div>';
			}
			if ($row["email"]) {
				${"kolom$ctr"} .= '
				<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
					<div class="col l-col3 m-col4 s-col4">
						<p style="line-height:normal">Email</p>
					</div>
					<div class="col l-col9 m-col8 s-col8">
						<p style="line-height:normal">'.$listEmail.'</p>
					</div>
				</div>';
			}
			if ($row["website"]) {
				${"kolom$ctr"} .= '
				<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">
					<div class="col l-col3 m-col4 s-col4">
						<p style="line-height:normal">Website</p>
					</div>
					<div class="col l-col9 m-col8 s-col8">
						<a href="http://'.$row["website"].'" target="_blank">
							<p style="line-height:normal">'.$row["website"].'</p>
						</a>
					</div>
				</div>';
			}
			if ($ctr%2==0) $ctr=0;
		}
	}
	echo '
	<div style="display:block">
		<div class="col l-col6 m-col12 s-col12" style="margin:0; padding:0">
			'.$kolom1.'
		</div>
		<div class="col l-col6 m-col12 s-col12">
			'.$kolom2.'
		</div>
	</div>';
	/** 
	echo '
	<div class="col l-col12 m-col12 s-col12" style="margin:0; padding:0">';
	$str =
	" SELECT * FROM atdag_itpc ".
	" WHERE active = 1 ";
	if ($pilihNegara) $str .= " AND countryID = ".$pilihNegara;
	$str .= 
	" ORDER BY urutan ";
	if ($result = mysql_query($str)) {
		while ($row = mysql_fetch_array($result)) {
			//$title = array ("title", "PIC", "Address", "Phone", "Fax", "Email", "Website");
			$email = explode(";",$row["email"]);
			$listEmail = '';
			foreach ($email as $value) {
				if ($listEmail) $listEmail .= '<br>';
				$listEmail .= '
				<a href="mailto:'.$value.'">'.$value.'</a>';
			}
			$pic = explode(";",$row["pic"]);
			$listpic = '';
			foreach ($pic as $value) {
				if ($listpic) $listpic .= '<br>';
				$listpic .= $value;
			}
			echo '
			<div class="col l-col6 m-col12 s-col12" style="padding:0; margin:0; border:1px solid #CCC">
				<div class="col l-col12 m-col12 s-col12">
					<div class="col l-col12 m-col12 s-col12">
						<h2 style="margin:20px 0px 5px 0px;" class="h5-teaser">
							'.strtoupper($row["title"]).'
						</h2>
					</div>
				</div>
				<div class="col l-col12 m-col12 s-col12">
					<div class="col l-col3 m-col4 s-col4">
						PIC
					</div>
					<div class="col l-col9 m-col8 s-col8">
						'.$listpic.'
					</div>
				</div>
				<div class="col l-col12 m-col12 s-col12">
					<div class="col l-col3 m-col4 s-col4">
						Address
					</div>
					<div class="col l-col9 m-col8 s-col8">
						'.$row["address"].'
					</div>
				</div>
				<div class="col l-col12 m-col12 s-col12">
					<div class="col l-col3 m-col4 s-col4">
						Phone
					</div>
					<div class="col l-col9 m-col8 s-col8">
						'.$row["phone"].'
					</div>
				</div>';
				if ($row["fax"]) {
					echo '
					<div class="col l-col12 m-col12 s-col12">
						<div class="col l-col3 m-col4 s-col4">
							Fax
						</div>
						<div class="col l-col9 m-col8 s-col8">
							'.$row["fax"].'
						</div>
					</div>';
				}
				echo '
				<div class="col l-col12 m-col12 s-col12">
					<div class="col l-col3 m-col4 s-col4">
						Email
					</div>
					<div class="col l-col9 m-col8 s-col8">
						'.$listEmail.'
					</div>
				</div>';
				if ($row["website"]) {
					echo '
					<div class="col l-col12 m-col12 s-col12">
						<div class="col l-col3 m-col4 s-col4">
							Website
						</div>
						<div class="col l-col9 m-col8 s-col8">
							<a href="'.$row["website"].'" target="_blank">
								'.$row["website"].'
							</a>
						</div>
					</div>';
				}
				echo '
			</div>';
		}
	}
	echo '
	</div>';**/
	?>
