PHP Classes

File: examples/testlogin.php

Recommend this page to a friend!
  Classes of Jorge Castro   DashOne   examples/testlogin.php   Download  
File: examples/testlogin.php
Role: Example script
Content type: text/plain
Description: Example script
Class: DashOne
Compose and display a dashboard programmatically
Author: By
Last change:
Date: 4 years ago
Size: 1,073 bytes
 

Contents

Class file image Download
<?php

use eftec\DashOne\controls\ContainerOne;
use
eftec\DashOne\controls\ControlOne;
use
eftec\DashOne\controls\ButtonOne;
use
eftec\DashOne\controls\ImageOne;
use
eftec\DashOne\DashOne;
use
eftec\DashOne\controls\LinkOne;
use
eftec\DashOne\controls\UlOne;
use
eftec\DashOne\controls\FormOne;
use
eftec\DashOne\controls\TableOne;
@
session_start();
include
"../vendor/autoload.php";

$valueUL=['Cocacola','Fanta','Sprite'];

/**
 * @param array $user =['username' => '', 'password' => '', '_csrf' => '','result'=>false]
 *
 * @return bool
 */
$validateLogin= function($user) {
    if(
$user['username']=='john' && $user['password']=='doe') {
        return
true;
    }
    return
false;
};

$dash=new DashOne(false,false,'salt_123',$validateLogin);
$user=[];
$dash->fetchLogin($user);

if(
$user['result']) {
   
header('location:testlogin2.php');
   
$message='ok';
} else {
   
$message='';
}


$dash->head('Example - test 1','',true);
$dash->login($user,null,'user "john" and password "doe"');
$dash->alert($message);
$dash->footer();
$dash->endLogin();
$dash->render();