//authorization check in and out of site
session_start();
require_once "../libs/datafilter.php";
// validation form data function
require_once "../config/autoload.php";
//autoload function to load class
if (isset($_POST['login_submit'])) {
    $_POST = m_r_e_sAll($_POST);
    //function to check form data validation - function in datafilter.php
    $_POST = trimAll($_POST);
    $_POST = htmlAll($_POST);
    $_POST = addslashesAll($_POST);
    $login = $_POST['login'];
    $pass = $_POST['pass'];
    $regist = new Family_members();
    //create ogject of registr_user class
    $query = $regist->autorization($login, $pass);
    //call the class method to check user data in MySQL Table
    if (mysqli_num_rows($query)) {
        $_SESSION['user'] = mysqli_fetch_assoc($query);
        //array(of user information) is placed in the session ---- to check its authorization
        header("Location: ../main.php");
    } else {
        $_SESSION['info'] = 'Wrong login or password';
        header("Location: ../index.php");
    }
}
if (isset($_GET['logout_user'])) {
    //  Logout
    unset($_SESSION['user']);
Exemplo n.º 2
0
$Family = new Family_job();
//create an object of class Family_job (to display all work)
$all_job = $Family->select_all();
//variable (to display all work)
//$Father = new Family_father();         //create an object of class Family_father (to display all father work)
$all_father_job = Family_father::all_job();
//variable (to display all Father work)
$Mother = new Family_mother();
//create an object of class Family_mother (to display all mother work)
$all_mother_job = $Mother->all_job();
//variable (to display all Mother work)
$Child = new Family_child();
//create an object of class Family_child (to display all child work)
$all_child_job = $Child->all_job();
//variable (to display all Child work)
$all_family_member = Family_members::select_all_member();
// select all fammily member
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Домашние заметки</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
    <link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/spacelab/bootstrap.min.css" rel="stylesheet" integrity="sha256-Ms+D/LmYu22BlovNARzPeE+n0PSOreOjj3aCsoHqi9o= sha512-OIJ6pwbyFgZ1r01HjgmF0MCHZstQ4L7n6nye+G2q/z8vvzG5On8s6fSFp3OkOVsYj+tVRNmWi8PYKTU3Fd4B7g==" crossorigin="anonymous">
    <link href="css/main.css" rel="stylesheet" type="text/css">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
</head>
<body>