Регистратура объединяется со вкладкой кланы. #54. Closes #56.

This commit is contained in:
2023-07-19 15:36:13 +03:00
parent 1500eb9364
commit 92772463e6
22 changed files with 844 additions and 522 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
use Core\Db;
class Images
{
public static function getSrc(int $id): string
{
$i = Db::getRow('select mime_type, img from images where id = ?', [$id]);
return 'data:' . $i['mime_type'] . ';base64,' . base64_encode($i['img']);
}
public static function getSrcByName(string $name): string
{
$i = Db::getRow('select mime_type, img from images where id = (select logo from clan where name = ?)', [$name]);
return 'data:' . $i['mime_type'] . ';base64,' . base64_encode($i['img']);
}
public static function getJson(int $id)
{
$stmt = Db::getRow('select mime_type, img from images where id = ?', [$id]);
if (!$stmt) {
$stmt = [];
}
return json_encode($stmt);
}
}