<?php echo !defined("GUVENLIK") ? die("Vaoww! Bu ne cesaret?") : null;?>
<?php
$page_header_setting = $db->prepare("select * from page_header where page_id='products_detail' order by id");
$page_header_setting->execute();
$pagehead = $page_header_setting->fetch(PDO::FETCH_ASSOC);
?>
<?php
$productsayar = $db->prepare("select * from urunmodul_ayar where id=:id");
$productsayar->execute(array(
        'id' => 1
));
$prodayar = $productsayar->fetch(PDO::FETCH_ASSOC);
?>
<?php
$id = $_GET['urun_id'];
$urunListele = $db->prepare("select * from urun where id=:id and durum=:durum and dil=:dil");
$urunListele->execute(array(
        'id' => $id,
        'durum' => 1,
        'dil' => $_SESSION['dil']
));
$urun = $urunListele->fetch(PDO::FETCH_ASSOC);
$etiketler = $urun['tags'];
$etiketler = explode(',', $etiketler);
?>
<?php
$product_kat_info = $db->prepare("select * from urun_cat where id=:id and durum=:durum and dil=:dil");
$product_kat_info->execute(array(
        'id' => $urun['kat_id'],
        'durum' => 1,
        'dil' => $_SESSION['dil']
));
$procat = $product_kat_info->fetch(PDO::FETCH_ASSOC);
?>
<?php
$product_ust_kat = $db->prepare("select * from urun_cat where id=:id and durum=:durum and dil=:dil");
$product_ust_kat->execute(array(
    'id' => $procat['ust_id'],
    'durum' => 1,
    'dil' => $_SESSION['dil']
));
$proustcat = $product_ust_kat->fetch(PDO::FETCH_ASSOC);
?>
<?php
$urun_galeri = $db->prepare("select * from urun_galeri where urun_id=:urun_id order by sira asc");
$urun_galeri->execute(array(
        'urun_id' => $urun['id']
));
?>
<?php
$varyantCek = $db->prepare("select * from varyant where urun_id=:urun_id order by sira asc");
$varyantCek->execute(array(
    'urun_id' => $urun['id']
));
$sayi = 1;
?>
<?php
if($urunListele->rowCount() == 0)
{
    header('Location:'.$siteurl.'');

    exit;

}
?>
<title><?php echo ucwords_tr($urun['baslik']) ?> | <?php echo $ayar[site_baslik]?></title>
<meta name="description" content="<?php echo"$urun[meta_desc]" ?>">
<meta name="keywords" content="<?php echo"$urun[tags]" ?>">
<meta name="news_keywords" content="<?php echo"$urun[tags]" ?>">
<meta name="author" content="<?php echo"$ayar[site_baslik]" ?>" />
<meta itemprop="author" content="<?php echo"$ayar[site_baslik]" ?>" />
<meta name="robots" content="index follow">
<meta name="googlebot" content="index follow">
<meta property="og:type" content="website" />

<?php include "includes/config/header_libs.php";?>

</head>
<body>
<?php include 'includes/template/pre-loader.php'?>
<?php include 'includes/template/header.php'?>


<!-- Page Header ====================== !-->
<style>
    .page-headers-main{width:<?php if($pagehead[width]==1){?> 90%; <?php }else {?> 100% <?php }?> ;  padding:<?php echo $pagehead[padding] ?>px 0 <?php echo $pagehead[padding] ?>px 0 ; border:1px solid #<?php echo $pagehead[border_color] ?>;

    <?php if($pagehead[shadow] == 1 ) {?>

        -webkit-box-shadow: inset 0px 5px 10px -7px rgba(0,0,0,0.1);
        -moz-box-shadow: inset 0px 5px 10px -7px rgba(0,0,0,0.1);
        box-shadow: inset 0px 5px 10px -7px rgba(0,0,0,0.1);

    <?php } ?>

    <?php if($pagehead[tip] == 0 ) {?>

        background:#<?php echo $pagehead[bg_color] ?> ;

    <?php } ?>

    <?php if($pagehead[tip] == 1 ) {?>

        background:url(images/uploads/<?php echo $pagehead[bg_image] ?>) ;

        box-shadow: inset 5000px 0 0 0 rgba(0, 0, 0, 0.7); border-color: rgba(0, 0, 0, 1);

    <?php } ?>

    }
    .product-detail-header-right-social a{
        width: 50px;
        height: 50px;
        justify-content: center;
        -ms-align-items: center;
        align-items: center;
        display: -webkit-inline-flex;
        display: -moz-inline-flex;
        display: -ms-inline-flex;
        display: -o-inline-flex;
        display: inline-flex;
        background: whitesmoke;
        border: 1px solid #00000010;
        border-radius: 10px;
    }
