If the function was to be used once in a page, I might get lazy and put the DB code in the function itself.
But since you're using the function at least 3 times, I'd lean towards keeping the DB code outside of this function. The idea is each time you query the database, its additional time and load you're script is using. So if you have the function called 3 times, thats three hits the function will make on the database. But if you call the database before the 3 funtions and then pass the DB values to the function itself, the you just hit the DB once.
It might also be of value to put the DB query code in its own function. Then you could decide how you want to retrieve the admin values and change your mind later. Lets say for example today you want to have the function get the values directly. You put the 2nd function call directly in the function, but later you decide it should be outside the function. You'd only have a few lines of code to update since the 2nd function is all setup (versus trying to untangle the coded mess you might have if you didn't use a function).
so you might have something like (and this is in pseudo code):
function calc($var1, $var2)
list($ssaval1, $ssaval2) = getSSAValues();
do your calculations here - but swap out the hardcoded numbers with the variables that hold those values
--
or if you want to do the function call outside of the function and pass the values on:
list($ssaval1, $ssava2) = getSSAValues();
// values passed in
function calc($var1, $var2, $ssaval1, $ssaval2)
do your calculations here - but swap out the hardcoded numbers with the variables that hold those values
--
How you do it is up to you...