« Back to History
kasab_weight_to_roll.php
|
20260723_000646.php
Initial Domain Snapshot
Copy Code
<?php // Base values (can be made dynamic later) $base_weight = 33; $base_rolls = 42; $result = null; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $input_weight = floatval($_POST['weight'] ?? 0); if ($input_weight > 0) { $roll_per_kg = $base_rolls / $base_weight; $calculated_rolls = $input_weight * $roll_per_kg; $result = round($calculated_rolls); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Roll Calculator</title> <!-- Bootstrap CDN --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body class="bg-light"> <div class="container py-5"> <div class="row justify-content-center"> <div class="col-md-5"> <div class="card shadow-sm"> <div class="card-body"> <h4 class="card-title mb-3">Roll Calculator</h4> <p class="text-muted mb-3"> <strong>Base:</strong> 33 kg = 42 rolls </p> <form method="post"> <div class="mb-3"> <label class="form-label">Enter Weight (kg)</label> <input type="number" step="0.01" name="weight" class="form-control" required> </div> <button type="submit" class="btn btn-primary w-100"> Calculate </button> </form> <?php if ($result !== null): ?> <div class="alert alert-success mt-3 mb-0"> Total Rolls: <strong><?= $result ?></strong> </div> <?php endif; ?> </div> </div> </div> </div> </div> </body> </html>