To shift the week start to Sunday, try adjusting your date function. Instead of date("W"), use something incorporating date('N'). You might...