Esempio n. 1
0
 // start form
 insert($w, $f = form(array("name" => "ENTRY", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
 insert($f, $con = container("fieldset", array("class" => "fieldset")));
 insert($con, $legend = container("legend", array("class" => "legend")));
 insert($legend, text(my_("Required information")));
 insert($con, textbr(my_("Customer/autonomous system description:")));
 insert($con, hidden(array("name" => "cust", "value" => "{$cust}")));
 myFocus($p, "ENTRY", "custdescrip");
 insert($con, input_text(array("name" => "custdescrip", "value" => "{$custdescrip}", "size" => "80", "maxlength" => "80")));
 insert($con, textbrbr(my_("Customer/autonomous system admin group:")));
 insert($con, textbr(my_("WARNING: If you choose a group that you do not have access to, you will not be able to see or access the data")));
 insert($con, selectbox($lst, array("name" => "grp"), $grp));
 insert($f, submit(array("value" => my_("Submit"))));
 insert($f, freset(array("value" => my_("Clear"))));
 if ($_GET) {
     $result2 = $ds->GetCustomerDNSInfo($cust);
     $org = $row1["org"];
     $street = $row1["street"];
     $city = $row1["city"];
     $state = $row1["state"];
     $zipcode = $row1["zipcode"];
     $cntry = $row1["cntry"];
     $nichandl = $row1["nichandl"];
     $lname = $row1["lname"];
     $fname = $row1["fname"];
     $mname = $row1["mname"];
     $torg = $row1["torg"];
     $tstreet = $row1["tstreet"];
     $tcity = $row1["tcity"];
     $tstate = $row1["tstate"];
     $tzipcode = $row1["tzipcode"];
Esempio n. 2
0
function __FetchCustomerInfo($params)
{
    global $xmlrpcerruser;
    // import user errcode value
    // $params is an Array of xmlrpcval objects
    $errstr = "";
    $err = 0;
    if (IPPLAN_API_VER != DBF_API_VER) {
        return new xmlrpcresp(0, $xmlrpcerruser + 3, "Incorrect API version");
    }
    // get the first param
    $custobj = $params->getParam(0);
    // if it's there and the correct type
    if (isset($custobj) && $custobj->scalartyp() == "int") {
        // extract the value of the state number
        $cust = $custobj->scalarval();
        if (!($ds = new IPplanDbf())) {
            return new xmlrpcresp(0, $xmlrpcerruser + 1, "Could not connect to database");
        }
        $result = $ds->GetCustomerDNSInfo($cust);
        while ($row = $result->FetchRow()) {
            $myDNS[] = new xmlrpcval(array("hname" => new xmlrpcval($row["hname"]), "ipaddr" => new xmlrpcval($row["ipaddr"])), "struct");
        }
        $result = $ds->GetCustomerInfo($cust);
        // only one row here
        $row = $result->FetchRow();
        $myVal = new xmlrpcval(array("org" => new xmlrpcval($row["org"]), "street" => new xmlrpcval($row["street"]), "city" => new xmlrpcval($row["city"]), "state" => new xmlrpcval($row["state"]), "zipcode" => new xmlrpcval($row["zipcode"]), "cntry" => new xmlrpcval($row["cntry"]), "nichandl" => new xmlrpcval($row["nichandl"]), "lname" => new xmlrpcval($row["lname"]), "fname" => new xmlrpcval($row["fname"]), "mname" => new xmlrpcval($row["mname"]), "torg" => new xmlrpcval($row["torg"]), "tstreet" => new xmlrpcval($row["tstreet"]), "tcity" => new xmlrpcval($row["tcity"]), "tstate" => new xmlrpcval($row["tstate"]), "tzipcode" => new xmlrpcval($row["tzipcode"]), "tcntry" => new xmlrpcval($row["tcntry"]), "phne" => new xmlrpcval($row["phne"]), "mbox" => new xmlrpcval($row["mbox"]), "dns" => new xmlrpcval($myDNS, "array")), "struct");
    } else {
        // parameter mismatch, complain
        $err = 2;
        $errstr = "Incorrect parameters";
    }
    if ($err) {
        // this is an error condition
        return new xmlrpcresp(0, $xmlrpcerruser + 1, $errstr);
    } else {
        // this is a successful value being returned
        return new xmlrpcresp($myVal);
    }
}