function delPopulation2($id)
{
    $tobeDeleted = new Population2($id);
    if ($tobeDeleted->isNew()) {
        return true;
    }
    // item never existed in the first place
    if ($tobeDeleted->del()) {
        return true;
    } else {
        return $tobeDeleted;
    }
}
require "Population2.inc.php";
require "connectToDataBase.inc.php";
if (isset($_REQUEST['save'])) {
    // handle ajax save request (do not show the interface)
    $ID = @$_REQUEST['ID'];
    // we posted . characters, but something converts them to _ (HTTP 1.1 standard)
    $r = array();
    foreach ($_REQUEST as $i => $v) {
        $r[join('.', explode('_', $i))] = $v;
        //convert _ back to .
    }
    $populatie = array();
    for ($i0 = 0; isset($r['0.' . $i0]); $i0++) {
        $populatie[$i0] = @$r['0.' . $i0 . ''];
    }
    $Population2 = new Population2($ID, $populatie);
    if ($Population2->save() !== false) {
        die('ok:' . serviceref($_REQUEST['content']) . '&Population2=' . urlencode($Population2->getId()));
    } else {
        die('Please fix errors!');
    }
    exit;
    // do not show the interface
}
$buttons = "";
if (isset($_REQUEST['new'])) {
    $new = true;
} else {
    $new = false;
}
if (isset($_REQUEST['edit']) || $new) {