<?php
require'fun.php';
header('Content-Type: image/png');
header('Last-Modified: '.gmdate('D, d M Y H:i:s T'));
header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0,post-check=0,pre-check=0');
header('Expires: -1');
if($de>0)
{
$im=imagecreatetruecolor(400,400);
$fer=$conn->query('SELECT`corx`,`cory`,`trib`FROM`t2_membrii`WHERE`de`="'.$de.'"')->fetch_row();
$x1=$fer[0]-200;
$y1=$fer[1]-200;
imagecopy($im,imagecreatefromgif('img/triburile2/harta.gif'),0,0,0,0,500,500);
$items=$conn->query('SELECT`corx`,`cory`,`sat`,`de`,`trib`FROM`t2_membrii`WHERE(`corx`>'.$x1.'&&`corx`<'.($fer[0]+200).')&&(`cory`>'.$y1.'&&`cory`<'.($fer[1]+200).')');
while($i=$items->fetch_row())
{
if($i[3]==$de)
$map=imagecreatefrompng('img/triburile2/map1.png');
else
{
$map=imagecreatefrompng('img/triburile2/map2.png');
if($i[4]==$fer[2])
$map=imagecreatefrompng('img/triburile2/map3.png');
}
imagefttext($im,12,0,$i[0]-$x1-20,$i[1]-$y1-20,imagecolorallocate($im,0,0,0),'img/triburile2/arial.ttf',$i[2]);
imagecopy($im,$map,$i[0]-$x1-20,$i[1]-$y1-20,0,0,40,40);
}
}
else
{
$im=imagecreate(60,60)
or die('Cannot Initialize new GD image stream');
imagestring($im,4,5,10,'Eroare!',imagecolorallocate($im,255,0,0));
imagestring($im,6,24,31,'X',imagecolorallocate($im,0,0,0));
}
imagepng($im);
imagedestroy($im);
require'f_fun.php';