How to add a switch to admin area which enables/disables crisis-mode: Redirect all traffic to certain page if switch is enabled

How to add a switch to admin area which enables/disables crisis-mode: Redirect all traffic to certain page if switch is enabled

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)