# File yang Harus Di-Upload ke Hosting

## 📁 File Konfigurasi (WAJIB)
```
config/session_config.php                    (BARU - unified session)
config/database_config_sqlsrv_only.php       (UPDATED - IP & kolom database)
config/auth_functions_sqlsrv_only.php        (UPDATED - session handling)
```

## 📁 File Login & Authentication
```
cek.php                                      (UPDATED - session config)
login_secure.php                             (cek jika ada perubahan)
logout.php                                   (cek jika ada perubahan)
```

## 📁 Dashboard Files
```
pgn/media.php                                (UPDATED - session check & DB error handling)
rwl/media.php                                (UPDATED - session check & DB error handling)
```

## 📁 Semua File di Folder pgn/ (karena IP address diubah batch)
```
pgn/*.php                                    (SEMUA file di folder pgn)
```

## ⚠️ PENTING - Sebelum Upload:

1. **BACKUP dulu file hosting yang lama!**
2. **Cek php.ini di hosting** - pastikan:
   - `session.save_path` writable
   - SQLSRV extension installed
   - Memory limit cukup (min 128M)

3. **Edit session_config.php** untuk hosting:
   - Ganti `$use_system_temp = true` jadi `false`
   - Set custom path: `$custom_session_path = '/home/username/tmp/sessions'`

## 🔒 File JANGAN Di-Upload (Debugging):
```
debug_*.php
test_*.php
check_*.php
clear_session.php
FILES_TO_UPLOAD.md (file ini)
```

## 📝 Catatan Hosting:

### Setting yang Berbeda di Hosting vs Localhost:

1. **Session Path**:
   - Localhost: System temp (C:\Users\Asus\AppData\Local\Temp)
   - Hosting: Custom folder di home directory

2. **Database Server**:
   - Sudah benar (103.133.223.213 & 103.133.223.212)
   - Pastikan hosting bisa akses IP eksternal

3. **SQLSRV Extension**:
   - Hosting harus support SQLSRV
   - Jika tidak support, harus request ke hosting provider

## 🚀 Cara Upload:

### Via FTP/FileZilla:
1. Connect ke hosting
2. Backup folder lama (rename ke `backup_YYYYMMDD`)
3. Upload file-file di atas
4. Set permission 755 untuk folder, 644 untuk file

### Via cPanel File Manager:
1. Login cPanel
2. File Manager → public_html/dsp-report
3. Backup lama
4. Upload & Extract

## ✅ Testing Setelah Upload:

1. Akses: `https://domain.com/dsp-report/login_secure.php`
2. Test login PGN: admin / password
3. Test login RWL: admin / password
4. Cek apakah session persist setelah login
5. Cek error log di cPanel jika ada masalah

## 🔧 Jika Error di Hosting:

1. **Cek error_log** di cPanel
2. **Pastikan session folder writable**:
   ```bash
   chmod 755 /home/username/tmp
   chmod 777 /home/username/tmp/sessions
   ```
3. **Test database connection** via SSH/cPanel Terminal
