insert($con, textbrbr(my_("Expire"))); insert($con, input_text(array("name" => "expire", "value" => "{$expire}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Minimum TTL"))); insert($con, input_text(array("name" => "minimum", "value" => "{$minimum}", "size" => "5", "maxlength" => "10"))); $dbfinfo = $ds->ds->GetOne("SELECT info FROM fwdzoneadd \n WHERE customer={$cust} AND data_id={$dataid}"); // use base template (for additional subnet information) $template = new IPplanIPTemplate("fwdzonetemplate", $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, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Forward zone location"))); insert($con, textbr(my_("Zone File Path"))); insert($con, span(my_("The path where the zone file will be written once exported and processed. Examples:"), array("class" => "textSmall"))); insert($con, span(my_("ftp://myhost.com/var/named/test.zone - if you want to transfer the zone using ncftput"), array("class" => "textSmall"))); insert($con, span(my_("user@myhost.com:/var/named/test.zone - if you want to transfer the zone using scp"), array("class" => "textSmall"))); insert($con, input_text(array("name" => "zonepath", "value" => "{$zonepath}", "size" => "80", "maxlength" => "254"))); insert($con, textbrbr(my_("Secondary Zone File Path"))); insert($con, input_text(array("name" => "seczonepath", "value" => "{$seczonepath}", "size" => "80", "maxlength" => "254"))); insert($f, submit(array("value" => my_("Save")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPdnsrecord", "ENTRY"); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "data_ID", "domain", "email", "serialdate", "serialnum", "ttl", "retry", "refresh", "expire", "minimum_ttl", "slave_zone", "zone_path", "second_zone_path"), array($cust, $ds->getCustomerDescrip($cust), $dataid, $domain, $responsiblemail, $serialdate, $serialnum, $ttl, $retry, $refresh, $expire, $minimum, $slaveonly, $zonepath, $seczonepath))); $export->createExportForm($w, $template); printhtml($p);
$width = $width * 5; insert($w, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_red.jpg\">")); insert($w, block("<img height=\"10\" width=\"{$diff}\" src=\"../images/square_green.jpg\">")); insert($w, textbr('')); insert($w, textb(my_("Total unassigned subnets (pre-allocated subnets marked as free): "))); insert($w, textbr($cntfree)); insert($w, textb(my_("Unassigned subnets (pre-allocated subnets marked as free): "))); insert($w, textbr(round($cntfreesubsize / ($endnum - $startnum + 1) * 100, 2) . "%")); $width = round($cntfreesubsize / ($endnum - $startnum + 1) * 100, 2); $diff = (100 - $width) * 5; $width = $width * 5; insert($w, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_red.jpg\">")); insert($w, block("<img height=\"10\" width=\"{$diff}\" src=\"../images/square_green.jpg\">")); insert($w, textbr()); insert($w, textb(my_("IP addresses allocated (including reserved addresses/excluding reserved addresses): "))); insert($w, textbr(round($used / ($endnum - $startnum + 1) * 100, 2) . "%" . "/" . round(($used - $cntsubnets * 2) / ($endnum - $startnum + 1) * 100, 2) . "%")); $width = round($used / ($endnum - $startnum + 1) * 100, 2); $diff = (100 - $width) * 5; $width = $width * 5; insert($w, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_red.jpg\">")); insert($w, block("<img height=\"10\" width=\"{$diff}\" src=\"../images/square_green.jpg\">")); } /* if( function_exists('memory_get_usage') ) { echo memory_get_usage(); // php >=4.3 only } */ // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "addr_start", "addr_end", "total_allocated_networks_subnets", "percent_network_subnets_allocated", "total_unassigned_subnets", "percent_unassigned_subnets", "percent_ip_allocated_include_reserved", "percent_ip_allocated_exclude_reserved"), array($cust, $ds->getCustomerDescrip($cust), $start, $end, $cnt, round($cntsubsize / ($endnum - $startnum + 1) * 100, 2), $cntfree, round($cntfreesubsize / ($endnum - $startnum + 1) * 100, 2), round($used / ($endnum - $startnum + 1) * 100, 2), round(($used - $cntsubnets * 2) / ($endnum - $startnum + 1) * 100, 2)))); $export->createExportForm($w, NULL); printhtml($p);
insert($con, hidden(array("name" => "cust", "value" => "{$cust}"))); myFocus($p, "ENTRY", "host"); insert($con, textbr(my_("Host Name"))); insert($con, block("<small><i>")); insert($con, textbr(my_("Terminate Fully Qualified Domand Name's (FQDN) with a . eg. mywwwserver.com. to signify 'This domain'"))); insert($con, block("</small></i>")); insert($con, input_text(array("name" => "host", "value" => "{$host}", "size" => "40", "maxlength" => "253"))); insert($con, anchor("JavaScript:thisdomain()", my_("This domain"))); // add some javascript magic to follow a link if field is completed insert($p, script(' function thisdomain() { document.ENTRY.host.value="' . $domain . '."; } ', array("language" => "JavaScript", "type" => "text/javascript"))); insert($con, textbrbr(my_("Record Type"))); insert($con, selectbox(array("A" => "A", "CNAME" => "CNAME", "MX" => "MX", "TXT" => "TXT", "KEY" => "KEY", "SRV" => "SRV", "NS" => "NS", "AFSDB" => "AFSDB"), array("name" => "recordtype"), $recordtype)); insert($con, textbrbr(my_("IP / Hostname"))); insert($con, block("<small><i>")); insert($con, textbr(my_("For MX records, format is \"preference hostname\", eg. \"10 mymailserver.com.\""))); insert($con, block("</small></i>")); insert($con, input_text(array("name" => "iphostname", "value" => "{$iphostname}", "size" => "40", "maxlength" => "250"))); insert($con, textbrbr(my_("Sort Order"))); insert($con, input_text(array("name" => "sortorder", "value" => "{$sortorder}", "size" => "6", "maxlength" => "6"))); insert($f, submit(array("value" => my_("Save")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPdnsrecord", "ENTRY"); // create the export view form $export = new exportForm(); $export->setInfo(array(array("customer_ID", "customer_description", "data_ID", "domain", "sort_order", "host", "record_type", "ip_hostname"), array($cust, $ds->getCustomerDescrip($cust), $dataid, $domain, $sortorder, $host, $recordtype, $iphostname))); $export->createExportForm($w, NULL); printhtml($p);
$export->addRow(NULL); setdefault("cell", array("class" => color_flip_flop())); insert($t, $c = cell()); // no point in making this a hyperlink - there are no ranges so search will // always return nothing! insert($c, text(inet_ntoa($row["areaaddr"]))); $export->addCell(inet_ntoa($row["areaaddr"])); insert($t, $c = cell()); insert($c, text($row["adescrip"])); $export->addCell($row["adescrip"]); $export->addCell(my_("No range")); $export->addCell(""); $export->addCell(""); $export->addCell(my_("No range in this area")); $export->saveRow(); insert($t, $c = cell()); insert($c, block("<small>")); insert($c, anchor("deletearea.php?areaindex=" . $row["areaindex"] . "&cust=" . $cust, my_("Delete Area"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure?") . "')") : FALSE)); insert($c, block(" | ")); insert($c, anchor("createarea.php?action=modify&areaindex=" . $row["areaindex"] . "&ipaddr=" . inet_ntoa($row["areaaddr"]) . "&cust=" . $cust . "&descrip=" . urlencode($row["adescrip"]), my_("Modify Area"))); insert($c, block("</small>")); $cnt++; } insert($w, block("<p>")); insert($w, textb(sprintf(my_("Total records: %u"), $cnt))); $temp2 = $cnt; $result->Close(); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "total_ranges_and_areas_with_ranges", "total_areas_without_ranges"), array($cust, $ds->getCustomerDescrip($cust), $temp1, $temp2))); $export->createExportForm($w, NULL); printhtml($p);
insert($legend, text(my_("Reverse zone SOA header information"))); insert($con, text(my_("Technical contact email address"))); insert($con, span(my_("No @ allowed - replace with ."), array("class" => "textSmall"))); insert($con, input_text(array("name" => "responsiblemail", "value" => "{$responsiblemail}", "size" => "64", "maxlength" => "64"))); insert($con, textbrbr(my_("TTL"))); insert($con, input_text(array("name" => "ttl", "value" => "{$ttl}", "size" => "10", "maxlength" => "10"))); insert($con, textbrbr(my_("Refresh"))); insert($con, input_text(array("name" => "refresh", "value" => "{$refresh}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Retry"))); insert($con, input_text(array("name" => "retry", "value" => "{$retry}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Expire"))); insert($con, input_text(array("name" => "expire", "value" => "{$expire}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Minimum TTL"))); insert($con, input_text(array("name" => "minimum", "value" => "{$minimum}", "size" => "5", "maxlength" => "10"))); insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Reverse zone location"))); insert($con, textbr(my_("Zone File Path"))); insert($con, span(my_("The path where the zone file will be written once exported and processed. Examples:"), array("class" => "textSmall"))); insert($con, span(my_("ftp://myhost.com/var/named/test.zone - if you want to transfer the zone using ncftput"), array("class" => "textSmall"))); insert($con, span(my_("user@myhost.com:/var/named/test.zone - if you want to transfer the zone using scp"), array("class" => "textSmall"))); insert($con, input_text(array("name" => "zonepath", "value" => "{$zonepath}", "size" => "80", "maxlength" => "254"))); insert($con, textbrbr(my_("Secondary Zone File Path"))); insert($con, input_text(array("name" => "seczonepath", "value" => "{$seczonepath}", "size" => "80", "maxlength" => "254"))); insert($f, submit(array("value" => my_("Save")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPzone", "ENTRY"); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "zoneid", "zone", "zone_ip", "email", "size", "serial_date", "serial_number", "ttl", "retry", "refresh", "expire", "minimum ttl", "slave_zone", "zone_path", "second_zone_path"), array($cust, $ds->getCustomerDescrip($cust), $zoneid, $zone, $zoneip, $responsiblemail, $size, $serialdate, $serialnum, $ttl, $retry, $refresh, $expire, $minimum, $slaveonly, $zonepath, $seczonepath))); $export->createExportForm($w, NULL); printhtml($p);