Come on, the first thing I modified in your code were the inputs to facilitate the result see:
<input type="checkbox" checked="" value="20.00" />
<input type="checkbox" checked="" value="20.00" />
<input type="checkbox" checked="" value="20.00" />
<input type="checkbox" checked="" value="20.00" />
I added the type to checkbox and changed the comma to point
Now for you to use the variables in PHP like $ variable, $ total and $ total_file you will need to save the data after each change in the checkbox, you can use ajax for this.
<?
$variavel = 100,00
?>
<input type="checkbox" checked="" value="20.00" />
<input type="checkbox" checked="" value="20.00" />
<input type="checkbox" checked="" value="20.00" />
<input type="checkbox" checked="" value="20.00" />
<div id='resultado_soma'><?echo $total?></div> <!--Resultado da soma dos checkbox-->
<div id='resultado_soma_menos_variavel'><?echo $total_geral?></div>
<!-- Resultado Pegando a Variavel - Resultado checkbox -->
Now the javascript for all of this to work
(function() {
var elements = document.getElementsByTagName('input');
var resultado = document.getElementById('resultado_soma');
var total = 100.00;
for (var i = 0; i < elements.length; i++) {
elements[i].onclick = function() {
if (this.checked === false) {
total = total - this.value;
} else {
total = total + parseFloat(this.value);
}
resultado.innerHTML = total;
}
}})();
You can see the full code here too: link