Browse Source

Implementation of event viewing (no handling yet) and prettifying admin panel

master
OliverParoczai 4 years ago
parent
commit
e922d0f267
  1. 45
      API/request.php
  2. 54
      admin/eventupload.php
  3. 7
      css/style.css
  4. 93
      event.php
  5. 53
      events.php
  6. 10
      header.php
  7. 55
      school.php
  8. 8
      schools.php

45
API/request.php

@ -31,11 +31,54 @@ if($type == null){
switch($type){ switch($type){
case "schools": case "schools":
$list = array(); $list = array();
if ($result = $conn->query("SELECT * FROM `schools`")) { if(isset($_GET["id"])){
$result = $conn->query("SELECT * FROM `schools` WHERE `id` = '".$conn->real_escape_string($_GET["id"])."'");
}else{
$result = $conn->query("SELECT * FROM `schools`");
}
if (!empty($result) && $result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$list[] = $row;
}
echo json_encode($list);
}else{
echo json_encode(array('response' => "No events connected to specified owner"));
}
$result->close();
$conn->close();
break;
case "user":
$list = array();
if(isset($_GET["id"])){
$result = $conn->query("SELECT * FROM `auth` WHERE `id` = '".$conn->real_escape_string($_GET["id"])."'");
}else{
$result = $conn->query("SELECT * FROM `auth`");
}
if (!empty($result) && $result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$list["name"] += $row["name"];
}
echo json_encode($list);
}else{
echo json_encode(array('response' => "No events connected to specified owner"));
}
$result->close();
$conn->close();
break;
case "companies":
$list = array();
if(isset($_GET["id"])){
$result = $conn->query("SELECT * FROM `companies` WHERE `id` = '".$conn->real_escape_string($_GET["id"])."'");
}else{
$result = $conn->query("SELECT * FROM `companies`");
}
if (!empty($result) && $result->num_rows > 0) {
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
$list[] = $row; $list[] = $row;
} }
echo json_encode($list); echo json_encode($list);
}else{
echo json_encode(array('response' => "No events connected to specified owner"));
} }
$result->close(); $result->close();
$conn->close(); $conn->close();

54
admin/eventupload.php

