예제 #1
0
     break;
 case 'changeOwnerProfile':
     if (isset($_POST['username']) && isset($_POST['phoneNum']) && isset($_POST['email'])) {
         $password = isset($_POST['password']) ? $_POST['password'] : null;
         if ($ownerDb->updateOwnerProfile($_POST['username'], $_POST['phoneNum'], $_POST['email'], $password)) {
             $result['success'] = '1';
         } else {
             $result['error'] = 'failed to update restaurant';
         }
     } else {
         $result['error'] = 'parameters not set';
     }
     break;
 case 'removeEvent':
     if (isset($_POST['eventId'])) {
         if ($eventDb->removeEvent($_POST['eventId'])) {
             $result['success'] = '1';
         } else {
             $result['error'] = 'failed to delete event';
         }
     } else {
         $result['error'] = 'event id not set';
     }
     break;
 case 'removeHostess':
     if (isset($_POST['hostessUsername'])) {
         if ($hostessDb->removeHostess($_POST['hostessUsername'])) {
             if ($loginDb->removeLogin($_POST['hostessUsername'])) {
                 $result['success'] = '1';
             } else {
                 $result['error'] = 'failed to delete login';