<?php /** * Created by PhpStorm. * User: eric * Date: 5/11/2015 * Time: 7:54 AM */ require 'createController.php'; if (!empty($_POST['creationType'])) { $createType = $_POST['creationType']; databaseController::createNew($createType, $_POST); } //if(!empty($_POST["restaurantAssociation"])){ // databaseController::getGroupListByRestaurantId($_POST["restaurantAssociation"]); //} class databaseController { public static function connectToDatabase() { $sql = mysqli_connect('localhost', 'ivars235_menu', 'slamclam!', 'ivars235_joomla'); return $sql; } public static function createNew($creationType, $creationPackage) { switch ($creationType) { case 'restaurant': createController::restaurantCreate($creationPackage); break; case 'menugroup': createController::groupCreate($creationPackage);