<?php
			$localhost = "103.29.196.246";
			$username = "rtmklungkung";
			$password = "s4r1bh4kt1m33n1ng";
			$database = "rtmklungkung_db_model";
			$test = mysql_connect("$localhost","$username","$password");
			$db = mysql_select_db($database,$test);

			$sql="select id_detil,id_pemesanan,jadwal,nama,no_identitas,id_angkutan,harga,tanggal from tb_pemesanan_detil";
			$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
			mysql_close($test);
					
					while($row = mysql_fetch_object($hasil)){
						$id_detil = $row->id_detil;
						$id_pemesanan = $row->id_pemesanan;
						$jadwal = $row->jadwal;
						$nama = $row->nama;
						$no_identitas = $row->no_identitas;
						$id_angkutan = $row->id_angkutan;
						$harga = $row->harga;
						$tanggal = $row->tanggal;

						include("config/connection.php");
						$sql3 ="select id_pemesanan from tb_pemesanan_detil where id_detil = '".$id_detil."'";
						$hasil3 = mysql_query($sql3) or die("Kesalahan Pada SQL");
						$jumlah3 = mysql_num_rows($hasil3);

						if ($jumlah3 < 1){
							include("config/connection.php");
							$sql2="insert into tb_pemesanan_detil(id_pemesanan,jadwal,nama,no_identitas,id_angkutan,harga,tanggal) values ('".$id_pemesanan."', '".$jadwal."', '".$nama."', '".$no_identitas."', '".$id_angkutan."', '".$harga."', '".$tanggal."')";
							if (!mysql_query($sql2,$test)){
							die('Error: ' . mysql_error());
							}
						}
					}
					
					
						
?>
