LVA-Filter für Anwesenheitsliste hinzugefügt

This commit is contained in:
Nikolaus Krondraf
2015-08-13 15:03:55 +02:00
parent f9c92cb6d2
commit a732b7a694
3 changed files with 88 additions and 3 deletions
+4 -1
View File
@@ -33,10 +33,11 @@ isset($_GET['bis']) ? $bis = date('Y-m-d', strtotime($_GET['bis'])) : $bis = $vo
isset($_GET['stundevon']) ? $stundevon = $_GET['stundevon'] : $stundevon = null;
isset($_GET['stundebis']) ? $stundebis = $_GET['stundebis'] : $stundebis = null;
isset($_GET['stg_kz']) ? $studiengang = $_GET['stg_kz'] : $studiengang = NULL;
isset($_GET['semester']) ? $semester = $_GET['semester'] : $semester = NULL;
isset($_GET['sem']) ? $semester = $_GET['sem'] : $semester = NULL;
isset($_GET['lehreinheit']) ? $lehreinheit = $_GET['lehreinheit'] : $lehreinheit = NULL;
isset($_GET['fixangestellt']) ? $fixangestellt = $_GET['fixangestellt'] : $fixangestellt = NULL;
isset($_GET['standort']) ? $standort = $_GET['standort'] : $standort = NULL;
isset($_GET['lvid']) ? $lvid = $_GET['lvid'] : $lvid = NULL;
if($von)
$studiensemester = getStudiensemesterFromDatum($von);
@@ -75,6 +76,8 @@ if(!is_null($stundebis))
$qry.=" AND stu.stunde<=".$db->db_add_param($stundebis);
if($standort)
$qry.=" AND sto.standort_id=".$db->db_add_param($standort);
if($lvid)
$qry .= " AND lv.lehrveranstaltung_id = " . $db->db_add_param($lvid);
$qry .= " ORDER BY datum, beginn";
if($db->db_query($qry))
@@ -44,6 +44,31 @@ $standort->getAllStandorteWithOrt();
$(document).ready(function()
{
$(".datepicker").datepicker($.datepicker.regional['de']).datepicker("setDate", new Date());
// Dropdown der Lehrveranstaltungen befüllen
$("#stg_kz, #sem").change(function()
{
// alte Optionen entfernen
$("#lvid").empty();
$('#lvid')
.append($('<option>', {value : ''})
.text('-- Alle --'));
var stg_kz = $("#stg_kz").val();
var sem = $("#sem").val();
if(stg_kz != '' && sem != '')
{
// LVs ergänzen
$.getJSON("lehrveranstaltungen_json.php", {stg_kz: stg_kz, sem: sem}, function(data) {
$.each(data, function(key, value) {
$('#lvid')
.append($('<option>', {value : key})
.text(value));
});
});
}
})
});
function checkDates()
@@ -125,7 +150,7 @@ $standort->getAllStandorteWithOrt();
<tr>
<td>Studiengang</td>
<td>
<select name="stg_kz">
<select name="stg_kz" id="stg_kz">
<option value=''>-- Alle --</option>
<?php foreach($studiengang->result as $value) echo "<option value='$value->studiengang_kz'>$value->kuerzel ($value->bezeichnung)</option>\n"; ?>
</select>
@@ -134,12 +159,21 @@ $standort->getAllStandorteWithOrt();
<tr>
<td>Ausbildungssemester</td>
<td>
<select name="sem">
<select name="sem" id="sem">
<option value=''>-- Alle --</option>
<?php for($x = 1; $x <= 10; $x++) echo "<option value='$x'>$x</option>\n"; ?>
</select>
</td>
</tr>
<tr>
<td>Lehrveranstaltung</td>
<td>
<select name="lvid" id="lvid">
<option value=''>-- Alle --</option>
</select>
</td>
</tr>
<tr>
<td>Anstellung der Vortragenden</td>
<td>
@@ -0,0 +1,48 @@
<?php
/* Copyright (C) 2014 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Nikolaus Krondraf <nikolaus.krondraf@technikum-wien.at>
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/lehrveranstaltung.class.php');
isset($_GET['stg_kz']) ? $stg_kz = $_GET['stg_kz'] : $stg_kz = NULL;
isset($_GET['sem']) ? $sem = $_GET['sem'] : $sem = NULL;
if(is_null($sem) || is_null($stg_kz))
die("Studiengangkennzahl und Semester müssen übergeben werden");
$lva = new lehrveranstaltung;
$lva->load_lva($stg_kz, $sem, null, true, true, "bezeichnung");
if(is_array($lva->lehrveranstaltungen))
{
$result = array();
foreach($lva->lehrveranstaltungen as $value)
{
$result[$value->lehrveranstaltung_id] = $value->bezeichnung . " (" . $value->lehrform_kurzbz . ")";
}
natcasesort($result);
echo json_encode($result);
}
else
{
echo "Daten konnten nicht geladen werden";
}