-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprojectbucket.php
More file actions
117 lines (97 loc) · 3.94 KB
/
Copy pathprojectbucket.php
File metadata and controls
117 lines (97 loc) · 3.94 KB
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
<?php
require_once('include/header.php');
require_once ('include/dbconfig.php');
require_once ('include/helpfulFunctions.php');
$username = $_SESSION['username'];
$tags = $_GET['tag'];
$pdo = db_connect();
$log = $pdo -> prepare(
"insert into log(username, operation, target)
values (:username, :operation, :target)"
);
$operation = "look tag";
$log -> bindParam(":username", $username, $pdo::PARAM_STR);
$log -> bindParam(":operation", $operation, $pdo::PARAM_STR);
$log -> bindParam(":target", $tags, $pdo::PARAM_STR);
$log -> execute();
$stmt = $pdo -> prepare(
"Select pid, pname, pdescription, pOwner, tags, Date(projectCreatedTime) createT, Date(endFundTime) endFT,
Date(completionDate) endPT, minFund, maxFund, fundSoFar, pstatus, cover
From Project
WHERE tags LIKE :tags"
);
$stmt -> execute([':tags' => "%".$tags."%"]);
$result = $stmt -> fetchAll();
function showProject($singleResult) {
$createTime = $singleResult['createT'];
$endTime = $singleResult['endFT'];
$completeTime = $singleResult['endPT'];
$fundSoFar = $singleResult['fundSoFar'];
$author = $singleResult['pOwner'];
$pid = $singleResult['pid'];
$pname = $singleResult['pname'];
$pdescription = $singleResult['pdescription'];
$allTags = $singleResult['tags'];
echo
<article class='portfolio-item pf-media pf-icons clearfix'>
<div class='portfolio-image'>
<a href='project.php?pid=$pid'>
<img src='projectimage.php?pid=$pid' alt='$pname'>
</a>
</div>
<div class='portfolio-desc'>
<h3><a href='project.php?pid=$pid'>$pname</a></h3>
<span>$allTags</span>
<p>$pdescription</p>
<ul class='iconlist'>
<li><i class='icon-ok'></i> <strong>Created:</strong>$createTime</li>
<li><i class='icon-ok'></i> <strong>End Fund:</strong>$endTime</li>
<li><i class='icon-ok'></i> <strong>Complete:</strong>$completeTime</li>
<li><i class='icon-ok'></i> <strong>Collected:</strong>$fundSoFar</li>
<li><i class='icon-ok'></i> <strong>By:</strong>$author</li>
</ul>
<a href='project.php?pid=$pid' class='button button-3d noleftmargin'>Have A Look</a>
</div>
</article>
";
}
?>
<!-- Page Title
============================================= -->
<section id="page-title">
<div class="container clearfix">
</div>
</section><!-- #page-title end -->
<!-- Content
============================================= -->
<section id="content">
<div class="content-wrap">
<div class="container clearfix">
<!-- <!-- Portfolio Filter-->
<!-- ============================================= -->
<!-- <ul id="portfolio-filter" class="portfolio-filter clearfix" data-container="#portfolio">-->
<!---->
<!-- <li class="activeFilter"><a href="projectAll.php" data-filter="*">Show All</a></li>-->
<!-- <li><a data-filter=".pf-icons">--><?php //echo $tags; ?><!--</a></li>-->
<!---->
<!-- </ul><!-- #portfolio-filter end -->
<h2>Tag: <?php echo $_GET['tag']?></h2>
<div id="portfolio-shuffle" class="portfolio-shuffle" data-container="#portfolio">
<i class="icon-random"></i>
</div>
<div class="clear"></div>
<!-- Portfolio Items
============================================= -->
<div id="portfolio" class="portfolio grid-container portfolio-1 clearfix">
<?php
foreach($result as $row) {
showProject($row);
}
?>
</div><!-- #portfolio end -->
</div>
</div>
</section><!-- #content end -->
<?php
require_once ('include/footer.html');
?>