ganti format table
This commit is contained in:
@@ -1,65 +1,258 @@
|
||||
-- Tabel Pelanggan
|
||||
CREATE TABLE customers (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
customer_code VARCHAR(20) UNIQUE,
|
||||
company_name VARCHAR(100),
|
||||
customer_type ENUM('internal', 'external'),
|
||||
address TEXT,
|
||||
city VARCHAR(50),
|
||||
postal_code VARCHAR(10),
|
||||
phone VARCHAR(20),
|
||||
email VARCHAR(100),
|
||||
pic_name VARCHAR(100),
|
||||
pic_phone VARCHAR(20),
|
||||
pic_email VARCHAR(100),
|
||||
registration_date DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
status ENUM('active', 'inactive') DEFAULT 'active',
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP
|
||||
CustomerID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerCode VARCHAR(20) UNIQUE,
|
||||
CustomerCompanyName VARCHAR(100),
|
||||
CustomerType ENUM('internal', 'external'),
|
||||
CustomerAddress TEXT,
|
||||
CustomerCity VARCHAR(50),
|
||||
CustomerPostalCode VARCHAR(10),
|
||||
CustomerPhone VARCHAR(20),
|
||||
CustomerEmail VARCHAR(100),
|
||||
CustomerPICName VARCHAR(100),
|
||||
CustomerPICPhone VARCHAR(20),
|
||||
CustomerPICEmail VARCHAR(100),
|
||||
CustomerRegistrationDate DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerStatus ENUM('active', 'inactive') DEFAULT 'active',
|
||||
CustomerCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCreatedUserID INT,
|
||||
CustomerUpdatedAt DATETIME,
|
||||
CustomerUpdatedUserID INT,
|
||||
CustomerDeletedAt DATETIME,
|
||||
CustomerDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Permintaan Analisis
|
||||
CREATE TABLE analysis_requests (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_code VARCHAR(20) UNIQUE,
|
||||
customer_id INT,
|
||||
request_date DATETIME,
|
||||
status ENUM('new', 'process', 'completed', 'cancelled'),
|
||||
total_amount DECIMAL(10,2),
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (customer_id) REFERENCES customers(id)
|
||||
AnalysisRequestID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisRequestCode VARCHAR(20) UNIQUE,
|
||||
CustomerID INT,
|
||||
AnalysisRequestDate DATETIME,
|
||||
AnalysisRequestStatus ENUM('new', 'process', 'completed', 'cancelled'),
|
||||
AnalysisRequestTotalAmount DECIMAL(10,2),
|
||||
AnalysisRequestNotes TEXT,
|
||||
AnalysisRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisRequestCreatedUserID INT,
|
||||
AnalysisRequestUpdatedAt DATETIME,
|
||||
AnalysisRequestUpdatedUserID INT,
|
||||
AnalysisRequestDeletedAt DATETIME,
|
||||
AnalysisRequestDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Pembayaran
|
||||
CREATE TABLE payments (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
payment_code VARCHAR(20) UNIQUE,
|
||||
payment_date DATETIME,
|
||||
amount DECIMAL(10,2),
|
||||
payment_method ENUM('cash', 'transfer', 'credit_card'),
|
||||
payment_status ENUM('pending', 'completed', 'failed'),
|
||||
proof_of_payment VARCHAR(255),
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES analysis_requests(id)
|
||||
PaymentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisRequestID INT,
|
||||
PaymentCode VARCHAR(20) UNIQUE,
|
||||
PaymentDate DATETIME,
|
||||
PaymentAmount DECIMAL(10,2),
|
||||
PaymentMethod ENUM('cash', 'transfer', 'credit_card'),
|
||||
PaymentStatus ENUM('pending', 'completed', 'failed'),
|
||||
PaymentProofPath VARCHAR(255),
|
||||
PaymentNotes TEXT,
|
||||
PaymentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
PaymentCreatedUserID INT,
|
||||
PaymentUpdatedAt DATETIME,
|
||||
PaymentUpdatedUserID INT,
|
||||
PaymentDeletedAt DATETIME,
|
||||
PaymentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Kategori Pelanggan
|
||||
CREATE TABLE customer_categories (
|
||||
CustomerCategoryID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerCategoryCode VARCHAR(20) UNIQUE,
|
||||
CustomerCategoryName VARCHAR(100),
|
||||
CustomerCategoryDescription TEXT,
|
||||
CustomerCategoryIsActive BOOLEAN DEFAULT TRUE,
|
||||
CustomerCategoryCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCategoryCreatedUserID INT,
|
||||
CustomerCategoryUpdatedAt DATETIME,
|
||||
CustomerCategoryUpdatedUserID INT,
|
||||
CustomerCategoryDeletedAt DATETIME,
|
||||
CustomerCategoryDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Kontak Tambahan Pelanggan
|
||||
CREATE TABLE customer_contacts (
|
||||
CustomerContactID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerContactName VARCHAR(100),
|
||||
CustomerContactPosition VARCHAR(100),
|
||||
CustomerContactDepartment VARCHAR(100),
|
||||
CustomerContactPhone VARCHAR(20),
|
||||
CustomerContactEmail VARCHAR(100),
|
||||
CustomerContactIsMainContact BOOLEAN DEFAULT FALSE,
|
||||
CustomerContactIsActive BOOLEAN DEFAULT TRUE,
|
||||
CustomerContactCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerContactCreatedUserID INT,
|
||||
CustomerContactUpdatedAt DATETIME,
|
||||
CustomerContactUpdatedUserID INT,
|
||||
CustomerContactDeletedAt DATETIME,
|
||||
CustomerContactDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Dokumen Pelanggan
|
||||
CREATE TABLE customer_documents (
|
||||
CustomerDocumentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerDocumentType VARCHAR(50),
|
||||
CustomerDocumentNumber VARCHAR(100),
|
||||
CustomerDocumentName VARCHAR(255),
|
||||
CustomerDocumentPath VARCHAR(255),
|
||||
CustomerDocumentIssuedDate DATE,
|
||||
CustomerDocumentExpiredDate DATE,
|
||||
CustomerDocumentIsActive BOOLEAN DEFAULT TRUE,
|
||||
CustomerDocumentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerDocumentCreatedUserID INT,
|
||||
CustomerDocumentUpdatedAt DATETIME,
|
||||
CustomerDocumentUpdatedUserID INT,
|
||||
CustomerDocumentDeletedAt DATETIME,
|
||||
CustomerDocumentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Aktivitas Pelanggan
|
||||
CREATE TABLE customer_activities (
|
||||
CustomerActivityID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerActivityType VARCHAR(50),
|
||||
CustomerActivityDescription TEXT,
|
||||
CustomerActivityDate DATETIME,
|
||||
CustomerActivityStatus VARCHAR(50),
|
||||
CustomerActivityNotes TEXT,
|
||||
CustomerActivityCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerActivityCreatedUserID INT,
|
||||
CustomerActivityUpdatedAt DATETIME,
|
||||
CustomerActivityUpdatedUserID INT,
|
||||
CustomerActivityDeletedAt DATETIME,
|
||||
CustomerActivityDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Komunikasi Pelanggan
|
||||
CREATE TABLE customer_communications (
|
||||
CustomerCommunicationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerContactID INT,
|
||||
CustomerCommunicationType VARCHAR(50),
|
||||
CustomerCommunicationSubject VARCHAR(255),
|
||||
CustomerCommunicationContent TEXT,
|
||||
CustomerCommunicationDate DATETIME,
|
||||
CustomerCommunicationStatus VARCHAR(50),
|
||||
CustomerCommunicationFollowUpDate DATETIME,
|
||||
CustomerCommunicationNotes TEXT,
|
||||
CustomerCommunicationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCommunicationCreatedUserID INT,
|
||||
CustomerCommunicationUpdatedAt DATETIME,
|
||||
CustomerCommunicationUpdatedUserID INT,
|
||||
CustomerCommunicationDeletedAt DATETIME,
|
||||
CustomerCommunicationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Contoh data pelanggan
|
||||
INSERT INTO customers (customer_code, company_name, customer_type, address, city, postal_code, phone, email, pic_name, pic_phone, pic_email) VALUES
|
||||
INSERT INTO customers (
|
||||
CustomerCode,
|
||||
CustomerCompanyName,
|
||||
CustomerType,
|
||||
CustomerAddress,
|
||||
CustomerCity,
|
||||
CustomerPostalCode,
|
||||
CustomerPhone,
|
||||
CustomerEmail,
|
||||
CustomerPICName,
|
||||
CustomerPICPhone,
|
||||
CustomerPICEmail
|
||||
) VALUES
|
||||
('CUST001', 'PT Lingkungan Hijau', 'external', 'Jl. Raya Utama No. 123', 'Jakarta', '12345', '021-5551234', 'info@lingkunganhijau.com', 'Budi Santoso', '081234567890', 'budi@lingkunganhijau.com'),
|
||||
('CUST002', 'Dinas Lingkungan Hidup', 'internal', 'Jl. Pemda No. 45', 'Bandung', '40111', '022-7891234', 'dlh@bandung.go.id', 'Siti Aminah', '087812345678', 'siti@bandung.go.id'),
|
||||
('CUST003', 'CV Alam Lestari', 'external', 'Jl. Industri Blok A2', 'Surabaya', '60111', '031-8765432', 'contact@alamlestari.com', 'Rudi Hartono', '085678901234', 'rudi@alamlestari.com');
|
||||
|
||||
-- Contoh data permintaan analisis
|
||||
INSERT INTO analysis_requests (request_code, customer_id, request_date, status, total_amount, notes) VALUES
|
||||
INSERT INTO analysis_requests (
|
||||
AnalysisRequestCode,
|
||||
CustomerID,
|
||||
AnalysisRequestDate,
|
||||
AnalysisRequestStatus,
|
||||
AnalysisRequestTotalAmount,
|
||||
AnalysisRequestNotes
|
||||
) VALUES
|
||||
('REQ001', 1, '2024-03-15 09:00:00', 'completed', 2500000, 'Analisis air limbah'),
|
||||
('REQ002', 1, '2024-03-16 10:30:00', 'process', 1750000, 'Analisis kualitas udara'),
|
||||
('REQ003', 2, '2024-03-17 13:15:00', 'new', 3000000, 'Analisis tanah');
|
||||
|
||||
-- Contoh data pembayaran
|
||||
INSERT INTO payments (request_id, payment_code, payment_date, amount, payment_method, payment_status, notes) VALUES
|
||||
INSERT INTO payments (
|
||||
AnalysisRequestID,
|
||||
PaymentCode,
|
||||
PaymentDate,
|
||||
PaymentAmount,
|
||||
PaymentMethod,
|
||||
PaymentStatus,
|
||||
PaymentNotes
|
||||
) VALUES
|
||||
(1, 'PAY001', '2024-03-15 14:30:00', 2500000, 'transfer', 'completed', 'Pembayaran lunas'),
|
||||
(2, 'PAY002', '2024-03-16 11:00:00', 875000, 'transfer', 'completed', 'Pembayaran DP 50%'),
|
||||
(3, 'PAY003', '2024-03-17 14:00:00', 1500000, 'transfer', 'pending', 'Menunggu konfirmasi transfer');
|
||||
(3, 'PAY003', '2024-03-17 14:00:00', 1500000, 'transfer', 'pending', 'Menunggu konfirmasi transfer');
|
||||
|
||||
-- Contoh data kategori pelanggan
|
||||
INSERT INTO customer_categories (
|
||||
CustomerCategoryCode,
|
||||
CustomerCategoryName,
|
||||
CustomerCategoryDescription
|
||||
) VALUES
|
||||
('CAT001', 'Industri', 'Pelanggan dari sektor industri manufaktur'),
|
||||
('CAT002', 'Pemerintahan', 'Instansi pemerintah dan BUMN'),
|
||||
('CAT003', 'Komersial', 'Pelanggan komersial non-industri');
|
||||
|
||||
-- Contoh data kontak tambahan
|
||||
INSERT INTO customer_contacts (
|
||||
CustomerID,
|
||||
CustomerContactName,
|
||||
CustomerContactPosition,
|
||||
CustomerContactDepartment,
|
||||
CustomerContactPhone,
|
||||
CustomerContactEmail,
|
||||
CustomerContactIsMainContact
|
||||
) VALUES
|
||||
(1, 'Andi Wijaya', 'HSE Manager', 'HSE', '081234567891', 'andi@lingkunganhijau.com', TRUE),
|
||||
(1, 'Diana Putri', 'Lab Coordinator', 'Quality Control', '081234567892', 'diana@lingkunganhijau.com', FALSE),
|
||||
(2, 'Bambang Kusuma', 'Kepala Seksi', 'Pengawasan', '087812345679', 'bambang@bandung.go.id', TRUE);
|
||||
|
||||
-- Contoh data dokumen
|
||||
INSERT INTO customer_documents (
|
||||
CustomerID,
|
||||
CustomerDocumentType,
|
||||
CustomerDocumentNumber,
|
||||
CustomerDocumentName,
|
||||
CustomerDocumentPath,
|
||||
CustomerDocumentIssuedDate,
|
||||
CustomerDocumentExpiredDate
|
||||
) VALUES
|
||||
(1, 'SIUP', '123/SIUP/2024', 'SIUP PT Lingkungan Hijau', '/documents/siup/123.pdf', '2024-01-01', '2029-01-01'),
|
||||
(1, 'NPWP', '01.234.567.8-123.000', 'NPWP PT Lingkungan Hijau', '/documents/npwp/123.pdf', '2024-01-01', NULL),
|
||||
(2, 'SK', 'SK-123/DLH/2024', 'SK Penunjukan', '/documents/sk/123.pdf', '2024-01-01', '2024-12-31');
|
||||
|
||||
-- Contoh data aktivitas
|
||||
INSERT INTO customer_activities (
|
||||
CustomerID,
|
||||
CustomerActivityType,
|
||||
CustomerActivityDescription,
|
||||
CustomerActivityDate,
|
||||
CustomerActivityStatus
|
||||
) VALUES
|
||||
(1, 'Visit', 'Kunjungan teknis untuk sampling rutin', '2024-03-15 10:00:00', 'Completed'),
|
||||
(1, 'Meeting', 'Pembahasan hasil analisis', '2024-03-16 13:00:00', 'Scheduled'),
|
||||
(2, 'Training', 'Pelatihan pengambilan sampel', '2024-03-17 09:00:00', 'Scheduled');
|
||||
|
||||
-- Contoh data komunikasi
|
||||
INSERT INTO customer_communications (
|
||||
CustomerID,
|
||||
CustomerContactID,
|
||||
CustomerCommunicationType,
|
||||
CustomerCommunicationSubject,
|
||||
CustomerCommunicationContent,
|
||||
CustomerCommunicationDate,
|
||||
CustomerCommunicationStatus
|
||||
) VALUES
|
||||
(1, 1, 'Email', 'Konfirmasi Jadwal Sampling', 'Konfirmasi jadwal sampling minggu depan', '2024-03-14 09:00:00', 'Sent'),
|
||||
(1, 2, 'Phone', 'Diskusi Hasil Analisis', 'Diskusi tentang hasil analisis yang melebihi baku mutu', '2024-03-15 14:00:00', 'Completed'),
|
||||
(2, 3, 'Meeting', 'Rapat Koordinasi', 'Rapat koordinasi program pemantauan lingkungan', '2024-03-16 10:00:00', 'Scheduled');
|
||||
@@ -206,6 +206,100 @@
|
||||
border: 1px solid #2196F3;
|
||||
color: #0d47a1;
|
||||
}
|
||||
|
||||
.parameter-category {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.parameter-item {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto auto;
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.parameter-item:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.parameter-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.parameter-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.parameter-method {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.parameter-price {
|
||||
font-weight: bold;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.selected-material {
|
||||
margin-bottom: 15px;
|
||||
padding: 10px;
|
||||
background: #e3f2fd;
|
||||
border-radius: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.category-selection {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.category-card {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
padding: 15px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.category-card:hover {
|
||||
border-color: #2196F3;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.category-card.selected {
|
||||
border-color: #2196F3;
|
||||
background: #e3f2fd;
|
||||
}
|
||||
|
||||
.selected-bidang,
|
||||
.selected-category {
|
||||
margin-bottom: 15px;
|
||||
padding: 10px;
|
||||
background: #e3f2fd;
|
||||
border-radius: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.parameter-group {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.parameter-group h4 {
|
||||
margin-bottom: 10px;
|
||||
color: #2196F3;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -217,11 +311,11 @@
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-number">2</div>
|
||||
<div class="step-title">Pilih Template</div>
|
||||
<div class="step-title">Pilih Bidang Pengujian</div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-number">3</div>
|
||||
<div class="step-title">Parameter</div>
|
||||
<div class="step-title">Pilih Kategori</div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-number">4</div>
|
||||
@@ -258,50 +352,56 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 2: Pilih Template -->
|
||||
<!-- Step 2: Pilih Bidang Pengujian -->
|
||||
<div class="form-section" id="step2">
|
||||
<h3>Pilih Template Analisis</h3>
|
||||
<h3>Pilih Bidang Pengujian</h3>
|
||||
<div class="template-selection">
|
||||
<div class="template-card" data-template-id="1">
|
||||
<h4>Air Limbah Industri</h4>
|
||||
<p>Template standar untuk analisis air limbah industri</p>
|
||||
<small>15 Parameter</small>
|
||||
<div class="template-card" data-type="fisika">
|
||||
<h4>FISIKA</h4>
|
||||
<p>Pengujian parameter fisika</p>
|
||||
<small>Udara Lingkungan Kerja</small>
|
||||
</div>
|
||||
<div class="template-card" data-template-id="2">
|
||||
<h4>Air Minum</h4>
|
||||
<p>Template untuk analisis kualitas air minum</p>
|
||||
<small>12 Parameter</small>
|
||||
<div class="template-card" data-type="kimia">
|
||||
<h4>KIMIA</h4>
|
||||
<p>Pengujian parameter kimia</p>
|
||||
<small>Air Minum & Limbah Domestik</small>
|
||||
</div>
|
||||
<div class="template-card" data-template-id="3">
|
||||
<h4>Udara Ambien</h4>
|
||||
<p>Template untuk analisis kualitas udara</p>
|
||||
<small>8 Parameter</small>
|
||||
<div class="template-card" data-type="biologi">
|
||||
<h4>BIOLOGI</h4>
|
||||
<p>Pengujian parameter biologi</p>
|
||||
<small>Air Minum, Limbah & IPAL</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 3: Parameter -->
|
||||
<!-- Step 3: Pilih Kategori -->
|
||||
<div class="form-section" id="step3">
|
||||
<h3>Pilih Parameter Analisis</h3>
|
||||
<div class="parameter-list">
|
||||
<!-- Parameters will be loaded dynamically based on selected template -->
|
||||
<h3>Pilih Kategori Pengujian</h3>
|
||||
<div class="selected-bidang"></div>
|
||||
<div class="category-selection">
|
||||
<!-- Categories will be loaded dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 4: Konfirmasi -->
|
||||
<!-- Step 4: Parameter -->
|
||||
<div class="form-section" id="step4">
|
||||
<h3>Konfirmasi Permintaan</h3>
|
||||
<div class="price-summary">
|
||||
<h4>Ringkasan Biaya</h4>
|
||||
<p>Jumlah Parameter: <span id="parameterCount">0</span></p>
|
||||
<p>Subtotal: <span id="subtotal">Rp 0</span></p>
|
||||
<p>PPN (11%): <span id="tax">Rp 0</span></p>
|
||||
<p><strong>Total: <span id="total">Rp 0</span></strong></p>
|
||||
<h3>Pilih Parameter Analisis</h3>
|
||||
<div class="selected-category"></div>
|
||||
<div class="parameter-list">
|
||||
<!-- Parameters will be loaded dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<p>Setelah permintaan disubmit, tim kami akan memproses dan mengirimkan quotation dalam 1x24 jam kerja.</p>
|
||||
</div>
|
||||
<div class="price-summary">
|
||||
<h4>Ringkasan Biaya</h4>
|
||||
<p>Jumlah Parameter: <span id="parameterCount">0</span></p>
|
||||
<p>Subtotal: <span id="subtotal">Rp 0</span></p>
|
||||
<p>PPN (11%): <span id="tax">Rp 0</span></p>
|
||||
<p><strong>Total: <span id="total">Rp 0</span></strong></p>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<p>Setelah permintaan disubmit, tim kami akan memproses dan mengirimkan quotation dalam 1x24 jam kerja.</p>
|
||||
</div>
|
||||
|
||||
<div class="navigation-buttons">
|
||||
@@ -360,17 +460,194 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Template selection
|
||||
let selectedBidang = null;
|
||||
let selectedCategory = null;
|
||||
let selectedParameters = new Set();
|
||||
|
||||
// Handle bidang selection
|
||||
document.querySelectorAll('.template-card').forEach(card => {
|
||||
card.addEventListener('click', () => {
|
||||
document.querySelectorAll('.template-card').forEach(c => c.classList.remove('selected'));
|
||||
card.classList.add('selected');
|
||||
// Here you would typically load the parameters for the selected template
|
||||
selectedBidang = card.dataset.type;
|
||||
loadCategories(selectedBidang);
|
||||
});
|
||||
});
|
||||
|
||||
function loadCategories(bidangType) {
|
||||
const bidang = testingParameters[bidangType];
|
||||
if (!bidang) return;
|
||||
|
||||
// Show selected bidang
|
||||
const selectedBidangDiv = document.querySelector('.selected-bidang');
|
||||
selectedBidangDiv.textContent = `Bidang Pengujian: ${bidang.name}`;
|
||||
|
||||
// Load categories
|
||||
const categorySelection = document.querySelector('.category-selection');
|
||||
categorySelection.innerHTML = bidang.categories.map(category => `
|
||||
<div class="category-card" data-category="${category.name}">
|
||||
<h4>${category.name}</h4>
|
||||
<p>${category.parameters.length} Parameter Tersedia</p>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
// Add event listeners to category cards
|
||||
categorySelection.querySelectorAll('.category-card').forEach(card => {
|
||||
card.addEventListener('click', () => {
|
||||
document.querySelectorAll('.category-card').forEach(c => c.classList.remove('selected'));
|
||||
card.classList.add('selected');
|
||||
selectedCategory = card.dataset.category;
|
||||
loadParameters(selectedBidang, selectedCategory);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadParameters(bidangType, categoryName) {
|
||||
const bidang = testingParameters[bidangType];
|
||||
const category = bidang.categories.find(c => c.name === categoryName);
|
||||
if (!category) return;
|
||||
|
||||
// Show selected category
|
||||
const selectedCategoryDiv = document.querySelector('.selected-category');
|
||||
selectedCategoryDiv.textContent = `Kategori: ${category.name}`;
|
||||
|
||||
// Load parameters
|
||||
const parameterList = document.querySelector('.parameter-list');
|
||||
parameterList.innerHTML = category.parameters.map(param => `
|
||||
<div class="parameter-item">
|
||||
<input type="checkbox" id="${param.id}" name="parameters[]" value="${param.id}"
|
||||
${selectedParameters.has(param.id) ? 'checked' : ''}>
|
||||
<div class="parameter-info">
|
||||
<span class="parameter-name">${param.name}</span>
|
||||
<span class="parameter-method">${param.method}</span>
|
||||
</div>
|
||||
<span class="parameter-price">Rp ${param.price.toLocaleString()}</span>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
// Add event listeners to checkboxes
|
||||
parameterList.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', () => {
|
||||
if (checkbox.checked) {
|
||||
selectedParameters.add(checkbox.value);
|
||||
} else {
|
||||
selectedParameters.delete(checkbox.value);
|
||||
}
|
||||
updatePriceSummary();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function updatePriceSummary() {
|
||||
let subtotal = 0;
|
||||
selectedParameters.forEach(paramId => {
|
||||
const bidang = testingParameters[selectedBidang];
|
||||
const category = bidang.categories.find(c => c.name === selectedCategory);
|
||||
const parameter = category.parameters.find(p => p.id === paramId);
|
||||
if (parameter) {
|
||||
subtotal += parameter.price;
|
||||
}
|
||||
});
|
||||
|
||||
const tax = subtotal * 0.11;
|
||||
const total = subtotal + tax;
|
||||
|
||||
document.getElementById('parameterCount').textContent = selectedParameters.size;
|
||||
document.getElementById('subtotal').textContent = `Rp ${subtotal.toLocaleString()}`;
|
||||
document.getElementById('tax').textContent = `Rp ${tax.toLocaleString()}`;
|
||||
document.getElementById('total').textContent = `Rp ${total.toLocaleString()}`;
|
||||
}
|
||||
|
||||
// Initialize form
|
||||
showStep(1);
|
||||
|
||||
const testingParameters = {
|
||||
// FISIKA
|
||||
fisika: {
|
||||
name: "FISIKA",
|
||||
categories: [
|
||||
{
|
||||
name: "Udara Lingkungan Kerja",
|
||||
parameters: [
|
||||
{ id: 'debu_total', name: 'Debu Total', method: 'SNI 16-7058-2004', price: 150000 },
|
||||
{ id: 'intensitas_pencahayaan', name: 'Intensitas Pencahayaan', method: 'SNI 7062:2019', price: 100000 },
|
||||
{ id: 'tekanan', name: 'Tekanan', method: 'Direct Reading', price: 100000 },
|
||||
{ id: 'iklim_kerja_suhu', name: 'Iklim Kerja (suhu)', method: 'Direct Reading', price: 100000 },
|
||||
{ id: 'iklim_kerja_kelembaban', name: 'Iklim Kerja (kelembaban)', method: 'Direct Reading', price: 100000 },
|
||||
{ id: 'intensitas_kebisingan', name: 'Intensitas Kebisingan', method: 'SNI 7231:2019', price: 150000 },
|
||||
{ id: 'kebisingan_personal', name: 'Kebisingan Personal', method: 'SNI/APHA', price: 150000 }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// KIMIA
|
||||
kimia: {
|
||||
name: "KIMIA",
|
||||
categories: [
|
||||
{
|
||||
name: "Air Minum, Hygiene, Sanitasi",
|
||||
parameters: [
|
||||
{ id: 'suhu', name: 'Suhu', method: 'SNI/APHA', price: 50000 },
|
||||
{ id: 'tds', name: 'TDS', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'kekeruhan', name: 'Kekeruhan', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'warna', name: 'Warna', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'bau', name: 'Bau', method: 'SNI/APHA', price: 50000 },
|
||||
{ id: 'ph', name: 'pH', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'nitrat', name: 'Nitrat (NO3 terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'nitrit', name: 'Nitrit (NO2 terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'kromium', name: 'Kromium Valensi 6 (CR6+ terlarut)', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'besi', name: 'Besi (Fe Terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'mangan', name: 'Mangan (Mn Terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'sisa_klor', name: 'Sisa Klor (terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'arsen', name: 'Arsen (AS terlarut)', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'kadmium', name: 'Kadmium (Cd) terlarut', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'timbal', name: 'Timbal (Pb terlarut)', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'fluoride', name: 'Fluoride (F) Terlarut', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'aluminium', name: 'Aluminium (Al) Terlarut', method: 'SNI/APHA', price: 200000 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Limbah Domestik",
|
||||
parameters: [
|
||||
{ id: 'ph_limbah', name: 'pH', method: 'SNI-6989.11-2019', price: 75000 },
|
||||
{ id: 'bod', name: 'BOD', method: 'APHA 5210 B-2017', price: 200000 },
|
||||
{ id: 'cod', name: 'COD', method: 'APHA 522 0.C-2017', price: 200000 },
|
||||
{ id: 'tss', name: 'TSS', method: 'SNI 06-6989.3-2004', price: 150000 },
|
||||
{ id: 'minyak_lemak', name: 'Minyak & Lemak', method: 'SNI-6989.10-2011', price: 200000 },
|
||||
{ id: 'amoniak', name: 'Amoniak', method: 'SNI 06-6989.30-2005', price: 150000 },
|
||||
{ id: 'debit', name: 'Debit', method: 'SNI', price: 100000 }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// BIOLOGI
|
||||
biologi: {
|
||||
name: "BIOLOGI",
|
||||
categories: [
|
||||
{
|
||||
name: "Air Minum, Hygiene, Sanitasi",
|
||||
parameters: [
|
||||
{ id: 'ecoli', name: 'E. Coli', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'total_coliform', name: 'Total Coliform', method: 'SNI/APHA', price: 200000 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Limbah Domestik",
|
||||
parameters: [
|
||||
{ id: 'total_coliform_limbah', name: 'Total Coliform', method: 'SNI', price: 200000 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "IPAL OUTLET",
|
||||
parameters: [
|
||||
{ id: 'total_coliform_ipal', name: 'Total Coliform', method: 'APHA 23 TAHUN 2017', price: 200000 }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,150 +1,184 @@
|
||||
-- Tabel Template Sampling
|
||||
CREATE TABLE sampling_templates (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
template_name VARCHAR(100),
|
||||
description TEXT,
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
SamplingTemplateID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingTemplateName VARCHAR(100),
|
||||
SamplingTemplateDescription TEXT,
|
||||
SamplingTemplateIsActive BOOLEAN DEFAULT TRUE,
|
||||
SamplingTemplateCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingTemplateCreatedUserID INT,
|
||||
SamplingTemplateUpdatedAt DATETIME,
|
||||
SamplingTemplateUpdatedUserID INT,
|
||||
SamplingTemplateDeletedAt DATETIME,
|
||||
SamplingTemplateDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Template Analisis
|
||||
CREATE TABLE analysis_templates (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
template_name VARCHAR(100),
|
||||
description TEXT,
|
||||
is_lab_analysis BOOLEAN DEFAULT true,
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
AnalysisTemplateID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisTemplateName VARCHAR(100),
|
||||
AnalysisTemplateDescription TEXT,
|
||||
AnalysisTemplateIsLabAnalysis BOOLEAN DEFAULT TRUE,
|
||||
AnalysisTemplateIsActive BOOLEAN DEFAULT TRUE,
|
||||
AnalysisTemplateCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisTemplateCreatedUserID INT,
|
||||
AnalysisTemplateUpdatedAt DATETIME,
|
||||
AnalysisTemplateUpdatedUserID INT,
|
||||
AnalysisTemplateDeletedAt DATETIME,
|
||||
AnalysisTemplateDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Parameter Analisis
|
||||
CREATE TABLE analysis_parameters (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
parameter_code VARCHAR(20),
|
||||
parameter_name VARCHAR(100),
|
||||
testing_method VARCHAR(100),
|
||||
unit VARCHAR(20),
|
||||
standard_method_number VARCHAR(50),
|
||||
price DECIMAL(10,2),
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
AnalysisParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisParameterCode VARCHAR(20),
|
||||
AnalysisParameterName VARCHAR(100),
|
||||
AnalysisParameterTestingMethod VARCHAR(100),
|
||||
AnalysisParameterUnit VARCHAR(20),
|
||||
AnalysisParameterStandardMethodNumber VARCHAR(50),
|
||||
AnalysisParameterPrice DECIMAL(10,2),
|
||||
AnalysisParameterIsActive BOOLEAN DEFAULT TRUE,
|
||||
AnalysisParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisParameterCreatedUserID INT,
|
||||
AnalysisParameterUpdatedAt DATETIME,
|
||||
AnalysisParameterUpdatedUserID INT,
|
||||
AnalysisParameterDeletedAt DATETIME,
|
||||
AnalysisParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Template Parameter
|
||||
CREATE TABLE template_parameters (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
template_id INT,
|
||||
parameter_id INT,
|
||||
is_required BOOLEAN DEFAULT false,
|
||||
FOREIGN KEY (template_id) REFERENCES analysis_templates(id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES analysis_parameters(id)
|
||||
TemplateParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisTemplateID INT,
|
||||
AnalysisParameterID INT,
|
||||
TemplateParameterIsRequired BOOLEAN DEFAULT FALSE,
|
||||
TemplateParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
TemplateParameterCreatedUserID INT,
|
||||
TemplateParameterUpdatedAt DATETIME,
|
||||
TemplateParameterUpdatedUserID INT,
|
||||
TemplateParameterDeletedAt DATETIME,
|
||||
TemplateParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Permintaan Layanan
|
||||
CREATE TABLE service_requests (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_code VARCHAR(20) UNIQUE,
|
||||
customer_id INT,
|
||||
request_type ENUM('sampling_analysis', 'analysis_only'),
|
||||
template_id INT,
|
||||
sampling_date DATE,
|
||||
sampling_location TEXT,
|
||||
gps_coordinates VARCHAR(50),
|
||||
status ENUM('draft', 'submitted', 'approved', 'rejected', 'in_progress', 'completed'),
|
||||
sampling_officer_id INT,
|
||||
testing_officer_id INT,
|
||||
total_amount DECIMAL(10,2),
|
||||
dp_amount DECIMAL(10,2),
|
||||
dp_status ENUM('unpaid', 'paid') DEFAULT 'unpaid',
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (customer_id) REFERENCES customers(id),
|
||||
FOREIGN KEY (template_id) REFERENCES analysis_templates(id),
|
||||
FOREIGN KEY (sampling_officer_id) REFERENCES users(id),
|
||||
FOREIGN KEY (testing_officer_id) REFERENCES users(id)
|
||||
ServiceRequestID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
ServiceRequestCode VARCHAR(20) UNIQUE,
|
||||
CustomerID INT,
|
||||
ServiceRequestType ENUM('sampling_analysis', 'analysis_only'),
|
||||
AnalysisTemplateID INT,
|
||||
ServiceRequestSamplingDate DATE,
|
||||
ServiceRequestSamplingLocation TEXT,
|
||||
ServiceRequestGPSCoordinates VARCHAR(50),
|
||||
ServiceRequestStatus ENUM('draft', 'submitted', 'approved', 'rejected', 'in_progress', 'completed'),
|
||||
ServiceRequestSamplingOfficerID INT,
|
||||
ServiceRequestTestingOfficerID INT,
|
||||
ServiceRequestTotalAmount DECIMAL(10,2),
|
||||
ServiceRequestDPAmount DECIMAL(10,2),
|
||||
ServiceRequestDPStatus ENUM('unpaid', 'paid') DEFAULT 'unpaid',
|
||||
ServiceRequestNotes TEXT,
|
||||
ServiceRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ServiceRequestCreatedUserID INT,
|
||||
ServiceRequestUpdatedAt DATETIME,
|
||||
ServiceRequestUpdatedUserID INT,
|
||||
ServiceRequestDeletedAt DATETIME,
|
||||
ServiceRequestDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Detail Parameter Permintaan
|
||||
CREATE TABLE request_parameters (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
parameter_id INT,
|
||||
price DECIMAL(10,2),
|
||||
status ENUM('pending', 'in_progress', 'completed', 'rejected'),
|
||||
result_value VARCHAR(50),
|
||||
result_unit VARCHAR(20),
|
||||
is_compliant BOOLEAN,
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES service_requests(id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES analysis_parameters(id)
|
||||
RequestParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
ServiceRequestID INT,
|
||||
AnalysisParameterID INT,
|
||||
RequestParameterPrice DECIMAL(10,2),
|
||||
RequestParameterStatus ENUM('pending', 'in_progress', 'completed', 'rejected'),
|
||||
RequestParameterResultValue VARCHAR(50),
|
||||
RequestParameterResultUnit VARCHAR(20),
|
||||
RequestParameterIsCompliant BOOLEAN,
|
||||
RequestParameterNotes TEXT,
|
||||
RequestParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
RequestParameterCreatedUserID INT,
|
||||
RequestParameterUpdatedAt DATETIME,
|
||||
RequestParameterUpdatedUserID INT,
|
||||
RequestParameterDeletedAt DATETIME,
|
||||
RequestParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Quotation
|
||||
CREATE TABLE quotations (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
quotation_code VARCHAR(20) UNIQUE,
|
||||
request_id INT,
|
||||
issue_date DATE,
|
||||
valid_until DATE,
|
||||
status ENUM('draft', 'sent', 'approved', 'rejected'),
|
||||
subtotal DECIMAL(10,2),
|
||||
tax_percentage DECIMAL(5,2),
|
||||
tax_amount DECIMAL(10,2),
|
||||
total_amount DECIMAL(10,2),
|
||||
terms_and_conditions TEXT,
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES service_requests(id)
|
||||
QuotationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
QuotationCode VARCHAR(20) UNIQUE,
|
||||
ServiceRequestID INT,
|
||||
QuotationIssueDate DATE,
|
||||
QuotationValidUntil DATE,
|
||||
QuotationStatus ENUM('draft', 'sent', 'approved', 'rejected'),
|
||||
QuotationSubtotal DECIMAL(10,2),
|
||||
QuotationTaxPercentage DECIMAL(5,2),
|
||||
QuotationTaxAmount DECIMAL(10,2),
|
||||
QuotationTotalAmount DECIMAL(10,2),
|
||||
QuotationTermsAndConditions TEXT,
|
||||
QuotationNotes TEXT,
|
||||
QuotationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
QuotationCreatedUserID INT,
|
||||
QuotationUpdatedAt DATETIME,
|
||||
QuotationUpdatedUserID INT,
|
||||
QuotationDeletedAt DATETIME,
|
||||
QuotationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Peralatan Sampling
|
||||
CREATE TABLE sampling_equipment (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
equipment_name VARCHAR(100),
|
||||
equipment_code VARCHAR(50),
|
||||
is_available BOOLEAN DEFAULT true,
|
||||
last_calibration_date DATE,
|
||||
next_calibration_date DATE,
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
SamplingEquipmentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingEquipmentName VARCHAR(100),
|
||||
SamplingEquipmentCode VARCHAR(50),
|
||||
SamplingEquipmentIsAvailable BOOLEAN DEFAULT TRUE,
|
||||
SamplingEquipmentLastCalibrationDate DATE,
|
||||
SamplingEquipmentNextCalibrationDate DATE,
|
||||
SamplingEquipmentNotes TEXT,
|
||||
SamplingEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingEquipmentCreatedUserID INT,
|
||||
SamplingEquipmentUpdatedAt DATETIME,
|
||||
SamplingEquipmentUpdatedUserID INT,
|
||||
SamplingEquipmentDeletedAt DATETIME,
|
||||
SamplingEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Peralatan yang Digunakan dalam Sampling
|
||||
CREATE TABLE request_equipment (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
equipment_id INT,
|
||||
usage_date DATE,
|
||||
return_date DATE,
|
||||
notes TEXT,
|
||||
FOREIGN KEY (request_id) REFERENCES service_requests(id),
|
||||
FOREIGN KEY (equipment_id) REFERENCES sampling_equipment(id)
|
||||
RequestEquipmentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
ServiceRequestID INT,
|
||||
SamplingEquipmentID INT,
|
||||
RequestEquipmentUsageDate DATE,
|
||||
RequestEquipmentReturnDate DATE,
|
||||
RequestEquipmentNotes TEXT,
|
||||
RequestEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
RequestEquipmentCreatedUserID INT,
|
||||
RequestEquipmentUpdatedAt DATETIME,
|
||||
RequestEquipmentUpdatedUserID INT,
|
||||
RequestEquipmentDeletedAt DATETIME,
|
||||
RequestEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Contoh data template sampling
|
||||
INSERT INTO sampling_templates (template_name, description) VALUES
|
||||
INSERT INTO sampling_templates (SamplingTemplateName, SamplingTemplateDescription) VALUES
|
||||
('Air Limbah Industri', 'Template untuk sampling air limbah industri'),
|
||||
('Kualitas Udara Ambien', 'Template untuk sampling kualitas udara'),
|
||||
('Air Permukaan', 'Template untuk sampling air sungai/danau');
|
||||
|
||||
-- Contoh data parameter analisis
|
||||
INSERT INTO analysis_parameters (parameter_code, parameter_name, unit, price, method) VALUES
|
||||
INSERT INTO analysis_parameters (AnalysisParameterCode, AnalysisParameterName, AnalysisParameterUnit, AnalysisParameterPrice, AnalysisParameterTestingMethod) VALUES
|
||||
('BOD5', 'Biochemical Oxygen Demand', 'mg/L', 250000, 'SNI 6989.72:2009'),
|
||||
('COD', 'Chemical Oxygen Demand', 'mg/L', 200000, 'SNI 6989.2:2009'),
|
||||
('TSS', 'Total Suspended Solid', 'mg/L', 150000, 'SNI 06-6989.3-2004'),
|
||||
('PH', 'Derajat Keasaman', '-', 100000, 'SNI 06-6989.11-2004');
|
||||
|
||||
-- Contoh data permintaan layanan
|
||||
INSERT INTO service_requests (request_code, customer_id, request_type, sampling_date, sampling_location, status, total_amount) VALUES
|
||||
INSERT INTO service_requests (ServiceRequestCode, CustomerID, ServiceRequestType, ServiceRequestSamplingDate, ServiceRequestSamplingLocation, ServiceRequestStatus, ServiceRequestTotalAmount) VALUES
|
||||
('REQ001', 1, 'sampling_analysis', '2024-03-20', 'Plant A - Outlet IPAL', 'approved', 700000),
|
||||
('REQ002', 2, 'analysis_only', '2024-03-21', 'Lab Internal', 'submitted', 450000),
|
||||
('REQ003', 3, 'sampling_analysis', '2024-03-22', 'Intake Water Treatment', 'draft', 550000);
|
||||
|
||||
-- Contoh data parameter yang diminta
|
||||
INSERT INTO request_parameters (request_id, parameter_id, price) VALUES
|
||||
INSERT INTO request_parameters (ServiceRequestID, AnalysisParameterID, RequestParameterPrice) VALUES
|
||||
(1, 1, 250000),
|
||||
(1, 2, 200000),
|
||||
(1, 3, 150000),
|
||||
@@ -155,7 +189,7 @@ INSERT INTO request_parameters (request_id, parameter_id, price) VALUES
|
||||
(3, 4, 100000);
|
||||
|
||||
-- Contoh data quotation
|
||||
INSERT INTO quotations (quotation_code, request_id, issue_date, valid_until, status, total_amount) VALUES
|
||||
INSERT INTO quotations (QuotationCode, ServiceRequestID, QuotationIssueDate, QuotationValidUntil, QuotationStatus, QuotationTotalAmount) VALUES
|
||||
('QUO001', 1, '2024-03-15', '2024-04-15', 'approved', 700000),
|
||||
('QUO002', 2, '2024-03-16', '2024-04-16', 'sent', 450000),
|
||||
('QUO003', 3, '2024-03-17', '2024-04-17', 'draft', 550000);
|
||||
|
||||
Reference in New Issue
Block a user