<main>
	<div id="carousel-home">
		<div class="owl-carousel owl-theme">
			<?php 
			$banner=$VT->VeriGetir("banner","WHERE durum=?",array(1),"ORDER BY sirano ASC");
			if($banner!=false)
			{
				for ($i=0; $i <count($banner) ; $i++) 
				{ 
					?>
					<div class="owl-slide cover" style="background-image: url(<?=SITE?>images/banner/<?=$banner[$i]["resim"]?>);" width="100%" height="550">
						<div class="opacity-mask d-flex align-items-center" data-opacity-mask="rgba(0, 0, 0, 0.0)">
							<div class="container">
								<div class="row justify-content-center justify-content-md-start">
									<div class="col-lg-6 static">
										<div class="slide-text text width">
											<h2 class="owl-slide-animated owl-slide-title" style="text-transform: none;">
												<?=stripslashes($banner[$i]["baslik"])?></h2>
												<p class="owl-slide-animated owl-slide-subtitle">
													<?=stripslashes($banner[$i]["aciklama"])?>
												</p> 
												<?php  
												if(!empty($banner[$i]["url"])) 
												{
													?>
													<div class="owl-slide-animated owl-slide-cta">
														<a class="btn_1" href="<?=$banner[$i]["url"]?>" role="button"> Alışverişe Başla</a>
													</div>
													<?php
												}
												?> 
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>

						<!--/owl-slide-->
						<?php
					}
				}
				?>
			</div>
			<div id="icon_drag_mobile"></div>
		</div>
		<!--/carousel-->
		<?php include_once(SAYFA."alt.php"); ?>
		<ul id="banners_grid" class="clearfix">
			<?php
			$secilenkategoriler=$VT->VeriGetir("kategoriler","WHERE durum=? AND tablo=?",array(1,"urunler"),"ORDER BY RAND() ASC",3);
			if ($secilenkategoriler!=false) 
			{
				for ($i=0; $i <count($secilenkategoriler) ; $i++) 
				{ 
					?>
					<?php
				}
			}
			?>
		</ul>
		<!--/banners_grid -->

		<div class="container margin_60_35">
			<div class="main_title">
				<h2>Vitrin Ürünlerimiz</h2>
				<p>Vitrin ürünleri özel fiyatlarla sizleri bekliyor.</p>
			</div>
			<div class="owl-carousel owl-theme products_carousel">
				<?php
				$urunler=$VT->VeriGetir("urunler","WHERE durum=? AND vitrindurum=?",array(1,1),"ORDER BY sirano ASC");
				if ($urunler!=false)
				{
					for ($i=0; $i <count($urunler) ; $i++) { 

						?>
						<div class="item">
							<div class="grid_item">
								<!--<span class="ribbon new">YENİ</span>--> 
								<figure>
									<a href="<?=SITE?>urun/<?=$urunler[$i]["seflink"]?>">
										<img class="owl-lazy" src="<?=SITE?>images/urunler/<?=$urunler[$i]["resim"]?>" data-src="<?=SITE?>images/urunler/<?=$urunler[$i]["resim"]?>" alt="<?=stripslashes($urunler[$i]["baslik"])?>">
									</a>
								</figure>

								<a href="<?=SITE?>urun/<?=$urunler[$i]["seflink"]?>">
									<h3><?=stripslashes($urunler[$i]["baslik"])?></h3>
								</a>
								<div class="price_box">
									<?php 
									if (!empty($urunler[$i]["indirimlifiyat"])) 
									{
										$fiyat=$urunler[$i]["indirimlifiyat"].".".$urunler[$i]["indirimlikurus"];
									}
									else
									{
										$fiyat=$urunler[$i]["fiyat"].".".$urunler[$i]["kurus"];
									}
									if ($urunler[$i]["kdvdurum"]==1) 
									{
										if ($urunler[$i]["kdvoran"]>9) 
										{
											$oran="1.".$urunler[$i]["kdvoran"]; 
										}
										else
										{
											$oran="1.0".$urunler[$i]["kdvoran"]; 
										} 
										$fiyat=($fiyat/$oran); /*KDVsiz Hali*/
									}
									?>
									<span class="new_price">₺ <?=number_format($fiyat,2,",",".")?></span>
								</div>
								<ul>
									<li>
										<a onclick="favoriyeEkle('<?=SITE?>','<?=$urunler[$i]["ID"]?>','<?=md5(sha1($urunler[$i]["ID"]))?>');" class="tooltip-1" data-toggle="tooltip" data-placement="left" title="Favorilere Ekle"><i class="ti-heart"></i><span>Favorilere Ekle</span>
										</a>
									</li> 
								</ul>
							</div>
							<!-- /grid_item -->
						</div>
						<!-- /item --> 
						<?php
					}
				} 
				?> 
			</div>
			<!-- /products_carousel -->
		</div> 
		<div class="container margin_60_35">
			<div class="main_title">
				<h2>Sizin İçin Seçtiklerimiz</h2> 
				<p>sizler için hazırladığımız fırsatları kaçırmayın.</p>
			</div>
			<div class="row small-gutters">
				<?php
				$urunler=$VT->VeriGetir("urunler","WHERE durum=?",array(1),"ORDER BY RAND() ASC",8);
				if ($urunler!=false)
				{
					for ($i=0; $i <count($urunler) ; $i++) 
					{ 

						?>
						<div class="col-6 col-md-4 col-xl-3">
							<div class="grid_item">
								<figure>
									<?php 
									if (!empty($urunler[$i]["indirimlifiyat"])) 
									{
										$indirimlifiyat=$urunler[$i]["indirimlifiyat"].".".$urunler[$i]["indirimlikurus"];
										$normalfiyat=$urunler[$i]["fiyat"].".".$urunler[$i]["kurus"];
										$hesapla=(($indirimlifiyat/$normalfiyat)*100);
										$indirimorani=round(100-$hesapla);

										?>
										<span class="ribbon off">% <?=$indirimorani?> İndirimli</span>
										<?php
									}
									?>
									<a href="<?=SITE?>urun/<?=$urunler[$i]["seflink"]?>">
										<img class="owl-lazy" src="<?=SITE?>images/urunler/<?=$urunler[$i]["resim"]?>" data-src="<?=SITE?>images/urunler/<?=$urunler[$i]["resim"]?>" width="100%" alt="<?=stripslashes($urunler[$i]["baslik"])?>"> 
									</a>

								</figure>

								<a href="<?=SITE?>urun/<?=$urunler[$i]["seflink"]?>">
									<h3><?=stripslashes($urunler[$i]["baslik"])?></h3>
								</a>
								<div class="price_box">
									<?php 
									if (!empty($urunler[$i]["indirimlifiyat"])) 
									{
										$fiyat=$urunler[$i]["indirimlifiyat"].".".$urunler[$i]["indirimlikurus"];
										$normalfiyat=$urunler[$i]["fiyat"].".".$urunler[$i]["kurus"];
										
										if ($urunler[$i]["kdvdurum"]==1) 
										{
											if ($urunler[$i]["kdvoran"]>9) 
											{
												$oran="1.".$urunler[$i]["kdvoran"]; 
											}
											else
											{
												$oran="1.0".$urunler[$i]["kdvoran"]; 
											} 
											$fiyat=($fiyat/$oran); /*KDVsiz Hali*/
											$normalfiyat=($normalfiyat/$oran);

										} 
										?>
										<span class="new_price"><?=number_format($fiyat,2,",",".")?> ₺</span>
										<span class="old_price"><?=number_format($normalfiyat,2,",",".")?> ₺</span>

										<?php
									}
									else
									{
										$fiyat=$urunler[$i]["fiyat"].".".$urunler[$i]["kurus"];

										if ($urunler[$i]["kdvdurum"]==1) 
										{
											if ($urunler[$i]["kdvoran"]>9) 
											{
												$oran="1.".$urunler[$i]["kdvoran"]; 
											}
											else
											{
												$oran="1.0".$urunler[$i]["kdvoran"]; 
											} 
											$fiyat=($fiyat/$oran); /*KDVsiz Hali*/ 

										} 

										?>
										<span class="new_price">₺<?=number_format($fiyat,2,",",".")?></span>
										<?php
									}
									?>

								</div>
								<ul>
									<li><a onclick="favoriyeEkle('<?=SITE?>','<?=$urunler[$i]["ID"]?>','<?=md5(sha1($urunler[$i]["ID"]))?>');" class="tooltip-1" data-toggle="tooltip" data-placement="left" title="Favorilere Ekle"><i class="ti-heart"></i><span>Favorilere Ekle</span>
									</a>
								</li> 
							</ul>
						</div>
						<!-- /grid_item -->
					</div>
					<?php

				}
			}
			?> 
			<!-- /col -->
		</div>
		<!-- /row -->
	</div>
	<!-- /container -->

	<!-- /bg_gray -->
	<div class="bg_gray">
		<div class="container margin_60_35">
			<div class="main_title">
				<h2>Bloglar</h2> 
				<p>Merak Ettiğiniz Neler Mi Var?</p>
			</div>
			<div class="row">

				<?php 
				$bloglar=$VT->VeriGetir("bloglar","WHERE durum=?",array(1),"ORDER BY ID DESC",4);
				if ($bloglar!=false)
				{
					for ($i=0; $i <count($bloglar) ; $i++) { 

						if(!empty($bloglar[$i]["resim"])) 
						{
							$resim=$bloglar[$i]["resim"];
						}
						else
						{
							$resim="varsayilan";
						}

						?>
						<div class="col-lg-6">
							<a class="box_news" href="<?=SITE?>blog-detay/<?=$bloglar[$i]["seflink"]?>">
								<figure>
									<img src="<?=SITE?>images/bloglar/<?=$resim?>" data-src="<?=SITE?>images/bloglar/<?=$resim?>" alt="<?=stripslashes($bloglar[$i]["baslik"])?>" width="400" height="266" class="lazy">
								</figure>
								<ul> 
									<li><?=date("d.m.y", strtotime($bloglar[$i]["tarih"]))?></li>
								</ul>
								<h4><?=stripslashes($bloglar[$i]["baslik"])?></h4>
								<p><?=mb_substr(strip_tags(stripslashes($bloglar[$i]["metin"])),0,160,"UTF-8")?>...</p>
							</a>
						</div>
						<!-- /box_news --> 
						<?php
					}
				}
				?>

				<!-- /box_news -->
			</div>
			<!-- /row -->
		</div>
	</div>
	<!-- /container -->
	<div class="feat">
		<div class="container">
			<ul>
				<li>
					<div class="box">
						<i class="ti-gift"></i>
						<div class="justify-content-center">
							<h3>Ücretsiz kargo</h3>
							<p>100 TL ve üzeri alışverişlerde geçerli</p>
						</div>
					</div>
				</li>
				<li>
					<div class="box">
						<i class="ti-wallet"></i>
						<div class="justify-content-center">
							<h3>Güvenli ödeme</h3>
							<p>%100 güvenli ödeme hizmeti</p>
						</div>
					</div>
				</li>
				<li>
					<div class="box">
						<i class="ti-headphone-alt"></i>
						<div class="justify-content-center">
							<h3>7/24 Canlı Destek</h3>
							<p>Çevrimiçi en iyi canlı destek</p>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</div>
	<!--/feat-->
</main>
<!-- /main -->
