예제 #1
0
insert($f, checkbox(array("name" => "dhcp", "value" => "1", "onclick" => "location.href='" . location_uri("createsubnetform.php?cust={$cust}&size={$size}&ipplanGroup={$ipplanGroup}&dhcp=1" . "'")), my_("Is this a DHCP subnet?"), $dhcp));
if ($dhcp) {
    insert($f, block("<p>"));
    insert($f, textb(my_("Creating a new DHCP subnet")));
}
insert($f, textbr());
// if called from findfree, save find results
if (isset($_SERVER['HTTP_REFERER']) and stristr($_SERVER['HTTP_REFERER'], "findfree.php")) {
    insert($f, hidden(array("name" => "findfree", "value" => base64_encode($_SERVER['HTTP_REFERER']))));
}
// Requires new default template: basetemplate.xml
// Start of template support [FE]
if ($dhcp) {
    // use dhcp template (for additional subnet information)
    $template = new IPplanIPTemplate("basetemplate-dhcp", $cust);
} else {
    // use base template (for additional subnet information)
    $template = new IPplanIPTemplate("basetemplate", $cust);
}
if ($template->is_error() == FALSE) {
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Additional information")));
    //$template->Merge($template->decode($dbfinfo));
    $template->DisplayTemplate($con);
}
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
myCopyPaste($f, "ipplanCPcreateform", "ENTRY");
$result->Close();
printhtml($p);