-
Notifications
You must be signed in to change notification settings - Fork 0
/
portfolio-details.php
146 lines (118 loc) · 5.81 KB
/
portfolio-details.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
138
139
140
141
142
143
144
145
146
<?php require('connection/db_connection.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Portfolio Details - Personal Bootstrap Template</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i"
rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<!-- =======================================================
* Template Name: Personal - v4.7.0
* Template URL: https://bootstrapmade.com/personal-free-resume-bootstrap-template/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
======================================================== -->
</head>
<body>
<?php
if(isset($_GET['id'])){
$id = $_GET['id'];
$sql = "SELECT * FROM `portfolio` WHERE `portfolio`.`id` = $id";
$result = mysqli_query($db, $sql);
$data = mysqli_fetch_assoc($result);
$category = $data['category'];
$category_sql = "SELECT * FROM `category` WHERE `category`.`id`='$category'";
$category_result = mysqli_query($db, $category_sql);
$category_data = mysqli_fetch_assoc($category_result);
}
?>
<main id="main">
<!-- ======= Portfolio Details ======= -->
<div id="portfolio-details" class="portfolio-details">
<div class="container">
<div class="row">
<div class="col-lg-8">
<div class="portfolio-details-slider swiper">
<div class="swiper-wrapper align-items-center">
<div id="project-image"> <!-- This div will display the project image -->
<img src="images/<?=$data['image']?>" alt="" style="width: 100%;">
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<div class="col-lg-4 portfolio-info">
<h3><?=$data['title']?></h3>
<ul>
<li><strong>Category</strong>: <?=$category_data['name']?></li>
<li><strong>Technologies</strong>: <?=$data['client']?></li>
<li><strong>Project date</strong>: <?php echo date('D M Y', strtotime($data['project_date']))?></li>
<li><strong>Project URL</strong>: <a href="<?=$data['url']?>" target="_blank"><?=$data['url']?></a></li>
</ul>
<p>
<?=$data['text']?>
</p>
</div>
</div>
</div>
</div><!-- End Portfolio Details -->
</main><!-- End #main -->
<!-- Vendor JS Files -->
<script src="assets/vendor/purecounter/purecounter.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
<script src="assets/vendor/waypoints/noframework.waypoints.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
<!-- Include Lightbox CSS and JavaScript -->
<link rel="stylesheet" href="assets/vendor/glightbox/css/glightbox.min.css">
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<!-- Initialize Lightbox -->
<script>
$(document).ready(function() {
// Initialize lightbox for portfolio images
$('[data-gallery="portfolioGallery"]').each(function() {
$(this).glightbox();
});
// Initialize lightbox for portfolio details
$('[data-gallery="portfolioDetailsGallery"]').each(function() {
$(this).glightbox({
type: 'external'
});
});
});
// JavaScript code to update the project image when the link icon is clicked
document.addEventListener('DOMContentLoaded', function () {
const linkIcon = document.querySelector('.portfolio-details-lightbox');
const projectImage = document.getElementById('project-image').querySelector('img');
// Add a click event listener to the link icon
linkIcon.addEventListener('click', function (e) {
e.preventDefault();
// Get the image source from the clicked project's data-image attribute
const newImageSrc = this.getAttribute('data-image');
// Update the project image source
projectImage.src = newImageSrc;
});
});
</script>
</body>
</html>