sore mas mo nanya dunk
saya mau menampilkan hasil query dari 4 tabel yg terelasi misal saya masukkan medrecnya data2 yag lain keluar
tabel saya
1. datasosial(medrec(pk), nama, tgllahir)
2. kunjungan(idkunjungan(pk), medrec, diagutama, diasekunder)
3. icd10(kd_penyakit(pk), penyakit)
4. icd10b (kd_penyakit(pk), penyakit)
relasi
1. datasosial(medrec)= kunjungan(medrec)
2. kunjunagan(diagutama)=icd10(kd_penyakit)
3. kunjungan(diasekunder)=icd10b(kd_penyakit)

sql saya berjalan dimysql
SELECT kunjungan.idkunjung, kunjungan.medrec, kunjungan.masuk, kunjungan.keluar, kunjungan.jnsrawat, kunjungan.jnskunjung, kunjungan.carakeluar, kunjungan.diagutama, kunjungan.diasekunder, datasosial.nama, datasosial.tglahir, datasosial.umurthn, datasosial.umurhari, datasosial.jnskelamin, datasosial.bblahir, icd10.penyakit AS diagnosautama, icd10b.penyakit AS diagnosasekunder FROM kunjungan, datasosial, icd10, icd10b WHERE kunjungan.diagutama=icd10.kd_penyakit AND kunjungan.diasekunder=icd10b.kd_penyakit AND datasosial.medrec=kunjungan.medrec AND kunjungan.medrec='0000001'
tp kl pake scrip kede dibawah muncul keterangan "Column 'medrec' in where clause is ambiguous"
<!DOCTYPE html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #666666;
	margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
	padding: 0;
	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
	color: #000000;
}
.oneColFixCtrHdr #container {
	width: auto;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
	background: #FFFFFF;
	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
	border: 1px solid #000000;
	text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColFixCtrHdr #header {
	background: #DDDDDD; 
	padding: 0 10px 0 20px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.oneColFixCtrHdr #header h1 {
	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.oneColFixCtrHdr #mainContent {
	padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
	background: #FFFFFF;
}
.oneColFixCtrHdr #footer {
	padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#DDDDDD;
}
.oneColFixCtrHdr #footer p {
	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
-->
</style></head>

<body class="oneColFixCtrHdr">

<div id="container">
  <div id="header">
    <h1>Resume</h1>
  <!-- end #header --></div>
  <div id="mainContent">
    <h1>HASIL</h1>
    
    <?php
error_reporting("E_ALL ^ E_NOTICE");
mysql_connect("localhost", "root", "");
mysql_select_db("datapx");

$bagianWhere = "";

if (isset($_POST['medrec']))
{
   $medrec = $_POST['medrec'];
   if (empty($bagianWhere))
   {
		$bagianWhere .= "medrec = '$medrec'";
   }
   else
   {
	   $bagianWhere .= " AND medrec LIKE '$medrec'";
   }
}




$query = "SELECT kunjungan.idkunjung, kunjungan.medrec, kunjungan.masuk, kunjungan.keluar, kunjungan.jnsrawat, kunjungan.jnskunjung, kunjungan.carakeluar, kunjungan.diagutama, kunjungan.diasekunder, datasosial.nama, datasosial.tglahir, datasosial.umurthn, datasosial.umurhari, datasosial.jnskelamin, datasosial.bblahir, icd10.penyakit AS diagnosautama, icd10b.penyakit AS diagnosasekunder FROM kunjungan, datasosial, icd10, icd10b WHERE kunjungan.diagutama=icd10.kd_penyakit AND kunjungan.diasekunder=icd10b.kd_penyakit AND datasosial.medrec=kunjungan.medrec AND kunjungan.medrec=".$bagianWhere;
$hasil = mysql_query($query) or die (mysql_error());


