Build FD calculator and Maturity Calculator using php

How to make FD calcultor in PHP

  • This is a PHP code is used finding the fixed deposit calculation , You can use this php code for making FD calculator & Maturity Calculator
  • Just Copy and paste the following code and use to find the FD & Mauturity Calculator

Source Code

Index.php

<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Required meta tags-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="Colorlib Templates">
    <meta name="author" content="Colorlib">
    <meta name="keywords" content="Colorlib Templates">

    <!-- Title Page-->
    <title>FD & Maturity Calculator in php</title>

    <!-- Icons font CSS-->
    <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
    <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
    <!-- Font special for pages-->
    <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

    <!-- Vendor CSS-->
    <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
    <link href="vendor/datepicker/daterangepicker.css" rel="stylesheet" media="all">

    <!-- Main CSS-->
    <link href="css/main.css" rel="stylesheet" media="all">
</head>

<body>
    <div class="page-wrapper bg-gra-02 p-t-130 p-b-100 font-poppins">
        <div class="wrapper wrapper--w680">
            <div class="card card-4">
                <div class="card-body">
                    <h2 class="title">Fixed Deposit Interest & Maturity Calculator</h2>
                    <form method="POST" autocomplete="on">
                        <div class="row row-space">
                            <div class="col-2">
                                <div class="input-group">
                                    <label class="label">Principal Amount</label>
                                    <input class="input--style-4" id="p" type="text" name="p" autocomplete="on">
                                </div>
                            </div>
                            <div class="col-2">
                                <div class="input-group">
                                    <label class="label">Intrest Rate</label>
                                    <input class="input--style-4" type="text" name="r">
                                </div>
                            </div>
                        </div>
                        <div class="row row-space">
                            <div class="col-2">
                                <div class="input-group">
                                    <label class="label">Number Of Periods</label>
                                    <input class="input--style-4" type="text" name="t">
                                </div>
                            </div>
                            <div class="col-2">
                                <div class="input-group">
                            <label class="label">Subject</label>
                            <div class="rs-select2 js-select-simple select--no-search">
                                <select name="opt">
                                    <option disabled="disabled" selected="selected">Choose option</option>
                                    <option>year</option>
        <option>days</option>
        <option>month</option>
                                </select>
                                <div class="select-dropdown"></div>
                            </div>
                        </div>
                        </div>
                        
                        
                        <div class="p-t-15">
                            <button class="btn btn--radius-2 btn--blue" type="submit" name="s">Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- Jquery JS-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <!-- Vendor JS-->
    <script src="vendor/select2/select2.min.js"></script>
    <script src="vendor/datepicker/moment.min.js"></script>
    <script src="vendor/datepicker/daterangepicker.js"></script>

    <!-- Main JS-->
    <script src="js/global.js"></script>

<?php
if (isset($_POST['s'])) 
{
    $P=  $_POST['p'];
    $r = $_POST['r'];
    $t=  $_POST['t'];
    $opt = $_POST['opt'];
    $n = 4;

    if ($opt=='year') 
    {
        echo "<br><center><b>\nFixed deposit: ".round($P);
        echo "<br><center><b>Interest Earned Amount:";
        echo $r*$t/100*$P;
        echo "</b></center>";
    }

    if ($opt=='days') 
    {
        echo "<br><center><b>\nFixed deposit: ".round($P);
        $si = $r*$t/100/365*$P;
        echo "<br><center>\nInterest Earned Amount: ".$si = number_format($si, 2, '.', '');
        echo "</b></center>";
    }

    if ($opt=='month') 
    {
        echo "<br><center><b>\nFixed deposit: ".round($P);
        $si = ($P*$r*$t/100/12);
        echo "<br><center>\nInterest Earned Amount: ".$si = number_format($si, 2, '.', '');
        echo "</b></center>";
    }
}
?>
</body><!-- This templates was made by Colorlib (https://colorlib.com) -->

</html>
<!-- end document-->

Template Credit to Colorlib (https://colorlib.com)

Leave a Reply

Your email address will not be published. Required fields are marked *