You could use the $_SERVER['HTTP_REFERER']
function to get the previous URL, store it in a variable and after your code execution is done you can use header('location')
to return to the calling page.
like this:
$prev_page = $_SERVER['HTTP_REFERER'];
function ReIssueRx(){
sqlStatement( Do function to completion);
header('location:' . $prev_page);
}
Goodluck!