echo "<table border='1' cellpadding = '2' cellspacing = '1' align = 'left'>";
echo "<tr><td>id kunjungan</td><td><tr><td>MEDREC</td><td>NAMA</td></td><td>TGL MASUK</td><td>TGL KELUAR</td><td>JENIS KELAMIN</td><td>TGL Lahir</td><td>UMUR TAHUN</td>
	<td>UMUR HARI</td><td>JENIS KUNJUNGAN</td><td>JENIS PERAWATAN</td><td>CARA KELUAR RS</td><td>BERAT BADAN LAHIR</td><td>DIAGNOSA UTAMA</td> <td>ICD10</td><td>DIAGNOSA SEKUNDER</td><td>IC10</td></tr>";

while ($data = mysql_fetch_array($hasil))
{
   echo "<tr><td>".$data['idkunjung']."</td><td>".$data['medrec']."</td><td>".$data['nama']."</td><td>".$data['masuk']."</td><td>".$data['keluar']."</td><td>".$data['jnskelamin']."</td><td>".$data['tglahir']."</td>
   <td>".$data['umurthn']."</td><td>".$data['umurhari']."</td><td>".$data['jnskunjung']."</td><td>".$data['jnsrawat']."</td><td>".$data['carakeluar']."</td><td>".$data['bblahir']."</td><td>".$data['penyakit']."</td>
   <td>".$data['kd_penyakit']."</td><td>".$data['diasekunder']."</td><td>".$data['kd_penyakit']."</td></tr>";
}
echo "</table>";
?>
  <!-- end #mainContent --></div>
  <div id="footer">
    <table width="317" border="1" >
      <tr>
        <th width="107" height="32" align="left" scope="row">TANGGAL : </th>
        <td width="199"><span id="date"><?php print date('d-m-Y'); ?></span></td>
      </tr>
      <tr>
        <th height="40" align="left" scope="row">JAM	:</th>
        <td><script type="text/javascript">
    //set timezone
    <?php date_default_timezone_set('Asia/Jakarta'); ?>
    //buat object date berdasarkan waktu di server
    var serverTime = new Date(<?php print date('Y, m, d, H, i, s, 0'); ?>);
    //buat object date berdasarkan waktu di client
    var clientTime = new Date();
    //hitung selisih
    var Diff = serverTime.getTime() - clientTime.getTime();    
    //fungsi displayTime yang dipanggil di bodyOnLoad dieksekusi tiap 1000ms = 1detik
    function displayServerTime(){
        //buat object date berdasarkan waktu di client
        var clientTime = new Date();
        //buat object date dengan menghitung selisih waktu client dan server
        var time = new Date(clientTime.getTime() + Diff);
        //ambil nilai jam
        var sh = time.getHours().toString();
        //ambil nilai menit
        var sm = time.getMinutes().toString();
        //ambil nilai detik
        var ss = time.getSeconds().toString();
        //tampilkan jam:menit:detik dengan menambahkan angka 0 jika angkanya cuma satu digit (0-9)
        document.getElementById("clock").innerHTML = (sh.length==1?"0"+sh:sh) + ":" + (sm.length==1?"0"+sm:sm) + ":" + (ss.length==1?"0"+ss:ss);
    }
    </script>
      <body onload="setInterval('displayServerTime()', 1000);">
	<br/>
      <span id="clock"><?php print date('H:i:s'); ?></span></td>
      </tr>
    </table>
    <a href="/ridha/index.php">Kembali ke halaman Sebelumnya</a>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
