Browse Source

Server change, minor setup script updates, data upload polish, implement normal font handling

master
OliverParoczai 4 years ago
parent
commit
609d0eb5fe
  1. 7
      API/request.php
  2. 3
      admin/dataupload.php
  3. 0
      css/.fuse_hidden0002546300000002
  4. BIN
      css/Roboto-Regular.woff2
  5. BIN
      css/Roboto-ext.woff2
  6. BIN
      css/Roboto.woff2
  7. 21
      css/font.css
  8. 2
      header.php
  9. 4
      school.php
  10. 11
      schools.php
  11. 33
      setup.php

7
API/request.php

@ -4,13 +4,10 @@ header("Cache-Control: post-check=0, pre-check=0", false);
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Pragma: no-cache"); header("Pragma: no-cache");
header('Content-Type: application/json'); header('Content-Type: application/json');
$servername = "localhost"; include "../creds.php";
$username = "paredu";
$password = "d5X5\$cN$9G";
$dbname = "paredu";
// Create connection // Create connection
$conn = new mysqli($servername, $username, $password, $dbname); $conn = new mysqli($sqlserver, $sqluser, $sqlpass, $dbname);
// Check connection // Check connection
if ($conn->connect_error) { if ($conn->connect_error) {

3
admin/dataupload.php

@ -89,7 +89,6 @@
<?php }else{ ?> <?php }else{ ?>
<option value="high" <?php if($selschvals["type"] == "high"){ echo "selected"; } ?>>Középiskola</option> <option value="high" <?php if($selschvals["type"] == "high"){ echo "selected"; } ?>>Középiskola</option>
<option value="uni" <?php if($selschvals["type"] == "uni"){ echo "selected"; } ?>>Egyetem</option> <option value="uni" <?php if($selschvals["type"] == "uni"){ echo "selected"; } ?>>Egyetem</option>
<option value="college" <?php if($selschvals["type"] == "college"){ echo "selected"; } ?>>Főiskola</option>
<?php } ?> <?php } ?>
</select> </select>
</div> </div>
@ -101,7 +100,7 @@
<b><?php if($type == 2){ echo "Vállalat"; } else { echo "Intézmény"; } ?> fotója</b> <b><?php if($type == 2){ echo "Vállalat"; } else { echo "Intézmény"; } ?> fotója</b>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"> <span class="input-group-addon">
<img class="squircle" id="formimageout" src="<?php echo $curdir; ?>API/request.php?type=image&subtype=<?php if($type == 2){ echo "company"; }else{ echo "school"; } ?>&id=<?php echo $selschvals["id"]; ?>" height="100px" width="100px"> <div class="squircle" id="formimageout" style='background: url("<?php echo $curdir; ?>API/request.php?type=image&subtype=<?php if($type == 2){ echo "company"; }else{ echo "school"; } ?>&id=<?php echo $selschvals["id"]; ?>") center center; width: 100px; height: 100px; background-size: cover; background-position: center;'></div>
</span> </span>
<div> <div>
<input type="file" name="formfile" id="formfile" style="display: none;"> <input type="file" name="formfile" id="formfile" style="display: none;">

0
css/Roboto-Regular.ttf → css/.fuse_hidden0002546300000002

BIN
css/Roboto-Regular.woff2

Binary file not shown.

BIN
css/Roboto-ext.woff2

Binary file not shown.

BIN
css/Roboto.woff2

Binary file not shown.

21
css/font.css

