118
BAB IV IMPLEMENTASI SISTEM
4.1. Spesifikasi Perangkat Keras dan Perangkat Lunak
Perangkat keras yang digunakan untuk membangun sistem adalah sebagai berikut:
Processor : AMD FX6300
Harddisk : 1TB
Memory : 8GB
Perangkat lunak yang digunakan untuk membangun sistem adalah sebagai berikut:
Sistem Operasi : Windows 8 64bit
Bahasa Pemrograman : PHP
DBMS : MySQL
4.2. Implementasi Basis Data
Pada tahap ini dilakukan pembangunan basis data menggunakan MySQL untuk menunjang sistem yang dibangun. Basis data yang dibangun terdiri dari tabel-
tabel yang telah dirancang pada bab sebelumnya. Berikut query yang digunakan untuk membuat database dengan nama
“tpa_skripsi” beserta tabel-tabel di dalamnya: PLAGIAT MERUPAKAN TINDAKAN TIDAK TERPUJI
119 CREATE TABLE `bank_soal`
`id_soal` varchar25 NOT NULL, `soal` text NOT NULL,
`pilihana` text NOT NULL, `pilihanb` varchar45 NOT NULL,
`pilihanc` varchar45 NOT NULL, `pilihand` varchar45 NOT NULL,
`pilihane` varchar45 NOT NULL, `pilihanf` varchar45 NOT NULL,
`pilihang` varchar45 NOT NULL, `pilihanh` varchar45 NOT NULL,
`judul` varchar45 NOT NULL, `link` varchar45 NOT NULL,
`id_jenis_tes` varchar45 NOT NULL, `periode` varchar45 NOT NULL,
PRIMARY KEY `id_soal` ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `kunci_jawaban` `id_soal` varchar25 NOT NULL,
`kunci_jawaban` varchar45 NOT NULL, KEY `fk_kunci_jawaban_bank_soal_idx` `id_soal`,
CONSTRAINT `fk_kunci_jawaban_bank_soal` FOREIGN KEY `id_soal` REFERENCES `bank_soal` `id_soal` ON DELETE NO ACTION ON UPDATE
NO ACTION ENGINE=InnoDB DEFAULT CHARSET=utf8
120 CREATE TABLE `skor_pilihan`
`id_soal` varchar25 NOT NULL, `pilihan` varchar45 NOT NULL,
`skor` int11 NOT NULL, KEY `fk_skor_pilihan_bank_soal1_idx` `id_soal`,
CONSTRAINT `fk_skor_pilihan_bank_soal1` FOREIGN KEY `id_soal` REFERENCES `bank_soal` `id_soal` ON DELETE NO ACTION ON UPDATE
NO ACTION ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `kode_soal` `idkode_soal` varchar20 NOT NULL,
`jenistes` varchar45 NOT NULL, `keterangan` varchar100 DEFAULT NULL,
PRIMARY KEY `idkode_soal` ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `paket` `idpaket` varchar25 NOT NULL,
`namapaket` varchar45 NOT NULL, `jurusan` varchar15 NOT NULL,
PRIMARY KEY `idpaket` ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `instansi` `idinstansi` int11 NOT NULL,
`nama_instansi` varchar100 NOT NULL, `alamat_instansi` varchar150 NOT NULL,
`no_telp_instansi` varchar45 DEFAULT NULL,
121 PRIMARY KEY `idinstansi` ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `peserta` `idpeserta` varchar25 NOT NULL,
`nama_peserta` varchar100 NOT NULL, `jenis_kelamin` varchar25 NOT NULL,
`umur` int11 NOT NULL, `tgl_lahir` date NOT NULL,
`jurusan` varchar45 NOT NULL, `tgl_daftar` date NOT NULL,
`tempat_tes` varchar45 NOT NULL, `password` varchar45 DEFAULT NULL,
`idinstansi` int11 NOT NULL, PRIMARY KEY `idpeserta`,
KEY `fk_peserta_instansi1_idx` `idinstansi`, CONSTRAINT `fk_peserta_instansi1` FOREIGN KEY `idinstansi`
REFERENCES `instansi` `idinstansi` ON DELETE NO ACTION ON UPDATE NO ACTION ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `bank_soal_kode_soal` `id_soal` varchar25 NOT NULL,
`idkode_soal` varchar20 NOT NULL, `nomor_urut` int11 NOT NULL,
PRIMARY KEY `id_soal`,`idkode_soal`, KEY `fk_bank_soal_has_kode_soal_kode_soal1_idx` `idkode_soal`,
KEY `fk_bank_soal_has_kode_soal_bank_soal1_idx` `id_soal`, CONSTRAINT `fk_bank_soal_has_kode_soal_bank_soal1` FOREIGN KEY
122 `id_soal` REFERENCES `bank_soal` `id_soal` ON DELETE NO ACTION ON
UPDATE NO ACTION, CONSTRAINT `fk_bank_soal_has_kode_soal_kode_soal1` FOREIGN KEY
`idkode_soal` REFERENCES `kode_soal` `idkode_soal` ON DELETE NO ACTION ON UPDATE NO ACTION
ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `kode_soal_paket` `idkode_soal` varchar20 NOT NULL,
`idpaket` varchar25 NOT NULL, PRIMARY KEY `idkode_soal`,`idpaket`,
KEY `fk_kode_soal_has_paket_paket1_idx` `idpaket`, KEY `fk_kode_soal_has_paket_kode_soal1_idx` `idkode_soal`,
CONSTRAINT `fk_kode_soal_has_paket_kode_soal1` FOREIGN KEY idkode_soal` REFERENCES `kode_soal` `idkode_soal` ON DELETE NO
TION ON UPDATE NO ACTION, CONSTRAINT `fk_kode_soal_has_paket_paket1` FOREIGN KEY `idpaket`
REFERENCES `paket` `idpaket` ON DELETE NO ACTION ON UPDATE NO ACTION ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `peserta_paket` `idpeserta` varchar25 NOT NULL,
`idpaket` varchar25 NOT NULL, `periode_norma` varchar5 NOT NULL,
`periode_bobot` varchar5 NOT NULL, `tgl_tes` date NOT NULL,
PRIMARY KEY `idpeserta`,`idpaket`,
123 KEY `fk_peserta_has_paket_paket1_idx` `idpaket`,
KEY `fk_peserta_has_paket_peserta1_idx` `idpeserta`, CONSTRAINT `fk_peserta_has_paket_paket1` FOREIGN KEY `idpaket`
REFERENCES `paket` `idpaket` ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_peserta_has_paket_peserta1` FOREIGN KEY
`idpeserta` REFERENCES `peserta` `idpeserta` ON DELETE NO ACTION ON UPDATE NO ACTION ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `tampung_jawaban` `id_soal` varchar25 NOT NULL,
`idpeserta` varchar25 NOT NULL, `idpaket` varchar25 NOT NULL,
`nilai` int11 NOT NULL, PRIMARY KEY `id_soal`,`idpeserta`,`idpaket`,
KEY `fk_bank_soal_has_peserta_has_paket_peserta_has_paket1_idx` `idpeserta`,`idpaket`,KEY `fk_bank_soal_has_peserta_has_paket_bank_soal1_idx`
`id_soal`,CONSTRAINT `fk_bank_soal_has_peserta_has_paket_bank_soal1` FOREIGN KEY `id_soal` REFERENCES `bank_soal` `id_soal` ON DELETE
NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_bank_soal_has_peserta_has_paket_peserta_has_paket1`
FOREIGN KEY `idpeserta`, `idpaket` REFERENCES `peserta_paket` `idpeserta`, `idpaket` ON DELETE NO ACTION ON UPDATE NO ACTION
ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `jawaban_peserta` `id_soal` varchar25 NOT NULL,
`idpeserta` varchar25 NOT NULL,
124 `idpaket` varchar25 NOT NULL,
`jawaban` varchar45 DEFAULT NULL, KEY `fk_jawaban_peserta_tampung_jawaban1_idx`
`id_soal`,`idpeserta`,`idpaket`, CONSTRAINT `fk_jawaban_peserta_tampung_jawaban1` FOREIGN KEY
`id_soal`, `idpeserta`, `idpaket` REFERENCES `tampung_jawaban` `id_soal`, `idpeserta`, `idpaket` ON DELETE NO ACTION ON UPDATE NO ACTION
ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `nilai` `idpeserta` varchar25 NOT NULL,
`idpaket` varchar25 NOT NULL, `idkode_soal` varchar20 NOT NULL,
`nilai` decimal10,1 DEFAULT NULL, PRIMARY KEY `idpeserta`,`idpaket`,`idkode_soal`,
KEY `fk_peserta_has_paket_has_kode_soal_kode_soal1_idx` `idkode_soal`, KEY `fk_peserta_has_paket_has_kode_soal_peserta_has_paket1_idx`
`idpeserta`,`idpaket`, CONSTRAINT `fk_peserta_has_paket_has_kode_soal_kode_soal1` FOREIGN
KEY `idkode_soal` REFERENCES `kode_soal` `idkode_soal` ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_peserta_has_paket_has_kode_soal_peserta_has_paket1` FOREIGN KEY `idpeserta`, `idpaket` REFERENCES `peserta_paket` `idpeserta`,
`idpaket` ON DELETE NO ACTION ON UPDATE NO ACTION ENGINE=InnoDB DEFAULT CHARSET=utf8
125 CREATE TABLE `bobot`
`tanggal_input` date DEFAULT NULL, `jurusan` varchar25 DEFAULT NULL,
`jenistes` varchar25 DEFAULT NULL, `pembilang` int3 DEFAULT NULL,
`penyebut` int3 DEFAULT NULL, `bobot` decimal10,4 DEFAULT NULL,
`jenisbobot` varchar50 DEFAULT NULL, `tahun` varchar5 DEFAULT NULL
ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `norma` `tanggal_input` date NOT NULL,
`jenistes` varchar15 NOT NULL, `min` int11 NOT NULL,
`max` int11 NOT NULL, `norma` decimal10,1 NOT NULL,
`tahun` varchar4 NOT NULL ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `staff` `idstaff` varchar30 NOT NULL,
`nama_staff` varchar100 NOT NULL, `jenisKelamin` varchar20 NOT NULL,
`tglLahir` date NOT NULL, `alamatStaff` varchar150 NOT NULL,
`jabatan` int11 NOT NULL,
126 `SIPP` varchar30 DEFAULT NULL,
`password` varchar50 NOT NULL, `noHp` varchar50 NOT NULL,
`last_login` datetime NOT NULL, `isLogin` int11 NOT NULL,
`isEnable` int11 NOT NULL DEFAULT 1, PRIMARY KEY `idstaff`
ENGINE=InnoDB DEFAULT CHARSET=latin1
4.3. Implementasi Sistem