Silahkan login untuk menjawab!
[ASK]
Sore mastah sekalian, ada yg mau saya tanyakan.
Saya tidak bisa delete data 3 Tabel sekaligus di page, namun query di jalankan di SQL bisa.
Mohon Pencerahan, please.
<?php
		if ($_GET[mode]=="hapus"){
			$xx = getData("id_reg","tb_medik","id_reg='$_GET[id]'");
			if (!$xx[0]==""){
				mysql_query("DELETE tb_medik, tb_resep, tb_transaksi FROM tb_medik LEFT JOIN tb_resep ON tb_medik.id_reg=tb_resep.id_reg LEFT JOIN tb_transaksi ON tb_medik.id_reg=tb_transaksi.id_reg WHERE tb_medik.id_reg='$_GET[id]'");
				echo "<script>
					 		notifsukses('Success,'Data Telah Dihapus..!!');
					  		setTimeout('window.location.href=\"media.php?page=$page\"', 2000)
					   </script>";
			}else{
				echo "<script>window.location=('media.php?page=$page')</script>";
			}
		}
?>

<div class="table-header">
	    DATA REKAM MEDIK
	</div>
	<div class="row-fluid">
	<table id="myTable" class="table table-striped table-bordered table-hover">
	<thead>
	    <tr>
	    <th class="center" width="35px">No</th>
	    <th class="center" width="90px">No. Registrasi</th>
	    <th class="hidden-480 center">Nama Pasien</th>	    
	    <th class="center" width="100px">Tanggal</th>
	    <th class="hidden-480 center">Nama Dokter</th>
	    <th class="hidden-480 center">Poliklinik</th>
	    <th class="hidden-480 center">Diagnosa</th>
	    <th class="center" width="100px">Pembayaran</th>
	    <th class="hidden-480 center" width="40px">Aksi</th>
	    </tr>
	</thead>
	<tbody>
	 <?php
	 	$qry = mysql_query("SELECT a.*, b.nm_pasien, c.nm_dokter FROM tb_medik a 
					 		LEFT JOIN tb_pasien b ON a.id_pasien=b.id_pasien 
					 		LEFT JOIN m_dokter c ON a.id_dokter=c.id_dokter 
					 		ORDER BY a.id_reg DESC");
		while ($d = mysql_fetch_array($qry)){
		$tgl = getTglIndo($d[tgl_reg]);
		
		    $cSP = getNumRows("SELECT * FROM tb_medik WHERE diagnosa !=0");
		    $spAlert = array(
	      		"0"=>"<a href='?page=$page&act=resep&id=$d[id_reg]'>
	      				<button class='btn btn-mini btn-success' class='tooltip-info' data-rel='tooltip' data-original-title='Resep'>
    		               <span class='white'> <i class='icon-leaf bigger-120'></i> </span>
            	        </button>
            	      </a>",
	      		"1"=>"".$d['diagnosa']."</span>"
	      	);
	      	$aSP = ($cSP>0 ? $spAlert["1"] : $spAlert["0"]);

		    $pRS = getNumRows("SELECT * FROM tb_medik WHERE jasa !=0");
		    $psAlert = array(
	      		"0"=>"<a href='?page=$page&act=bayar&id=$d[id_reg]'>
	      				<button class='btn btn-mini btn-info' class='tooltip-success' data-rel='tooltip' data-original-title='Bayar'>
                   			<span class='white'>&nbsp;<i class='icon-dollar bigger-120'></i>&nbsp;</span>
                   		</button>
                   	  </a>",
	      		"1"=>"".rupiah($d['jasa'])."</span>"
	      	);
	      	$pCS = ($pRS>0 ? $psAlert["1"] : $psAlert["0"]);
	      
	      ?>
	      <tr>
	      <?php
	      $no++;
	      echo "	      
	      <td class='center'>$no</td>	      
	      <td class='center'>$d[id_reg]</td>
	      <td class='center'>$d[nm_pasien]</td>
	      <td class='center'>$tgl</td>
	      <td class='center'>$d[nm_dokter]</td>
	      <td class='center'>$d[nm_poli]</td>
	      <td class='center'>$aSP</td>
	      <td class='center'>$pCS</td>
	      <td class='center'>
	            <a href='?page=$page&mode=hapus&id=$d[id_reg]'><button class='btn btn-mini btn-yellow' onclick='return qh();' class='tooltip-error' data-rel='tooltip' data-original-title='Hapus'>
                   <span class='red'><i class='icon-trash bigger-120'></i></span>
                   </button></a></td>";
	      ?>
	     </tr>
	    <?php 
	       }
	    ?>
	</tbody>
	</table>
	</div>
Silahkan login untuk menjawab!

Menyimpan dengan id sama

Zaya · Jul 19, 2017
Salam kenal mas, saya banyak belajar dari postingan di sini. Saya mau nnya dong mas. Kan saya bikin seperti kuesioner, ada daftar, trus jawab pertanyaan sama jawaban. Disina saya mau simpan jawaban ke database. Kendala yg saya temui, saat daftar data berhasil masuk ke database, saat menyimpan jawaban juga masuk ke database tapi id_user 0.
Gimana ya mas cara menyimpan jawaban dengan id_user sama. Mohon bantuannya mas
Tabel peserta id_user, nama, tanggal
Tabel pertanyaan, id_soal, pilihan_a, pilhihan_b, tipe_soal.
Tabel untuk jawabannya id_user, nilai_tipe1, nilai_tipe2.
Silahkan login untuk menjawab!
Selamat malam, saya membuat form input soal. Table db soal dan jawaban terpisah, karena akan ditampilkan random. Tapi problem ada di input radiobutton untuk optionnya. Jawaban benar nilainya 1, masih bingung cara nyimpennya krn pakai array. Kalau isi dari option sudah bisa masuk db jawaban.
$opsi = 4;
For ($i=0; $i<opsi; $i++){
Echo" 
<tr>
<td><inout type='radio' name='jawaban$i'><textearea name='option[]'></textarea>
</td>
</tr>";
}

mohon pencerahannya, urgent banget. Nyari sana sini gak nemu.
Silahkan login untuk menjawab!
gimana cara biar ada peringatan stok kurang dari permintaan keluar??
<?php
error_reporting(0);
error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
error_reporting(E_ALL & ~E_NOTICE);
?> 
<?php
	//kondisi jika data SES_USER masih kosong maka...
	if (isset($_SESSION['SES_USER'])=="") {
		//merefresh halaman ke index.php
		echo"<meta http-equiv='refresh' content='0;url=index.php'>";
	} else {	//jika SES_USER tidak kosong maka...
		include "koneksi.php";	//memanggil koneksi
?>
<?php
mysql_connect("localhost","root","");
mysql_select_db("dbstok");

$query = "select max(id_trans_klr) as Kode from brg_klr";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
$kode = $data['Kode'];

$nourut = (int) substr($kode, 3, 3);
$nourut++;

//karakter tetap
$char = "OUT";
//mengatur 02 karakter berubah-ubah
$IdBaru = $char.sprintf("%03s",$nourut);
?>


<style type="text/css">
	caption {font-size:x-large}
</style>

<!-- link ke jQuery-1.4.4  -->
<link rel="stylesheet" href="jQuery-1.4.4/bundle/themes/base/jquery.ui.all.css">					
<script type="text/javascript" src="jQuery-1.4.4/jscript/jquery-1.4.4.min.js"></script>				
<script type="text/javascript" src="jQuery-1.4.4/jscript/jquery-ui-1.8.9.custom.min.js"></script>	
<script type="text/javascript" src="jQuery-1.4.4/bundle/ui/jquery.ui.datepicker.js"></script>		

<script> <!-- Javascript untuk fungsi kalender  -->
	$(function() {
		$( "#tanggal" ).datepicker({
			changeMonth: true,
			changeYear: true,
			dateFormat:'yy-mm-dd',
			yearRange: '1980:c+9'
		});	
	});
</script>
<style type="text/css">
a {
	text-decoration: none;
}
.inputnonaktif {
	background-color:#6F9;
}
</style>
<link href="thickbox/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="jquery/jquery-1.2.6.js"></script>
<script language="javascript" src="thickbox/thickbox.js"></script>

<script language="javascript">

var $jnoc = jQuery.noConflict();
	$jnoc(document).ready(function(){
	$jnoc("a.slick").click(function(){
	$jnoc(".active").removeClass("active");
	$jnoc(this).addClass("active");
	$jnoc(".content-slick").slideUp();
	var content_show = $jnoc(this).attr("title");
	$jnoc("#" +content_show).slideDown();
	});
	});


function selectbarang(kode_brg,nama_brg,kualitas,id_suplier){
	$jnoc('input[@name=kode_brg]').val(kode_brg);
	$jnoc('input[@name=nama_brg]').val(nama_brg);
  $jnoc('input[@name=kualitas]').val(kualitas);
  $jnoc('input[@name=id_suplier]').val(id_suplier);
  tb_remove(); // hilangkan dialog thickbox
}

function selectbrg_klr(kode_brg,nama_brg,kualitas,id_suplier){
	$jnoc('input[@name=kode_brg]').val(kode_brg);
	$jnoc('input[@name=nama_brg]').val(nama_brg);
  $jnoc('input[@name=kualitas]').val(kualitas);
  $jnoc('input[@name=id_suplier]').val(id_suplier);
  tb_remove(); // hilangkan dialog thickbox
}
</script>

<form name="frmSimpan" method="post" action="" enctype="multipart/form-data">
	<table width="450" align="center">
		<caption>INPUT BARANG KELUAR<br><br></caption>
        <tr>
			<td width="50%">ID Transaksi Keluar</td>
          	<td width="2%">:</td>
          	<td width="66%">
            <!-- echo $data['nim']; digunakan untuk menampilkan data dari field nim -->
            	<input type="text" name="id_trans_klr" maxlength="15" size="9" required="" value="<?php echo $IdBaru; ?>" readonly> 
                	
            </td>
        </tr>
        <tr>
			<td width="50%">Kode Barang</td>
          	<td width="2%">:</td>
          	<td width="66%">
        <input type="text" name="kode_brg" size="30" class="inputnonaktif" maxlength="8" required="" readonly id="kode_brg"><a href="cari_barang.php?width=400&amp;height=400" class="thickbox"><input type="submit" name="browse" id="browse3" value="Browse" /></a>
            *cari kode barang</tr></td>
            
            <tr>
			<td width="50%">Nama Barang</td>
          	<td width="2%">:</td>
          	<td width="66%">
            <input name="nama_brg" size="30" maxlength="30" required="" readonly>
            </td>
            </tr>
            <!--<input type="text" name="id_daftar" size="30" class="inputnonaktif" maxlength="8" required="" readonly id="id_daftar"><a href="cari_daftar.php?width=600&height=400" class="thickbox"><input type="submit" name="browse" id="browse3" value="Browse" /></a>
            *cari id pendaftaran</tr></td> -->
        <tr>
          	<td width="50%">Kualitas</td>
          	<td width="2%">:</td>
          	<td width="66%">
            <!-- echo $data['nama']; digunakan untuk menampilkan data dari field nama -->
            	<input name="kualitas" size="30" maxlength="30" required="" readonly>
                	
            </td>
        </tr>
        <tr>
          	<td width="50%">ID Suplier</td>
          	<td width="2%">:</td>
          	<td width="66%">
            <!-- echo $data['nama']; digunakan untuk menampilkan data dari field nama -->
            	<input name="id_suplier" size="30" maxlength="30" required="" readonly>
                	
            </td>
        </tr>
        <tr>
          	<td width="32%">Tanggal Keluar</td>
          	<td width="2%">:</td>
          	<td width="66%">
            	<input type="text" name="tgl_klr" id="tanggal"/>
			</td>
        </tr>
        <tr>
          	<td width="32%">Jumlah Keluar</td>
          	<td width="2%">:</td>
          	<td width="66%">
            	<input name="jml_klr" size="30" maxlength="30" required="" >
			</td>
        </tr>
        <tr>
          	<td width="32%">&nbsp;</td>
          	<td width="2%">&nbsp;</td>
          	<td width="66%">
            	<input name="btnSimpan" type="submit" value="Simpan">
                <!-- membuat link ke mahasiswa_tampil.php pada tombol Batal -->
          		<input name="btnBatal" type="reset" 
                	onclick="window.location.href='?page=barang_keluar&hal=1'" value="Batal" />
            </td>
        </tr>
	</table>
</form>


<?php


	//jika tombol Simpan di klik maka...
	if (isset($_POST['btnSimpan'])) {
		/*
		eksekusi query untuk memasukkan data pada tb_mahasiswa dengan field yang diisi
		nim,nama,jekel,alamat,sts_mhs
		
		".$_POST['txtNIM']." digunakan menampung data dari txtNIM
		... dst
		*/

		
		
		$sql_insert = "INSERT INTO brg_klr (id_trans_klr,tgl_klr,kode_brg,nama_brg,jml_klr,id_suplier) VALUES (
					'".$_POST['id_trans_klr']."',
					'".$_POST['tgl_klr']."',
					'".$_POST['kode_brg']."',	
					'".$_POST['nama_brg']."',
					'".$_POST['jml_klr']."',
					'".$_POST['id_suplier']."')";
		$query_insert = mysql_query($sql_insert) or die (mysql_error());
		
		//mengcopy file gambar ke lokasi yang ditentukan [folder=imgFoto]
		
		//jika proses penyimpanan berhasil maka...
		if ($query_insert) {
			//menampilkan pesan data berhasil disimpan
			echo"<script>alert('Simpan data berhasil !')</script>";
			//merefresh halaman ke mahasiswa_tampil.php
			echo "<meta http-equiv='refresh' content='0; url=?page=barang_keluar&hal=1'>";
		}
	}

	}//menutup kondisi jika SES_USER tidak kosong di atas

?>
Silahkan login untuk menjawab!
Selamat Malam,
Saat ini saya membuat web aplication untuk pengajuan kredit, namun saya ada kendala membuat combobox dinamis untuk jenis kredit, merk barang dan tipe barang, mohon bantuannya.
<?php
include("koneksi.php");
?>

<head>
<title>Form Pengajuan Kredit</title>
<script type="text/javascript" src="js/jqueryy.js"></script>
<script type="text/javascript">
var htmlobjek;
$(document).ready(function() {
$("#kredit").change(function() {
var kredit = $("#kredit").val();
$.ajax({
url : "ambilmerk.php",
data : "id_kredit="+id_kredit,
cache : false,
success : function(msg){
$("#merk").html(msg);
}
});
});
$("#merk").change(function(){
var merk = $("#merk").val();
$.ajax({
url : "ambiltipe.php",
data : "id_merk="+id_merk,
cache : false,
success :function(msg){
$("#tipe").html(msg);
}
});
});
});
</script>
</head>

<html>
<body>
<p>

<div id='header'>	
        <div id='isi'>
			<form action='simpan_permohonan.php' method='post'>
			<fieldset>
			<center>
			<table>
			  <tr>
				<td colspan='2' align='center' ><h1>Formulir Pengajuan Kredit	</h1></td>
			  </tr>
			  
			  <p align='center' class='style6 style7'><img src='images/mega.jpg' class='gambar'></p>
			   			  
			  <tr>
				<td>Nama Lengkap</td>
				<td><input type='text' name='nama' size='50' /></td>
			  </tr>
			  		  
			  <tr>
				<td>Nomor Identitas</td>
				<td><input type='text' name='no_id' size='50' /></td>
			  </tr>
			  	  
			  <tr>
				<td>Jenis Kelamin</td>
				<td><label><input type='radio' name='jenis' value='Laki Laki' />Laki-Laki</label> 
					<label><input type='radio' name='jenis' value='Perempuan' />Perempuan</label></td>
					<script>
					var radio = document.getElementsByName('jenis');
					var jenis = '';
					for (var i = 0, length = radio.length; i < length; i++) {
						if (radio[i].checked) {
							jenis = radio[i].value;
						}
					}
					</script>
			  </tr> 
					  
			  <tr>
				<td>Pekerjaan</td>
				<td><input type='text' name='pekerjaan' size='50' /></td>
			  </tr>
			  
			  <tr>
				<td>Agama</td>
				<td><select name='agama'>
					<option>Pilih Agama</option>
					<option>Islam</option>
					<option>Kristen Katolik</option>
					<option>Kristen Protestan</option>
					<option>Hindu</option>
					<option>Bhudha</option>
					<option>Kong Khuchu</option>
					</select>
				</td>
			  </tr>
			  
			   <tr>
				<td>Email</td>
				<td><input type='text' name='email' size='50' /></td>
			  </tr>
			  
			   <tr>
				<td>Telepon</td>
				<td><input type='text' name='tlp' size='50' /></td>
			  </tr>
			  
			   
			   <tr>
				<td>Alamat</td>
				<td><textarea name='alamat' cols='52' rows='5'> </textarea></td>
			  </tr>
			  
			  <tr>
				<td>Nama Perusahaan</td>
				<td><input type='text' name='kantor' size='50' /></td>
			  </tr>
			  
			  <tr>
				<td>Jabatan</td>
				<td><input type='text' name='jabatan' size='50' /></td>
			  </tr>
			  
			  <tr>
				<td>Lama Bekerja </td>
				<td><input type='text' name='lama_kerja' size='50' /></td>
			  </tr>
			  
			   <tr>
				<td>Alamat Perusahaan</td>
				<td><textarea name='alamat_ktr' cols='52' rows='5'> </textarea></td>
			  </tr>
			  
			  <tr>
				<td>Telp Perusahaan </td>
				<td><input type='text' name='tlp_ktr' size='50' /></td>
			  </tr>
			  
			 <tr>
			 <td>Jenis Kredit</td>
			 <td><select name="kredit" id="kredit" class="form-control">
				<option>--Pilih Jenis Kredit--</option>
				<?php
				$kredit = mysql_query("SELECT * FROM kredit ORDER BY jenis_kredit");
				while($p=mysql_fetch_array($kredit)){
				echo "<option value=\"$p[id_kredit]\">$p[jenis_kredit]</option>\n";
				}
				?>
			</tr>
			</td>
			</select>
			<tr>
			<td>Merk Barang</td>
			<td><select name="merk" id="merk">
				<option>--Pilih Merk Barang--</option>
				<?php
				$kredit = mysql_query("SELECT * FROM merk ORDER BY merk_barang");
				while($p=mysql_fetch_array($kredit)){
				echo "<option value=\"$p[id_merk]\">$p[merk_barang]</option>\n";
				}
				?>
			</tr>
			</td>
			</select>
			<tr>
			<td>Tipe Barang</td>
			<td><select name="tipe" id="tipe">
				<option>--Pilih Tipe Barang--</option>
				<?php
				$merk = mysql_query("SELECT * FROM tipe ORDER BY tipe_barang");
				while($p=mysql_fetch_array($merk)){
				echo "<option value=\"$p[id_tipe]\">$p[tipe_barang]</option>\n";
				}
				?>
			</tr>
			</td>
			</select>
			  
			  <tr>
				<td>Harga Barang </td>
				<td><input type='text' name='harga' size='25' /></td>
			  </tr>
			  
			  <tr>
				<td>DP </td>
				<td><select name='dp'>
					<option>Pilih Uang Muka</option>
					</select>
				</td>
			  </tr>
			  
			  <tr>
				<td>Tenor </td>
				<td><select name='tenor'>
					<option>Pilih Tenor</option>
					</select>
				</td>
			  </tr>
			  
			  <tr>
				<td>Angsuran </td>
				<td><select name='angsuran'>
					<option>Angsuran Perbulan</option>
					</select>
				</td>
			  </tr>
			  
			  <tr>
				<td colspan='2' align='right'><input type = 'submit' name = 'daftar' value = 'Simpan' /></td>    
			  </tr>
			
			</table>
			</center>
			</fieldset>
			</form>
</div>
</div>
</p>
	
</body>
</html>
Silahkan login untuk menjawab!