-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhesabimfavoriler.php
169 lines (158 loc) · 9.24 KB
/
hesabimfavoriler.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
if (isset($_SESSION["Kullanici"])) {
$sayfalamaIcinSolveSagButonSayisi = 2;
$sayfaBasinaGosterilecekKayitSayisi = 10;
$toplamKayitSayisiSorgusu = $dbConnection->prepare("select * from favoriler where UyeId = ? order by id desc");
$toplamKayitSayisiSorgusu->execute([$kullaniciId]);
$toplamKayitSayisi = $toplamKayitSayisiSorgusu->rowCount();
$sayfalamayaBaslanacakKayitSayisi = ($sayfalama * $sayfaBasinaGosterilecekKayitSayisi) - $sayfaBasinaGosterilecekKayitSayisi;
$bulunanSayfaSayisi = ceil($toplamKayitSayisi / $sayfaBasinaGosterilecekKayitSayisi);
?>
<table width="1065" align="center" border="0" cellpadding="0" cellspacing="0" bgcolor="F9F9F9">
<tr>
<td>
<hr />
</td>
</tr>
<tr>
<td>
<table width="1065" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="UyelikBilgilerimMenu"><a href="index.php?SK=50">Üyelik Bilgilerim</a></td>
<td> </td>
<td class="UyelikBilgilerimMenu"><a href="index.php?SK=58">Adresler</a></td>
<td> </td>
<td class="UyelikBilgilerimMenu"><a href="index.php?SK=59">Favoriler</a></td>
<td> </td>
<td class="UyelikBilgilerimMenu"><a href="index.php?SK=60">Yorumlar</a></td>
<td> </td>
<td class="UyelikBilgilerimMenu"><a href="index.php?SK=61">Siparişler</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
<tr>
<td width="1065" valign="top">
<table width="1065" align="center" border="0" cellspacing="0" cellpadding="0" style="margin-bottom: 20px; ">
<tr height="40">
<td colspan="4" style="color:#FF9900;">
<h3>Hesabım > Favoriler</h3>
</td>
</tr>
<tr height="40">
<td colspan="4" valign="top" style="border-bottom: 1px dashed #CCC">Favori ürünlerinize
buradan ulaşabilirsiniz.
</td>
</tr>
<tr height="50">
<td width="50">Resim</td>
<td width="865">Adı</td>
<td width="50">Fiyatı</td>
<td width="25">Sil</td>
</tr>
<?php
$favorilerSorgusu = $dbConnection->prepare("select * from favoriler where UyeId = ? order by id desc limit $sayfalamayaBaslanacakKayitSayisi, $sayfaBasinaGosterilecekKayitSayisi");
$favorilerSorgusu->execute([$kullaniciId]);
$favoriSayisi = $favorilerSorgusu->rowCount();
$favoriKayitlari = $favorilerSorgusu->fetchAll(PDO::FETCH_ASSOC);
if ($favoriSayisi > 0) {
foreach ($favoriKayitlari as $favoriSatirlar) {
$urunlerSorgusu = $dbConnection->prepare("select * from urunler where id = ? limit 1");
$urunlerSorgusu->execute([$favoriSatirlar['UrunId']]);
$urunKaydi = $urunlerSorgusu->fetch(PDO::FETCH_ASSOC);
$urununAdi = $urunKaydi["UrunAdi"];
$urununTuru = $urunKaydi["UrunTuru"];
$urununFiyati = $urunKaydi["UrunFiyati"];
$urununParaBirimi = $urunKaydi["ParaBirimi"];
$urununResmi = $urunKaydi["UrunResmiBir"];
if ($urununTuru == "Erkek Ayakkabısı") {
$resimKlasoruAdi = "Erkek";
} elseif ($urununTuru == "Kadın Ayakkabısı") {
$resimKlasoruAdi = "Kadin";
} else {
$resimKlasoruAdi = "Cocuk";
}
?>
<tr height="50">
<td width="75"><img height="60" src="Resimler/UrunResimleri/<?php echo donusumleriGeriDondur($resimKlasoruAdi); ?>/<?php echo donusumleriGeriDondur($urununResmi); ?>" />
</td>
<td width="800"><a href="index.php?SK=83&ID=<?php echo $urunKaydi["id"]; ?>"><?php echo donusumleriGeriDondur($urununAdi); ?></a></td>
<td width="100"><?php echo donusumleriGeriDondur(fiyatBicimlendir($urununFiyati)); ?> <?php echo donusumleriGeriDondur($urununParaBirimi); ?></td>
<td><a href="index.php?SK=80&ID=<?php echo $favoriSatirlar["id"]; ?>"><img src="Resimler/Sil20x20.png"></a></td>
</tr>
<?php
}
?>
<tr height="30">
<td colspan="4">
<hr />
</td>
</tr>
<?php
if ($bulunanSayfaSayisi > 1) {
?>
<tr>
<td colspan="4" align="left">
<div class="SayfalamaAlaniKapsayicisi">
<div class="SayfalamaAlaniIcinMetinAlaniKapsayicisi" align="center">
<p>Toplam <b><?php echo $bulunanSayfaSayisi; ?></b> sayfada,<b><?php echo $toplamKayitSayisi; ?></b> adet kayit bulunmaktadir.</p>
</div>
<div class="SayfalamaAlanıIcinNumaraAlaniKapsayicisi">
<?php
if ($sayfalama > 1) {
echo "<span class='SayfalamaPasif'> <a href='index.php?SK=59&SYF=1'> << </a></span>";
$safalamaIcinSayfaDegeriniBirGeriAL = $sayfalama - 1;
echo "<span class='SayfalamaPasif'><a href='index.php?SK=59&SYF=" .
$safalamaIcinSayfaDegeriniBirGeriAL . "'> < </a></span>";
}
for (
$sayfalamaIcinSayfaIndexDegeri = $sayfalama -
$sayfalamaIcinSolveSagButonSayisi;
$sayfalamaIcinSayfaIndexDegeri <= $sayfalama +
$sayfalamaIcinSolveSagButonSayisi;
$sayfalamaIcinSayfaIndexDegeri++
) {
if (($sayfalamaIcinSayfaIndexDegeri > 0) and ($sayfalamaIcinSayfaIndexDegeri <= $bulunanSayfaSayisi)
) {
if ($sayfalama == $sayfalamaIcinSayfaIndexDegeri) {
echo "<span class='SayfalamaAktif'>$sayfalamaIcinSayfaIndexDegeri</span>";
} else {
echo "<span class='SayfalamaPasif'><a href='index.php?SK=59&SYF=" .
$sayfalamaIcinSayfaIndexDegeri . "'>
$sayfalamaIcinSayfaIndexDegeri</a></span>";
}
}
}
if ($sayfalama != $bulunanSayfaSayisi) {
$sayfalamaIcinSayfaDegeriniBirIleriAl = $sayfalama + 1;
echo "<span class='SayfalamaPasif'><a href='index.php?SK=59&SYF=" .
$sayfalamaIcinSayfaDegeriniBirIleriAl . "'> > </a></span>";
echo "<span class='SayfalamaPasif'><a href='index.php?SK=59&SYF=" . $bulunanSayfaSayisi . "'> >> </a></span>";
}
?>
</div>
</div>
</td>
</tr>
<?php
}
} else { ?>
<tr>
<td colspan="4" align="left">Sisteme kayıtlı favori ürününüz bulunmamaktadır.</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<?php
} else {
header("Location:index.php");
exit();
}
?>