예제 #1
0
/**
 * Outputs the form for editing existing location
 */
function edit_locations()
{
    View::loadScripts();
    $locations = EventDatabaseManager::getAllLocations();
    View::outputAllLocations('edit_locations', $locations);
    View::linkToAddLocation();
    if (isset($_GET['locationID']) && is_numeric($_GET['locationID'])) {
        $location = EventDatabaseManager::getLocation($_GET['locationID']);
        View::locationFormOutput($location['locationID'], $location['name']);
    } else {
        if (isset($_GET['locationID'])) {
            echo MANDANT_ID_INCORRECT_MESSAGE;
        }
    }
}
예제 #2
0
 /**
  * Returns the output string for the form field creating new address
  * 
  * @param string $param
  * @param string $defaultValue
  * @return string
  */
 public static function addressFormOutput($param, $defaultValue = "")
 {
     if ($param == 'locationID') {
         $values = EventDatabaseManager::getAllLocations();
         return View::outputOptions('locationID', $values, $defaultValue) . " " . ENTER_NEW_LOCATION . ": " . "<input type='text' name='location'>";
     } else {
         return "<input type='text' name='{$param}'>";
     }
 }