diff --git a/index.php b/index.php index 2dcc0b9..97d04c9 100755 --- a/index.php +++ b/index.php @@ -15,6 +15,15 @@ display: inline-block; } + table#result { + border-collapse: collapse; + } + + table#result td { + border: 1px solid gray; + padding: 0.5em; + } + div.table { display: table; max-width: 800px; @@ -35,6 +44,7 @@ display: table-cell; margin-top: 0.5em; margin-bottom: 0.5em; + } div.table>div.row>:first-child { vertical-align: top; @@ -62,14 +72,18 @@ border-color: hsl(224, 78%, 75%); background-color: hsl(224, 78%, 90%); } + + :required:invalid, :focus:invalid { + /* insert your own styles for invalid form input */ + background-color: #ffeeee; + }
-'; - foreach ($lines as $line) { - $parts = explode(' ', $line); - - echo $engine->render($template, $parts); - get_card_data($parts[0], $parts[1]); - echo "\n"; + $headers = []; + foreach ($meta["wrapper_data"] as $line) { + $parts = explode(":", $line, 2); + if (isset($parts[1])) + $headers[trim($parts[0])] = trim($parts[1]); } - echo '
(屮゚Д゚)屮
"; + return; + } + + switch ($_REQUEST['format']) { + case "set:num": + $template = "{set}: {number}"; + break; + case "cardname": + default: + $template = "{name}"; + } + + $lines = explode("\n", $q); + if (count($lines) > 100) { + echo "Please request no more than 100 cards at a time
"; + return; + } + + echo ''; + if (!empty($_REQUEST["prefix"])) + echo '
$parts[0] $parts[1] | "; + elseif ($urls_only) + echo "$parts[0] $parts[1]: "; + + if (empty($response["data"])) + echo "Card not found :("; + elseif (!$urls_only) + echo $engine->render($template, $response["data"]); + else + echo "$url"; + + if (!empty($_REQUEST["prefix"])) + echo ' |