Пример #1
0
    insert($t, $c = cell());
    insert($c, text($row["action"]));
    $export->addCell($row["action"]);
    $export->saveRow();
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&descrip=" . urlencode($descrip), "dt");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
insert($w, block("<p>"));
insert($w, text(my_("Total records:") . " " . $cnt));
/*
include_once('../adodb/adodb-pager.inc.php');
$sql = "SELECT userid, action, dt FROM auditlog ORDER BY dt DESC";

function callback($buffer) {
    return ($buffer);
}
Пример #2
0
    }
    insert($c, block(" | "));
    insert($c, anchor("whois.php?lookup=" . urlencode($row["domain"]), my_("Whois")));
    insert($c, block("</small>"));
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&domain=" . urlencode($domain) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "domain");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
insert($w, block("<p>"));
if ($cnt) {
    insert($w, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&dataid=0&action=export", my_("Export all changed DNS Zones"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure to Export?") . "')") : FALSE));
} else {
    myError($w, $p, my_("Search found no DNS Zone entries"), FALSE);
}
insert($w, $f = form(array("method" => "post", "action" => "modifydnsform.php?cust={$cust}&action=add")));
insert($f, submit(array("value" => my_("Add a DNS Zone"))));
$result->Close();
// create the export view form
Пример #3
0
function searchOverlap($ds, &$w, $cust1, $cust2)
{
    global $block;
    // dont trust variables
    $cust1 = floor($cust1);
    $cust2 = floor($cust2);
    $custdescrip1 = $ds->GetCustomerDescrip($cust1);
    $custdescrip2 = $ds->GetCustomerDescrip($cust2);
    // this query is not quick as indexes cannot be used!!!
    // must have first baseaddr called baseaddr else block pager
    // will not work - may break databases other than mysql
    $result =& $ds->ds->Execute("SELECT t1.baseaddr AS baseaddr,\n                           t1.baseindex AS baseindex1,\n                           t1.subnetsize AS subnetsize1,\n                           t1.descrip AS descrip1,\n                           t2.baseaddr AS baseaddr2,\n                           t2.baseindex AS baseindex2,\n                           t2.subnetsize AS subnetsize2,\n                           t2.descrip AS descrip2\n                        FROM base t1, base t2\n                        WHERE ((t1.baseaddr BETWEEN t2.baseaddr AND\n                                t2.baseaddr+t2.subnetsize-1) OR\n                               (t1.baseaddr+t1.subnetsize-1\n                                BETWEEN t2.baseaddr AND\n                                        t2.baseaddr+t2.subnetsize-1) OR\n                               (t1.baseaddr < t2.baseaddr AND\n                                t1.baseaddr+t1.subnetsize >\n                                t2.baseaddr+t2.subnetsize)) AND\n                               t1.customer={$cust1} AND\n                                t2.customer={$cust2}\n                        ORDER BY t1.baseaddr");
    $totcnt = 0;
    $vars = "";
    // fastforward till first record if not first block of data
    while ($block and $totcnt < $block * MAXTABLESIZE and $row = $result->FetchRow()) {
        $vars = DisplayBlock($w, $row, $totcnt, "&cust1[]=" . $cust1 . "&cust2[]=" . $cust2);
        $totcnt++;
    }
    insert($w, block("<p>"));
    $cnt = 0;
    while ($row = $result->FetchRow()) {
        // draw heading only if there are records to display
        if ($cnt == 0) {
            // create a table
            insert($w, $t = table(array("cols" => "8", "class" => "outputtable")));
            // draw heading
            setdefault("cell", array("class" => "heading"));
            insert($t, $c = cell(array("colspan" => "4")));
            insert($c, block("<center>"));
            insert($c, text($custdescrip1));
            insert($c, block("</center>"));
            insert($t, $c = cell(array("colspan" => "4")));
            insert($c, block("<center>"));
            insert($c, text($custdescrip2));
            insert($c, block("</center>"));
            insert($t, $c = cell());
            if (!empty($vars)) {
                insert($c, anchor($vars, "<<"));
            }
            insert($c, text(my_("Base address")));
            insert($t, $c = cell());
            insert($c, text(my_("Subnet size")));
            insert($t, $c = cell());
            insert($c, text(my_("Subnet mask")));
            insert($t, $c = cell());
            insert($c, text(my_("Description")));
            insert($t, $c = cell());
            insert($c, text(my_("Base address")));
            insert($t, $c = cell());
            insert($c, text(my_("Subnet size")));
            insert($t, $c = cell());
            insert($c, text(my_("Subnet mask")));
            insert($t, $ck = cell());
            insert($ck, text(my_("Description")));
            setdefault("cell", array("class" => color_flip_flop()));
        }
        // customer 1
        if ($row["subnetsize1"] == 1) {
            insert($t, $c = cell());
            insert($c, text(inet_ntoa($row["baseaddr"])));
        } else {
            insert($t, $c = cell());
            insert($c, anchor("displaysubnet.php?baseindex=" . $row["baseindex1"], inet_ntoa($row["baseaddr"])));
        }
        if ($row["subnetsize1"] == 1) {
            insert($t, $c = cell());
            insert($c, text("Host"));
        } else {
            insert($t, $c = cell());
            insert($c, text($row["subnetsize1"]));
        }
        insert($t, $c = cell());
        insert($c, text(inet_ntoa(inet_aton(ALLNETS) + 1 - $row["subnetsize1"]) . "/" . inet_bits($row["subnetsize1"])));
        insert($t, $c = cell());
        insert($c, text($row["descrip1"]));
        // customer 2
        if ($row["subnetsize2"] == 1) {
            insert($t, $c = cell());
            insert($c, text(inet_ntoa($row["baseaddr2"])));
        } else {
            insert($t, $c = cell());
            insert($c, anchor("displaysubnet.php?baseindex=" . $row["baseindex2"], inet_ntoa($row["baseaddr2"])));
        }
        if ($row["subnetsize2"] == 1) {
            insert($t, $c = cell());
            insert($c, text(my_("Host")));
        } else {
            insert($t, $c = cell());
            insert($c, text($row["subnetsize2"]));
        }
        insert($t, $c = cell());
        insert($c, text(inet_ntoa(inet_aton(ALLNETS) + 1 - $row["subnetsize2"]) . "/" . inet_bits($row["subnetsize2"])));
        insert($t, $c = cell());
        insert($c, text($row["descrip2"]));
        if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
            break;
        }
        $cnt++;
        $totcnt++;
    }
    insert($w, block("<p>"));
    if ($cnt) {
        $vars = "";
        $printed = 0;
        while ($row = $result->FetchRow()) {
            $totcnt++;
            $vars = DisplayBlock($w, $row, $totcnt, "&cust1[]=" . $cust1 . "&cust2[]=" . $cust2);
            if (!empty($vars) and !$printed) {
                insert($ck, anchor($vars, ">>"));
                $printed = 1;
            }
        }
    }
}
Пример #4
0
        insert($c, block($result->UserTimeStamp($row["swipmod"], "M d Y H:i:s")));
        insert($c, block("</small>"));
    }
    $export->addCell($row["swipmod"]);
    $export->saveRow();
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
if (!$cnt) {
    myError($w, $p, my_("Search found no matching entries"));
}
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&cust={$cust}&areaindex={$areaindex}" . "&rangeindex={$rangeindex}&ipaddr={$ipaddr}&expr={$expr}&size={$size}" . "&descrip=" . urlencode($descrip));
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
$export->setInfo(array(array("customer_ID", "customer_description", "area_ID", "range_ID", "search_criterion", "search_expression"), array($cust, $ds->getCustomerDescrip($cust), $areaindex, $rangeindex, $expression, $descrip)));
$export->createExportForm($w, NULL);
printhtml($p);
Пример #5
0
        insert($t, $c = cell());
        insert($c, block("<small>"));
        insert($c, anchor($_SERVER["PHP_SELF"] . "?action=deleterequestidx&block={$block}&requestindex=" . $row["requestindex"] . "&requestdesc=" . urlencode($row["requestdesc"]), my_("Delete request")));
        insert($c, block("</small>"));
        if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
            break;
        }
        $cnt++;
        $totcnt++;
    }
    insert($w, block("<p>"));
    $vars = "";
    $printed = 0;
    while ($row = $result->FetchRow()) {
        $totcnt++;
        $vars = DisplayBlock($w, $row, $totcnt, "&action=reqindex", "requestdesc");
        if (!empty($vars) and !$printed) {
            insert($ck, anchor($vars, ">>"));
            $printed = 1;
        }
    }
    //create the export view form
    $export->setInfo(array(array("maintenance_page"), array("request index")));
    $export->createExportForm($w, NULL);
}
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, textbr(my_("Perform the selected IPplan database maintenance.")));
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
insert($f, hidden(array("name" => "action", "value" => "custindex")));
Пример #6
0
    if (DHCPENABLED) {
        insert($c, block(" | "));
        insert($c, anchor("exportdhcp.php?cust=" . $row["customer"], my_("Export DHCP details")));
    }
    insert($c, block(" | "));
    insert($c, anchor("../admin/usermanager.php?action=groupeditform&grp=" . urlencode($row["admingrp"]), my_("Group membership")));
    insert($c, block("</small>"));
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
//insert($w,textb(sprintf(my_("Total records: %u"), $cnt)));
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&expr={$expr}&search=" . urlencode($search), "custdescrip");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
$export->setInfo(array(array("search_criterion", "search_expression"), array($expression, $search)));
$export->createExportForm($w, $template);
printhtml($p);
Пример #7
0
    insert($c, anchor("modifyzoneform.php?cust={$cust}&zoneid=" . $row["id"] . "&action=edit" . "&zone=" . urlencode($row["zone"]) . "&zoneip=" . $row["zoneip"] . "&responsiblemail=" . urlencode($row["responsiblemail"]) . "&size=" . $row["zonesize"] . "&serialdate=" . $row["serialdate"] . "&serialnum=" . $row["serialnum"] . "&ttl=" . $row["ttl"] . "&retry=" . $row["retry"] . "&refresh=" . $row["refresh"] . "&expire=" . $row["expire"] . "&minimum=" . $row["minimum"] . "&slaveonly=" . $row["slaveonly"] . "&zonepath=" . urlencode($row["zonefilepath1"]) . "&seczonepath=" . urlencode($row["zonefilepath2"]), my_("Edit Zone")));
    insert($c, block(" | "));
    insert($c, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&zoneid=" . $row["id"] . "&action=export" . "&zoneip=" . inet_ntoa($row["zoneip"]) . "&zone=" . urlencode($row["zone"]) . "&serialdate=" . $row["serialdate"] . "&serialnum=" . $row["serialnum"], my_("Export Zone"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure?") . "')") : FALSE));
    insert($c, block("</small>"));
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&zone=" . urlencode($zone) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "zone");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
if ($cnt) {
    insert($w, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&zoneid=0&action=export", my_("Export all changed DNS Zones"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure to Export?") . "')") : FALSE));
} else {
    myError($w, $p, my_("Search found no Zone entries") . "\n", FALSE);
}
insert($w, $f = form(array("method" => "post", "action" => "modifyzoneform.php?cust={$cust}&action=add")));
insert($f, submit(array("value" => my_("Add a Zone"))));
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
Пример #8
0
        insert($c, text($row["hname"]));
        insert($c, block("</i></small>"));
    }
    insert($t, $c = cell());
    insert($c, text($row["telno"]));
    insert($t, $c = cell());
    insert($c, block("<small>"));
    insert($c, block($result->UserTimeStamp($row["lastmod"], "M d Y H:i:s")));
    insert($c, block("</small>"));
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
if (!$cnt) {
    myError($w, $p, my_("Search found no matching entries"));
}
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&cust=" . $cust . "&areaindex=" . $areaindex . "&rangeindex=" . $rangeindex . "&day=" . $day . "&month=" . $month . "&year=" . $year . "&tmplfield=" . $tmplfield . "&search=" . urlencode($search) . "&field=" . $field);
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
$result->Close();
printhtml($p);
Пример #9
0
   var i=0;
   for( i=0 ; i<len ; i++) {
      if (al.elements[i].name==\'baseindex[]\') {
         al.elements[i].checked=val;
      }
   }
}
//-->
</script>
'));
    // think this is too dangerous!
    insert($f, anchor("javascript:checkAll(1)", my_("Check all")));
    insert($f, anchor("javascript:checkAll(0)", my_("Clear all")));
    insert($f, block("<p>"));
    insert($f, submit(array("value" => my_("Delete multiple"))));
}
if (!$cnt) {
    myError($w, $p, my_("Search found no matching entries"));
}
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&cust=" . $cust . "&areaindex=" . $areaindex . "&rangeindex=" . $rangeindex . "&ipaddr=" . $ipaddr . "&descrip=" . urlencode($descrip));
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
$result->Close();
printhtml($p);