<?php
//DATA JADWAL					
						include("config/connection.php");
			$sql9="select * from tb_jadwal where tanggal > curdate() - 2";
			$hasil9 = mysql_query($sql9) or die("Kesalahan Pada SQL");
			mysql_close($test);

					while($row9 = mysql_fetch_object($hasil9)){
						$Id_Jadwal = $row9->Id_Jadwal;
						$Waktu = $row9->Waktu;
						$Id_Kapal = $row9->Id_Kapal;
						$Id_Nahkoda = $row9->Id_Nahkoda;
						$Kuota_Order = $row9->Kuota_Order;
						$Sisa = $row9->Sisa;
						$Dari = $row9->Dari;
						$Tujuan = $row9->Tujuan;
						$Status = $row9->Status;
						$tanggal = $row9->tanggal;
						$isbrangkat = $row9->isbrangkat;

						$localhost = "156.67.220.146";
						$username = "admin_etiket";
						$password = "3t1k3tj00s";
						$database = "admin_etiket";
						$test = mysql_connect("$localhost","$username","$password");
						$db = mysql_select_db($database,$test);
						$sql10 ="select Id_Jadwal from tb_jadwal where Id_Jadwal = '".$Id_Jadwal."'";
						$hasil10 = mysql_query($sql10) or die("Kesalahan Pada SQL");
						$jumlah10 = mysql_num_rows($hasil10);

						if ($jumlah10 < 1){
			$localhost = "156.67.220.146";
			$username = "admin_etiket";
			$password = "3t1k3tj00s";
			$database = "admin_etiket";
			$test = mysql_connect("$localhost","$username","$password");
			$db = mysql_select_db($database,$test);
							$sql11="insert into tb_jadwal (Id_Jadwal ,Waktu ,Id_Kapal ,Id_Nahkoda ,Kuota_Order ,Sisa ,Dari ,Tujuan ,Status ,tanggal ,isbrangkat) values 
							('".$Id_Jadwal."', '".$Waktu."', '".$Id_Kapal."', '".$Id_Nahkoda."', '".$Kuota_Order."', '".$Sisa."', '".$Dari."', '".$Tujuan."', '".$Status."', '".$tanggal."', '".$isbrangkat."')";
							if (!mysql_query($sql11,$test)){
							die('Error: ' . mysql_error());
							}
						}
					}
?>
		<script>window.location = "<?php echo $base?>sinkrontiket2"</script>
