58 lines
2.4 KiB
HTML
58 lines
2.4 KiB
HTML
<?
|
|
error_reporting(E_ERROR);
|
|
function daj_plan($fpietro, $fnumer="", $fid="", $fopis="", $fskala=1, $fbranza="", $fbranzao="")
|
|
{
|
|
$opism=array("pietro"=>"piętro","parter"=>"parter","podziemie"=>"podziemie","antresola"=>"antresola");
|
|
$tx = "";
|
|
if( file_exists("sklepy/sklepy.txt") )
|
|
{
|
|
$arr=file("sklepy/sklepy.txt");
|
|
$l=0;
|
|
$kor_y=0;
|
|
$kor_x=0;
|
|
while(list($key,$val) = each($arr))
|
|
{
|
|
list($wersja,$pietro,$numer,$nazwa,$tel,$branza, $branzao,$opis, $www, $x, $y, $w, $h) = explode("#",$val);
|
|
if(trim($pietro)==trim($fpietro))
|
|
{ if(($x!="")&&($y!=""))
|
|
{
|
|
if((trim($pietro)=="parter")||(trim($pietro)=="pietro")||(trim($pietro)=="podziemie"))
|
|
$kor_y=70;
|
|
$x+=$kor_x;
|
|
$y+=$kor_y;
|
|
|
|
if ((trim($fnumer)==trim($numer))||(trim($fnumer===""))) $dodatek="plan_active"; else $dodatek="plan_not_active";
|
|
if (trim($fnumer===""))
|
|
{
|
|
if((trim($fbranza)==trim($branza))||(trim($fbranza===""))) $dodatek="plan_active"; else $dodatek="plan_not_active";
|
|
if((trim($fbranzao)!=trim($branzao))&&(trim($fbranzao!=""))) $dodatek="plan_not_active";
|
|
}
|
|
if(trim($numer)=="pic")
|
|
{
|
|
$tx .= "<img src='pic/".$nazwa."' class='$dodatek' style='position:absolute;left:".($x*$fskala)."px;top:".($y*$fskala)."px;width:".($w*$fskala)."px;height:".($h*$fskala)."px;'>";
|
|
}
|
|
else
|
|
{
|
|
$dod_popup = "popover";
|
|
$dod_link = "<a href='?tytul=sklep&fpietro=$pietro&fnumer=$numer'>";
|
|
$dod_end ="</a>";
|
|
if ($nazwa==="---")
|
|
{
|
|
$dodatek .= " plan_elem_empty";
|
|
$dod_popup = "";
|
|
$dod_link = "";
|
|
$dod_end = "";
|
|
}
|
|
if(trim($branzao)=="")$branzao=$branza;
|
|
$dodatek_kol = "col".md5(trim($branza));
|
|
$tx .= "$dod_link<div class='plan_elem ".$dodatek." ".$dodatek_kol."' style='left:".($x*$fskala)."px;top:".($y*$fskala)."px;width:".($w*$fskala)."px;height:".($h*$fskala)."px;' data-toggle=\"$dod_popup\" title=\"$nazwa \" data-content=\"".$opism[$pietro]."/$numer - $branzao\" data-placement=\"top\" data-trigger=\"hover\" id=\"$pietro"."_".str_replace(",","-",$numer)."\"> </div>$dod_end";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "<div class='plan_wrap' style='margin-left:".(190*$fskala)."px; margin-top:".(20*$fskala)."px; margin-bottom:".(40*$fskala)."px;width:".(800*$fskala)."px;height:".(400*$fskala)."px;' id='$fid'>".$tx."<div style=\"position: absolute; right: 20px; bottom: 10px;font-size:".(20*$fskala)."px\" class=\"plan_opis\">$fopis</div></div>";
|
|
}
|
|
|
|
?>
|