This commit is contained in:
Andreas Österreicher
2008-01-08 15:35:53 +00:00
parent f908e51aa9
commit 953ada29a2
9 changed files with 379 additions and 10 deletions
+12 -4
View File
@@ -198,7 +198,9 @@ function onStplDetail(event)
attributes+=idList;
var url = "<?php echo APP_ROOT; ?>rdf/lehrstunde.rdf.php";
url+=attributes;
//alert(url);
//alert('first:'+window.parent.STPLlastDetailUrl);
window.parent.STPLlastDetailUrl = url;
//alert(url+' - '+window.parent.STPLlastDetailUrl);
var treeStplDetails=parent.document.getElementById('treeStplDetails');
treeStplDetails.setAttribute('datasources',url);
}
@@ -206,12 +208,15 @@ function onStplDetail(event)
function STPLDetailEdit()
{
alert('comming soon');
}
function STPLDetailDelete()
{
//alert('url'+STPLlastDetailUrl);
//return false;
tree = document.getElementById('treeStplDetails');
var col = tree.columns ? tree.columns["stundenplan_id"] : "stundenplan_id";
@@ -248,8 +253,11 @@ function STPLDetailDelete()
else
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var url = '<?php echo APP_ROOT ?>rdf/lehrstunde.rdf.php';
document.getElementById('treeStplDetails').setAttribute('src',url);
var treeStplDetails=parent.document.getElementById('treeStplDetails');
//alert('url'+STPLlastDetailUrl);
treeStplDetails.setAttribute('datasources', '');
treeStplDetails.setAttribute('datasources', STPLlastDetailUrl);
}
}
}
+1 -1
View File
@@ -155,7 +155,7 @@ $num_rows_stunde=pg_numrows($result_stunde);
/>
</hbox>
</row>
<row style="background-color^: rdf:http://www.technikum-wien.at/lehreinheit-lvplan/rdf#lehrfach_farbe^;">
<row style="background-color^: rdf:http://www.technikum-wien.at/lehreinheit-lvplan/rdf#lehrfach_farbe^;" >
<label value="rdf:http://www.technikum-wien.at/lehreinheit-lvplan/rdf#lehrfach rdf:http://www.technikum-wien.at/lehreinheit-lvplan/rdf#lehrform"
tooltiptext="rdf:http://www.technikum-wien.at/lehreinheit-lvplan/rdf#lehrfach_bez" />
<label align="right" value="rdf:http://www.technikum-wien.at/lehreinheit-lvplan/rdf#raumtyp"
+1
View File
@@ -22,6 +22,7 @@
include('../vilesci/config.inc.php');
?>
var menuUndoDatasource=0;
var STPLlastDetailUrl='leer';
// ----------------------------------------------------------
// ------- CLASS Progressmeter ------------------------------
+18 -4
View File
@@ -29,6 +29,7 @@ require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/log.class.php');
require_once('../include/benutzerfunktion.class.php');
require_once('../include/stundenplan.class.php');
$user = get_uid();
@@ -168,13 +169,26 @@ if(!$error)
}
elseif(isset($_POST['type']) && $_POST['type']=='deletestundenplaneintrag')
{
//Loescht einen Eintrag aus der Stundenplantabelle
loadVariables($conn, get_uid());
if(isset($_POST['stundenplan_id']) && is_numeric($_POST['stundenplan_id']))
{
//$stundenplan = new stundenplan($conn);
//$stundenplan->delete();
$errormsg='Not implemented';
$stundenplan = new stundenplan($conn, $db_stpl_table);
if($stundenplan->delete($_POST['stundenplan_id']))
{
$return = true;
}
else
{
$errormsg='Fehler beim Loeschen: '.$stundenplan->errormsg;
$return = false;
$data = '';
}
}
else
{
$return = false;
$data = '';
$errormsg = 'ID ist ungueltig';
}
}
else
+25 -1
View File
@@ -57,7 +57,7 @@ class stundenplan
// * $unicode Gibt an ob die Daten mit UNICODE Codierung
// * oder LATIN9 Codierung verarbeitet werden sollen
// *************************************************************************
function lehreinheit($conn, $stundenplantabelle, $stundenplan_id=null, $unicode=false)
function stundenplan($conn, $stundenplantabelle, $stundenplan_id=null, $unicode=false)
{
$this->conn = $conn;
@@ -182,5 +182,29 @@ class stundenplan
return false;
}
}
// ****
// * Loescht einen Eintrag aus der Stundenplantabelle
// ****
function delete($id)
{
if(!is_numeric($id))
{
$this->errormsg = 'ID muss eine gueltige Zahl sein';
return false;
}
$qry = "DELETE FROM lehre.tbl_$this->stpl_table WHERE ".$this->stpl_table."_id='$id'";
if(pg_query($this->conn, $qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Loeschen des Eintrages: '.pg_last_error($this->conn);
return false;
}
}
}
?>
+4
View File
@@ -132,6 +132,10 @@ if ($berechtigung->isBerechtigt('admin'))
<td width="10" nowrap>&nbsp;</td>
<td nowrap><a class="MenuItem2" href="lehre/check/index.html" target="main"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Checken</a></td>
</tr>
<tr>
<td width="10" nowrap>&nbsp;</td>
<td nowrap><a class="MenuItem2" href="lehre/stpl_benutzer_kollision_frameset.html" target="main"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Kollision Student</a></td>
</tr>
<tr>
<td width="10" nowrap>&nbsp;</td>
<td nowrap><a class="MenuItem2" href="lehre/import/index.html" target="main"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Import</a></td>
+133
View File
@@ -0,0 +1,133 @@
<?php
/* Copyright (C) 2006 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/studiensemester.class.php');
require_once('../../include/functions.inc.php');
if(!$conn = pg_pconnect(CONN_STRING))
die('Fehler beim Herstellen der Datenbankverbindung');
$beginn = (isset($_GET['beginn'])?$_GET['beginn']:'');
$ende = (isset($_GET['ende'])?$_GET['ende']:'');
$dontloadcontent=false;
$user = get_uid();
loadVariables($conn, $user);
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Kollision Student</title>
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css" />
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
<script language="Javascript">
function changeStudiensemester(dropdown)
{
document.getElementById("beginn").value = dropdown.options[dropdown.selectedIndex].getAttribute("beginn");
document.getElementById("ende").value = dropdown.options[dropdown.selectedIndex].getAttribute("ende");
}
</script>
</head>
<body style="background-color:#eeeeee;">
<h2>Kollision Student - '.$db_stpl_table.'</h2>
';
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
if($beginn=='' || $ende=='')
{
$stsem_obj = new studiensemester($conn);
$stsem_akt = $stsem_obj->getaktorNext();
$stsem_obj->load($stsem_akt);
$beginn = $stsem_obj->start;
$ende = $stsem_obj->ende;
$dontloadcontent=true;
}
echo 'Studiensemester <SELECT name="studiensemester_kurzbz" onchange="changeStudiensemester(this)">';
echo "<option value='' beginn='' ende=''>-- Auswahl --</option>";
$stsem_obj = new studiensemester($conn);
$stsem_obj->getAll();
foreach($stsem_obj->studiensemester as $stsem)
{
if(isset($stsem_akt) && $stsem_akt!='' && $stsem_akt==$stsem->studiensemester_kurzbz)
$selected='selected';
else
$selected='';
echo "<option value='$stsem->studiensemester_kurzbz' beginn='$stsem->start' ende='$stsem->ende' $selected>$stsem->studiensemester_kurzbz</option>";
}
echo '</SELECT>';
echo " Beginn <INPUT type='text' size='10' id='beginn' name='beginn' value='$beginn'>";
echo " Ende <INPUT type='text' size='10' id='ende' name='ende' value='$ende'>";
echo " <INPUT type='submit' value='OK'>";
echo '</form>';
if($dontloadcontent)
exit;
$qry = "SELECT datum, stunde, student_uid, count(student_uid) AS anzahl
FROM lehre.vw_".$db_stpl_table."_student_unr
WHERE datum>='$beginn' AND datum<='$ende'
GROUP BY datum, stunde, student_uid
HAVING count(student_uid)>1
ORDER BY datum, stunde, student_uid LIMIT 30;
";
//echo $qry;
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe">
<thead>';
echo '<tr class="liste">
<th class="table-sortable:default">Datum</th>
<th class="table-sortable:default">Stunde</th>
<th class="table-sortable:default">UID</th>
<th class="table-sortable:default">Anzahl</th>
<th class="table-sortable:default">&nbsp;</th>
<th class="table-sortable:default">&nbsp;</th>
</tr>
</thead>
<tbody>';
if($result = pg_query($conn, $qry))
{
while($row = pg_fetch_object($result))
{
echo "<tr>";
echo "<td class='table-sortable:default' align='center'>$row->datum</td>";
echo "<td class='table-sortable:default' align='center'>$row->stunde</td>";
echo "<td class='table-sortable:default' align='center'>$row->student_uid</td>";
echo "<td class='table-sortable:default' align='center'>$row->anzahl</td>";
echo "<td class='table-sortable:default' align='center'><a href='stpl_benutzer_kollision_details.php?datum=$row->datum&stunde=$row->stunde' target='kollision_detail'>Stundenplan</a></td>";
echo "<td class='table-sortable:default' align='center'><a href='stpl_benutzer_kollision_details.php?datum=$row->datum&stunde=$row->stunde&uid=$row->student_uid' target='kollision_detail'>UNR</a></td>";
echo "</tr>";
}
}
echo '</tbody></table>';
echo '</body></html';
?>
@@ -0,0 +1,164 @@
<?php
/* Copyright (C) 2006 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: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/studiensemester.class.php');
require_once('../../include/functions.inc.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/stundenplan.class.php');
if(!$conn = pg_pconnect(CONN_STRING))
die('Fehler beim Herstellen der Datenbankverbindung');
$student_uid = (isset($_GET['uid'])?$_GET['uid']:'');
$datum = (isset($_GET['datum'])?$_GET['datum']:'');
$stunde = (isset($_GET['stunde'])?$_GET['stunde']:'');
$user = get_uid();
loadVariables($conn, $user);
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Kollision Student</title>
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css" />
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
</head>
<body style="background-color:#eeeeee;">
';
if(isset($_GET['type']) && $_GET['type']=='delete')
{
if(isset($_GET['id']) && is_numeric($_GET['id']))
{
$stdplan = new stundenplan($conn, $db_stpl_table);
if($stdplan->delete($_GET['id']))
{
echo 'Eintrag wurde geloescht';
}
else
{
echo "Fehler beim Loeschen des Eintrages: $stdplan->errormsg";
}
}
else
{
echo 'ID muss uebergeben werden';
}
}
if($student_uid!='')
{
echo "<h2>UNR - $db_stpl_table</h2>";
$qry = "SELECT datum, stunde, student_uid, unr
FROM lehre.vw_".$db_stpl_table."_student_unr
WHERE datum='$datum' AND stunde='$stunde' AND student_uid='$student_uid'
ORDER BY unr LIMIT 30;
";
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe">
<thead>';
echo '<tr class="liste">
<th class="table-sortable:default">Datum</th>
<th class="table-sortable:default">Stunde</th>
<th class="table-sortable:default">UID</th>
<th class="table-sortable:default">UNR</th>
</tr>
</thead>
<tbody>';
if($result = pg_query($conn, $qry))
{
while($row = pg_fetch_object($result))
{
echo "<tr>";
echo "<td class='table-sortable:default' align='center'>$row->datum</td>";
echo "<td class='table-sortable:default' align='center'>$row->stunde</td>";
echo "<td class='table-sortable:default' align='center'>$row->student_uid</td>";
echo "<td class='table-sortable:default' align='center'>$row->unr</td>";
echo "</tr>";
}
}
echo '</tbody></table>';
}
else
{
echo "<h2>Stundenplaneinträge - $db_stpl_table</h2>";
$stg_obj = new studiengang($conn);
$stg_obj->getAll('typ, kurzbz', false);
$stg_arr = array();
foreach ($stg_obj->result as $stg)
{
$stg_arr[$stg->studiengang_kz] = $stg->kuerzel;
}
$qry = "SELECT * FROM lehre.tbl_$db_stpl_table WHERE datum='$datum' AND stunde='$stunde'";
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe">
<thead>';
echo '<tr class="liste">
<th class="table-sortable:default">ID</th>
<th class="table-sortable:default">LEID</th>
<th class="table-sortable:default">UNR</th>
<th class="table-sortable:default">STG</th>
<th class="table-sortable:default">S</th>
<th class="table-sortable:default">V</th>
<th class="table-sortable:default">G</th>
<th class="table-sortable:default">GruppeKurzbz</th>
<th class="table-sortable:default">Lektor</th>
<th class="table-sortable:default">Datum</th>
<th class="table-sortable:default">Stunde</th>
<th class="table-sortable:default">Ort</th>
</tr>
</thead>
<tbody>';
if($result = pg_query($conn, $qry))
{
while($row = pg_fetch_object($result))
{
echo "<tr>";
$id = ($db_stpl_table."_id");
echo "<td class='table-sortable:default' align='center'>".$row->$id."</td>";
echo "<td class='table-sortable:default' align='center'>$row->lehreinheit_id</td>";
echo "<td class='table-sortable:default' align='center'>$row->unr</td>";
echo "<td class='table-sortable:default' align='center'>".$stg_arr[$row->studiengang_kz]."</td>";
echo "<td class='table-sortable:default' align='center'>$row->semester</td>";
echo "<td class='table-sortable:default' align='center'>$row->verband</td>";
echo "<td class='table-sortable:default' align='center'>$row->gruppe</td>";
echo "<td class='table-sortable:default' align='center'>$row->gruppe_kurzbz</td>";
echo "<td class='table-sortable:default' align='center'>$row->mitarbeiter_uid</td>";
echo "<td class='table-sortable:default' align='center'>$row->datum</td>";
echo "<td class='table-sortable:default' align='center'>$row->stunde</td>";
echo "<td class='table-sortable:default' align='center'>$row->ort_kurzbz</td>";
echo "<td class='table-sortable:default' align='center'><a href='".$_SERVER['PHP_SELF']."?datum=$datum&stunde=$stunde&type=delete&id=".$row->$id."' onclick='return confirm(\"Diesen Datensatz wirklich loeschen?\")'>delete</a></td>";
echo "</tr>";
}
}
echo '</tbody></table>';
}
echo '</body></html>';
?>
@@ -0,0 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html lang="de_AT">
<head>
<title>VileSci</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css" />
</head>
<frameset rows="400,*">
<frame src="stpl_benutzer_kollision.php" id="uebersicht" name="uebersicht" frameborder="0" />
<frame src="" id="kollision_detail" name="kollision_detail" frameborder="0" />
<noframes>
<body bgcolor="#FFFFFF">
This application works only with a frames-enabled browser.<br />
<a href="main.php">Use without frames</a>
</body>
</noframes>
</frameset>
</html>