Beispiel #1
0
header("Content-Type: text/html; charset=UTF-8");
$error = "";
//Prüfen ob maximal Alter übertragen wurde
$imgDateNewer = null;
if (isset($_POST["imgdate"])) {
    if (strlen($_POST["imgdate"]) >= 6) {
        $date_tmp = explode(".", $_POST["imgdate"]);
        if (sizeof($date_tmp == 3)) {
            $imgDateNewer = mktime(0, 0, 0, $date_tmp[1], $date_tmp[0], $date_tmp[2]);
        }
    }
}
//Daten der Schüler einlesen
ob_start();
getDir("../" . $_SESSION["settings"]["images_matching_lisa"], "MAINDIRECTORY", "lisa");
$student_data = lisaDirToStudentData($_SESSION["lisa"], $_SESSION["settings"]["images_matching_lisa"]);
ob_end_clean();
function lisaDirToStudentData(&$dirData, $imgbasepath)
{
    $student_data = array();
    if (is_array($dirData)) {
        foreach ($dirData as $data) {
            $student = array();
            $student["createTime"] = isset($data["createTime"]) ? $data["createTime"] : "";
            $student["given_name"] = isset($data["givenname"]) ? $data["givenname"] : "";
            $student["last_name"] = isset($data["lastname"]) ? $data["lastname"] : "";
            $student["birthday"] = (isset($data["birthday_year"]) and isset($data["birthday_month"]) and isset($data["birthday_day"])) ? $data["birthday_day"] . "." . $data["birthday_month"] . "." . $data["birthday_year"] : "";
            $student["class"] = isset($data["class"]) ? $data["class"] : "";
            $student["pic_small"] = isset($data["picfile"]) ? $imgbasepath . $data["picfile"] : "";
            $student["pic_big"] = isset($data["picfile"]) ? $imgbasepath . $data["picfile"] : "";
            $student_data[$student["class"]][] = $student;
Beispiel #2
0
    }
}
$imgDateOlder = null;
if (isset($_POST["imguntil"])) {
    if (strlen($_POST["imguntil"]) >= 6) {
        $date_tmp = explode(".", $_POST["imguntil"]);
        if (sizeof($date_tmp == 3)) {
            $imgDateOlder = mktime(0, 0, 0, $date_tmp[1], $date_tmp[0], $date_tmp[2]) + 60 * 60 * 24;
            // mktime(0,0,0,0,1,0); //+1 Tag
        }
    }
}
//Daten der Schüler einlesen
ob_start();
getDir("../" . $_SESSION["settings"]["images_matching_lisa"], "MAINDIRECTORY", "lisa");
$student_data = lisaDirToStudentData($_SESSION["lisa"], $_SESSION["settings"]["images_matching_lisa"], $imgDateNewer, $imgDateOlder);
ob_end_clean();
function lisaDirToStudentData(&$dirData, $imgbasepath, $imgDateNewer = null, $imgDateOlder = null)
{
    $student_data = array();
    if (is_array($dirData)) {
        foreach ($dirData as $data) {
            $student = array();
            $student["createTime"] = isset($data["createTime"]) ? $data["createTime"] : "";
            $student["given_name"] = isset($data["givenname"]) ? $data["givenname"] : "";
            $student["last_name"] = isset($data["lastname"]) ? $data["lastname"] : "";
            $student["birthday"] = (isset($data["birthday_year"]) and isset($data["birthday_month"]) and isset($data["birthday_day"])) ? $data["birthday_day"] . "." . $data["birthday_month"] . "." . $data["birthday_year"] : "";
            $student["class"] = isset($data["class"]) ? $data["class"] : "";
            $student["pic"] = isset($data["picfile"]) ? $imgbasepath . $data["picfile"] : "";
            //$student["pic_small"] = ( isset($data["picfile"]) ? $imgbasepath.$data["picfile"] : "");
            //$student["pic_big"] = ( isset($data["picfile"]) ? $imgbasepath.$data["picfile"] : "");