コード例 #1
0
ファイル: class_user.php プロジェクト: karu/SmallTime
 function check_htaccess()
 {
     $_file = "./Data/.htaccess";
     if (!file_exists($_file)) {
         $_zeilenvorschub = "\r\n";
         $fp = fopen($_file, "a+");
         fputs($fp, "Deny from all");
         fclose($fp);
         $_datum = date("d.m.Y", time());
         $_uhrzeit = date("H:i", time());
         $_datetime = $_datum . " - " . $_uhrzeit;
         $_debug = new time_filehandle("./debug/", "time.txt", ";");
         $_debug->insert_line("Time;" . $_datetime . ";Fehler in class_user;213;" . $this->_file . ";htaccess nicht vorhanden, wurde erstellt.");
     }
 }
コード例 #2
0
ファイル: class_group.php プロジェクト: karu/SmallTime
 function get_timestamps($_ordnerpfad)
 {
     $_w_jahr = date("Y", time());
     $_w_monat = date("n", time());
     $_file = "./Data/" . $_ordnerpfad . "/Timetable/" . $_w_jahr . "." . $_w_monat;
     if (file_exists($_file)) {
         $_timeTable = file($_file);
         sort($_timeTable);
     } else {
         $_timeTable = NULL;
     }
     // Anzeige der heutigen Stempelzeiten (nur heute $temptime)
     $_temptime = array();
     $_str = "";
     if (count($_timeTable)) {
         foreach ($_timeTable as $_time) {
             //Datenüberprüfung und Bereinigung
             $_time = trim($_time);
             $_time = str_replace("\r", "", $_time);
             $_time = str_replace("\n", "", $_time);
             if ($_time) {
                 //Stempelzeit berechnen
                 $_w_jahr = date("Y", time());
                 $_w_monat = date("n", time());
                 $_w_tag = date("j", time());
                 $_w_stunde = date("H", time());
                 $_w_minute = date("i", time());
                 $_w_sekunde = date("s", time());
                 $_w_jahr_t = date("Y", $_time);
                 $_w_monat_t = date("n", $_time);
                 $_w_tag_t = date("j", $_time);
                 $_w_stunde_t = date("H", $_time);
                 $_w_minute_t = date("i", $_time);
                 $_w_sekunde_t = date("s", $_time);
                 if ($_w_jahr == $_w_jahr_t && $_w_monat == $_w_monat_t && $_w_tag == $_w_tag_t) {
                     $_temptime[] = $_w_stunde_t . ":" . $_w_minute_t;
                 }
             } else {
                 $_datum = date("d.m.Y", time());
                 $_uhrzeit = date("H:i", time());
                 $_datetime = $_datum . " - " . $_uhrzeit;
                 $_debug = new time_filehandle("./debug/", "time.txt", ";");
                 $_debug->insert_line("Time;" . $_datetime . ";Fehler in class_group;141;" . $_file . ";Leerzeile entdeckt");
             }
         }
     }
     return $_temptime;
 }
コード例 #3
0
ファイル: class_month.php プロジェクト: karu/SmallTime
 private function get_timestamps($_Day)
 {
     $_stempelzeit = array();
     $_saldo = array();
     for ($g = 0; $g < count($this->_timeTable); $g++) {
         //Datenüberprüfung und Bereinigung bei Leerzeilen
         $this->_timeTable[$g] = trim($this->_timeTable[$g]);
         $this->_timeTable[$g] = str_replace("\r", "", $this->_timeTable[$g]);
         $this->_timeTable[$g] = str_replace("\n", "", $this->_timeTable[$g]);
         if ($this->_timeTable[$g]) {
             if (date("d.m.Y", $this->_timeTable[$g]) == date("d.m.Y", $_Day)) {
                 $_stempelzeit[] = $this->_timeTable[$g];
             }
         } else {
             $_datum = date("d.m.Y", time());
             $_uhrzeit = date("H:i", time());
             $_datetime = $_datum . " - " . $_uhrzeit;
             $_debug = new time_filehandle("./debug/", "time.txt", ";");
             $_debug->insert_line("Time;" . $_datetime . ";Fehler in class_month;304;" . $this->_file . ";Leerzeile entdeckt");
         }
     }
     return $_stempelzeit;
 }
コード例 #4
0
ファイル: index.php プロジェクト: karu/SmallTime
$_zeitmessung = $_time_end - $_start_time;
// ^^ Endzeit minus Startzeit = die Differenz der beiden Zeiten
$_zeitmessung = substr($_zeitmessung, 0, 4);
// ^^ Die Zeit wird auf X Kommastellen gekürzt
$_copyright .= "<hr color=#DFDFDF size=1>Ladezeit der Seite: {$_zeitmessung} Sekunden.<br>";
// ----------------------------------------------------------------------------
// copyright Text
// ----------------------------------------------------------------------------
$_arr = file("./include/Settings/copyright.txt");
$_ver = file("./include/Settings/smalltime.txt");
$_copyright .= "";
$_mem_usage = round(memory_get_peak_usage(true) / 1048576, 3);
if ($_mem_usage > 19.9) {
    $_debug = new time_filehandle("./debug/", "time.txt", ";");
    $_seite = explode('?', $_SERVER['HTTP_REFERER']);
    $_debug->insert_line("Memory Fehler ;" . date('d.m.Y', time()) . "; File:  admin.php?" . $_seite[1] . "; RAM:" . $_mem_usage);
}
foreach ($_arr as $_zeile) {
    $_tmp = str_replace("##ver##", $_ver[0], $_zeile);
    $_tmp = str_replace("##phpver##", phpversion(), $_tmp);
    $_tmp = str_replace("##memory##", $_mem_usage, $_tmp);
    $_copyright .= $_tmp;
}
$_copyright .= "</div>";
// ----------------------------------------------------------------------------
// Viewer - Anzeige der Seite
// ----------------------------------------------------------------------------
if (isset($_GET['modal'])) {
    // bei Modal nur DIV04 anzeigen
    include $_template->get_user04();
} elseif (isset($_GET['excel'])) {
コード例 #5
0
ファイル: time_funktionen.php プロジェクト: karu/SmallTime
function check_htaccess($_file, $_rwo, $_text)
{
    if (!file_exists($_file)) {
        $_zeilenvorschub = "\r\n";
        $fp = fopen($_file, "a+");
        if ($_rwo) {
            fputs($fp, "Order deny,allow");
            fputs($fp, $_zeilenvorschub);
            fputs($fp, "Allow from all");
            fputs($fp, $_zeilenvorschub);
            fputs($fp, "Allow from <127.0.0.1>");
            fputs($fp, $_zeilenvorschub);
        } else {
            fputs($fp, "Deny from all");
        }
        fclose($fp);
        $_datum = date("d.m.Y", time());
        $_uhrzeit = date("H:i", time());
        $_datetime = $_datum . " - " . $_uhrzeit;
        $_debug = new time_filehandle("./debug/", "time.txt", ";");
        $_debug->insert_line("Time;" . $_datetime . ";Fehler in;" . $_file . ";" . $_text);
    }
}