This commit is contained in:
Andreas Österreicher
2008-07-29 13:51:07 +00:00
parent 65a487a616
commit e61ffd0738
10 changed files with 156 additions and 256 deletions
+21 -8
View File
@@ -264,16 +264,29 @@ function js_toggle_container(conid)
<?php
$lv_obj = new lehrveranstaltung($sql_conn);
if(!$lv_obj->load_lva($course_id,$term_id, null, true, true))
echo "<tr><td>$lv_obj->errormsg</td></tr>";
//if(!$lv_obj->load_lva($course_id,$term_id, null, true, true))
// echo "<tr><td>$lv_obj->errormsg</td></tr>";
$qry = "SELECT * FROM lehre.tbl_lehrveranstaltung where studiengang_kz='".addslashes($course_id)."' AND semester='".addslashes($term_id)."' AND aktiv AND lehre ORDER BY orgform_kurzbz DESC, bezeichnung";
foreach($lv_obj->lehrveranstaltungen as $row)
$lastform='';
if($result = pg_query($sql_conn, $qry))
{
echo '<tr>';
echo ' <td class="tdwrap"><ul style="margin: 0px; padding: 0px; padding-left: 20px;">';
echo "<li><a class=\"Item2\" title=\"".$row->bezeichnung."\" href=\"lesson.php?lvid=$row->lehrveranstaltung_id\" target=\"content\">".CutString($row->bezeichnung, 21).' '.$row->lehrform_kurzbz."</a></li>";
echo ' </ul></td>';
echo '</tr>';
while($row = pg_fetch_object($result))
{
if($row->orgform_kurzbz!=$lastform)
{
$qry_orgform = "SELECT * FROM bis.tbl_orgform WHERE orgform_kurzbz='$row->orgform_kurzbz'";
if($result_orgform = pg_query($sql_conn, $qry_orgform))
if($row_orgform = pg_fetch_object($result_orgform))
echo "<tr><td><b>$row_orgform->bezeichnung</b></td></tr>";
$lastform=$row->orgform_kurzbz;
}
echo '<tr>';
echo ' <td class="tdwrap"><ul style="margin: 0px; padding: 0px; padding-left: 20px;">';
echo "<li><a class=\"Item2\" title=\"".$row->bezeichnung."\" href=\"lesson.php?lvid=$row->lehrveranstaltung_id\" target=\"content\">".CutString($row->bezeichnung, 21).' '.$row->lehrform_kurzbz."</a></li>";
echo ' </ul></td>';
echo '</tr>';
}
}
echo '<tr>';
+4
View File
@@ -472,6 +472,10 @@ echo '<?xml-stylesheet href="datepicker/datepicker.css" type="text/css"?>';
accesskey = "&menu-dokumente-urkunde_englisch.accesskey;"/>
</menupopup>
</menu>
<!-- ***** Zusatzmenues inkludieren ***** -->
<?php
include('../include/'.EXT_FKT_PATH.'/fas_zusatzmenues.inc.php');
?>
<!-- ********** EXTRAS ********* -->
<menu id="menu-extras" label="&menu-extras.label;" accesskey="&menu-extras.accesskey;">
<menupopup id="menu-extras-popup">
@@ -366,6 +366,9 @@ function LeNeu()
var stsem = getStudiensemester();
document.getElementById('lehrveranstaltung-detail-menulist-studiensemester').value=stsem;
//Defaultwert fuer Anmerkung
document.getElementById('lehrveranstaltung-detail-textbox-anmerkung').value='<?php echo str_replace("'","\'",LEHREINHEIT_ANMERKUNG_DEFAULT);?>';
}
// ****
// * Selectiert die Lektorzuordnung nachdem der Tree
+9 -5
View File
@@ -45,6 +45,7 @@ class firma
var $updateamum; // @var timestamp
var $updatevon; // @var bigint
var $firmentyp_kurzbz; // @var
var $schule; // @var boolean
/**
* Konstruktor
@@ -107,6 +108,7 @@ class firma
$this->insertamum = $row->insertamum;
$this->insertvon = $row->insertvon;
$this->ext_id = $row->ext_id;
$this->schule = ($row->schule=='t'?true:false);
return true;
}
else
@@ -172,7 +174,7 @@ class firma
if($this->new)
{
//Neuen Datensatz einfuegen
$qry='INSERT INTO public.tbl_firma (name, adresse, email, telefon, fax, anmerkung, firmentyp_kurzbz, updateamum, updatevon, insertamum, insertvon, ext_id) VALUES('.
$qry='INSERT INTO public.tbl_firma (name, adresse, email, telefon, fax, anmerkung, firmentyp_kurzbz, updateamum, updatevon, insertamum, insertvon, ext_id, schule) VALUES('.
$this->addslashes($this->name).', '.
$this->addslashes($this->adresse).', '.
$this->addslashes($this->email).', '.
@@ -184,7 +186,8 @@ class firma
$this->addslashes($this->updatevon).', '.
$this->addslashes($this->insertamum).', '.
$this->addslashes($this->insertvon).', '.
$this->addslashes($this->ext_id).'); ';
$this->addslashes($this->ext_id).','.
($this->schule?'true':'false').'); ';
}
else
{
@@ -206,8 +209,9 @@ class firma
'fax='.$this->addslashes($this->fax).', '.
'anmerkung='.$this->addslashes($this->anmerkung).', '.
'updateamum= now(), '.
'updatevon='.$this->addslashes($this->updatevon).', '.
'firmentyp_kurzbz='.$this->addslashes($this->firmentyp_kurzbz).' '.
'updatevon='.$this->addslashes($this->updatevon).', '.
'firmentyp_kurzbz='.$this->addslashes($this->firmentyp_kurzbz).', '.
'schule='.($this->schule?'true':'false').' '.
'WHERE firma_id='.$this->addslashes($this->firma_id).';';
}
//echo $qry;
@@ -299,7 +303,7 @@ class firma
$fa->insertamum = $row->insertamum;
$fa->insertvon = $row->insertvon;
$fa->ext_id = $row->ext_id;
$fa->schule = ($row->schule=='t'?true:false);
$this->result[] = $fa;
}
return true;
+44
View File
@@ -0,0 +1,44 @@
<?php
/* Copyright (C) 2008 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>.
*/
/*
* include fuer zusaetzliche Menuepunkte im FAS
*/
//include der JS files
//echo '<script type="application/x-javascript" src="'.APP_ROOT.'include/'.EXT_FKT_PATH.'/fas_zusatzmenues.js.php" />';
//Menuepunkte
/*
echo '
<menu label="Statistik" accesskey="S">
<menupopup>
<menuitem
label = "Test"
oncommand = "MenuIncStatistikTest()"
accesskey = "T"/>
</menupopup>
</menu>
';
*/
?>
+30
View File
@@ -0,0 +1,30 @@
<?php
/* Copyright (C) 2008 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>.
*/
/*
* Javascript Code fuer die zusaetzlichen Menuepunkte im FAS
*/
?>
function MenuIncStatistikTest()
{
alert('Test');
}
+38 -22
View File
@@ -428,6 +428,22 @@ if (!@pg_query($conn,'SELECT * FROM lehre.vw_stundenplandev_student_unr WHERE un
echo 'VIEW lehre.vw_stundenplandev_student_unr wurde hinzugefuegt!<BR>';
}
// ************** Leserechte auf bis.tbl_orgform fuer web user *****************
if($result =pg_query($conn, "SELECT has_table_privilege('web','bis.tbl_orgform','select') as bool"))
{
if($row = pg_fetch_object($result))
{
if($row->bool=='f')
{
$sql="GRANT SELECT ON bis.tbl_orgform TO GROUP web;";
if (!@pg_query($conn,$sql))
echo '<strong>bis.tbl_orgform Rechte: '.pg_last_error($conn).' </strong><BR>';
else
echo 'User web erhaelt Leserechte auf die Tabelle bis.tbl_orgform<BR>';
}
}
}
// ********************** Pruefungen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -583,32 +599,32 @@ foreach ($tabellen AS $attribute)
$i++;
}
echo '<H2>Gegenpruefung!</H2>';
echo '<H2>Gegenpruefung!</H2>';
$sql_query="SELECT schemaname,tablename FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema' AND schemaname != 'sync';";
if (!$result=@pg_query($conn,$sql_query))
echo '<BR><strong>'.pg_last_error($conn).' </strong><BR>';
else
while ($row=pg_fetch_object($result))
{
$fulltablename=$row->schemaname.'.'.$row->tablename;
if (!isset($tabellen[$fulltablename]))
echo 'Tabelle '.$fulltablename.' existiert in der DB, aber nicht in diesem Skript!<BR>';
else
while ($row=pg_fetch_object($result))
{
$fulltablename=$row->schemaname.'.'.$row->tablename;
if (!isset($tabellen[$fulltablename]))
echo 'Tabelle '.$fulltablename.' existiert in der DB, aber nicht in diesem Skript!<BR>';
else
if (!$result_fields=@pg_query($conn,"SELECT * FROM $fulltablename LIMIT 1;"))
echo '<BR><strong>'.pg_last_error($conn).' </strong><BR>';
else
for ($i=0; $i<pg_num_fields($result_fields); $i++)
{
$found=false;
$fieldnameDB=pg_field_name($result_fields,$i);
foreach ($tabellen[$fulltablename] AS $fieldnameARRAY)
if ($fieldnameDB==$fieldnameARRAY)
{
$found=true;
break;
}
if (!$found)
echo 'Attribut '.$fulltablename.'.<strong>'.$fieldnameDB.'</strong> existiert in der DB, aber nicht in diesem Skript!<BR>';
}
else
for ($i=0; $i<pg_num_fields($result_fields); $i++)
{
$found=false;
$fieldnameDB=pg_field_name($result_fields,$i);
foreach ($tabellen[$fulltablename] AS $fieldnameARRAY)
if ($fieldnameDB==$fieldnameARRAY)
{
$found=true;
break;
}
if (!$found)
echo 'Attribut '.$fulltablename.'.<strong>'.$fieldnameDB.'</strong> existiert in der DB, aber nicht in diesem Skript!<BR>';
}
}
?>
?>
+4 -2
View File
@@ -40,6 +40,7 @@
$fax = (isset($_POST['fax'])?$_POST['fax']:'');
$anmerkung = (isset($_POST['anmerkung'])?$_POST['anmerkung']:'');
$firmentyp_kurzbz = (isset($_POST['typ'])?$_POST['typ']:'');
$schule = isset($_POST['schule']);
// ******* SPEICHERN ********
if(isset($_POST['save']))
@@ -75,6 +76,7 @@
$firma->firmentyp_kurzbz = $firmentyp_kurzbz;
$firma->updateamum = date('Y-m-d H:i:s');
$firma->updatevon = $user;
$firma->schule = $schule;
if($firma->save())
{
@@ -145,8 +147,8 @@
$htmlstr .= " <td><input type='text' name='adresse' value='".htmlentities($firma->adresse)."' maxlength='256'></td>\n";
$htmlstr .= " <td>Anmerkung: </td>";
$htmlstr .= " <td><textarea name='anmerkung'/>".htmlentities($firma->anmerkung)."</textarea></td>\n";
$htmlstr .= " <td valign='bottom'><input type='submit' name='save' value='speichern'></td>";
$htmlstr .= " <td>Schule: </td>";
$htmlstr .= " <td><input type='checkbox' name='schule' ".($firma->schule?'checked':'')."<br><input type='submit' name='save' value='speichern'></td>";
$htmlstr .= " </tr></table>\n";
$htmlstr .= "</form>\n";
+3 -2
View File
@@ -47,7 +47,7 @@
$htmlstr .= "</form><table id='t1' class='liste table-autosort:1 table-stripeclass:alternate table-autostripe'>\n";
$htmlstr .= " <thead><tr class='liste'>\n";
$htmlstr .= " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Name</th><th class='table-sortable:default'>Adresse</th><th class='table-sortable:default'>Email</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Fax</th><th class='table-sortable:default'>Anmerkung</th><th class='table-sortable:default'>Typ</th>";
$htmlstr .= " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Name</th><th class='table-sortable:default'>Adresse</th><th class='table-sortable:default'>Email</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Fax</th><th class='table-sortable:default'>Anmerkung</th><th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Schule</th>";
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row=pg_fetch_object($erg))
@@ -60,8 +60,9 @@
$htmlstr .= " <td>$row->email</td>\n";
$htmlstr .= " <td>$row->telefon</td>\n";
$htmlstr .= " <td>$row->fax</td>\n";
$htmlstr .= " <td>$row->anmerkung</td>\n";
$htmlstr .= " <td title='".htmlentities($row->anmerkung, ENT_QUOTES)."'>".(strlen($row->anmerkung)>30?substr($row->anmerkung,0,27).'...':$row->anmerkung)."</td>\n";
$htmlstr .= " <td>$row->firmentyp_kurzbz</td>\n";
$htmlstr .= " <td>".($row->schule=='t'?'Ja':'Nein')."</td>\n";
$htmlstr .= " </tr>\n";
$i++;
}
-217
View File
@@ -1,217 +0,0 @@
<?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>,
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
* Gerald Raab <gerald.raab@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/firma.class.php');
require_once('../../include/datum.class.php');
if (!$conn = pg_pconnect(CONN_STRING))
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
$user = get_uid();
$datum_obj = new datum();
$firma_id = (isset($_GET['firma_id'])?$_GET['firma_id']:'');
$neu = (isset($_GET['neu'])?true:false);
$error = false;
echo '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Firma</title>
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-9" />
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
</head>
<body class="Background_main">
<h2>Reihungstest - Verwaltung</h2>';
// Speichern einer Firma
if(isset($_POST['speichern']))
{
$firma = new firma($conn);
if(isset($_POST['firma_id']) && $_POST['firma_id']!='')
{
//Reihungstest laden
if(!$firma->load($_POST['firma_id']))
die($firma->errormsg);
$firma->new = false;
}
else
{
//Neue Firma anlegen
$firma->new=true;
$firma->insertvon = $user;
$firma->insertamum = date('Y-m-d H:i:s');
}
if(!$error)
{
$firma->name = $_POST['name'];
$firma->adresse = $_POST['adresse'];
$firma->email = $_POST['email'];
$firma->telefon = $_POST['telefon'];
$firma->fax = $_POST['fax'];
$firma->anmerkung = $_POST['anmerkung'];
$firma->firmentyp_kurzbz = $_POST['firmentyp_kurzbz'];
$reihungstest->updateamum = date('Y-m-d H:i:s');
$reihungstest->udpatevon = $user;
if($firma->save())
{
echo 'Daten wurden erfolgreich gespeichert';
$firma_id = $firma->firma_id;
}
else
{
echo 'Fehler beim Speichern der Daten: '.$firma->errormsg;
}
}
}
echo '<br><table width="100%"><tr><td>';
//Firma DropDown
$reihungstest = new reihungstest($conn);
if($stg_kz==-1)
$reihungstest->getAll(date('Y').'-01-01'); //Alle Reihungstests ab diesem Jahr laden
else
$reihungstest->getReihungstest($stg_kz);
echo "<SELECT name='reihungstest' onchange='window.location.href=this.value'>";
foreach ($reihungstest->result as $row)
{
if($reihungstest_id=='')
$reihungstest_id=$row->reihungstest_id;
if($row->reihungstest_id==$reihungstest_id)
$selected='selected';
else
$selected='';
echo "<OPTION value='".$_SERVER['PHP_SELF']."?stg_kz=$stg_kz&reihungstest_id=$row->reihungstest_id' $selected>$row->datum $row->uhrzeit $row->ort_kurzbz $row->anmerkung</OPTION>";
}
echo "</SELECT></td>";
echo "<td align='right'><INPUT type='button' value='Neuen Reihungstesttermin anlegen' onclick='window.location.href=\"".$_SERVER['PHP_SELF']."?stg_kz=$stg_kz&neu=true\"' >";
echo "</td></tr></table><br><br>";
$reihungstest = new reihungstest($conn);
if(!$neu)
{
if(!$reihungstest->load($reihungstest_id))
die('Reihungstest existiert nicht: '.$reihungstest_id);
}
else
{
if($stg_kz!=-1 && $stg_kz!='')
$reihungstest->studiengang_kz = $stg_kz;
}
//Formular zum bearbeiten des Reihungstests
echo '<HR>';
echo "<FORM method='POST'>";
echo "<input type='hidden' value='$reihungstest->reihungstest_id' name='reihungstest_id' />";
//Studiengang DropDown
echo "<table><tr><td>Studiengang</td><td><SELECT name='studiengang_kz'>";
if($reihungstest->studiengang_kz=='')
$selected = 'selected';
else
$selected = '';
echo "<OPTION value='' $selected>-- keine Auswahl --</OPTION>";
foreach ($studiengang->result as $row)
{
if($row->studiengang_kz==$reihungstest->studiengang_kz)
$selected = 'selected';
else
$selected = '';
echo "<OPTION value='$row->studiengang_kz' $selected>$row->kuerzel</OPTION>";
}
echo "</SELECT></TD></TR>";
//Ort DropDown
echo "<tr><td>Ort</td><td><SELECT name='ort_kurzbz'>";
if($reihungstes->ort_kurzbz=='')
$selected = 'selected';
else
$selected = '';
echo "<OPTION value='' $selected>-- keine Auswahl --</OPTION>";
$ort = new ort($conn);
$ort->getAll();
foreach ($ort->result as $row)
{
if($row->ort_kurzbz==$reihungstest->ort_kurzbz)
$selected='selected';
else
$selected='';
echo "<OPTION value='$row->ort_kurzbz' $selected>$row->ort_kurzbz</OPTION";
}
echo '</SELECT></td></tr>';
echo '<tr><td>Anmerkung</td><td><input type="input" name="anmerkung" value="'.$reihungstest->anmerkung.'"></td></tr>';
echo '<tr><td>Datum</td><td><input type="input" name="datum" value="'.$datum_obj->convertISODate($reihungstest->datum).'"></td></tr>';
echo '<tr><td>Uhrzeit</td><td><input type="input" name="uhrzeit" value="'.$reihungstest->uhrzeit.'"></td></tr>';
echo '<tr><td></td><td><input type="submit" name="speichern" value="Speichern"></td></tr>';
echo '</table>';
echo '</FORM>';
echo '<HR>';
echo "<a href='".$_SERVER['PHP_SELF']."?reihungstest_id=$reihungstest_id&excel=true'>Excel Export</a><br><br>";
//Liste der Interessenten die zum Reihungstest angemeldet sind
$qry = "SELECT *, (SELECT kontakt FROM tbl_kontakt WHERE kontakttyp='email' AND person_id=tbl_prestudent.person_id ORDER BY zustellung LIMIT 1) as email FROM public.tbl_prestudent JOIN public.tbl_person USING(person_id) WHERE reihungstest_id='$reihungstest_id' ORDER BY nachname, vorname";
$mailto = '';
if($result = pg_query($conn, $qry))
{
echo 'Anzahl: '.pg_num_rows($result);
echo "<table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'><thead><tr class='liste'><th class='table-sortable:default'>Vorname</th><th class='table-sortable:default'>Nachname</th><th class='table-sortable:default'>Studiengang</th><th class='table-sortable:default'>Geburtsdatum</th><th>EMail</th></tr></thead><tbody>";
while($row = pg_fetch_object($result))
{
echo "
<tr>
<td>$row->vorname</td>
<td>$row->nachname</td>
<td>".$stg_arr[$row->studiengang_kz]."</td>
<td>".$datum_obj->convertISODate($row->gebdatum)."</td>
<td><a href='mailto:$row->email'>$row->email</a></td>
</tr>";
$mailto.= ($mailto!=''?',':'').$row->email;
}
echo "</tbody></table>";
echo "<br><a href='mailto:$mailto'>Mail an alle senden</a>";
}
echo '
</body>
</html>';
}
?>