```php
<?php
require_once '../../../config/database.php';
require_once '../../../config/auth.php';
require_once '../../../includes/header.php';
require_once '../../../includes/sidebar.php';

requireRole(['admin', 'super_admin']);

$db = getDB();
$error = '';
$success = '';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $name = $_POST['name'] ?? '';
    $price = $_POST['price'] ?? 0;
    $wattage = $_POST['wattage'] ?? 0;
    $quality = $_POST['quality'] ?? 0;
    $age = $_POST['age'] ?? 0;
    
    if (empty($name)) {
        $error = 'Nama power supply harus diisi!';
    } elseif (!is_numeric($price) || $price <= 0) {
        $error = 'Harga harus berupa angka positif!';
    } elseif (!is_numeric($wattage) || $wattage <= 0) {
        $error = 'Wattage harus berupa angka positif!';
    } elseif (!is_numeric($quality) || $quality < 1 || $quality > 10) {
        $error = 'Quality harus antara 1-10!';
    } elseif (!is_numeric($age) || $age < 0 || $age > 5) {
        $error = 'Age harus antara 0-5!';
    } else {
        try {
            $stmt = $db->prepare("INSERT INTO power_supply (name, price, wattage, quality, age) VALUES (?, ?, ?, ?, ?)");
            $stmt->execute([$name, $price, $wattage, $quality, $age]);
            
            $success = 'Data power supply berhasil ditambahkan!';
            
            // Redirect setelah 1 detik
            header("refresh:1;url=index.php");
        } catch (PDOException $e) {
            $error = 'Terjadi kesalahan saat menyimpan data!';
        }
    }
}
?>

<!-- Content Wrapper -->
<div class="content-wrapper">
    <!-- Content Header -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>Tambah Power Supply</h1>
                </div>
            </div>
        </div>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="container-fluid">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Form Tambah Power Supply</h3>
                </div>
                <div class="card-body">
                    <?php if ($error): ?>
                        <div class="alert alert-danger"><?php echo $error; ?></div>
                    <?php endif; ?>
                    <?php if ($success): ?>
                        <div class="alert alert-success"><?php echo $success; ?></div>
                    <?php endif; ?>

                    <form method="POST">
                        <div class="form-group">
                            <label for="name">Nama Power Supply</label>
                            <input type="text" class="form-control" id="name" name="name" 
                                   value="<?php echo htmlspecialchars($_POST['name'] ?? ''); ?>" required>
                        </div>

                        <div class="form-group">
                            <label for="wattage">Wattage</label>
                            <div class="input-group">
                                <input type="number" class="form-control" id="wattage" name="wattage" 
                                       value="<?php echo htmlspecialchars($_POST['wattage'] ?? ''); ?>" 
                                       min="0" required>
                                <div class="input-group-append">
                                    <span class="input-group-text">W</span>
                                </div>
                            </div>
                            <small class="form-text text-muted">
                                Masukkan kapasitas daya dalam Watt (contoh: 500)
                            </small>
                        </div>

                        <div class="form-group">
                            <label for="price">Harga</label>
                            <input type="number" class="form-control" id="price" name="price" 
                                   value="<?php echo htmlspecialchars($_POST['price'] ?? ''); ?>" 
                                   min="0" required>
                        </div>

                        <div class="form-group">
                            <label for="quality">Quality (1-10)</label>
                            <input type="number" class="form-control" id="quality" name="quality" 
                                   value="<?php echo htmlspecialchars($_POST['quality'] ?? ''); ?>"
                                   min="1" max="10" step="0.1" required>
                            <small class="form-text text-muted">
                                1 = Kualitas Terendah, 10 = Kualitas Tertinggi
                            </small>
                        </div>

                        <div class="form-group">
                            <label for="age">Age (0-5)</label>
                            <input type="number" class="form-control" id="age" name="age" 
                                   value="<?php echo htmlspecialchars($_POST['age'] ?? ''); ?>"
                                   min="0" max="5" step="0.1" required>
                            <small class="form-text text-muted">
                                0 = Baru, 5 = Sangat Lama
                            </small>
                        </div>

                        <button type="submit" class="btn btn-primary">Simpan</button>
                        <a href="index.php" class="btn btn-secondary">Kembali</a>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>

<?php require_once '../../../includes/footer.php'; ?>
```