		<title>KONTAK DAGANG</title>
       	
        <meta charset='UTF-8'>
 		
        <link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto" rel="stylesheet"> 		
        <link href="<?php echo $thisPage . "adm1n/css/style.css"; ?>" rel="stylesheet" type="text/css">
		<link href="<?php echo $thisPage . "adm1n/css/pagination.css"; ?>" rel="stylesheet" type="text/css">

		<link href="<?php echo $thisPage; ?>buttons/hover.css" rel="stylesheet" media="all">
		<link href="<?php echo $thisPage; ?>buttons/demo-page.css" rel="stylesheet" media="all">
		
		<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
		echo '
		<script src="'.$thisPage.'adm1n/js/jquery.min.js"></script>
		<script src="'.$thisPage.'adm1n/js/modernizr.js"></script>
		<script src="'.$thisPage.'js/jquery.cookie.js"></script>
		';
		
		$temp = $thisPage . 'admin/php_functions.php';
		include ($temp);
		
		require_once ($thisUrl.'functions/form_creator.php');
		require_once ($thisUrl.'adm1n/functions/getFormValue.php');

		$s_text = $_REQUEST["s_text"];
		//echo "<br>Text Search: ".$s_text;
		
		$page = $_SESSION['page'];
		if (!$page) $page = $_REQUEST["page"];
		$perhalaman = 15;

		if ($page){
			$start=($page - 1) * $perhalaman;
		} else {
			$start=0;
		}

		$sql  = 
		"SELECT * FROM exhibitor_list, kontak_dagang_tanggal ";
		if ($s_text) $sql .= "WHERE UPPER(companyName) like '%".strtoupper($s_text)."%' ";
		$sql .= "order by companyName, tglNAMA ";
		$sql .= "
		LIMIT $start, $perhalaman ";


		$sql2 = 
		"SELECT * FROM kontak_dagang_transaksi, kontak_dagang_header, exhibitor_list " .
		"WHERE to_exhibitor_id = exhibitorID " .
		"AND header_id = to_kontak_dagang_header LIMIT $start, $perhalaman ";
		
		//echo $sql;
		?>
        <script>
            //paste this code under head tag or in a seperate js file.
            // Wait for window load
            $(window).load(function() {
                // Animate loader off screen
                $(".se-pre-con").fadeOut("slow");;
            });
        </script>

		<script>
            $(document).ready(function () {
              $('#nav > li > a').click(function(e){
                 if ($(this).attr('class') != 'active'){
                   $('#nav li ul').slideUp();
                   $(this).next().slideToggle();
                   $('#nav li a').removeClass('active');
                   $(this).addClass('active');
                 }
                 e.preventDefault();
              });
            });
        </script>
		
		<script type="text/javascript" language="javascript">
			my_function = null;
			$(document).ready(function() { /// Wait till page is loaded
				$('#tab-content').load('property-detailed.php #tab-content-1', function() {
					 /// can add another function here
				});
				$('#tab1').click(function(){
				  $('#tab-content').load('property-detailed.php #tab-content-1', function() {
					  $(".se-pre-con").fadeOut("slow");;
					   /// can add another function here
				  });
				});
				$('#tab2').click(function(){
				  $('#tab-content').load('property-detailed.php #tab-content-2', function() {
					  $(".se-pre-con").fadeOut("slow");;
					   /// can add another function here
				  });
				});
				$('#tab3').click(function(){
				  $('#tab-content').load('property-detailed.php #tab-content-3', function() {
					   $(".se-pre-con").fadeOut("slow");;		
					   /// can add another function here
				  });
				});
			}); //// End of Wait till page is loaded
			
			<?php
			//<strong></strong>echo $sql; 
			$counter=0;
			if ($hasil = mysql_query($sql)) {
				if (mysql_num_rows($hasil)) {
					echo '
					$(document).ready(function() {';
					while ($data = mysql_fetch_array($hasil)) {
						$counter++;
						echo '
						$(\'#'.$counter.'-listCompany\').click(function() {  
							$.cookie(\'action\', \'entryForm\');
							$.cookie(\'exhibitorID\', \''.$data["exhibitorID"].'\');
							$.cookie(\'tglNAMA\', \''.$data["tglNAMA"].'\');
							$(\'form#formManageForm\').submit();
						});';
					}
					echo '
					});';
				}
			}

			//echo $sql; 
			if ($hasil = mysql_query($sql2)) {
				if (mysql_num_rows($hasil)) {
					echo '
					$(document).ready(function() {';
					while ($data = mysql_fetch_array($hasil)) {
						echo '
						$(\'#'.$data["transaksiID"].'-kontakDagang\').click(function() {  
							$.cookie(\'action\', \'viewKontakDagang\');
							$.cookie(\'header_id\', \''.$data["header_id"].'\');
							$.cookie(\'transaksiID\', \''.$data["transaksiID"].'\');
							$(\'form#formKontakDagang\').submit();
						});';
					}
					echo '
					});';
				}
			}

			?>			
        	
        </script>

        <?php
        echo '
		<script>
			function deleteCookie() {
				var cookies = document.cookie.split(";");
				for (var i = 0; i < cookies.length; i++) {
					var cookie = cookies[i];
					var eqPos = cookie.indexOf("=");
					var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
					document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
				}
			}				
		
			$(document).ready(function() {
				$(\'#submitformEntryForm\').click(function() { 
					$(\'form#formEntryForm\').submit();
				});
	
				$(\'#10\').click(function() { 
					deleteCookie();
				});

				$(\'#submitformKelengkapanData\').click(function() { 
					$(\'form#formKelengkapanData\').submit();
				});

				$(\'#cancelformKelengkapanData\').click(function() { 
					$(\'input[name="action"]\').val(\'entryForm\');
					$(\'form#formKelengkapanData\').submit();
				});

				$(\'#submitformNewTransaction\').click(function() { 
					$(\'form#formNewTransaction\').submit();
				});

				$(\'#submitformViewKontakDagang\').click(function() { 
					$(\'form#formViewKontakDagang\').submit();
				});
				
				$(\'#submitformBackToMain\').click(function() { 
					deleteCookie();
					$(\'form#formBackToMain\').submit();
				});

				$(\'#submitformEditKontakDagang\').click(function() { 
					$(\'form#formEditKontakDagang\').submit();
				});
				

				$(\'#submitformLaporan\').click(function() { 
					$(\'form#formLaporan\').submit();
				});
				
			});
		</script>';
		?>





