예제 #1
0
                     break;
                 }
             }
         }
     }
     if ($key == "COUNT(*)") {
         //! columns looking like functions
         $link = h(ME . "select=" . urlencode($TABLE));
         $i = 0;
         foreach ((array) $_GET["where"] as $v) {
             if (!array_key_exists($v["col"], $unique_array)) {
                 $link .= h(where_link($i++, $v["col"], $v["val"], $v["op"]));
             }
         }
         foreach ($unique_array as $k => $v) {
             $link .= h(where_link($i++, $k, $v));
         }
     }
 }
 if (!$link) {
     if (is_mail($val)) {
         $link = "mailto:{$val}";
     }
     if ($protocol = is_url($row[$key])) {
         $link = $protocol == "http" && $HTTPS ? $row[$key] : "{$protocol}://www.adminer.org/redirect/?url=" . urlencode($row[$key]);
     }
 }
 $id = h("val[{$unique_idf}][" . bracket_escape($key) . "]");
 $value = $_POST["val"][$unique_idf][bracket_escape($key)];
 $h_value = h($value !== null ? $value : $row[$key]);
 $long = strpos($val, "<i>...</i>");
예제 #2
0
                     break;
                 }
             }
         }
     }
     if ($key == "COUNT(*)") {
         //! columns looking like functions
         $link = ME . "select=" . urlencode($TABLE);
         $i = 0;
         foreach ((array) $_GET["where"] as $v) {
             if (!array_key_exists($v["col"], $unique_array)) {
                 $link .= where_link($i++, $v["col"], $v["val"], $v["op"]);
             }
         }
         foreach ($unique_array as $k => $v) {
             $link .= where_link($i++, $k, $v);
         }
     }
     $val = select_value($val, $link, $field, $text_length);
     $id = h("val[{$unique_idf}][" . bracket_escape($key) . "]");
     $value = $_POST["val"][$unique_idf][bracket_escape($key)];
     $editable = !is_array($row[$key]) && is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key];
     $text = preg_match('~text|lob~', $field["type"]);
     if ($_GET["modify"] && $editable || $value !== null) {
         $h_value = h($value !== null ? $value : $row[$key]);
         echo "<td>" . ($text ? "<textarea name='{$id}' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>{$h_value}</textarea>" : "<input name='{$id}' value='{$h_value}' size='{$lengths[$key]}'>");
     } else {
         $long = strpos($val, "<i>...</i>");
         echo "<td id='{$id}' onclick=\"selectClick(this, event, " . ($long ? 2 : ($text ? 1 : 0)) . ($editable ? "" : ", '" . h(lang('Use edit link to modify this value.')) . "'") . ");\">{$val}";
     }
 }