test with faces

This commit is contained in:
Ruben 2016-09-14 13:33:15 +01:00
parent ef2dd8b746
commit 1bc8b11ee1

33
www/faces.php Normal file
View file

@ -0,0 +1,33 @@
<?php
require __DIR__ . '/../bootstrap.php';
$em = \EmotionHero\Application::getInstance()->getEm();
$hitRepo = $em->getRepository(\EmotionHero\Models\Hit::class);
$hits = $hitRepo->findBy([], ['sadness'=>'ASC']);
?>
<html>
<head>
<title>Emotion Hero</title>
</head>
<style type="text/css">
body{
background:yellow;
}
</style>
<body>
<?php
/* @var $hit EmotionHero\Models\Hit */
foreach($hits as $hit) {
$filename = __DIR__ . '/../files/hits/brows/'. $hit->getId() . '.jpg';
if(!file_exists($filename))
continue;
$img = file_get_contents($filename);
$data = base64_encode($img);
echo "<img src=\"data:image/x-icon;base64,$data\">";
}
?>
</body>
</html>