Example #1
0
    }
    $init = $save;
} else {
    $init = $_GET['init'];
    $name = $_GET['name'];
}
// get the unit id
$id = StructuredUnit::getUnitId($name);
// create a new value label record
$new = $_GET['new'];
if ($new) {
    // create new value label
    if (strcmp($type, 'value') == 0) {
        StructuredFieldValueLabel::create($id);
    } else {
        StructuredFieldAssetLabel::create($id);
    }
    $message = "A new {$type} label has been created";
}
//delete record
$delete = $_GET['delete'];
if ($delete) {
    // delete value label
    if (strcmp($type, 'value') == 0) {
        StructuredFieldValueLabel::delete($delete);
    } else {
        StructuredFieldAssetLabel::delete($delete);
    }
    $message = "{$type} label deleted";
}
// get the list of record labels