# DEBUG PANDUAN - RWL SHIPMENT DETAIL

## MASALAH YANG DILAPORKAN
User melaporkan bahwa setelah test di lokal, date range picker tidak muncul.

## FILES YANG TERSEDIA UNTUK TESTING

### 1. File Testing Sederhana
- **`test_simple_form.php`** - Form HTML sederhana tanpa library eksternal
- **`test_php_basic.php`** - Test PHP basic functionality dan database connection
- **`debug_shipment_detail.php`** - Debug lengkap dengan library loading test
- **`shipment_detail_debug.php`** - Versi debug dari file utama

### 2. File Testing DatePicker
- **`test_daterange_inline.php`** - Test inline JavaScript approach
- **`test_daterange_pgn_style.php`** - Test PGN style yang berhasil
- **`test_form_display.php`** - Test form display dengan library status

### 3. File Alternatif
- **`shipment_detail_alternative.php`** - Hybrid approach dengan fallback
- **`shipment_detail.php`** - File utama yang sudah dimodifikasi

## LANGKAH DEBUGGING

### Step 1: Test Form HTML Basic
```
http://localhost/dsp-report/rwl/module/report/test_simple_form.php
```
**Cek:** Apakah form HTML dasar muncul?

### Step 2: Test PHP Basic
```
http://localhost/dsp-report/rwl/module/report/test_php_basic.php
```
**Cek:** 
- PHP version
- Database connection
- Form POST handling

### Step 3: Test Library Loading
```
http://localhost/dsp-report/rwl/module/report/debug_shipment_detail.php
```
**Cek:**
- jQuery loading
- moment.js loading
- daterangepicker loading
- select2 loading

### Step 4: Test DatePicker Specific
```
http://localhost/dsp-report/rwl/module/report/test_daterange_inline.php
```
**Cek:**
- DatePicker initialization
- DatePicker functionality
- Library compatibility

### Step 5: Test Debug Version
```
http://localhost/dsp-report/rwl/module/report/shipment_detail_debug.php
```
**Cek:**
- Bootstrap styling
- Form display
- Console output

## KEMUNGKINAN MASALAH

### 1. Library Loading Issues
- CDN terblokir atau lambat
- Library version conflict
- Network connectivity issues

### 2. JavaScript Errors
- Syntax errors in JavaScript
- Library dependency issues
- Browser compatibility

### 3. CSS Issues
- Bootstrap CSS tidak load
- CSS conflict dengan tema lain
- Responsive design issues

### 4. PHP Issues
- Error reporting disabled
- PHP version compatibility
- File permission issues

## SOLUSI BERDASARKAN HASIL TEST

### Jika Form HTML Tidak Muncul:
1. Cek PHP error logs
2. Cek file permissions
3. Cek web server configuration

### Jika Library Tidak Load:
1. Gunakan fallback files
2. Download library ke local
3. Cek network connectivity

### Jika DatePicker Tidak Inisialisasi:
1. Gunakan inline JavaScript
2. Simplifikasi konfigurasi
3. Gunakan alternative library

## CONSOLE DEBUGGING

### Browser Console Commands:
```javascript
// Check jQuery
console.log('jQuery:', typeof jQuery !== 'undefined' ? jQuery.fn.jquery : 'NOT LOADED');

// Check moment
console.log('moment:', typeof moment !== 'undefined' ? moment.version : 'NOT LOADED');

// Check daterangepicker
console.log('daterangepicker:', typeof $.fn.daterangepicker !== 'undefined' ? 'LOADED' : 'NOT LOADED');

// Test daterange element
console.log('dateRange element:', $('#dateRange').length > 0 ? 'FOUND' : 'NOT FOUND');

// Manual initialization
if (typeof $.fn.daterangepicker !== 'undefined') {
    $('#dateRange').daterangepicker();
    console.log('Manual initialization attempted');
}
```

## FALLBACK SOLUTIONS

### 1. Inline JavaScript (Sudah Diimplementasi)
File `shipment_detail.php` sudah menggunakan inline JavaScript seperti PGN.

### 2. Alternative Libraries
- Gunakan HTML5 date input
- Gunakan jQuery UI datepicker
- Gunakan vanilla JavaScript date picker

### 3. Server-side Date Handling
- Gunakan PHP untuk date validation
- Implement server-side date picker
- Use simple text input dengan server validation

## NEXT STEPS

1. **Test semua file debug yang tersedia**
2. **Catat hasil testing di setiap step**
3. **Identifikasi di step mana masalah terjadi**
4. **Implement solusi yang sesuai**
5. **Test di hosting setelah lokal berhasil**

## CONTACT INFO
Jika masih ada masalah, berikan informasi:
- Browser yang digunakan
- Hasil test dari setiap file debug
- Error messages dari browser console
- Screenshot dari setiap step testing
