-
Notifications
You must be signed in to change notification settings - Fork 0
/
portfolio-item.php
137 lines (116 loc) · 4.1 KB
/
portfolio-item.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php include "classes.php" ?>
<?php
$securityUserId = SessionManager::getSecurityUserId();
$customerId = SessionManager::getCustomerId();
if($_SERVER["REQUEST_METHOD"] == "POST"){
if(isset($_POST["btnDelete"])){
if(is_numeric($_POST["btnDelete"])){
Portfolioitem::remove($_POST["btnDelete"]);
header("location: portfolio-1-col.php");
}
}
}
if($_SERVER["REQUEST_METHOD"] == "GET"){
if(isset($_GET["id"]) && is_numeric($_GET["id"]) && $_GET["id"] > 0){
$id = $_GET["id"];
$portfolioitem = new Portfolioitem($id);
if($portfolioitem != null){
}
else{
header("location: index.php");
}
}
else{
header("location: index.php");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include "head.php" ?>
<body>
<!-- Navigation -->
<?php include "navbar.php" ?>
<!-- Page Content -->
<div class="container">
<!-- Page Heading/Breadcrumbs -->
<div class="row">
<div class="col-sm-9">
<h1 class="mt-4 mb-3">
<?php echo $portfolioitem->getName(); ?>
</h1>
</div>
<div class="col-sm-3">
<br>
<?php
if($securityUserId > 0){
?>
<div class="dropdown show mb-2">
<a class="btn btn-secondary dropdown-toggle btn-block" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Manage Portfolio Item
</a>
<div class="dropdown-menu w-100" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="create-portfolioitem.php?id=<?php echo $portfolioitem->getId(); ?>&cmd=edit">Edit</a>
<form method="post">
<button name="btnDelete" class="dropdown-item" value="<?php echo $portfolioitem->getId()?>">Delete</button>
</form>
</div>
</div>
<?php
}
?>
</div>
</div>
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.php">Home</a>
</li>
<li class="breadcrumb-item">
<a href="portfolio-1-col.php">Portfolio</a>
</li>
<li class="breadcrumb-item active"><?php echo $portfolioitem->getName(); ?></li>
</ol>
<!-- Portfolio Item Row -->
<div class="row">
<div class="col-md-8">
<a data-toggle="modal" data-target="#myModal">
<img class="img-fluid mx-auto d-block" src="<?php echo $portfolioitem->getImageURL(); ?>" alt="<?php echo $portfolioitem->getName(); ?>">
</a>
</div>
<div class="col-md-4">
<h3 class="my-3">Project Description</h3>
<p><?php echo nl2br($portfolioitem->getDescription()); ?></p>
<a target="_blank" href="<?php echo $portfolioitem->getProjectUrl(); ?>" class="btn btn-primary btn-lg btn-block" title="Visit <?php echo $portfolioitem->getProjectUrl(); ?>">
<i class="icon-screen-desktop"></i> <?php echo $portfolioitem->getName(); ?>
</a>
</div>
</div>
<!-- /.row -->
<!-- Related Projects Row -->
<h3 class="my-4">Related Projects</h3>
<div class="row">
<?php
$portfolioitemList = Portfolioitem::loadbyportfoliocategoryid($portfolioitem->getPortfolioCategoryId());
if(!empty($portfolioitemList)){
foreach ($portfolioitemList as $pi){
?>
<div class="col-md-3 col-sm-6 mb-4">
<a href="portfolio-item.php?id=<?php echo $pi->getId() ?>">
<img class="img-fluid" src="<?php echo $pi->getImageUrl() ?>" alt="">
</a>
</div>
<?php
}
}
?>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- Footer -->
<?php include "footer.php" ?>
<!-- Bootstrap core JavaScript -->
<?php include "scripts.php" ?>
<?php include "modal.php" ?>
</body>
</html>