The administration panel and web client for ParEdu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

80 lines
5.2 KiB

<?php
ini_set("allow_url_fopen", 1);
$load_leaflet = true;
include "header.php";
$json = json_decode(file_get_contents($url."/API/request.php?type=schools"), true);
$jsonlang = json_decode(file_get_contents($url."/API/request.php?type=string&subtype=school"), true);
for($schoolid = 0; $schoolid<count($json); $schoolid++) {
if($json[$schoolid]["id"] == $_GET["id"]){
break;
}
}
$json[$schoolid]["type"]
?>
<section class="content">
<div class="row clearfix" >
<div class="container-fluid">
<div class="col-xs-12">
<div class="card profile-card">
<div class="profile-header" style="background: url('<?php echo $url; ?>/API/request.php?type=image&subtype=school&id=<?php echo $json[$schoolid]["id"]; ?>') center center; width: 100%; height: 200px; background-repeat: no-repeat; background-size: cover;"></div>
<div class="profile-body">
<div style="text-align: left; padding-left: 15px;">
<h3><?php echo $json[$schoolid]["name"]; ?></h3>
<p><b><?php
for($i = 0; $i<count($jsonlang); $i++) {
if($jsonlang[$i]["abbr"] == $json[$schoolid]["type"]){
echo $jsonlang[$i]["hun"];
break;
}
}; ?></b></p>
</div>
</div>
<div class="profile-footer">
<div class="col-md-6 col-sm-12" style="padding: 0 0 0 0;">
<div class="card" tabindex="-1" style="background-color: transparent; box-shadow: 0 0 0 0;">
<div class="body" style="padding: 0 0 0 0;">
<ul>
<li>
<span><i class="material-icons left" style="vertical-align: middle;">map</i>Cím</span>
<?php if($json[$schoolid]["locationspec"] != ""){ echo "<span><a href='geo:".$json[$schoolid]["postalcode"]." ".$json[$schoolid]["location"]." ".$json[$schoolid]["locationspec"]."'><b>".$json[$schoolid]["postalcode"]." ".$json[$schoolid]["location"]."</b>, ".$json[$schoolid]["locationspec"]." </a></span>"; }else{ echo "<span><b>Nincs megadva</b></span>"; }?>
</li>
<li>
<span><i class="material-icons left" style="vertical-align: middle;">phone</i>Telefonszám</span>
<?php if($json[$schoolid]["phonenumber"] != ""){ echo "<span><a href='tel:".$json[$schoolid]["phonenumber"]."'><b>".$json[$schoolid]["phonenumber"]."</b></a></span>"; }else{ echo "<span><b>Nincs megadva</b></span>"; }?>
</li>
<li>
<span><i class="material-icons left" style="vertical-align: middle;">email</i>E-mail cím</span>
<?php if($json[$schoolid]["emailaddress"] != ""){ echo "<span><a href='mailto:".$json[$schoolid]["emailaddress"]."'><b>".$json[$schoolid]["emailaddress"]."</b></a> </span>"; }else{ echo "<span><b>Nincs megadva</b></span>"; }?>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-6 col-sm-12" style="padding-right: 0;">
<div id="map"></div>
</div>
<button class="btn btn-primary btn-lg waves-effect btn-block">FOLLOW</button>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<script>
var map = L.map('map').setView([<?php $nomjson = json_decode(file_get_contents("http://open.mapquestapi.com/nominatim/v1/search.php?key=FFle08zQAR5FjrmbTFyblegtAptAhMRU&format=json&q=".urlencode($json[$schoolid]["postalcode"]." ".$json[$schoolid]["location"]." ".$json[$schoolid]["locationspec"])."&addressdetails=1&limit=1"), true); echo $nomjson[0]["lat"].", ".$nomjson[0]["lon"]; ?>], 13);
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png ', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.marker([<?php echo $nomjson[0]["lat"].", ".$nomjson[0]["lon"];?>]).addTo(map)
.bindPopup('<?php echo $json[$schoolid]["name"]; ?>')
</script>
<?php include "footer.php"; ?>