<?php
$isadmin = true; $load_inputs = true; $data_upload = true; $sqldependent = true; include "../header.php";
//INSERT INTO `schools` (`id`, `name`, `type`, `spec`, `postalcode`, `location`, `locationspec`, `email`) VALUES ('1', 'Békéscsabai SZC Nemes Tihamér Technikum és Kollégium', 'high', 'IT, Gépész, Rendész', 'Békéscsaba', 'Kazinczy u. 7.');
//$conn->close();
?>
< section class = "content" >
< div class = "container-fluid" >
< div class = "block-header" >
< h2 > ADATKEZELÉS< / h2 >
< / div >
<!-- Input Group -->
< div class = "row clearfix" >
< form class = "col-lg-12 col-md-12 col-sm-12 col-xs-12" method = "POST" action = "#" id = "uploadform" enctype = "multipart/form-data" >
< div class = "card" >
< div class = "header" >
<?php
if(isset($_GET["uploaded"]) || isset($_GET["addedfaculty"])){
if(isset($_GET["uploaded"])){
if($_GET["uploaded"] == 0){ echo '< div id = "uploadsuccess" class = "alert alert-danger text-center" > < strong > Sikertelen feltöltés.< / strong > Kérjük < a href = "mailto:admin@paredu.hu" style = "color: white;" > vegye fel a kapcsolatot az adminisztrátorokkal< / a > .< / div > ';
}elseif($_GET["uploaded"] == 1){ echo '< div id = "uploadsuccess" class = "alert alert-success text-center" > Sikeres feltöltés< / div > ';
}
}else{
if($_GET["addedfaculty"] == 0){ echo '< div id = "uploadsuccess" class = "alert alert-danger text-center" > A < strong > kar hozzáadása sikertelen.< / strong > Kérjük < a href = "mailto:admin@paredu.hu" style = "color: white;" > vegye fel a kapcsolatot az adminisztrátorokkal< / a > .< / div > ';
}elseif($_GET["addedfaculty"] == 1){ echo '< div id = "uploadsuccess" class = "alert alert-success text-center" > Az új kar < strong > sikeresen hozzáadva< / strong > az intézményhez< / div > ';
}
}
?>
< script >
setTimeout(function(){
document.getElementById('uploadsuccess').style.display ='none';
}
,3000);
< / script >
<?php } ?>
< h2 >
<?php if ( $type == 2 ){ echo "VÁLLALAT" ; } else { echo "INTÉZMÉNY" ; } ?> ADATAI
< / h2 >
< ul class = "header-dropdown m-r--5" >
< li class = "dropdown" >
< a href = "javascript:void(0);" class = "dropdown-toggle" data-toggle = "dropdown" role = "button" aria-haspopup = "true" aria-expanded = "false" >
< i class = "material-icons" > more_vert< / i >
< / a >
< ul class = "dropdown-menu pull-right" >
< li > < a href = "javascript:void(0);" > Action< / a > < / li >
< li > < a href = "javascript:void(0);" > Another action< / a > < / li >
< li > < a href = "javascript:void(0);" > Something else here< / a > < / li >
< / ul >
< / li >
< / ul >
< / div >
< div class = "body" >
< h2 class = "card-inside-title" > Azonosíthatóság< / h2 >
< div class = "row clearfix" >
< div class = "col-md-2" >
< b > Egyedi Azonosító (ID)< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > fact_check< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control text-center" name = "id" value = "# <?php echo $selschvals [ "id" ]; ?> " readOnly >
< / div >
< / div >
< / div >
< div class = "col-md-7" >
< b > <?php if ( $type == 2 ){ echo "Vállalat" ; } else { echo "Intézmény" ; } ?> Neve</ b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > edit< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "formname" placeholder = "Név" value = " <?php echo $selschvals [ "name" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-3" >
< b > <?php if ( $type == 2 ){ echo "Vállalat" ; } else { echo "Intézmény" ; } ?> Típusa</ b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > school< / i >
< / span >
< div class = "form-line" >
< select class = "form-control show-tick" name = "formtype" >
<?php if ( $type == 2 ){ ?>
< option value = "vallalat" <?php if ( $selschvals [ "type" ] == "vallalat" ){ echo "selected" ; } ?> > Vállalat</ option >
< option value = "nonprofit" <?php if ( $selschvals [ "type" ] == "nonprofit" ){ echo "selected" ; } ?> > Non-profit</ option >
<?php } else { ?>
< 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 >
<?php } ?>
< / select >
< / div >
< / div >
< / div >
< / div >
< div class = "row clearfix" >
< div class = "col-md-2" >
< b > <?php if ( $type == 2 ){ echo "Vállalat" ; } else { echo "Intézmény" ; } ?> fotója</ b >
< div class = "input-group" >
< span class = "input-group-addon" >
< 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 >
< div >
< input type = "file" name = "formfile" id = "formfile" style = "display: none;" >
< button type = "button" class = "btn bg-indigo waves-effect" onclick = "document.getElementById('formfile').click();" style = "vertical-align: text-top;" >
< i class = "material-icons" > upload< / i >
< / button >
< a href = " <?php echo $curdir ; ?> API/request.php?type=image&subtype= <?php if ( $type == 2 ){ echo "company" ; } else { echo "school" ; } ?> &id= <?php echo $selschvals [ "id" ]; ?> " download = " <?php if ( $type == 2 ){ echo "vallalat" ; } else { echo "iskola" ; } ?> foto" >
< button type = "button" class = "btn bg-green waves-effect" style = "vertical-align: text-top;" >
< i class = "material-icons" > download< / i >
< / button >
< / a >
< / div >
< / div >
< / div >
<?php if ( $type != 2 ){ ?>
< div class = "col-md-10" >
< b > Intézmény által oktatott szakok< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > assignment< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" data-role = "tagsinput" value = " <?php echo $selschvals [ "spec" ]; ?> " name = "spec" >
< / div >
< / div >
< / div >
<?php } ?>
< div class = "col-md-3" >
< b > <?php if ( $type == 2 ){ echo "Vállalat" ; } else { echo "Intézmény" ; } ?> telefonszáma</ b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > phone< / i >
< / span >
< div class = "form-line masked-input" >
< input type = "text" class = "form-control phone-number" name = "phnnum" placeholder = "Pl.: +36 00/000-0000" value = " <?php echo $selschvals [ "phonenumber" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-4" >
< b > <?php if ( $type == 2 ){ echo "Vállalat" ; } else { echo "Intézmény" ; } ?> e-mail címe</ b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > email< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "email" placeholder = "Pl.: iroda@intezmeny.hu" value = " <?php echo $selschvals [ "emailaddress" ]; ?> " >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "body" >
< h2 class = "card-inside-title" > Elhelyezkedés< / h2 >
< div class = "row clearfix" >
< div class = "col-md-2" >
< b > Irányítószám< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > local_post_office< / i >
< / span >
< div class = "form-line masked-input" >
< input type = "text" class = "form-control postal-code" name = "postcode" placeholder = "Pl.: 1011" value = " <?php echo $selschvals [ "postalcode" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-5" >
< b > Város< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > location_city< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "loc" placeholder = "Pl.: Budapest" value = " <?php echo $selschvals [ "location" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-5" >
< b > Utca, házszám< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > label< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "locspec" placeholder = "Pl.: Egyetem tér 1-3" value = " <?php echo $selschvals [ "locationspec" ]; ?> " >
< / div >
< / div >
< / div >
< / div >
<?php if ( $selschvals [ "type" ] == "uni" ){ ?>
< h2 class = "card-inside-title" > Egyetemi karok< / h2 >
<?php
$viewsql = "SELECT * FROM `faculties` WHERE `schoolid` = ".substr($_SESSION["selectedschool"], 1);
$result = $conn->query($viewsql);
if ($result == TRUE) {
if (!empty($result) & & $result->num_rows > 0) {
for($i = 0; $i < $result->num_rows; $i++){
echo '< h2 class = "card-inside-title" > Kar '.($i+1).'< / h2 > ';
$facvals = $result->fetch_assoc();
//echo "< div > s".$facvals["facultyid"]."< / div > ";
?>
< div class = "row clearfix" >
< div class = "col-md-2" >
< b > Egyedi Azonosító (ID)< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > fact_check< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control text-center" name = "facultyid_ <?php echo $facvals [ "facultyid" ]; ?> " value = "# <?php echo $facvals [ "facultyid" ]; ?> " readOnly >
< / div >
< / div >
< / div >
< div class = "col-md-10" >
< b > Kar Neve< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > edit< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "facultyname_ <?php echo $facvals [ "facultyid" ]; ?> " placeholder = "Név" value = " <?php echo $facvals [ "facultyname" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-12" >
< b > Kar által oktatott szakok< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > assignment< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" data-role = "tagsinput" value = " <?php echo $facvals [ "facultyspec" ]; ?> " name = "facultyspec_ <?php echo $facvals [ "facultyid" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-3" >
< b > Kar telefonszáma< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > phone< / i >
< / span >
< div class = "form-line masked-input" >
< input type = "text" class = "form-control phone-number" name = "facultyphnnum_ <?php echo $facvals [ "facultyphonenumber" ]; ?> " placeholder = "Pl.: +36 00/000-0000" value = " <?php echo $facvals [ "facultyphonenumber" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-3" >
< b > Kar e-mail címe< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > email< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "facultyemail_ <?php echo $facvals [ "facultyid" ]; ?> " placeholder = "Pl.: kar@intezmeny.hu" value = " <?php echo $facvals [ "facultyemail" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-2" >
< b > Irányítószám< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > local_post_office< / i >
< / span >
< div class = "form-line masked-input" >
< input type = "text" class = "form-control postal-code" name = "postcode" placeholder = "Pl.: 1011" value = " <?php echo $selschvals [ "postalcode" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-4" >
< b > Város< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > location_city< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "loc" placeholder = "Pl.: Budapest" value = " <?php echo $selschvals [ "location" ]; ?> " >
< / div >
< / div >
< / div >
< div class = "col-md-5" >
< b > Utca, házszám< / b >
< div class = "input-group" >
< span class = "input-group-addon" >
< i class = "material-icons" > label< / i >
< / span >
< div class = "form-line" >
< input type = "text" class = "form-control" name = "locspec" placeholder = "Pl.: Egyetem tér 1-3" value = " <?php echo $selschvals [ "locationspec" ]; ?> " >
< / div >
< / div >
< / div >
< / div >
<?php
}
}else{
echo "Még nincsennek karok hozzáadva.";
}
}else{
echo $conn->error;
}
mysqli_free_result($result);
?>
< br >
< button type = "submit" name = "addfaculty" class = "btn bg-teal waves-effect" style = "margin-top: 5px;" >
< i class = "material-icons" > add< / i >
< span > KAR HOZZÁADÁSA< / span >
< / button >
< br >
<?php } ?>
< button type = "submit" name = "submit" class = "btn bg-green waves-effect" style = "margin-top: 15px;" >
< i class = "material-icons" > send< / i >
< span > FELTÖLTÉS< / span >
< / button >
< / div >
< / div >
< / form >
< / div >
<!-- #END# Input Group -->
< / div >
< / section >
< script >
document.addEventListener('DOMContentLoaded', function() {
$('.colorpicker').colorpicker();
$('.masked-input').find('.phone-number').inputmask('+36 99/999-9999', { placeholder: '+__ __/___-____' });
$('.masked-input').find('.postal-code').inputmask('9999', { placeholder: '____' });
});
document.getElementById("formfile").onchange = function() {
document.getElementById("uploadform").submit.click();
};
< / script >
<?php mysqli_free_result ( $result ); include "../footer.php" ; ?>