@ -1,4 +1,7 @@
<?php
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
//session_cache_limiter('private');session_cache_expire(0);
//session_cache_limiter('private');session_cache_expire(0);
session_start();
session_start();
if(isset($_SESSION["login"])) {
if(isset($_SESSION["login"])) {
@ -60,10 +63,17 @@ if(!isset($liteload) && !$loggedin && $isadmin){
if(isset($_POST["submit"])){
if(isset($_POST["submit"])){
$modsql = "UPDATE `schools` SET `name` = '".$conn->real_escape_string($_POST['schoolname'])."', `type` = '".$conn->real_escape_string($_POST['schooltype'])."', `postalcode` = '".$conn->real_escape_string($_POST['postcode'])."', `spec` = '".str_replace(', ', ',', preg_replace('/\s+/', ' ', trim($conn->real_escape_string($_POST['spec']))))."', `location` = '".$conn->real_escape_string($_POST['loc'])."', `locationspec` = '".$conn->real_escape_string($_POST['locspec'])."', `phonenumber` = '".$conn->real_escape_string($_POST['phnnum'])."', `emailaddress` = '".$conn->real_escape_string($_POST['email'])."' WHERE `schools`.`id` = ".substr($_SESSION["selectedschool"], 1);
$modsql = "UPDATE `schools` SET `name` = '".$conn->real_escape_string($_POST['schoolname'])."', `type` = '".$conn->real_escape_string($_POST['schooltype'])."', `postalcode` = '".$conn->real_escape_string($_POST['postcode'])."', `spec` = '".str_replace(', ', ',', preg_replace('/\s+/', ' ', trim($conn->real_escape_string($_POST['spec']))))."', `location` = '".$conn->real_escape_string($_POST['loc'])."', `locationspec` = '".$conn->real_escape_string($_POST['locspec'])."', `phonenumber` = '".$conn->real_escape_string($_POST['phnnum'])."', `emailaddress` = '".$conn->real_escape_string($_POST['email'])."' WHERE `schools`.`id` = ".substr($_SESSION["selectedschool"], 1);
if ($conn->query($modsql) === TRUE) {
if ($conn->query($modsql) === TRUE) {
echo "Adat feltöltve" ;
header("Location: dataupload.php?uploaded=1") ;
} else {
} else {
echo "Error: " . $sql . "< br > " . $conn->error;
//echo "Error: " . $modsql . "< br > " . $conn->error;
header("Location: dataupload.php?uploaded=0");
}
}
die();
}elseif(isset($_POST["addfaculty"]) & & $_POST['schooltype'] == "uni"){
$modsql = "INSERT INTO `faculties` (`schoolid`, `facultyname`, `facultyspec`) VALUES ('".substr($_SESSION["selectedschool"], 1)."', '', '')";
$conn->query($modsql);
header("Location: dataupload.php");
die();
}
}
}
}
@ -274,6 +284,7 @@ if(!isset($liteload) && !$loggedin && $isadmin){
< ul class = "menu" >
< ul class = "menu" >
< form method = "POST" action = "#" >
< form method = "POST" action = "#" >
<?php
<?php
$ssname = "Nincs iskola kiválasztva";
for($i = 0; $i < count ( $ connctdschids ) ; $ i + + ) {
for($i = 0; $i < count ( $ connctdschids ) ; $ i + + ) {
$sql = "SELECT * FROM `schools` WHERE `id` = ".$connctdschids[$i];
$sql = "SELECT * FROM `schools` WHERE `id` = ".$connctdschids[$i];
$result = $conn->query($sql);
$result = $conn->query($sql);
@ -289,6 +300,7 @@ if(!isset($liteload) && !$loggedin && $isadmin){
$sname = $sqlvals["name"];
$sname = $sqlvals["name"];
}
}
if(("s".$sqlvals["id"]) == $_SESSION["selectedschool"]){
if(("s".$sqlvals["id"]) == $_SESSION["selectedschool"]){
$ssname = $sname;
$sname = "(< b > Kiválasztott< / b > ) ".$sname;
$sname = "(< b > Kiválasztott< / b > ) ".$sname;
}
}
echo '< button type = "submit" name = "selectedschool" value = "s'.$sqlvals[" id " ] . ' " class = "btn bg-transparent waves-effect" style = "width: 100%; box-shadow: 0 0 0 0 !important; -webkit-border-radius: 0px;" >
echo '< button type = "submit" name = "selectedschool" value = "s'.$sqlvals[" id " ] . ' " class = "btn bg-transparent waves-effect" style = "width: 100%; box-shadow: 0 0 0 0 !important; -webkit-border-radius: 0px;" >
@ -326,7 +338,7 @@ if(!isset($liteload) && !$loggedin && $isadmin){
< / 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 echo $username ; ?> </ div >
< div class = "email " > <?php echo $fulltype ; ?> </ div >
< div class = "misc " > <?php echo $fulltype . "<br>" . $ssnam e ; ?> </ div >
<?php if ( $loggedin ){ ?>
<?php if ( $loggedin ){ ?>
< div class = "btn-group user-helper-dropdown" >
< div class = "btn-group user-helper-dropdown" >
< i class = "material-icons" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "true" > keyboard_arrow_down< / i >
< i class = "material-icons" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "true" > keyboard_arrow_down< / i >