ADATFELTÖLTÉS
+ADATKEZELÉS
ESEMÉNYKEZELÉS
+'.$json[$i]["description"].''; + } + } + echo "
Még nincsennek események hozzáadva
diff --git a/API/request.php b/API/request.php
index 164e909..3a1aa3b 100644
--- a/API/request.php
+++ b/API/request.php
@@ -41,7 +41,22 @@ if($type == null){
$conn->close();
break;
case "events":
- echo json_encode(array('events' => "Linamar"));
+ $list = array();
+ if(isset($_GET["ownertype"]) && isset($_GET["ownerid"])){
+ $result = $conn->query("SELECT * FROM `events` WHERE `ownertype` = '".$conn->real_escape_string($_GET["ownertype"])."' AND `ownerid` = '".$conn->real_escape_string($_GET["ownerid"])."' ");
+ }else{
+ $result = $conn->query("SELECT * FROM `events`");
+ }
+ 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 "image":
if(isset($_GET["subtype"])){
@@ -77,6 +92,15 @@ if($type == null){
include "../images/defaultuser.png";
}
break;
+ case "eventcategory":
+ header('Content-Type: image/png');
+ $file = "../images/eventcategory/".$_GET["category"].".png";
+ if(file_exists($file)){
+ include $file;
+ }else{
+ include "../images/eventcategory/default.png";
+ }
+ break;
default:
echo json_encode(array('response' => "Invalid subtype specified"));
break;
diff --git a/admin/dataupload.php b/admin/dataupload.php
index 7966559..d689be4 100644
--- a/admin/dataupload.php
+++ b/admin/dataupload.php
@@ -8,7 +8,7 @@
Még nincsennek események hozzáadvaADATFELTÖLTÉS
+ ADATKEZELÉS
ESEMÉNYKEZELÉS
+
'.$json[$i]["description"].'';
+ }
+ }
+ echo "