function checkLogin() { session_start(); if (!$_SESSION["cliente"] or !($_SESSION["cliente"] = Cliente::getCliente($_SESSION["cliente"]->getValue("id_cliente")))) { $_SESSION["cliente"] = ""; header("Location: login.php"); exit; } else { } }
public function persists(Cliente $entity) { $this->entity = $entity->getCliente(); return $this; }
<?php $id = $_GET['id']; try { $conexao = new \PDO('mysql:host=localhost;dbname=clientes', 'root', 'admin'); } catch (Exception $e) { echo $e->getMessage(); } require_once 'cliente.php'; $cliente = new Cliente($conexao); $cliente->setId($id); $cli = $cliente->getCliente(); ?> <!DOCTYPE html> <html lang="pt-br"> <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>CRUD com Bootstrap 3</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header">