</style>
<style>
    .quantity button{width: auto; height: 42px; outline: none; margin-left: 10px; color:#<?=$odemeayar[button_text_color]?>; font-family: 'Open Sans',Arial; font-size:15px; font-weight: bold; padding: 0 30px 0 30px; border: 0; background: #<?=$odemeayar[button_bg]?>}
</style>
<div class="page-headers-main page-headers-main about-title about-title-bg">
    <div class="d-table">
        <div class="d-table-cell">
            <div class="container">
                <div class="about-title-text">
                    <h2 style="color:#<?php echo $pagehead[text_color] ?>">
                        <?php echo ucwords_tr($urun['baslik']) ?>
                    </h2>
                    <span style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"><?php echo $diller['buradasiniz'] ?>:</span>
                    <ul>
                        <li>
                            <a href="index.html" style="color:#<?php echo $pagehead[text_color] ?> !important;"><span style="padding-right: 15px; font-weight: 600;color:#<?php echo $pagehead[text_color] ?> !important;"><?php echo $diller['anasayfa'] ?></span></a>
                        </li>
                        <li>
                            <i class="icofont-rounded-double-right" style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"></i>
                            <a href="urunler" style="color:#<?php echo $pagehead[text_color] ?>;"><span style="padding-right: 15px;  font-weight: 600"><?php echo ucwords_tr($diller['urunlerimiz']) ?></span></a>
                        </li>
                        <?php if($proustcat[id] == !0) {?>
                            <li>
                                <i class="icofont-rounded-double-right" style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"></i>
                                <a href="urun-kategori/<?=$proustcat[id]?>/<?=seo($proustcat[baslik])?>" style="color:#<?php echo $pagehead[text_color] ?>;"><span style="padding-right: 15px; font-weight: 600"><?php echo ucwords_tr($proustcat['baslik']) ?></span></a>
                            </li>
                        <?php }?>
                        <?php if($proustcat[id] == !0) {?>
                             <li>
                                <i class="icofont-rounded-double-right" style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"></i>
                                <a href="urun-kategori/<?=$procat[id]?>/<?=seo($procat[baslik])?>" style="color:#<?php echo $pagehead[text_color] ?>;"><span style="padding-right: 15px; "><?php echo ucwords_tr($procat['baslik']) ?></span></a>
                            </li>
                        <?php }?>
                        <?php if($proustcat[id] == 0) {?>
                            <i class="icofont-rounded-double-right" style="color:#<?php echo $pagehead[pasif_text_color] ?>; padding-right: 15px;"></i>
                            <a href="urun-kategori/<?=$procat[id]?>/<?=seo($procat[baslik])?>" style="color:#<?php echo $pagehead[text_color] ?>;"><span style="padding-right: 15px;"><?php echo ucwords_tr($procat['baslik']) ?></span></a>
                        <?php }?>

                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="service-details-area main-service-area pt-100 services-details-page">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="service-details-post">
                    <h3>
                        <?=$urun[baslik]?>
                    </h3>
                    <p>
                    <?=$urun['spot']?>
                    </p>
                    <div class="product-slider owl-carousel owl-theme">
                        <a data-fancybox href="images/product/<?=$urun[gorsel]?>"><img src="images/product/<?=$urun[gorsel]?>" ></a>
                        <?php foreach ($urun_galeri as $galeri) { ?> 
                            <a data-fancybox href="images/product/<?=$galeri[gorsel]?>"><img src="images/product/<?=$galeri[gorsel]?>" ></a>
                        <?php } ?>
                    </div>
                    <p>
                        <strong><?=$diller['kategori']?></strong> :
                        <?php if($proustcat[id] == !0) {?>
                            <a href="urun-kategori/<?=$proustcat[id]?>/<?=seo($proustcat[baslik])?>" style="color:#000;"><?php echo ucwords_tr($proustcat['baslik']) ?></a>
                        <?php }?>

                        <?php if($proustcat[id] == !0) {?>
                            <i class="fa fa-caret-right" style="margin: 0 5px 0 5px;"></i>
                            <a href="urun-kategori/<?=$procat[id]?>/<?=seo($procat[baslik])?>" style="color:#000;"><?php echo ucwords_tr($procat['baslik']) ?></a>
                        <?php }?>

                        <?php if($proustcat[id] == 0) {?>
                            <a href="urun-kategori/<?=$procat[id]?>/<?=seo($procat[baslik])?>" style="color:#000;"><?php echo ucwords_tr($procat['baslik']) ?></a>
                        <?php }?>
                    </p>
                    <p>
                        
                        <strong><?=$diller['etiketler']?></strong> :
                        <?php
                        foreach( $etiketler as $anahtar => $deger ){ ?>
                            <a alt="<?=$deger?>" title="<?=$deger?>"><div class="product-detail-etiket-box"><?=$deger?></div></a>
                        <?php } ?>
                    </p>
                    <div class="product-detail-header-right-social pb-3">

                        <a style="background: #3b5998;color:white;" href="https://www.facebook.com/sharer.php?u=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>" onclick="window.open('https://www.facebook.com/sharer.php?u=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>','popup','width=900,height=450');" target="popup" ><i aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="<?=$diller['paylas']?>" class="fa fa-facebook"></i></a>

                        <a style="background: #00acee;color:white;" href="https://twitter.com/intent/tweet?url=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>"  onclick="window.open('https://twitter.com/intent/tweet?url=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>','popup','width=900,height=450');" target="popup" ><i class="fa fa-twitter" data-toggle="tooltip" data-placement="bottom" title="<?=$diller['paylas']?>"></i></a>

                        <a style="background: #0e76a8;color:white;" href="http://www.linkedin.com/shareArticle?mini=true&url=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>"  onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>','popup','width=900,height=450');" target="popup"  ><i class="fa fa-linkedin" data-toggle="tooltip" data-placement="bottom" title="<?=$diller['paylas']?>"></i></a>

                        <a style="background: #c8232c;color:white;" href="https://www.pinterest.com/pin/create/button/?url=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>&media=<?=$ayar['site_url']?>images/product/<?=$urun[gorsel]?>&description=<?=$urun[baslik]?>" onclick="window.open('https://www.pinterest.com/pin/create/button/?url=<?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>&media=<?=$ayar['site_url']?>images/product/<?=$urun[gorsel]?>&description=<?=$urun[baslik]?>','popup','width=900,height=450');" target="popup" ><i class="fa fa-pinterest-p" data-toggle="tooltip" data-placement="bottom" title="<?=$diller['paylas']?>"></i></a>

                        <a style="background: #25d366;color:white;" href="https://api.whatsapp.com/send?text=<?=$urun[baslik]?> <?=$ayar['site_url']?>urun/<?=$urun[id]?>/<?=seo($urun[baslik])?>" target="_blank"><i class="fa fa-whatsapp" data-toggle="tooltip" data-placement="bottom" title="<?=$diller['paylas']?>"></i></a>

                    </div>
                    <div id="info" class="products_tabs_contents" >

                        <?php
                        $icerik  = $urun['icerik'];
                        $eski   = "../images";
                        $yeni   = "images";
                        $icerik = str_replace($eski, $yeni, $icerik);
                        ?>
                        <?=$icerik?>

                    </div>

                    <div id="map" class="products_tabs_contents" >

                        <?php
                        $ek_bilgi  = $urun['ek_bilgi'];
                        $eski   = "../images";
                        $yeni   = "images";
                        $ek_bilgi = str_replace($eski, $yeni, $ek_bilgi);
                        ?>
                        <?=$ek_bilgi?>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php include 'includes/template/footer.php'?>
</body>
</html>
<?php include "includes/config/footer_libs.php";?>

