first commit
This commit is contained in:
102
detail_prof.php
Executable file
102
detail_prof.php
Executable file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/*
|
||||
# Fuer debugging
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
#echo __LINE__."<br>";
|
||||
*/
|
||||
|
||||
include_once './classes/TestProjektSmarty.class.php';
|
||||
$smarty = new Smarty();
|
||||
require_once("./config.inc.php");
|
||||
$template = "standard";
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
require_once "./language/german.inc.php";
|
||||
require_once("func_rollenrechte.php");
|
||||
$jahrgang = $_COOKIE["jahrgang"];
|
||||
|
||||
// Rechteüberprüfung
|
||||
#$db = dbconnect();
|
||||
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
|
||||
if(!rore($user_admin,'j_detail','RE')){echo "Keine Rechte";exit;}
|
||||
// Rechteüberprüfung ende
|
||||
|
||||
|
||||
|
||||
session_start();
|
||||
|
||||
|
||||
|
||||
# Wenn Seite neu aufgerufen wird, dann alle Sessions, die mit "bearbeiten_" beginnen löschen
|
||||
if(isset($_GET['new']) AND $_GET['new'] == 1){;
|
||||
$search_prefix = 'bearbeiten_';
|
||||
$search_len = strlen($search_prefix);
|
||||
foreach( $_SESSION as $key => $value){
|
||||
if ( substr( $key, 0, $search_len) == $search_prefix) {
|
||||
unset( $_SESSION[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($_GET['action'])){
|
||||
$action = $_GET['action'];
|
||||
}else{
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if($action == ''){
|
||||
|
||||
$query_prof = "SELECT did, doz_titel, doz_vorname, doz_name
|
||||
FROM prog_professor
|
||||
ORDER BY doz_name ASC";
|
||||
$result_prof = $db->query($query_prof)
|
||||
or die ("Cannot execute query prof");
|
||||
|
||||
while ($row_prof = $result_prof->fetch_array()){
|
||||
|
||||
# Wenn ein Prof keine Zulagen hat, dann soll er nicht in die Auswahlliste kommen
|
||||
$result_anz_bz = $db->query("SELECT count(*) Anz
|
||||
FROM prog_tmp_lb_bz
|
||||
WHERE did= '$row_prof[did]'
|
||||
AND date_format(monat,'%Y') = '$jahrgang'
|
||||
AND wert > 0
|
||||
");
|
||||
$row_anz_bz = $result_anz_bz->fetch_array();
|
||||
|
||||
$result_anz_lz = $db->query("SELECT count(*) Anz
|
||||
FROM prog_tmp_lb_lz
|
||||
WHERE did= '$row_prof[did]'
|
||||
AND date_format(monat,'%Y') = '$jahrgang'
|
||||
AND wert > 0
|
||||
");
|
||||
$row_anz_lz = $result_anz_lz->fetch_array();
|
||||
|
||||
$result_anz_fz = $db->query("SELECT count(*) Anz
|
||||
FROM prog_tmp_lb_fz
|
||||
WHERE did= '$row_prof[did]'
|
||||
AND date_format(monat,'%Y') = '$jahrgang'
|
||||
AND wert > 0
|
||||
");
|
||||
$row_anz_fz = $result_anz_fz->fetch_array();
|
||||
|
||||
$summe_anz = $row_anz_bz['Anz'] + $row_anz_lz['Anz'] + $row_anz_fz['Anz'];
|
||||
if ($summe_anz != 0) {
|
||||
$value_prof[] = $row_prof;
|
||||
}
|
||||
}
|
||||
$smarty->assign('table_data3', $value_prof);
|
||||
|
||||
}
|
||||
if($action == 'auswahl'){
|
||||
|
||||
$_SESSION["bearbeiten_did"] = $_POST["prof"];
|
||||
$did = $_SESSION["bearbeiten_did"];
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2; URL=detail_prof_pdf.php?prof=$did\">";
|
||||
|
||||
}
|
||||
|
||||
$smarty->assign('action', "$action");
|
||||
$smarty->display("$template/$templatename");
|
||||
?>
|
Reference in New Issue
Block a user