CREATE TABLE kadar_air(
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int NOT NULL,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(50),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
kode_vochdost varchar(20),
berat_vochdost_kosong varchar(20),
berat_sampel varchar(20),
bfsd varchar(20) COMMENT"berat vochdost dan sampel setelah dioven",
kadar_air varchar(20),
selesai_uji datetime,
nama_analis varchar(50),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
keterangan text,
is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_air TO 'simlab_admin'@'localhost';




CREATE TABLE kadar_abu(
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int NOT NULL,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(100),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
kode_krusebel varchar(10),
berat_krusebel varchar(20),
berat_sampel varchar(20),
bksf varchar(20) COMMENT"berat krusibel + sampel setelah furnace",
kadar_abu varchar(20),
selesai_uji datetime,
nama_analis varchar(100),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
lanjut_uji_ca varchar(100),
lanjut_uji_p varchar(100),
keterangan text,
is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_abu TO 'simlab_admin'@'localhost';




-- protein_kasar
-- --------------------
CREATE TABLE kadar_protein_kasar (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(100),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
-- ------
selesai_uji datetime,
nama_analis varchar(50),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
-- -------
no_bagian varchar(30),
kode_tabung_erlenmeyer varchar(50),
berat_sampel varchar(20),
volume_titrasi varchar(20),
volume_blanko varchar(20),
n_hci varchar(20),
faktor_14_01 varchar(20),
faktor_konversi_n_kprotein varchar(20),
kadar_pk varchar(20),
katalis varchar(50),
digestor varchar(100),
kjeltec varchar(50),
buret varchar(20),
neraca varchar(100),
is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_protein_kasar TO 'simlab_admin'@'localhost';




-- serat_kasar
-- --------------------
CREATE TABLE kadar_serat_kasar (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(100),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
-- ------
selesai_uji datetime,
nama_analis varchar(50),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
-- -------
no_bagian varchar(30),
kode_crucible_filter varchar(30),
berat_crucible_filter_kosong varchar(30),
berat_sampel varchar(30),
bcfso varchar(30) COMMENT"Berat Crucible Filter dan Sampel Setelah Oven",
bcfst varchar(30) COMMENT"Berat Crucible Filter dan Sampel Setelah Tanur",
kadar_sk varchar(30),
kode_fibertio varchar(30),
jenis_oven varchar(30),
jenis_furnace varchar(30),
keterangan text,

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_serat_kasar TO 'simlab_admin'@'localhost';




-- lemak_kasar
-- --------------------
CREATE TABLE kadar_lemak_kasar (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(100),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
-- ------
selesai_uji datetime,
nama_analis varchar(50),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
-- -------
kode_extraction_cup varchar(30),
berat_extraction_cup varchar(30),
berat_sampel varchar(30),
becs varchar(30) COMMENT"Berat Extraction Cup + Sampel (gram)",
kadar_lk varchar(30),
kode_soxtec varchar(30),
jenis_oven varchar(30),
lama_recovery varchar(30),
keterangan text,

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_lemak_kasar TO 'simlab_admin'@'localhost';





-- fosfor
-- --------------------
CREATE TABLE kadar_fosfor (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(100),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
-- ------
selesai_uji datetime,
nama_analis varchar(50),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
-- -------
kode_krusibel_porselen varchar(30),
berat_sampel varchar(30),
v_indukan varchar(30),
v_labu varchar(30),
v_pipet varchar(30),
abs varchar(30),
intercept varchar(30),
slope varchar(30),
konsentrasi_sampel varchar(30),
kadar_p varchar(30),

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_fosfor TO 'simlab_admin'@'localhost';




-- kalsium
-- --------------------
CREATE TABLE kadar_kalsium (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,
suhu varchar(20),
rh varchar(20),
alat_uji varchar(100),
terbitan_revisi_ke varchar(5),
tanggal_terbitan date,
tanggal_revisi date,
mulai_uji datetime,
-- ------
selesai_uji datetime,
nama_analis varchar(50),
paraf_analis text,
paraf_penyelia text,
persetujuan datetime,
-- -------
kode_krusibel varchar(30),
berat_sampel varchar(30),
volume_titrasi_sampel varchar(30),
volume_titrasi_blanko varchar(30),
normalitas_kmno4 varchar(30),
volume_larutan_induk varchar(30),
volume_alikuot varchar(30),
nomor_atom_ca varchar(30),
kadar_ca varchar(30),
keterangan text,

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_kalsium TO 'simlab_admin'@'localhost';


-- tdn
-- --------------------
CREATE TABLE kadar_tdn (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,

kadar_tdn varchar(30),

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_tdn TO 'simlab_admin'@'localhost';

-- ur
-- --------------------
CREATE TABLE kadar_ur (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,

kadar_ur varchar(30),

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_ur TO 'simlab_admin'@'localhost';

-- af
-- --------------------
CREATE TABLE kadar_af (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,

kadar_af varchar(30),

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_af TO 'simlab_admin'@'localhost';

-- andf
-- --------------------
CREATE TABLE kadar_andf (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,

kadar_andf varchar(30),

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_andf TO 'simlab_admin'@'localhost';

-- mbm
-- --------------------
CREATE TABLE kadar_mbm (
id_kadar int(11) NOT NULL AUTO_INCREMENT,
id_sampel int,

kadar_mbm varchar(30),

is_active enum('0', '1') NOT NULL DEFAULT '1',
last_modified_time datetime DEFAULT CURRENT_TIMESTAMP,
last_modified_user int,
PRIMARY KEY(id_kadar)
)ENGINE=InnoDB;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON kadar_mbm TO 'simlab_admin'@'localhost';


CREATE TABLE `deret_af` (
  `id` int(11) NOT NULL,
  `nomor_batch` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `level_standart` decimal(5,2) DEFAULT NULL,
  `abs` decimal(5,3) DEFAULT NULL,
  `intercept` decimal(5,4) DEFAULT NULL,
  `slope` decimal(5,4) DEFAULT NULL,
  `total_af` decimal(5,3) DEFAULT NULL,
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- -- Grant For Table
GRANT SELECT, INSERT, UPDATE ON deret_af TO 'simlab_admin'@'localhost';


CREATE TABLE `deret_ur` (
  `id` int(11) NOT NULL,
  `nomor_batch` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deret_std_urea` decimal(5,2) DEFAULT NULL,
  `volume_pipet_std_urea` decimal(5,2) DEFAULT NULL,
  `valume_labu_ukur` decimal(5,2) DEFAULT NULL,
  `abs` decimal(5,3) DEFAULT NULL,
  `intercept` decimal(5,4) DEFAULT NULL,
  `slope` decimal(5,4) DEFAULT NULL,
  `c_std_urea` decimal(5,3) DEFAULT NULL,
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

GRANT SELECT, INSERT, UPDATE ON deret_ur TO 'simlab_admin'@'localhost';


CREATE TABLE `deret_ca` (
  `id` int(11) NOT NULL,
  `nomor_batch` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deret_std_ca` decimal(5,2) DEFAULT NULL,
  `volume_pipet_std_ca` decimal(5,2) DEFAULT NULL,
  `labu_ukur_std_ca` decimal(5,2) DEFAULT NULL,
  `std_ca40_ppm` decimal(5,2) DEFAULT NULL,
  `abs` decimal(5,3) DEFAULT NULL,
  `intercept` decimal(5,4) DEFAULT NULL,
  `slope` decimal(5,4) DEFAULT NULL,
  `c_std_ca` decimal(5,3) DEFAULT NULL,
  primary key(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

GRANT SELECT, INSERT, UPDATE ON deret_ca TO 'simlab_admin'@'localhost';
