Mike,
it's this part of the code that is causing the issue:
switch(isset(action)?action:""){
action should be a url parameter i.e. $_GET['action'] or a variable i.e. $action or a recordset row value or anything else that is defined, action on it's own as you have it there is what is causing your syntax error