No.Anggota = <input type="text" name="noanggota"><br>
Nama = <input type="text" name="nama"><br>
Lisensi Provider = <input type="text" name="lisensi"><br>
Pilihan Pulsa = <input type="radio" name="pilpulsa" value="elektrik">Elektrik
<input type="radio" name="pilpulsa" value="nonelektrik">Non Elektrik<br>
Paket Provider = <select name="provider">
<option>**___Pilihan___**</option>
<option>XL AXIATA</option>
<option>TELKOMSEL</option>
<option>INDOSAT</option>
<option>AXIS</option>
</select><br>
Harga Provider = <input type="text" name="hargaprovider"><br>
Banyaknya Pembelian = <input type="text" name="banyaknya"><br>
Diskon = <input type="text" name="diskon"><br>
Total = <input type="text" name="total"><br>
Bayar = <input type="text" name="bayar"><br>
Kembali = <input type="text" name="kembali"><br>
<input type="submit" name="simpan" value="Simpan"> <input type="reset" name="cancel" value="Cancel">
<input type="submit" name="tampil" value="Tampil">
<?php
$koneksi=mysql_connect("localhost","root","") or die (mysql_error());
$pilih_db=mysql_select_db("mega_cell") or die (mysql_error());
$perintah="SELECT * FROM transaksi_megacell ORDER BY id_anggota";
$jalankan_perintah=mysql_query($perintah) or die (mysql_error());
$result = mysql_query("select * from transaksi_megacell");
$jsArray = "var hargaprovider = new Array();\n";
echo '<select name="provider" onchange="document.getElementById(\'paket_provider\').value = provider[this.value]">';
echo '<option>-------</option>';
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['paket_provider'] . '">' . $row['paket_provider'] . '</option>';
$jsArray .= "hargaprovider['" . $row['paket_provider'] . "'] = '" . addslashes($row['harga_provider']) . "';\n";
}
echo '</select>';
?>
<input type="text" name="prod_name" id="harga_provider"/>
<script type="text/javascript">
<?php echo $jsArray; ?>
</script>
<?php
$koneksi=mysql_connect("localhost","root","") or die (mysql_error());
$pilih_db=mysql_select_db("mega_cell") or die (mysql_error());
$perintah="SELECT * FROM transaksi_megacell ORDER BY id_anggota";
$jalankan_perintah=mysql_query($perintah) or die (mysql_error());
$result = mysql_query("select * from transaksi_megacell");
$jsArray = "var harga_provider = new Array();\n";
echo '<select name="provider" onchange="document.getElementById(\'hargaprovider\').value = harga_provider[this.value]">';
echo '<option>-------</option>';
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['paket_provider'] . '">' . $row['paket_provider'] . '</option>';
$jsArray .= "harga_provider['" . $row['paket_provider'] . "'] = '" . addslashes($row['harga_provider']) . "';\n";
}
echo '</select>';
?>
<input type="text" name="hargaprovider" id="hargaprovider"/>
<script type="text/javascript">
<?php echo $jsArray; ?>
</script>