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.
 
 
 
 
 

49 lines
2.7 KiB

<?php ini_set("allow_url_fopen", 1); $sqldependent = true; include "header.php"; ?>
<section class="content">
<div class="container-fluid">
<div class="block-header">
<h2>ESEMÉNYEK</h2>
</div>
<div class="row clearfix">
<div class="list-group">
<?php
$json = json_decode(file_get_contents($siteurl."/API/request.php?type=events"), true);
if(!isset($json["response"])){
for($i = count($json)-1; $i>=0; $i--) {
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();
if($json[$i]["uploadedas_userid"] != ""){
$userjson = json_decode(file_get_contents($siteurl."/API/request.php?type=user&id=".$json[$i]["ownerid"]), true);
$ownername = $userjson["name"];
}else{
$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="'.$siteurl.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><td>
<td style="white-space: pre-line;"><b>'.$json[$i]["title"].'</b><br>'.$ownername.'<br>'.$json[$i]["description"].'</b><td>
</table>
</a>';
}
}
}
?>
</div>
</div>
</div>
</section>
<?php include "footer.php"; ?>