The administration panel and web client for ParEdu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
8.3 KiB

<?php ini_set("allow_url_fopen", 1); $isadmin = true; $eventupload = true; include "../header.php"; ?>
<section class="content">
<div class="container-fluid">
<div class="block-header">
<h2>ESEMÉNYKEZELÉS</h2>
</div>
<div class="row clearfix">
<div class="container-fluid innercontainer">
<div>
<button type="button" data-toggle="modal" data-target="#addEvent" class="btn bg-teal waves-effect" style="margin-bottom: 15px;">ESEMÉNY HOZZÁADÁSA</button>
</div>
<?php
if($type == 2){
$ownertype = 2;
$ownerid = substr($_SESSION["selectedcompany"], 1);
$schjson = json_decode(file_get_contents($siteurl."/API/request.php?type=companies&id=".$ownerid), true);
}else{
$ownertype = 1;
$ownerid = substr($_SESSION["selectedschool"], 1);
$schjson = json_decode(file_get_contents($siteurl."/API/request.php?type=schools&id=".$ownerid), true);
}
$json = json_decode(file_get_contents($siteurl."/API/request.php?type=events&ownertype=".$ownertype."&ownerid=".$ownerid), true);
$userjson = json_decode(file_get_contents($siteurl."/API/request.php?type=user&id=".$userid), true);
if(!isset($json["response"])){
echo "<div class='list-group'>";
for($i = count($json)-1; $i>=0; $i--) {
if($json[$i]["title"] != ""){
#echo '<a class="listitem list-group-item waves-effect"><img class="smallimg listitemimg squircle" src="'.$siteurl.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><b>'.$json[$i]["title"].'</b><br>'.$json[$i]["description"].'</a>';
//echo '<a class="listitem list-group-item waves-effect" href="'.$curdir.'event.php?id='.$json[$i]["eventid"].'"><table><td><img class="smallimg listitemimg squircle" src="'.$siteurl.'/API/request.php?type=image&subtype=eventcategory&category='.$json[$i]["category"].'"><td><td><b>'.$json[$i]["title"].'</b><br>'.$selschvals["name"].'<br>'.$json[$i]["description"].'</b><td></table></a>';
echo '
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="media">
<div class="media-left">
<a href="#">';
if($json[$i]["uploadedas_userid"] != ""){ echo '<img class="fixsizeimg42" src="'.$siteurl.'/API/request.php?type=image&subtype=user&id='.$userid.'">';
}else{ echo '<img class="fixsizeimg42" src="'.$siteurl.'/API/request.php?type=image&subtype=school&id='.$ownerid.'">'; }
echo'</a>
</div>
<div class="media-body">
<h4 class="media-heading">
<a href="#">';
if($json[$i]["uploadedas_userid"] != ""){ echo $userjson["name"];
}else{ echo $schjson[0]["name"]; }
echo '</a>
</h4>
'.date_format(date_create($json[$i]["datetime"]),"Y.m.d. H:i").'
</div>
</div>
</div>
<div class="panel-body">
<div class="post">
<div class="post-heading">
<p><b>'.$json[$i]["title"].'</b></p><br>
<p>'.$json[$i]["description"].'</p>
</div>
<div class="post-content">
</div>
</div>
</div>
<div class="panel-footer">
<ul>
<li>
<a href="#">
<i class="material-icons">comment</i>
<span>0 komment</span>
</a>
</li>
</ul>
<div class="form-group">
<div class="form-line">
<input type="text" class="form-control" placeholder="Komment írása">
</div>
</div>
</div>
</div>
';
}
}
echo "</div>";
}else{
echo "<div class='text-center'><img src='".$curdir."images/nodata.png' width=80px height=80px class='center'><p style='font-size: x-large'>Még nincsennek események hozzáadva</p></div>";
}
?>
</div>
</div>
</div>
</section>
<div class="modal fade" id="addEvent" tabindex="-1" role="dialog" style="display: none;">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="largeModalLabel">ESEMÉNY HOZZÁADÁSA</h4>
</div>
<form method="POST" action="#">
<div class="modal-body">
<div class="input-group">
<span class="form-line">
<input type="text" class="form-control" placeholder="Cím" name="title" required>
</span>
<textarea id="eventdesceditor" name="description"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal">MÉGSEM</button>
<button type="submit" name="submituser" class="btn btn-link waves-effect col-blue-grey">FELTÖLTÉS (FELHASZNÁLÓKÉNT)</button>
<button type="submit" name="submit" class="btn btn-link waves-effect">FELTÖLTÉS</button>
</div>
</form>
</div>
</div>
</div>
<script src="<?php echo $curdir; ?>plugins/tinymce/tinymce.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
tinymce.init({
selector: "textarea#eventdesceditor",
language: 'hu_HU',
theme: "modern",
height: 150,
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'paste textcolor colorpicker textpattern imagetools'
],
toolbar1: 'insertfile undo redo | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar2: 'print preview media | styleselect | forecolor backcolor',
image_advtab: true
});
tinymce.suffix = ".min";
tinyMCE.baseURL = '<?php echo $curdir; ?>plugins/tinymce';
});
</script>
<?php include "../footer.php"; ?>