battles/test.php
2018-01-28 20:29:41 +02:00

84 lines
3.0 KiB
PHP

<?php if (isset($_GET['items'])) {
foreach (glob("i/sh/*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
foreach (glob("i/sh/Podarki/*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
foreach (glob("i/sh/runes/*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
exit('EOF');
}
if (isset($_GET['obraz'])) {
foreach (glob("i/shadow/*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
exit('EOF');
}
?>
<?php require_once('config.php'); ?>
<!DOCTYPE html>
<html>
<head>
<title>Нычка</title>
<meta charset=utf-8>
</head>
<body style="background: silver;">
<?php
if (isset($_GET['dbshow'])) {
$sql = db::c()->query('SELECT * FROM `lichka`')->fetch_assoc();
$table = "<table border=1 width=100% align=center>\n";
while ($sql)
{
$table .= "<tr>\n";
$table .= "<th>Lichka\n";
$table .= "<td>".$row['id']."</td>\n";
$table .= "<td>".$row['pers']."</td>\n";
$table .= "<td>".$row['text']."</td>\n";
$table .= "</tr>\n";
}
$table .= "</table><p>\n";
$sql2 = db::c()->query('SELECT * FROM `paldelo`')->fetch_assoc();
$table2 = "<table border=1 width=100% align=center>\n";
while ($sql2)
{
$table2 .= "<tr>\n";
$table2 .= "<th>Paldelo\n";
$table2 .= "<td>".$sql2['id']."</td>\n";
$table2 .= "<td>".$sql2['author']."</td>\n";
$table2 .= "<td>".$sql2['text']."</td>\n";
$table2 .= "</tr>\n";
}
$table2 .= "</table>\n";
// Выводим заполненую таблицу на экран
echo $table.$table2; exit();
}
if (isset($_GET['phpinfo'])) phpinfo();
echo "Склонности: ";
foreach (glob("i/align_*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
echo "<br>Красные Кнопки: ";
foreach (glob("i/a__*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
echo "<br>Синие Кнопки: ";
foreach (glob("i/b__*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
echo "<br>Медали: ";
foreach (glob("i/medal*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
foreach (glob("i/pal*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
foreach (glob("i/tar*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
echo "<br>Свитки: ";
foreach (glob("i/magic/*.{jpg,png,gif}", GLOB_BRACE) as $filename) echo "<img src={$filename} title={$filename}> ";
// Получить все...
$res = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i',11263)->fetch_assoc();
// Последовательно получать в виде ассоциативных массивов
while ($res) print_r($res['id']);
echo '<hr>';
print_r($res['id']);
?>
</body>
</html>