Exemplo n.º 1
0
 public function Insert()
 {
     global $obj, $model;
     include_once 'Model/loginhistory.php';
     $model = new Loginhistory();
     if (isset($_POST['btnSubmit'])) {
         foreach ($_POST as $key => $value) {
             try {
                 $model->{$key} = $value;
             } catch (Exception $ex) {
             }
         }
         if ($model->Insert()) {
             print '<span class="success">login Created</span>';
             $model = new Loginhistory();
         } else {
             print '<span class="error">' . $model->Error . '</span>';
         }
     }
     include_once 'View/Loginhistory/insert.php';
 }
Exemplo n.º 2
0
    unset($_SESSION['usertype']);
    unset($_SESSION['userid']);
}
if (isset($_POST['btnLogin'])) {
    include_once 'Model/user.php';
    $model = new User();
    $model->Email = $_POST['Email'];
    $model->Password = $_POST['Password'];
    if ($model->Login()) {
        $_SESSION['username'] = $model->Name;
        $_SESSION['usertype'] = $model->Type;
        $_SESSION['userid'] = $model->Id;
        include_once 'Model/loginhistoty.php';
        $lh = new Loginhistory();
        $lh->UserId = $model->Id;
        if (!$lh->Insert()) {
        }
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example of Twitter Bootstrap 3 Dropdowns within a Navbar</title>
<link rel="stylesheet" type="text/css" href="<?php 
print baseurl;
?>
Styles/style2/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php