@ -10,11 +10,63 @@
<?php <?php
if($type == 2){ $ownertype = 2; $ownerid = substr($_SESSION["selectedcompany"], 1); }else{ $ownertype = 1; $ownerid = substr($_SESSION["selectedschool"], 1); } if($type == 2){ $ownertype = 2; $ownerid = substr($_SESSION["selectedcompany"], 1); }else{ $ownertype = 1; $ownerid = substr($_SESSION["selectedschool"], 1); }
$json = json_decode(file_get_contents($url."/API/request.php?type=events&ownertype=".$ownertype."&ownerid=".$ownerid), true); $json = json_decode(file_get_contents($url."/API/request.php?type=events&ownertype=".$ownertype."&ownerid=".$ownerid), true);
$schjson = json_decode(file_get_contents($url."/API/request.php?type=schools&id=".$ownerid), true);
$userjson = json_decode(file_get_contents($url."/API/request.php?type=user&id=".$userid), true);
if(!isset($json["response"])){ if(!isset($json["response"])){
echo "<div class='list-group'>"; echo "<div class='list-group'>";
for($i = 0; $i<count($json); $i++) { for($i = 0; $i<count($json); $i++) {
if($json[$i]["title"] != ""){ if($json[$i]["title"] != ""){
echo '<a class="listitem list-group-item waves-effect"><img class="smallimg listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><b>'.$json[$i]["title"].'</b><br>'.$json[$i]["description"].'</a>'; #echo '<a class="listitem list-group-item waves-effect"><img class="smallimg listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><b>'.$json[$i]["title"].'</b><br>'.$json[$i]["description"].'</a>';
//echo '<a class="listitem list-group-item waves-effect" href="'.$curdir.'event.php?id='.$json[$i]["eventid"].'"><table><td><img class="smallimg listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><td><td><b>'.$json[$i]["title"].'</b><br>'.$selschvals["name"].'<br>'.$json[$i]["description"].'</b><td></table></a>';
echo '
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="media">
<div class="media-left">
<a href="#">';
if($json[$i]["uploadedas_userid"] != ""){ echo '<img src="'.$url.'/API/request.php?type=image&subtype=user&id='.$userid.'">';
}else{ echo '<img src="'.$url.'/API/request.php?type=image&subtype=school&id='.$ownerid.'">'; }
echo'</a>
</div>
<div class="media-body">
<h4 class="media-heading">
<a href="#">';
if($json[$i]["uploadedas_userid"] != ""){ echo "stuff";
}else{ echo $schjson[0]["name"]; }
echo '</a>
</h4>
'.date_format(date_create($json[$i]["datetime"]),"Y.m.d. H:i").'
</div>
</div>
</div>
<div class="panel-body">
<div class="post">
<div class="post-heading">
<p><b>'.$json[$i]["title"].'</b></p><br>
<p>'.$json[$i]["description"].'</p>
</div>
<div class="post-content">
</div>
</div>
</div>
<div class="panel-footer">
<ul>
<li>
<a href="#">
<i class="material-icons">comment</i>
<span>0 komment</span>
</a>
</li>
</ul>
<div class="form-group">
<div class="form-line">
<input type="text" class="form-control" placeholder="Komment írása">
</div>
</div>
</div>
</div>
';
} }
} }
echo "</div>"; echo "</div>";

7
css/style.css

@ -1,14 +1,12 @@
/* Custom ParEdu mods ====================================== */ /* Custom ParEdu mods ====================================== */
.squircle { .squircle {
border-radius: 4% !important; border-radius: 6% !important;
} }
.listitemimg { .listitemimg {
float:left;
display:inline-block;
height: 45px; height: 45px;
width: 45px; width: 45px;
margin-right: 10px; margin-right: 15px;
} }
.listitem{ .listitem{
@ -30,6 +28,7 @@
margin-left: auto; margin-left: auto;
} }
/* Navbar ====================================== */ /* Navbar ====================================== */
@import url(materialize.css); @import url(materialize.css);
.navbar { .navbar {

93
event.php

@ -0,0 +1,93 @@
<?php
ini_set("allow_url_fopen", 1);
$sqldependent = true;
include "header.php";
$json = json_decode(file_get_contents($url."/API/request.php?type=events"), true);
$jsonlang = json_decode(file_get_contents($url."/API/request.php?type=string&subtype=school"), true);
for($eventid = 0; $eventid<count($json); $eventid++) {
if($json[$eventid]["eventid"] == $_GET["id"]){
break;
}
}
if($json[$eventid]["ownertype"] == 2){
$iscompany = true;
$viewsql = "SELECT * FROM `companies` WHERE `id` = ".$json[$eventid]["ownerid"];
$profimg = $url."/API/request.php?type=image&subtype=company&id=".$json[$eventid]["ownerid"];
}else{
$viewsql = "SELECT * FROM `schools` WHERE `id` = ".$json[$eventid]["ownerid"];
$profimg = $url."/API/request.php?type=image&subtype=school&id=".$json[$eventid]["ownerid"];
}
$result = $conn->query($viewsql);
if ($result == TRUE) {
if (!empty($result) && $result->num_rows > 0) {
$ownervals = $result->fetch_assoc();
$ownername = $ownervals["name"];
}else{
$ownername = "Ismeretlen";
}
}
?>
<section class="content">
<div class="row clearfix" >
<div class="container-fluid">
<div class="col-xs-12 col-sm-3">
<?php $borderless = true; $inputid = $ownervals["id"]; include "school.php"; ?>
</div>
<div class="col-xs-12 col-sm-9">
<div class="card profile-card">
<div class="profile-footer">
<a href="events.php">
<button class="btn bg-indigo btn-lg waves-effect btn-block" style="margin-bottom: 15px;"><i class="material-icons left">keyboard_backspace</i><span>VISSZA</span></button>
</a>
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="media">
<div class="media-left">
<a href="#">
<img src="<?php echo $profimg; ?>">
</a>
</div>
<div class="media-body">
<h4 class="media-heading">
<a href="#"><?php echo $ownername; ?></a>
</h4>
<?php echo date_format(date_create($json[0]["datetime"]),"Y.m.d. H:i"); ?>
</div>
</div>
</div>
<div class="panel-body">
<div class="post">
<div class="post-heading">
<p><b><?php echo $json[0]["title"]; ?></b></p><br>
<p><?php echo $json[0]["description"]; ?></p>
</div>
<div class="post-content">
</div>
</div>
</div>
<div class="panel-footer">
<ul>
<li>
<a href="#">
<i class="material-icons">comment</i>
<span>0 komment</span>
</a>
</li>
</ul>
<div class="form-group">
<div class="form-line">
<input type="text" class="form-control" placeholder="Komment írása">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php include "footer.php"; ?>

53
events.php

@ -1,4 +1,4 @@
<?php ini_set("allow_url_fopen", 1); include "header.php"; ?> <?php ini_set("allow_url_fopen", 1); $sqldependent = true; include "header.php"; ?>
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
@ -9,9 +9,30 @@
<div class="list-group"> <div class="list-group">
<?php <?php
$json = json_decode(file_get_contents($url."/API/request.php?type=events"), true); $json = json_decode(file_get_contents($url."/API/request.php?type=events"), true);
for($i = 0; $i<count($json); $i++) { if(!isset($json["response"])){
if($json[$i]["name"] != ""){ for($i = 0; $i<count($json); $i++) {
echo '<a class="listitem list-group-item waves-effect" href="'.$curdir.'event.php?id='.$json[$i]["id"].'"><img class="listitemimg" src="'.$url.'/API/request.php?type=image&subtype=event&id='.$json[$i]["id"].'"><b>'.$json[$i]["name"].'</b><br>'.$json[$i]["location"].'<br>Second line</a>'; if($json[$i]["title"] != ""){
if($json[$i]["ownertype"] == 2){
$viewsql = "SELECT * FROM `companies` WHERE `id` = ".$json[$i]["ownerid"];
}else{
$viewsql = "SELECT * FROM `schools` WHERE `id` = ".$json[$i]["ownerid"];
}
$result = $conn->query($viewsql);
if ($result == TRUE) {
if (!empty($result) && $result->num_rows > 0) {
$vals = $result->fetch_assoc();
$ownername = $vals["name"];
}else{
$ownername = "Ismeretlen";
}
}
echo '<a class="listitem list-group-item waves-effect" href="'.$curdir.'event.php?id='.$json[$i]["eventid"].'">
<table>
<td><img class="smallimg listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><td>
<td><b>'.$json[$i]["title"].'</b><br>'.$ownername.'<br>'.$json[$i]["description"].'</b><td>
</table>
</a>';
}
} }
} }
?> ?>
@ -20,28 +41,4 @@
</div> </div>
</section> </section>
<?php
for($i = 0; $i<count($json); $i++) { #data-toggle="modal" data-target="#schoolModal'.$i.'"
if($json[$i]["name"] == "223"){
echo '<div class="modal fade" id="schoolModal'.$i.'" tabindex="-1" role="dialog" style="display: none;">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="largeModalLabel">'.$json[$i]["name"].'</h4>
</div>
<div class="modal-body">
<div class="list-group">
<a class="list-group-item"><i class="material-icons" style="vertical-align: middle;">map</i>Elhelyezkedés</a>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link waves-effect">SAVE CHANGES</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>';
}
} ?>
<?php include "footer.php"; ?> <?php include "footer.php"; ?>

10
header.php

@ -35,8 +35,12 @@ if ($conn->connect_error) {
} }
if(isset($_POST["selectedcompany"]) && $loggedin){ if(isset($_POST["selectedcompany"]) && $loggedin){
$_SESSION["selectedcompany"] = $_POST["selectedcompany"]; $_SESSION["selectedcompany"] = $_POST["selectedcompany"];
header("Location: http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
die();
}elseif(isset($_POST["selectedschool"]) && $loggedin){ }elseif(isset($_POST["selectedschool"]) && $loggedin){
$_SESSION["selectedschool"] = $_POST["selectedschool"]; $_SESSION["selectedschool"] = $_POST["selectedschool"];
header("Location: http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
die();
} }
if(!isset($liteload) && $loggedin == false && $isadmin && $type != 1 && $type != 2 && $type != 3){ if(!isset($liteload) && $loggedin == false && $isadmin && $type != 1 && $type != 2 && $type != 3){
@ -51,7 +55,11 @@ if(!isset($liteload) && $loggedin == false && $isadmin && $type != 1 && $type !=
if (!empty($result) && $result->num_rows > 0) { if (!empty($result) && $result->num_rows > 0) {
$sqlvals = $result->fetch_assoc(); $sqlvals = $result->fetch_assoc();
$username = $sqlvals["username"]; $username = $sqlvals["username"];
$userid = $sqlvals["id"];
$type = $sqlvals["type"]; $type = $sqlvals["type"];
if(isset($sqlvals["fullname"])){
$fullname = $sqlvals["fullname"];
}
if($type == 2){ if($type == 2){
$connctdcmps = explode(",", $sqlvals["connectedcompanyids"]); $connctdcmps = explode(",", $sqlvals["connectedcompanyids"]);
}elseif($type == 1){ }elseif($type == 1){
@ -462,7 +470,7 @@ if(!isset($liteload) && $loggedin == false && $isadmin && $type != 1 && $type !=
<img src="<?php echo $curdir; ?>API/request.php?type=image&subtype=user&id=<?php echo $id; ?>" width="48" height="48" alt="User" /> <img src="<?php echo $curdir; ?>API/request.php?type=image&subtype=user&id=<?php echo $id; ?>" width="48" height="48" alt="User" />
</div> </div>
<div class="info-container"> <div class="info-container">
<div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php echo $username; ?></div> <div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php if(isset($fullname)){ echo $fullname; }else {echo $username; } ?></div>
<div class="misc"><?php echo $fulltype."<br>".$ssname; ?></div> <div class="misc"><?php echo $fulltype."<br>".$ssname; ?></div>
<?php if($loggedin){ ?> <?php if($loggedin){ ?>
<div class="btn-group user-helper-dropdown"> <div class="btn-group user-helper-dropdown">

55
school.php

@ -1,63 +1,74 @@
<?php <?php
ini_set("allow_url_fopen", 1); ini_set("allow_url_fopen", 1);
$load_leaflet = true; $load_leaflet = true;
include "header.php"; if(!isset($borderless)){ include "header.php"; $inputid = $_GET["id"]; }
$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); if(isset($iscompany)){
for($schoolid = 0; $schoolid<count($json); $schoolid++) { $mjson = json_decode(file_get_contents($url."/API/request.php?type=companies"), true);
if($json[$schoolid]["id"] == $_GET["id"]){ }else{
$mjson = json_decode(file_get_contents($url."/API/request.php?type=schools"), true);
}
$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){
break; break;
} }
} }
$json[$schoolid]["type"]
?> ?>
<?php if(!isset($borderless)){ ?>
<section class="content"> <section class="content">
<div class="row clearfix" > <div class="row clearfix" >
<div class="container-fluid"> <div class="container-fluid">
<div class="col-xs-12"> <div class="col-xs-12">
<?php } ?>
<div class="card profile-card"> <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-header" style="background: url('<?php echo $url; ?>/API/request.php?type=image&subtype=school&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>
<div class="profile-body"> <div class="profile-body">
<div style="text-align: left; padding-left: 15px;"> <div style="text-align: left; padding-left: 15px;">
<h3><?php echo $json[$schoolid]["name"]; ?></h3> <?php if(!isset($borderless)){ echo "<h3>".$mjson[$mid]["name"]."</h3>"; }else{ echo "<h4>".$mjson[$mid]["name"]."</h4>"; }?>
<p><b><?php <p><b><?php
for($i = 0; $i<count($jsonlang); $i++) { for($i = 0; $i<count($mjsonlang); $i++) {
if($jsonlang[$i]["abbr"] == $json[$schoolid]["type"]){ if($mjsonlang[$i]["abbr"] == $mjson[$mid]["type"]){
echo $jsonlang[$i]["hun"]; echo $mjsonlang[$i]["hun"];
break; break;
} }
}; ?></b></p> }; ?></b></p>
</div> </div>
</div> </div>
<div class="profile-footer"> <div class="profile-footer">
<div class="col-md-6 col-sm-12" style="padding: 0 0 0 0;"> <div <?php if(!isset($borderless)){ echo '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="card" tabindex="-1" style="background-color: transparent; box-shadow: 0 0 0 0;">
<div class="body" style="padding: 0 0 0 0;"> <div class="body" style="padding: 0 0 0 0;">
<ul> <ul>
<li> <li>
<span><i class="material-icons left" style="vertical-align: middle;">map</i>Cím</span> <span><i class="material-icons left" style="vertical-align: middle;">map</i><?php if(!isset($borderless)){ echo '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>"; }?> <?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>
</li> </li>
<li> <li>
<span><i class="material-icons left" style="vertical-align: middle;">phone</i>Telefonszám</span> <span><i class="material-icons left" style="vertical-align: middle;">phone</i><?php if(!isset($borderless)){ echo '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>"; }?> <?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>
</li> </li>
<li> <li>
<span><i class="material-icons left" style="vertical-align: middle;">email</i>E-mail cím</span> <span><i class="material-icons left" style="vertical-align: middle;">email</i><?php if(!isset($borderless)){ echo '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>"; }?> <?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>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<?php if(!isset($borderless)){ ?>
<div class="col-md-6 col-sm-12" style="padding-right: 0;"> <div class="col-md-6 col-sm-12" style="padding-right: 0;">
<div id="map"></div> <div id="map"></div>
</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> <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 } ?>
</div> </div>
</div> </div>
<?php if(!isset($borderless)){ ?>
</div> </div>
</div> </div>
</div> </div>
@ -67,14 +78,14 @@ $json[$schoolid]["type"]
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script> crossorigin=""></script>
<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); 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);
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png ', { 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' attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map); }).addTo(map);
L.marker([<?php echo $nomjson[0]["lat"].", ".$nomjson[0]["lon"];?>]).addTo(map) L.marker([<?php echo $nomjson[0]["lat"].", ".$nomjson[0]["lon"];?>]).addTo(map)
.bindPopup('<?php echo $json[$schoolid]["name"]; ?>') .bindPopup('<?php echo $mjson[$mid]["name"]; ?>')
</script> </script>
<?php include "footer.php"; ?> <?php include "footer.php"; } ?>

8
schools.php

@ -11,7 +11,13 @@
$json = json_decode(file_get_contents($url."/API/request.php?type=schools"), true); $json = json_decode(file_get_contents($url."/API/request.php?type=schools"), true);
for($i = 0; $i<count($json); $i++) { for($i = 0; $i<count($json); $i++) {
if($json[$i]["name"] != ""){ if($json[$i]["name"] != ""){
echo '<a class="listitem list-group-item waves-effect" href="'.$curdir.'school.php?id='.$json[$i]["id"].'"><img class="listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=school&id='.$json[$i]["id"].'"><b>'.$json[$i]["name"].'</b><br>'.$json[$i]["location"].'<br>Second line</a>'; echo '
<a class="listitem list-group-item waves-effect" href="'.$curdir.'school.php?id='.$json[$i]["id"].'">
<table>
<td><img class="listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=school&id='.$json[$i]["id"].'"></td>
<td><b>'.$json[$i]["name"].'</b><br>'.$json[$i]["location"].'<br>Second line</b></td>
</table>
</a>';
} }
} }
?> ?>

Loading…
Cancel
Save