rofl
umm
yah thats what happens if you have to go and post it in a hurry without testing

(ive set chmod no idea why the error) (AND theres no error for me)
for the files being smaller, the script's deleting some unneccessary whitespaces and replaces some TABs with whitespaces
ps: this is the pcre one liner for this file

preg_replace("/total( |)=( |)([0-9.]*)/e","\"total=\".ceil(\\3*$percentage/100)",$file);