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.

93 lines
6.0 KiB

4 years ago
<?php
ini_set("allow_url_fopen", 1);
$load_leaflet = true;
if(!isset($borderless)){ include "header.php"; $inputid = $_GET["id"]; }
if(isset($iscompany)){
$mjson = json_decode(file_get_contents($url."/API/request.php?type=companies"), true);
$ownerimgtype = "company";
}else{
$mjson = json_decode(file_get_contents($url."/API/request.php?type=schools"), true);
$ownerimgtype = "school";
}
$mjsonlang = json_decode(file_get_contents($url."/API/request.php?type=string&subtype=school"), true);
for($mid = 0; $mid<count($mjson); $mid++) {
if($mjson[$mid]["id"] == $inputid){
4 years ago
break;
}
}
?>
<?php if(!isset($borderless)){ ?>
4 years ago
<section class="content">
<div class="row clearfix" >
<div class="container-fluid">
<div class="col-xs-12">
<?php } ?>
4 years ago
<div class="card profile-card">
<div class="profile-header" style="background: url('<?php echo $url; ?>/API/request.php?type=image&subtype=<?php echo $ownerimgtype; ?>&id=<?php echo $mjson[$mid]["id"]; ?>') center center; width: 100%; height: <?php if(!isset($borderless)){ echo '200px'; }else{ echo '150px'; } ?>; background-repeat: no-repeat; background-size: cover;"></div>
4 years ago
<div class="profile-body">
<div style="text-align: left; padding-left: 15px;">
<?php if(!isset($borderless)){ echo "<h3>".$mjson[$mid]["name"]."</h3>"; }else{ echo "<h4>".$mjson[$mid]["name"]."</h4>"; }?>
4 years ago
<p><b><?php
for($i = 0; $i<count($mjsonlang); $i++) {
if($mjsonlang[$i]["abbr"] == $mjson[$mid]["type"]){
echo $mjsonlang[$i]["hun"];
4 years ago
break;
}
}; ?></b></p>
</div>
</div>
<div class="profile-footer">
<div <?php if(!isset($borderless)){ echo 'class="col-md-6 col-sm-12"'; } ?> style="padding: 0 0 0 0;">
4 years ago
<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><?php if(!isset($borderless)){ echo 'Cím'; } ?></span>
<?php if($mjson[$mid]["locationspec"] != ""){ echo "<span><a href='geo:".$mjson[$mid]["postalcode"]." ".$mjson[$mid]["location"]." ".$mjson[$mid]["locationspec"]."'><b>".$mjson[$mid]["location"]."</b>, ".$mjson[$mid]["locationspec"]." </a></span>"; }else{ echo "<span><b>Nincs megadva</b></span>"; }?>
<br>
4 years ago
</li>
<li>
<span><i class="material-icons left" style="vertical-align: middle;">phone</i><?php if(!isset($borderless)){ echo 'Telefonszám'; } ?></span>
<?php if($mjson[$mid]["phonenumber"] != ""){ echo "<span><a href='tel:".$mjson[$mid]["phonenumber"]."'><b>".$mjson[$mid]["phonenumber"]."</b></a></span>"; }else{ echo "<span><b>Nincs megadva</b></span>"; }?>
<br>
4 years ago
</li>
<li>
<span><i class="material-icons left" style="vertical-align: middle;">email</i><?php if(!isset($borderless)){ echo 'E-mail cím'; } ?></span>
<?php if($mjson[$mid]["emailaddress"] != ""){ echo "<span><a href='mailto:".$mjson[$mid]["emailaddress"]."'><b>".$mjson[$mid]["emailaddress"]."</b></a> </span>"; }else{ echo "<span><b>Nincs megadva</b></span>"; }?>
<br>
4 years ago
</li>
</ul>
</div>
</div>
</div>
<?php if(!isset($borderless)){ ?>
4 years ago
<div class="col-md-6 col-sm-12" style="padding-right: 0;">
<div id="map"></div>
</div>
<a href="schools.php"><button class="btn bg-indigo btn-lg waves-effect btn-block"><i class="material-icons left">keyboard_backspace</i><span>VISSZA</span></button></a>
<?php } ?>
4 years ago
</div>
</div>
<?php if(!isset($borderless)){ ?>
4 years ago
</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($mjson[$mid]["postalcode"]." ".$mjson[$mid]["location"]." ".$mjson[$mid]["locationspec"])."&addressdetails=1&limit=1"), true); echo $nomjson[0]["lat"].", ".$nomjson[0]["lon"]; ?>], 13);
4 years ago
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 $mjson[$mid]["name"]; ?>')
4 years ago
</script>
<?php include "footer.php"; } ?>