Exemplo n.º 1
0
 public function save()
 {
     $petOwner = new PetOwner();
     $petOwner->setUsername(Session::get('username'));
     $petOwner->setEmail(Session::get('email'));
     $petOwner->setPassword(Session::get('password'));
     $petFactory = new PetFactory(Session::get('planet'), $_POST['kind']);
     $pet = $petFactory->createPet();
     // Usar transação
     DAO::on('PetOwner')->save($petOwner);
     // DAO::on('Pet')->insert($pet);
     header('Location: ' . URL . 'login/run');
 }
Exemplo n.º 2
0
if (\Libs\Session::get('loggedIn') == true) {
    ?>
		<a href="<?php 
    echo URL;
    ?>
dashboard">Dashboard</a>	
		<a href="<?php 
    echo URL;
    ?>
note">Notes</a>	
		<a href="<?php 
    echo URL;
    ?>
image">Image</a>	
		<?php 
    if (\Libs\Session::get('role') == 'owner') {
        ?>
			<a href="<?php 
        echo URL;
        ?>
user">Users</a>	
		<?php 
    }
    ?>
		<a href="<?php 
    echo URL;
    ?>
dashboard/logout">Logout</a>	
	<?php 
} else {
    ?>
Exemplo n.º 3
0
 public function action(string $do, string $element)
 {
     $action = new Action(Session::get('pet', Session::UNSERIALIZE));
     $action->do($do, $element);
 }