@ -1,9 +1,26 @@
/* fallback */
@font-face { @font-face {
font-family: 'Material Icons'; font-family: 'Material Icons';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: url(Roboto.woff2) format('woff2'); src: url(icons.woff2) format('woff2');
}
/* fallback */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(Roboto-Regular.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(Roboto-ext.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
} }
.material-icons { .material-icons {

2
header.php

@ -371,7 +371,7 @@ if(!isset($liteload) && $loggedin == false && $isadmin && $type != 1 && $type !=
</li> </li>
<!-- #END# Notifications --> <!-- #END# Notifications -->
<!-- Tasks --> <!-- Tasks -->
<?php if(isset($connctdcmps) || isset($connctdschids)){ ?> <?php if((isset($connctdcmps) || isset($connctdschids)) && $isadmin){ ?>
<li class="dropdown"> <li class="dropdown">
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button">
<i class="material-icons">business</i> <i class="material-icons">business</i>

4
school.php

@ -5,8 +5,10 @@ if(!isset($borderless)){ include "header.php"; $inputid = $_GET["id"]; }
if(isset($iscompany)){ if(isset($iscompany)){
$mjson = json_decode(file_get_contents($url."/API/request.php?type=companies"), true); $mjson = json_decode(file_get_contents($url."/API/request.php?type=companies"), true);
$ownerimgtype = "company";
}else{ }else{
$mjson = json_decode(file_get_contents($url."/API/request.php?type=schools"), true); $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); $mjsonlang = json_decode(file_get_contents($url."/API/request.php?type=string&subtype=school"), true);
for($mid = 0; $mid<count($mjson); $mid++) { for($mid = 0; $mid<count($mjson); $mid++) {
@ -23,7 +25,7 @@ for($mid = 0; $mid<count($mjson); $mid++) {
<div class="col-xs-12"> <div class="col-xs-12">
<?php } ?> <?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 $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-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>
<div class="profile-body"> <div class="profile-body">
<div style="text-align: left; padding-left: 15px;"> <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>"; }?> <?php if(!isset($borderless)){ echo "<h3>".$mjson[$mid]["name"]."</h3>"; }else{ echo "<h4>".$mjson[$mid]["name"]."</h4>"; }?>

11
schools.php

@ -1,4 +1,4 @@
<?php ini_set("allow_url_fopen", 1); include "header.php"; ?> <?php ini_set("allow_url_fopen", 1); include "header.php"; $jsonlang = json_decode(file_get_contents($url."/API/request.php?type=string&subtype=school"), true); ?>
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
@ -6,16 +6,23 @@
<h2>ISKOLÁK</h2> <h2>ISKOLÁK</h2>
</div> </div>
<div class="row clearfix"> <div class="row clearfix">
<div class="alert alert-warning text-center"><span class="font-bold" style="color: rgb(57, 57, 57);">Az itt található adatok az intézmények engedélye nélkül lettek feltöltve, tesztelés céljából.</span></div>
<div class="list-group"> <div class="list-group">
<?php <?php
$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"] != ""){
for($j = 0; $j<count($jsonlang); $j++) {
if($jsonlang[$j]["abbr"] == $json[$i]["type"]){
$fulltype = $jsonlang[$j]["hun"];
break;
}
}
echo ' echo '
<a class="listitem list-group-item waves-effect" href="'.$curdir.'school.php?id='.$json[$i]["id"].'"> <a class="listitem list-group-item waves-effect" href="'.$curdir.'school.php?id='.$json[$i]["id"].'">
<table> <table>
<td><img class="listitemimg squircle" src="'.$url.'/API/request.php?type=image&subtype=school&id='.$json[$i]["id"].'"></td> <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> <td><b>'.$json[$i]["name"].'</b><br>'.$json[$i]["location"].'<br>'.$fulltype.'</b></td>
</table> </table>
</a>'; </a>';
} }

33
setup.php

@ -1,20 +1,37 @@
<?php <?php
#Setup for first start #Setup for first start
$error = 0;
if(!file_exists("images/company")){ if(!file_exists("images/company")){
mkdir("images/company", 0777); if(mkdir("images/company", 0777) && $error != 1){
echo "Vállalati fotó könyvtár létrehozva"; echo "Vállalati fotó könyvtár létrehozva<br>";
}else{
$error = 1;
}
} }
if(!file_exists("images/school")){ if(!file_exists("images/school")){
mkdir("images/school", 0777); if(mkdir("images/school", 0777) && $error != 1){
echo "Felhasználói fotó könyvtár létrehozva"; echo "Felhasználói fotó könyvtár létrehozva<br>";
}else{
$error = 1;
}
} }
if(!file_exists("images/school")){ if(!file_exists("images/school")){
mkdir("images/user", 0777); if(mkdir("images/user", 0777) && $error != 1){
echo "Intézményi fotó könyvtár létrehozva"; echo "Intézményi fotó könyvtár létrehozva<br>";
}else{
$error = 1;
}
} }
if(!file_exists("creds.php")){ if(!file_exists("creds.php")){
file_put_contents("creds.php", '<?php\n$sqlserver = "localhost";\n$sqluser = "root";\n$sqlpass = "dbpass";\n$dbname = "paredu\n?>'); if(file_put_contents("creds.php", '<?php $sqlserver = "localhost"; $sqluser = "root"; $sqlpass = "dbpass"; $dbname = "paredu"; ?>') && $error != 1){
echo "Adatbázis konfiguráció létrehozva (creds.php)"; echo "Adatbázis konfiguráció létrehozva (creds.php)<br>";
}else{
$error = 1;
}
}
if($error == 1){
echo "Nincsennek a jogok megfelelően beállítva. A gyökérmappa (".basename(__DIR__) .") legyen 777 jogosultságú.";
} }
?> ?>
Loading…
Cancel
Save