How to use php to calculate the cost of an order? [closed]

I am trying to create a canteen order calculator without using MySQL (project spec, not in my control). The idea is that a user enters some values into the html table and then receives the calculated total cost of their order. Most other ways I’ve tried resulted in fatal errors. This solution is only marginally better, always outputting a cost of $0. Does anyone know why it’s doing that, and how I could fix it? (also new user here, hope I’m asking this right).

<?php
if
(   
    isset($_POST['rolls']) 
    or isset($_POST['pies']) 
    or isset($_POST['crosses']) 
    or isset($_POST['chickens']) 
    or isset($_POST['pastas']) 
    or isset($_POST['milks']) 
    or isset($_POST['juices']) 
    or isset($_POST['waters']) 
)
{
    $finalcost=floatval(0);
    $rolls=0.00;
    $pies=0.00;
    $crosses=0.00;
    $pastas=0.00;
    $chickens=0.00;
    $milks=0.00;
    $juices=0.00;
    $waters=0.00;
    
    function pricefixer ($a,$b)
    {
        switch($b) # find which post to look at. 
        {
            case 'rolls':
            $c=$_POST['rolls'];
            break;
            case 'crosses':
            $c=$_POST['crosses'];
            break;
            case 'chickens':
            $c=$_POST['chickens'];
            break;
            case 'pastas':
            $c=$_POST['pastas'];
            break;
            case 'juices':
            $c=$_POST['juices'];
            break;
            case 'pies':
            $c=$_POST['pies'];
            break;
            case 'milks':
            $c=$_POST['milks'];
            break;
            case 'waters':
            $c=$_POST['waters'];
            break;
            default:
            $c=0;
            break;
            
        }
        
        if($c>0)
        {   
            $a+=$c;
            $a==floatval($a); #Decimal/float prices need decimal/float multipliers. 
        }
    }
    
    function priceadder ($a, $b)
    {
        
        for ($x=0; $x<$a; $x++)
        {
            $finalcost+=$b;
        }
    }
    #simplifes calculation code later

    $order=1; #used to check if user has ordered
    
    #See function pricefixer above
    pricefixer($rolls, 'rolls');
    pricefixer($pies, 'pies');
    pricefixer($chickens, 'chickens');
    pricefixer($pastas, 'pastas');
    pricefixer($crosses, 'crosses');
    pricefixer($milks, 'milks');
    pricefixer($waters, 'waters');
    pricefixer($juices, 'juices');
    
    #Calculate cost
    priceadder($rolls, 4.50);
    priceadder($pies, 2.50);
    priceadder($crosses, 5.00);
    priceadder($chickens, 7.00);
    priceadder($pastas, 6.30);
    priceadder($milks, 3.50);
    priceadder($juices, 3.00);
    priceadder($waters, 2.50);
}
else
{
    $order=0;
}
?>
<html>
<head>
<!-- For when stylehseet is made: <link rel="stylesheet" href="[stylesheet_name_here].css" -->
<meta charset="utf-8">
<title>Canteen Menu</title>
</head>
<body>
<table width=<?php echo $wide; ?> height=<?php echo $tall; ?> border="1" align="center">
    <tr>
        <td colspan="6" align="center" height="15%"> <h2> <b> Hello <?php echo "$given"." "."$surname" ?>, welcome to Narrabundah College online shop. </h2> </b> 
        <br> You are signed in as:<?php echo "$user" ?>. <br> Today's date is <?php echo"$date"; ?>. </td>
    </tr>
    <tr>
        <td rowspan="4" align="center" width="15%"> 
        <a href="canteen_menu.php"> Canteen Data </a> <br>
        <a href="customers_menu.php"> Customer Data </a> <br>
        <a href="stationery_menu.php"> Stationery Data </a> <br>
        <a href="logout.php"> Log Out </a> <br>
        </td>
    </tr>
    <tr>
        <td rowspan="4" colspan="4" align="center"> 
        <!-- Table for easy fo alignment and readability for user -->
        <?php
        if ($order==0)
        {
        ?>
        <table border="1">
        <tr>
        <td colspan="2">
        <h3> Welcome To The Canteen </h3>
        </td>
        </tr>
        <tr>
        <td>
        Items Currentely Avalible:
        <ul align="left">
            <li> Sausage Roll ($4.50) </li>
            <li> Beef and Mushroom Pie ($6.50) </li>
            <li> Almond Crossaint ($5.00) </li>
            <li> Satay Chicken and Rice [conatins peanuts] ($7.00)</li>
            <li> Spaghetti Bolognese ($6.30) </li>
            <li> Chocolate Milk ($3.50) </li>
            <li> Sparkling Raspberry Juice ($3.00) </li>
            <li> PUMP Water ($2.50) </li>
        </ul>
        </td>
        <td>
        Order Quantities: <br> <br>
        <form action="<?php $self ?>" method="post">
        <ul style="list-style-type:none;"> <!-- Removes bullets, list assists in formatting -->
        <li> <input type="number" name="rolls">  </li>
        <li> <input type="number" name="pies">  </li>
        <li> <input type="number" name="crosses">  </li>
        <li> <input type="number" name="chickens">  </li>
        <li> <input type="number" name="pastas">  </li>
        <li><input type="number"  name="milks"> </li>
        <li> <input type="number" name="juices"> </li>
        <li> <input type="number" name="waters"> </li>
        </ul>
        <input type="submit" value="Submit" align="center">
        </form>
        </tr>
        </table>
        </td>
        <?php
        }
        if ($order==1)
        {
            echo 'That order comes to $'.$finalcost.'.';
        }
        ?>
    </tr>
</table>
</body>
</html>