-
Notifications
You must be signed in to change notification settings - Fork 0
/
verSelfPub.php
69 lines (58 loc) · 1.79 KB
/
verSelfPub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?
require_once('utils/Autoload.php');
session_start();
if(empty($_SESSION) || !array_key_exists('Nome',$_SESSION) || !isset($_SESSION['Nome'])){
$_SESSION['error'] = array ('source' => 'contato.php','type' => 'No Permissions');
header('Location:formLogin.php');
die();
}else{
$myDbManager = new classes_DbManagerPDO();
$myUserManager = new classes_UserManager($myDbManager);
$myUser = new classes_User($_SESSION,'SessionSet');
$Nome = $myUser->getUsername();
try{
$myDbManager = new classes_DbManagerPDO();
$pubAllSelf = new classes_PublicationManager($myDbManager);
$result = $pubAllSelf->listSelfPub($myUser->getId());
}
catch(InvalidArgumentException $e){
echo '<div class="alert alert-danger" role="alert">'.$e->getMessage().'</div>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?
include('head.php');
?>
<title>Suas Publicações - Socialite</title>
<style>
img {
height: 100px;
width: 100px;
}
</style>
</head>
<body>
<?
include('navbar.php');
?>
<main>
<div class="container">
<?
if(empty($result)){
echo 'Não tem publicações suas <br>';
}
for($i=0; $i<count($result);$i++){
echo '<img src= "'.$result[$i]['imagem'].'" alt="'.$result[$i]['descricao'].'">"'.$result[$i]['descricao'].'"<br>';
echo '<a href="deletePub?id='.$result[$i]['id_pub'].'" name="apagar">Apagar</a><br>';
}?>
<a href="index.php" title="Ir para a página anterior">Voltar</a>
</div>
</main>
<?
include ("footer.php");
?>
</body>
</html>