-
Notifications
You must be signed in to change notification settings - Fork 0
/
hesabimsiparisler.php
157 lines (148 loc) · 8.02 KB
/
hesabimsiparisler.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
<?php
if(isset($_SESSION["Kullanici"])){
$SayfalamaIcinSolVeSagButonSayisi = 2;
$SayfaBasinaGosterilecekKayitSayisi = 10;
$ToplamKayitSayisiSorgusu = $VeritabaniBaglantisi->prepare("SELECT DISTINCT SiparisNumarasi FROM siparisler WHERE UyeId = ? ORDER BY SiparisNumarasi DESC");
$ToplamKayitSayisiSorgusu->execute([$KullaniciID]);
$ToplamKayitSayisiSorgusu = $ToplamKayitSayisiSorgusu->rowCount();
$SayfalamayaBaslanacakKayitSayisi = ($Sayfalama*$SayfaBasinaGosterilecekKayitSayisi)-$SayfaBasinaGosterilecekKayitSayisi;
$BulunanSayfaSayisi = ceil($ToplamKayitSayisiSorgusu/$SayfaBasinaGosterilecekKayitSayisi);
?>
<table width="1065" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><hr /></td>
</tr>
<tr>
<td><table width="1065" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="203" style="border: 1px solid black; text-align: center; padding: 10px 0; font-weight: bold;"><a href="index.php?SK=50" style="text-decoration: none; color: black;">Üyelik Bilgileri</a></td>
<td width="10"> </td>
<td width="203" style="border: 1px solid black; text-align: center; padding: 10px 0; font-weight: bold;"><a href="index.php?SK=58" style="text-decoration: none; color: black;">Adresler</a></td>
<td width="10"> </td>
<td width="203" style="border: 1px solid black; text-align: center; padding: 10px 0; font-weight: bold;"><a href="index.php?SK=59" style="text-decoration: none; color: black;">Favoriler</a></td>
<td width="10"> </td>
<td width="203" style="border: 1px solid black; text-align: center; padding: 10px 0; font-weight: bold;"><a href="index.php?SK=60" style="text-decoration: none; color: black;">Yorumlar</a></td>
<td width="10"> </td>
<td width="203" style="border: 1px solid black; text-align: center; padding: 10px 0; font-weight: bold;"><a href="index.php?SK=61" style="text-decoration: none; color: black;">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" cellpadding="0" cellspacing="0">
<tr height="40">
<td colspan="8" style="color:#FF9900"><h3>Hesabım > Siparişler</h3></td>
</tr>
<tr height="30">
<td colspan="8" valign="top" style="border-bottom: 1px dashed #CCCCCC;">Tüm Siparişlerinizi Bu Alandan Görüntüleyebilirsiniz.</td>
</tr>
<tr height="50">
<td width="125" style="background: #f8ffa7; color: black;" align="left"> Sipariş Numarası</td>
<td width="75" style="background: #f8ffa7; color: black;" align="left">Resim</td>
<td width="50" style="background: #f8ffa7; color: black;" align="left">Yorum</td>
<td width="415" style="background: #f8ffa7; color: black;" align="left">Adı</td>
<td width="100" style="background: #f8ffa7; color: black;" align="left">Fiyatı</td>
<td width="50" style="background: #f8ffa7; color: black;" align="left">Adet</td>
<td width="100" style="background: #f8ffa7; color: black;" align="left">Toplam Fiyat</td>
<td width="150" style="background: #f8ffa7; color: black;" align="left">Kargo Durumu / Takip</td>
</tr>
<?php
$SiparisNumaralariSorgusu = $VeritabaniBaglantisi->prepare("SELECT DISTINCT SiparisNumarasi FROM siparisler WHERE UyeId = ? ORDER BY SiparisNumarasi DESC LIMIT $SayfalamayaBaslanacakKayitSayisi, $SayfaBasinaGosterilecekKayitSayisi");
$SiparisNumaralariSorgusu->execute([$KullaniciID]);
$SiparisNumaralariSayisi = $SiparisNumaralariSorgusu->rowCount();
$SiparisNumaralariKayitlari = $SiparisNumaralariSorgusu->fetchAll(PDO::FETCH_ASSOC);
if($SiparisNumaralariSayisi>0){
foreach($SiparisNumaralariKayitlari as $SiparisNumaralariSatirlar){
$SiparisNo = DonusumleriGeriDondur($SiparisNumaralariSatirlar["SiparisNumarasi"]);
$SiparisSorgusu = $VeritabaniBaglantisi->prepare("SELECT * FROM siparisler WHERE UyeId = ? AND SiparisNumarasi = ? ORDER BY id ASC");
$SiparisSorgusu->execute([$KullaniciID, $SiparisNo]);
$SiparisSorgusuKayitlari = $SiparisSorgusu->fetchAll(PDO::FETCH_ASSOC);
foreach($SiparisSorgusuKayitlari as $SiparisSatirlar){
$UrunTuru = DonusumleriGeriDondur($SiparisSatirlar["UrunTuru"]);
if($UrunTuru == "Erkek Ayakkabısı"){
$ResimKlasoruAdi = "Erkek";
}elseif($UrunTuru == "Kadın Ayakkabısı"){
$ResimKlasoruAdi = "Kadin";
}else{
$ResimKlasoruAdi = "Cocuk";
}
$KargoDurumu = DonusumleriGeriDondur($SiparisSatirlar["KargoDurumu"]);
if($KargoDurumu == 0){
$KargoDurumuYazdir = "Beklemede";
}else{
$KargoDurumuYazdir = DonusumleriGeriDondur($SiparisSatirlar["KargoGonderiKodu"]);
}
?>
<tr height="30">
<td width="125" align="left"> #<?php echo DonusumleriGeriDondur($SiparisSatirlar["SiparisNumarasi"]); ?></td>
<td width="75" align="left"><img src="Resimler/UrunResimleri/<?php echo $ResimKlasoruAdi; ?>/<?php echo DonusumleriGeriDondur($SiparisSatirlar["UrunResmiBir"]); ?>" border="0" width="60" height="80"></td>
<td width="50" align="left"><a href="index.php?SK=75&UrunID=<?php echo DonusumleriGeriDondur($SiparisSatirlar["UrunId"]); ?>"><img src="Resimler/DokumanKirmiziKalemli20x20.png" border="0"></a></td>
<td width="415" align="left"><?php echo DonusumleriGeriDondur($SiparisSatirlar["UrunAdi"]); ?></td>
<td width="100" align="left"><?php echo FiyatBicimlendir(DonusumleriGeriDondur($SiparisSatirlar["UrunFiyati"])); ?> TL</td>
<td width="50" align="left"><?php echo DonusumleriGeriDondur($SiparisSatirlar["UrunAdedi"]); ?></td>
<td width="100" align="left"><?php echo FiyatBicimlendir(DonusumleriGeriDondur($SiparisSatirlar["ToplamUrunFiyati"])); ?> TL</td>
<td width="150" align="left"><?php echo $KargoDurumuYazdir; ?></td>
</tr>
<?php
}
?>
<tr height="30">
<td colspan="8"><hr /></td>
</tr>
<?php
}
if($BulunanSayfaSayisi>1){
?>
<tr height="50">
<td colspan="8" align="center"><div class="SayfalamaAlaniKapsayicisi">
<div class="SayfalamaAlaniIciMetinAlaniKapsayicisi">
Toplam <?php echo $BulunanSayfaSayisi; ?> sayfada, <?php echo $ToplamKayitSayisiSorgusu; ?> adet kayıt bulunmaktadır.
</div>
<div class="SayfalamaAlaniIciNumaraAlaniKapsayicisi">
<?php
if($Sayfalama>1){
echo "<span class='SayfalamaPasif'><a href='index.php?SK=61&SYF=1'><<</a></span>";
$SayfalamaIcinSayfaDegeriniBirGeriAl = $Sayfalama-1;
echo "<span class='SayfalamaPasif'><a href='index.php?SK=61&SYF=" . $SayfalamaIcinSayfaDegeriniBirGeriAl . "'><</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=61&SYF=" . $SayfalamaIcinSayfaIndexDegeri . "'> " . $SayfalamaIcinSayfaIndexDegeri . "</a></span>";
}
}
}
if($Sayfalama!=$BulunanSayfaSayisi){
$SayfalamaIcinSayfaDegeriniBirIleriAl = $Sayfalama+1;
echo "<span class='SayfalamaPasif'><a href='index.php?SK=61&SYF=" . $SayfalamaIcinSayfaDegeriniBirIleriAl . "'>></a></span>";
echo "<span class='SayfalamaPasif'><a href='index.php?SK=61&SYF=" . $BulunanSayfaSayisi . "'>>></a></span>";
}
?>
</div>
</div></td>
</tr>
<?php
}
}else{
?>
<tr height="50">
<td colspan="8" align="left">Sisteme Kayıtlı Siparişiniz Bulunmamaktadır.</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<?php
}else{
header("Location:index.php");
exit();
}
?>