mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
This commit is contained in:
@@ -32,14 +32,6 @@ require_once('../../include/akte.class.php');
|
||||
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
echo "<html><body>";
|
||||
//wandelt einen String in HEX-Werte um
|
||||
function strhex($string)
|
||||
{
|
||||
$hex="";
|
||||
for ($i=0;$i<strlen($string);$i++)
|
||||
$hex.=(strlen(dechex(ord($string[$i])))<2)? "0".dechex(ord($string[$i])): dechex(ord($string[$i]));
|
||||
return $hex;
|
||||
}
|
||||
|
||||
function resize($filename, $width, $height)
|
||||
{
|
||||
@@ -93,7 +85,7 @@ if(isset($_POST['submitbild']))
|
||||
{
|
||||
//Extension herausfiltern
|
||||
$ext = explode('.',$_FILES['bild']['name']);
|
||||
$ext = strtolower($ext[count($ext)-1]);
|
||||
$ext = mb_strtolower($ext[count($ext)-1]);
|
||||
|
||||
$width=101;
|
||||
$height=130;
|
||||
@@ -130,7 +122,7 @@ if(isset($_POST['submitbild']))
|
||||
|
||||
$akte->dokument_kurzbz = 'Lichtbil';
|
||||
$akte->person_id = $_GET['person_id'];
|
||||
$akte->inhalt = strhex($content);
|
||||
$akte->inhalt = base64_encode($content);
|
||||
$akte->mimetype = "image/jpg";
|
||||
$akte->erstelltam = date('Y-m-d H:i:s');
|
||||
$akte->gedruckt = false;
|
||||
@@ -156,13 +148,13 @@ if(isset($_POST['submitbild']))
|
||||
//auslesen
|
||||
$content = fread($fp, filesize($filename));
|
||||
fclose($fp);
|
||||
//in HEX-Werte umrechnen
|
||||
$content = strhex($content);
|
||||
//in base64-Werte umrechnen
|
||||
$content = base64_encode($content);
|
||||
|
||||
$person = new person();
|
||||
if($person->load($_GET['person_id']))
|
||||
{
|
||||
//HEX Wert in die Datenbank speichern
|
||||
//base64 Wert in die Datenbank speichern
|
||||
$person->foto = $content;
|
||||
$person->new = false;
|
||||
if($person->save())
|
||||
|
||||
Reference in New Issue
Block a user