Esempio n. 1
0
echo "<form action=genihistory.php method=post>\n      <b>Search:</b> \n      <input type=text\n             name=searchfor\n             size=50\n             value=\"{$searchfor}\"";
if ($searchfor == $searchbox) {
    echo "   onfocus='focus_text(this, \"{$searchfor}\")'\n             onblur='blur_text(this, \"{$searchfor}\")'";
}
echo " />\n      <b><input type=submit name=search value=Go></b> ";
if ($ISCLRHOUSE) {
    echo "<input type=checkbox name=ch value=1 " . ($ch ? "checked" : "") . "> Search CH";
}
echo "</form>\n";
function GeneratePopupDiv($id, $text)
{
    return "<div id=\"{$id}\" " . "style='display:none;width:700;height:400;overflow:auto;'>\n" . "{$text}\n" . "</div>\n";
}
if (1) {
    $myindex = $index;
    $dblink = GetDBLink($ch ? "ch" : "cm");
    $clause = "";
    if (isset($slice_uuid)) {
        if (!preg_match("/^\\w+\\-\\w+\\-\\w+\\-\\w+\\-\\w+\$/", $slice_uuid)) {
            USERERROR("Invalid slice uuid", 1);
        }
        $clause = "and a.slice_uuid='{$slice_uuid}' ";
    } else {
        if ($myindex) {
            $clause = "and a.idx<{$myindex} ";
        }
        if (isset($search) && isset($searchfor)) {
            $safe_searchfor = addslashes($searchfor);
            if (preg_match("/^\\w+\\-\\w+\\-\\w+\\-\\w+\\-\\w+\$/", $searchfor)) {
                $clause = "{$clause} and a.slice_uuid='{$safe_searchfor}' ";
            } elseif (preg_match("/^urn:publicid:IDN\\+[-\\w\\.]+\\+slice\\+[-\\w]*\$/", $searchfor)) {
Esempio n. 2
0
 function SliverList($slice)
 {
     $result = array();
     $dblink = GetDBLink("sa");
     $slice_idx = $slice->idx();
     if (!$dblink) {
         return null;
     }
     $query_result = DBQueryFatal("select idx from client_slivers " . "where slice_idx='{$slice_idx}'", $dblink);
     if (!($query_result && mysql_num_rows($query_result))) {
         return null;
     }
     while ($row = mysql_fetch_array($query_result)) {
         $idx = $row["idx"];
         if (!($sliver = ClientSliver::Lookup($idx))) {
             TBERROR("ClientSliver::SliverList: " . "Could not load client sliver {$idx}!", 1);
         }
         $result[] = $sliver;
     }
     return $result;
 }