?head??title?Memanipulasi Data Pegawai?/title?
?script language = "javascript" type="text/javascript"?
?!--
var DBPegawai = new Array();
function Pegawai ( Fields_NIP,Fields_Nama,Fields_Gaji_Per_Jam,Fields_Jam_Kerja,Fields_Gaji_Total){
this.NIP = Fields_NIP;
this.Nama = Fields_Nama;
this.Gaji_Jam = Fields_Gaji_Per_Jam;
this.Jam_Kerja = Fields_Jam_Kerja;
this.Gaji_Total = Fields_Gaji_Total;}
function inputPegawai(){
var Nama,Gaji_Per_Jam, Jam_Kerja, Gaji;
while ( NIP = window.prompt("Ketikan NIP (Nomor Induk Pegawai)\n\n Click 'cancal' untuk Berhenti !!." )){
Nama = window.prompt( "Nama Pegawai :");
Gaji_Per_Jam = parseInt(window.prompt(" Gaji Per Jam:"));
Jam_Kerja = parseInt(window.prompt(" Jumlah Jam Kerja:"));
Gaji = Gaji_Per_Jam*Jam_Kerja;
DBPegawai[DBPegawai.length]=new Pegawai(NIP,Nama,Gaji_Per_Jam,Jam_Kerja,Gaji);
}
ShowPegawai();
}
function ShowPegawai(){
document.write("
NIP | Nama | Gaji Per Jam | Jam Kerja | "+Gaji Total | "+" + DBPegawai[i].NIP + " | "+" + DBPegawai[i].Nama + " | "+" + DBPegawai[i].Gaji_Jam+" | "+" + DBPegawai[i].Jam_Kerja+" | "+" + DBPegawai[i].Gaji_Total + " | "+
---|