Moved some treatements to functions for better understanding.
moved forms to separate files to put panorama.php to diet and make it more readable