diff --git a/.gitignore b/.gitignore index e037f59..252f3fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ creds.php +images/company +images/school +images/user \ No newline at end of file diff --git a/API/request.php b/API/request.php index 7a091d8..164e909 100644 --- a/API/request.php +++ b/API/request.php @@ -59,13 +59,22 @@ if($type == null){ include "../images/default.png"; } break; + case "company": + header('Content-Type: image/png'); + $file = "../images/company/".$_GET["id"].".png"; + if(file_exists($file)){ + include $file; + }else{ + include "../images/default.png"; + } + break; case "user": header('Content-Type: image/png'); $file = "../images/user/".$_GET["id"].".png"; if(file_exists($file)){ include $file; }else{ - include "../images/user/default.png"; + include "../images/defaultuser.png"; } break; default: @@ -96,6 +105,17 @@ if($type == null){ $result->close(); $conn->close(); break; + case "company": + $list = array(); + if ($result = $conn->query("SELECT * FROM `schooltypes`")) { + while($row = $result->fetch_assoc()) { + $list[] = $row; + } + echo json_encode($list); + } + $result->close(); + $conn->close(); + break; case "user": $list = array(); if ($result = $conn->query("SELECT * FROM `acctypes`")) { diff --git a/admin/dataupload.php b/admin/dataupload.php index a156a87..46c30f3 100644 --- a/admin/dataupload.php +++ b/admin/dataupload.php @@ -12,13 +12,20 @@