File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/admin3/lot-size-calculator.php
Back
<?php session_start(); if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) { header("Location: login.php"); exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Lot Size Calculator</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body class="bg-light"> <div class="container mt-5"> <h2 class="mb-4 text-center">Lot Size Calculator</h2> <div class="card p-4 shadow-sm"> <form method="post"> <div class="mb-3"> <label for="price" class="form-label">IPO Price per Share (₹)</label> <input type="number" class="form-control" id="price" name="price" required step="0.01" min="0"> </div> <div class="mb-3"> <label for="lot_size" class="form-label">Lot Size (Shares per Lot)</label> <input type="number" class="form-control" id="lot_size" name="lot_size" required min="1"> </div> <button type="submit" class="btn btn-primary">Calculate</button> </form> <?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { $price = floatval($_POST['price']); $lot_size = intval($_POST['lot_size']); $lot_cost = $price * $lot_size; if ($lot_cost > 0) { $lots_2lakh = floor(200000 / $lot_cost); $lots_5lakh = floor(500000 / $lot_cost); echo "<hr><h5>Results:</h5>"; echo "<ul>"; echo "<li>Cost per Lot: ₹" . number_format($lot_cost, 2) . "</li>"; echo "<li>Maximum Lots in ₹2,00,000: <strong>$lots_2lakh</strong></li>"; echo "<li>Maximum Lots in ₹5,00,000: <strong>$lots_5lakh</strong></li>"; echo "</ul>"; echo "<hr><h5>Investment Table (up to ₹5,00,000)</h5>"; echo "<div class='table-responsive'><table class='table table-bordered'>"; echo "<thead class='table-light'><tr> <th>Lots</th> <th>Total Shares</th> <th>Total Investment (₹)</th> </tr></thead><tbody>"; for ($i = 1; $i <= $lots_5lakh; $i++) { $total_shares = $lot_size * $i; $total_amount = $lot_cost * $i; echo "<tr> <td>$i</td> <td>$total_shares</td> <td>₹" . number_format($total_amount, 2) . "</td> </tr>"; } echo "</tbody></table></div>"; } else { echo "<div class='alert alert-danger mt-3'>Invalid input. Please enter valid numbers.</div>"; } } ?> </div> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings