mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Prüfungsanmeldung
This commit is contained in:
@@ -144,7 +144,6 @@ function writePruefungsfenster(data)
|
||||
|
||||
function writePrfFensterDetails(){
|
||||
var id = $("#pruefungsfenster option:selected").val();
|
||||
// console.log(data);
|
||||
if(id !== null)
|
||||
{
|
||||
var start = $("#pruefungsfenster option:selected").attr("start");
|
||||
@@ -161,7 +160,7 @@ function writePrfFensterDetails(){
|
||||
|
||||
function loadPruefungen()
|
||||
{
|
||||
// var studiensemester_kurzbz = $("#studiensemester option:selected").val();
|
||||
//TODO student_uid
|
||||
var student_uid = "if11b044";
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
@@ -170,7 +169,7 @@ function loadPruefungen()
|
||||
typ: "json",
|
||||
class: "lehrveranstaltung",
|
||||
method: "load_lva_student",
|
||||
parameter_0: student_uid //IDs der beuschten LVs eines Studenten
|
||||
parameter_0: student_uid
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data){
|
||||
@@ -178,7 +177,6 @@ function loadPruefungen()
|
||||
data.result.forEach(function(e){
|
||||
lvIds.push(e.lehrveranstaltung_id);
|
||||
});
|
||||
console.log(lvIds);
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: "./pruefungsanmeldung.json.php",
|
||||
@@ -190,8 +188,118 @@ function loadPruefungen()
|
||||
error: loadError
|
||||
}).success(function(data){
|
||||
data.result.forEach(function(e){
|
||||
$("#prfDetails").append(e.lehrveranstaltung_id+"</br>");
|
||||
})
|
||||
$("#pruefungen").append("<option value="+e.pruefung.pruefung_id+" lv="+e.lehrveranstaltung.lehrveranstaltung_id+">"+e.lehrveranstaltung.bezeichnung+"</option>");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadTermine(pruefung_id)
|
||||
{
|
||||
console.log(pruefung_id);
|
||||
if($("#prfTermine").attr("disabled") === "disabled")
|
||||
{
|
||||
$("#prfTermine").attr("disabled", false);
|
||||
}
|
||||
if(pruefung_id!=="null" && pruefung_id!==null)
|
||||
{
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: "./pruefungsanmeldung.json.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
method: "loadTermine",
|
||||
pruefung_id: pruefung_id
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data){
|
||||
$("#prfTermine").html("<option>Termin auswählen</option>");
|
||||
data.result.forEach(function(e){
|
||||
var termin = e.von.split(" ");
|
||||
termin = termin[0].split("-");
|
||||
termin = new Date(termin[0], termin[1]-1,termin[2]);
|
||||
termin = termin.getDate()+"."+(termin.getMonth()+1)+"."+termin.getFullYear();
|
||||
$("#prfTermine").append("<option value="+e.pruefungstermin_id+">"+termin+"</option>");
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#prfTermine").html("<option>Zuerst Prüfung auswählen.</option>");
|
||||
}
|
||||
}
|
||||
|
||||
function showPruefungsDetails()
|
||||
{
|
||||
var prfId = $("#pruefungen option:selected").val();
|
||||
if(prfId!=="null")
|
||||
{
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: "./pruefungsanmeldung.json.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
method: "loadPruefung",
|
||||
pruefung_id: prfId
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data){
|
||||
var e = data.result[0];
|
||||
loadTermine(e.pruefung_id);
|
||||
$("#prfTyp").html(e.pruefungstyp_kurzbz);
|
||||
$("#prfMethode").html(e.methode);
|
||||
$("#prfBeschreibung").html(e.beschreibung);
|
||||
if(e.einzeln === true)
|
||||
{
|
||||
$("#prfDetails").append("<b>Einzelprüfung!</b>");
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#prfTermine").attr("disabled", true);
|
||||
$("#prfTermine").html("<option>Zuerst Prüfung auswählen.</option>");
|
||||
clearPrfDetails();
|
||||
}
|
||||
}
|
||||
|
||||
function saveAnmeldung()
|
||||
{
|
||||
var lehrveranstaltung_id = $("#pruefungen option:selected").attr("lv");
|
||||
var termin_id = $("#prfTermine option:selected").val();
|
||||
var bemerkungen = $("#prfWuensche").val();
|
||||
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: "./pruefungsanmeldung.json.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
method: "saveAnmeldung",
|
||||
termin_id: termin_id,
|
||||
lehrveranstaltung_id: lehrveranstaltung_id,
|
||||
bemerkung: bemerkungen
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data){
|
||||
$("#message").html(data.result);
|
||||
resetForm();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function clearPrfDetails()
|
||||
{
|
||||
$("#prfTyp").empty();
|
||||
$("#prfMethode").empty();
|
||||
$("#prfBeschreibung").empty();
|
||||
}
|
||||
|
||||
function resetForm()
|
||||
{
|
||||
|
||||
$("form").find("input[type=text], textarea").val("");
|
||||
$("form").find("select").val("null");
|
||||
$("#prfTermine").attr("disabled", true);
|
||||
clearPrfDetails();
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
header( 'Expires: -1' );
|
||||
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
|
||||
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
||||
header( 'Pragma: no-cache' );
|
||||
header('Content-Type: text/html;charset=UTF-8');
|
||||
|
||||
require_once('../../../../config/vilesci.config.inc.php');
|
||||
require_once('../../../../include/functions.inc.php');
|
||||
require_once('../../../../include/pruefungCis.class.php');
|
||||
require_once('../../../../include/lehrveranstaltung.class.php');
|
||||
require_once('../../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../../include/pruefungsanmeldung.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
//TODO Berechtigung
|
||||
//if(!$rechte->isBerechtigt('lehre/pruefungsanmeldung'))
|
||||
// die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
$method = isset($_REQUEST['method'])?$_REQUEST['method']:'';
|
||||
|
||||
switch($method)
|
||||
{
|
||||
case 'getPruefungByLv':
|
||||
$lehrveranstaltungen=$_REQUEST['lvIds'];
|
||||
$pruefung = new pruefungCis();
|
||||
if($pruefung->getPruefungByLv($lehrveranstaltungen))
|
||||
{
|
||||
$pruefungen = array();
|
||||
foreach($pruefung->lehrveranstaltungen as $lv)
|
||||
{
|
||||
//TODO Datenoverhead beseitigen
|
||||
$lehrveranstaltung = new lehrveranstaltung($lv->lehrveranstaltung_id);
|
||||
$prf = new stdClass();
|
||||
$prf->pruefung = new pruefungCis($lv->pruefung_id);
|
||||
$prf->lehrveranstaltung = $lehrveranstaltung;
|
||||
array_push($pruefungen, $prf);
|
||||
}
|
||||
|
||||
$data['result']=$pruefungen;
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$pruefung->errormsg;
|
||||
}
|
||||
break;
|
||||
case 'loadPruefung':
|
||||
$pruefung_id=$_REQUEST["pruefung_id"];
|
||||
$pruefung = new pruefungCis();
|
||||
if($pruefung->load($pruefung_id))
|
||||
{
|
||||
$data['result'] = array();
|
||||
array_push($data['result'], $pruefung);
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$pruefung->errormsg;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'loadTermine':
|
||||
$pruefung_id=$_REQUEST["pruefung_id"];
|
||||
$pruefung = new pruefungCis($pruefung_id);
|
||||
if($pruefung->getTermineByPruefung($pruefung_id))
|
||||
{
|
||||
$data['result'] = $pruefung->termine;
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$pruefung->errormsg;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'saveAnmeldung':
|
||||
$anmeldung = new pruefungsanmeldung();
|
||||
$anmeldung->lehrveranstaltung_id = $_REQUEST["lehrveranstaltung_id"];
|
||||
$anmeldung->pruefungstermin_id = $_REQUEST["termin_id"];
|
||||
$anmeldung->wuensche = $_REQUEST["bemerkung"];
|
||||
$anmeldung->uid = $uid;
|
||||
if($anmeldung->save(true))
|
||||
{
|
||||
$data['result'] = "Anmeldung erfolgreich!";
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$anmeldung->errormsg;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
?>
|
||||
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 fhcomplete.org
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
* Authors: Stefan Puraner <puraner@technikum-wien.at>
|
||||
*/
|
||||
|
||||
require_once('../../../../config/cis.config.inc.php');
|
||||
require_once('../../../../include/functions.inc.php');
|
||||
require_once('../../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../../include/lehrveranstaltung.class.php');
|
||||
|
||||
|
||||
$uid = get_uid();
|
||||
$db = new basis_db();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
//if(!$rechte->isBerechtigt('lehre/pruefungsanmeldung'))
|
||||
// die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
|
||||
$lehrveranstaltung = new lehrveranstaltung();
|
||||
$lehrveranstaltung->load_lva_student("if11b044");
|
||||
//foreach ($lehrveranstaltung->lehrveranstaltungen as $lv)
|
||||
//{
|
||||
// echo $lv->bezeichnung."</br>";
|
||||
//}
|
||||
//var_dump($lehrveranstaltung->lehrveranstaltungen[1]);
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Prüfungsanmeldung</title>
|
||||
<script src="../../../../include/js/datecheck.js"></script>
|
||||
<script src="../../../../include/js/jquery1.9.min.js"></script>
|
||||
<script src="./pruefung.js"></script>
|
||||
<link rel="stylesheet" href="../../../../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<link rel="stylesheet" href="../../../../skin/fhcomplete.css">
|
||||
<link rel="stylesheet" href="../../../../skin/style.css.php">
|
||||
<link rel="stylesheet" href="../../../../skin/tablesort.css">
|
||||
<style type="text/css">
|
||||
#prfDetails {
|
||||
/*border: 1px solid black;*/
|
||||
}
|
||||
|
||||
#anmeldung {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
div {
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
loadPruefungen();
|
||||
});
|
||||
</script>
|
||||
<h1>Prüfungsanmeldung</h1>
|
||||
<div id="anmeldung">
|
||||
<form action="pruefungsanmeldung.php" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Prüfung:
|
||||
</td>
|
||||
<td>
|
||||
<select id="pruefungen" onChange="showPruefungsDetails();">
|
||||
<!--Prüfungen werden durch Js geladen-->
|
||||
<option value="null">Prüfung auswählen</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Termin:
|
||||
</td>
|
||||
<td>
|
||||
<select id="prfTermine" disabled="true">
|
||||
<!-- verfügbare Termine werden durch JS geladen-->
|
||||
<option value="null">Zuerst Prüfung auswählen</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
Bemerkungen:
|
||||
</td>
|
||||
<td>
|
||||
<textarea id="prfWuensche" rows="7" cols="20"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="button" value="Anmelden" onclick="saveAnmeldung();"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="message">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h1>Prüfungsdetails</h1>
|
||||
<div id="prfDetails">
|
||||
<span>Typ: </span><span id="prfTyp"></span></br>
|
||||
<span>Methode: </span><span id="prfMethode"></span></br>
|
||||
<span>Beschreibung: </span><span id="prfBeschreibung"></span></br>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// put your code here
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2014 fhcomplete.org
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
* Authors: Stefan Puraner <puraner@technikum-wien.at>
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/basis_db.class.php');
|
||||
|
||||
class pruefungsanmeldung extends basis_db {
|
||||
public $new;
|
||||
public $result = array();
|
||||
|
||||
public $pruefungsanmeldung_id; //bigint
|
||||
public $uid; //varchar(32)
|
||||
public $pruefungstermin_id; //bigint
|
||||
public $lehrveranstaltung_id; //bigint
|
||||
public $status_kurzbz; //varchar(32)
|
||||
public $wuensche; //text
|
||||
public $reihung; //smallint
|
||||
public $kommentar; //text
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
* @param pruefung_id ID der zu ladenden Prüfung
|
||||
*/
|
||||
public function __construct($pruefungsanmeldung_id = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if ($pruefungsanmeldung_id != null)
|
||||
$this->load($pruefungsanmeldung_id);
|
||||
}
|
||||
|
||||
public function __set($name, $value)
|
||||
{
|
||||
switch ($name) {
|
||||
case 'pruefungsanmeldung_id':
|
||||
if (!is_numeric($value))
|
||||
throw new Exception('Attribute pruefungsanmeldung_id must be numeric!');
|
||||
$this->$name = $value;
|
||||
break;
|
||||
case 'pruefungstermin_id':
|
||||
if(!is_numeric($value))
|
||||
throw new Exception('Attribute pruefungstermin_id must be numeric!');
|
||||
$this->$name = $value;
|
||||
break;
|
||||
case 'lehrveranstaltung_id':
|
||||
if(!is_numeric($value))
|
||||
throw new Exception('Attribute lehrveranstaltung_id must be numeric!');
|
||||
$this->$name = $value;
|
||||
break;
|
||||
default:
|
||||
$this->$name = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
public function save($new = null)
|
||||
{
|
||||
if ($new == null)
|
||||
$new = $this->new;
|
||||
|
||||
if($new)
|
||||
{
|
||||
$qry = 'INSERT INTO campus.tbl_pruefungsanmeldung (uid, pruefungstermin_id, lehrveranstaltung_id, status_kurzbz, wuensche, reihung, kommentar) VALUES ('
|
||||
. $this->db_add_param($this->uid).', '
|
||||
. $this->db_add_param($this->pruefungstermin_id).', '
|
||||
. $this->db_add_param($this->lehrveranstaltung_id).', '
|
||||
. $this->db_add_param($this->status_kurzbz).', '
|
||||
. $this->db_add_param($this->wuensche).', '
|
||||
. $this->db_add_param($this->reihung).', '
|
||||
. $this->db_add_param($this->kommentar).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
//UPDATE
|
||||
}
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern der Anmeldung.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user