resize($tmpfname, 101, 130); //in DB speichern //File oeffnen $fp = fopen($tmpfname, 'r'); //auslesen $content = fread($fp, filesize($tmpfname)); fclose($fp); //in base64-Werte umrechnen $content = base64_encode($content); $person = new person(); if ($person->load($person_id)) { //base64 Wert in die Datenbank speichern $person->foto = $content; $person->new = false; if ($person->save()) { $fs = new fotostatus(); $fs->person_id = $person->person_id; $fs->fotostatus_kurzbz = 'hochgeladen'; $fs->datum = date('Y-m-d'); $fs->insertamum = date('Y-m-d H:i:s'); $fs->insertvon = $user; $fs->updateamum = date('Y-m-d H:i:s'); $fs->updatevon = $user; if (!$fs->save(true)) { echo '<span class="error">Fehler beim Setzen des Bildstatus</span>'; } else { echo "<b>Bild wurde erfolgreich gespeichert</b>"; } } else { echo '<b>' . $person->errormsg . '</b><br />'; }
echo '<td>' . $row->nachname . '</td>'; echo '<td>'; foreach ($benutzer->result as $row_account) { echo $row_account->uid . ' '; } echo '</td>'; echo '</tr>'; } echo '</tbody></table>'; } } if ($person_id != '') { echo '<br><hr>'; $person = new person(); $person->load($person_id); $fs = new fotostatus(); $fs->getLastFotoStatus($person_id); echo '<table> <tr> <td> <img src="../../content/bild.php?src=person&person_id=' . $person_id . '" height="100px" width="75px"> </td> <td> Vorname: ' . $person->vorname . ' <br>Nachname: ' . $person->nachname . ' <br>Geburtsdatum: ' . $datum_obj->formatDatum($person->gebdatum, 'd.m.Y') . ' </td> </tr> </table>'; echo '<br>Aktueller Fotostatus: '; if ($fs->fotostatus_kurzbz == '') {
$errormsg = 'Falsche Paramenteruebergabe'; } } elseif (isset($_POST['type']) && $_POST['type'] == 'imagedelete') { if (isset($_POST['person_id']) && is_numeric($_POST['person_id'])) { if ($_POST['studiengang_kz'] != '' && !$rechte->isBerechtigt('admin', $_POST['studiengang_kz'], 'suid') && !$rechte->isBerechtigt('assistenz', $_POST['studiengang_kz'], 'suid') || $_POST['studiengang_kz'] == '' && !$rechte->isBerechtigt('admin', null, 'suid') && !$rechte->isBerechtigt('mitarbeiter', null, 'suid')) { $return = false; $errormsg = 'Keine Berechtigung'; $data = ''; $error = true; } else { $qry = "UPDATE public.tbl_person SET foto=null WHERE person_id=" . $db->db_add_param($_POST['person_id']) . ";"; $qry .= "DELETE FROM public.tbl_person_fotostatus where fotostatus_kurzbz='akzeptiert' AND person_id=" . $db->db_add_param($_POST['person_id']); if ($db->db_query($qry)) { $qry = "DELETE FROM public.tbl_akte WHERE person_id=" . $db->db_add_param($_POST['person_id']) . " AND dokument_kurzbz='Lichtbil'"; if ($db->db_query($qry)) { $fs = new fotostatus(); $fs->person_id = $_POST['person_id']; $fs->fotostatus_kurzbz = 'abgewiesen'; $fs->datum = date('Y-m-d'); $fs->insertamum = date('Y-m-d H:i:s'); $fs->insertvon = $user; $fs->updateamum = date('Y-m-d H:i:s'); $fs->updatevon = $user; $fs->save(true); $return = true; } else { $return = false; $errormsg = 'Fehler beim Loeschen des grossen Bildes'; } } else { $return = false;