mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-13 18:19:27 +00:00
Seite zum Überschreiben von bestehenden Akten hinzugefügt
This commit is contained in:
@@ -195,6 +195,7 @@ $menu=array
|
||||
'checkStudenten'=>array('name'=>'CheckStudenten', 'link'=>'../system/checkStudenten.php', 'target'=>'main'),
|
||||
'StudienplanZuteilung'=>array('name'=>'Studienplan Zuteilung', 'link'=>'lehre/studienplan_zuteilung.php', 'target'=>'main','permissions'=>array('assistenz')),
|
||||
'lv_merge'=>array('name'=>'LVs zusammenlegen', 'link'=>'lehre/lv_merge.php', 'target'=>'main','permissions'=>array('admin','lv-plan')),
|
||||
'akteupdate'=>array('name'=>'Akten überschreiben', 'link'=>'personen/akteupdate.php', 'target'=>'main','permissions'=>array('admin')),
|
||||
),
|
||||
'Auswertung'=> array
|
||||
(
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Aktualisiert eine bestehende Akte mit einer neuen Datei
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/basis_db.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
if(!$rechte->isBerechtigt('admin', null, 'suid'))
|
||||
die($rechte->errormsg);
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Akte aktualisieren</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body>';
|
||||
|
||||
//Bei Upload des Bildes
|
||||
if(isset($_POST['submitdatei']))
|
||||
{
|
||||
if(isset($_FILES['datei']['tmp_name']))
|
||||
{
|
||||
$filename = $_FILES['datei']['tmp_name'];
|
||||
//File oeffnen
|
||||
$fp = fopen($filename,'r');
|
||||
//auslesen
|
||||
$content = fread($fp, filesize($filename));
|
||||
fclose($fp);
|
||||
//Base64 Codieren
|
||||
$content = base64_encode($content);
|
||||
$akte_id = $_POST['akte_id'];
|
||||
$db = new basis_db();
|
||||
|
||||
$qry = "UPDATE public.tbl_akte SET inhalt=".$db->db_add_param($content)." WHERE akte_id=".$db->db_add_param($akte_id, FHC_INTEGER).";";
|
||||
|
||||
if($db->db_query($qry))
|
||||
echo '<span class="ok">Saved!</span>';
|
||||
else
|
||||
echo '<span class="error">Failed</span>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
<br>
|
||||
Hier können bestehnde Akten die bereits im FAS archiviert mit neuen Dokumenten überschrieben werden.<br>
|
||||
Dies ist hilfreich wenn zB Zeugnisse manuell korrigiert wurden.
|
||||
<br><br>
|
||||
<form method="POST" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'">
|
||||
<table>
|
||||
<tr><td>Datei:</td><td><input type="file" name="datei" /></td></tr>
|
||||
<tr><td>AkteID:</td><td><input type="text" name="akte_id" /></td></tr>
|
||||
<tr><td> </td><td> </td></tr>
|
||||
<tr><td></td><td><input type="submit" name="submitdatei" value="Upload" /></td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user