Example #1
0
<!DOCTYPE html>
<head>
  <meta charset="utf-8">
</head>
<?php 
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
require_once '../php/DateTime.php';
use weblibs\php\DateTime;
echo "1: '" . (new DateTime("25/01/1984"))->inverti() . "'<br />";
echo "2: '" . (new DateTime("1984-01-25"))->inverti() . "'<br />";
echo "3: '" . (new DateTime("1984-01-25 02:03:00"))->inverti() . "'<br />";
echo "4: '" . (new DateTime("25-01-1984"))->inverti() . "'<br />";
$DataTest = new DateTime("1984-01-25 02:03:00");
echo "TEST: '" . $DataTest->inverti() . "'<br />";
Example #2
0
    $namespace = '';
    if ($lastNsPos = strrpos($className, '\\')) {
        $namespace = substr($className, 0, $lastNsPos);
        $className = substr($className, $lastNsPos + 1);
        $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
    }
    $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
    require "../../{$fileName}";
}
use weblibs\php\DateTime;
use weblibs\php\Database;
use weblibs\php\Authentication;
use weblibs\php\Form;
echo "<pre>";
echo "Verifica meccanismo di autenticazione:\n\n";
$date = new DateTime(time());
$d = new Database("localhost", "test", "sample", "db_anathema");
$a = new Authentication($d, "testAuth");
$d->getRows("*", "tab_config", "opt = 'enabled'", true);
$StatoDB = $d->Results[0]['val'];
print_r($d->Results);
// Pulisco il campo user:
if (filter_input(INPUT_POST, 'username') != "") {
    //echo "effettuo il login\n\n";
    $a->logIn(filter_input(INPUT_POST, 'username'), filter_input(INPUT_POST, 'password'), "testAuth", "");
}
//echo "DB STATUS: $StatoDB\n\n";
//    echo "POST\n";
//    print_r($_POST);
//
//    echo "\nGET\n";