<?php echo !defined("GUVENLIK") ? die("Vaoww! Bu ne cesaret?") : null;?><?php
$ekipsettings = $db->prepare("select * from ekip_ayar where id='1'");
$ekipsettings->execute();
$ekipset = $ekipsettings->fetch(PDO::FETCH_ASSOC);
$ekiplimit = $ekipset["ekip_limit"];

$num = 1;
$ekip_listele = $db->prepare("select * from ekip where durum='1' and dil='$_SESSION[dil]' order by sira asc limit $ekiplimit");
$ekip_listele->execute();


?>

<style>
    .ekip-home-main-div{width:<?php if($ekipset[width]==1){?> 90%; <?php }else {?> 100% <?php }?> ; height: auto; overflow: hidden; background-color: #<?php echo $ekipset[back_color] ?>; padding: <?php echo $ekipset[padding] ?>px 0 <?php echo $ekipset[padding] ?>px 0; }


</style>
<section class="team-section pt-100 pb-70 ekip-home-main-div">
    <div class="container">
        <div class="section-head text-center">
            <h2 class="font-<?php echo $ekipset[font_weight] ?> font-spacing" style="color:#<?php echo $ekipset[baslik_color] ?>">
                <?php echo $diller['ekip']?></h2>
            <p style="color:#<?php echo $ekipset[spot_color] ?>; letter-spacing: 0.07em">
                <?php echo $diller['ekip-aciklamasi']?></p>
        </div>
        <?php if ($ekip_listele->rowCount() > 0 ) { ?>
            <div class="row">
                <?php foreach ($ekip_listele as $ekip) { ?>

                    <div class="col-lg-3 col-md-6 col-sm-6">
                        <div class="team-card">
                            <div class="team-img">
                                <img src="images/team/<?php echo $ekip[gorsel] ?>" alt="<?php echo $ekip[isim] ?>">
                                <?php
                                $ekipsosyalcount = $db->prepare("select * from ekip_sosyal where ekip_id='$ekip[id]' order by sira asc");
                                $ekipsosyalcount->execute();

                                if($ekipsosyalcount->rowCount() > 0) {
                                    ?>
                                    <div class="team-social">                           
                                        <?php
                                        $ekip_sosyal = $db->prepare("select * from ekip_sosyal where ekip_id='$ekip[id]' order by sira asc");
                                        $ekip_sosyal->execute();
                                        while($sos = $ekip_sosyal->fetch(PDO::FETCH_ASSOC)){ ?>
                                            <a href="<?php echo $sos[url] ?>" target="_blank"><i class="fa <?php echo $sos[icon] ?>" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="<?php echo $sos[baslik] ?>"></i></a>
                                        <?php } ?>
                                    </div>
                                <?php } ?>
                            </div>
                            <div class="team-text">
                                <h4><?php echo $ekip[isim] ?></h4>
                                <p><?php echo $ekip[pozisyon] ?></p>
                                <?php
                                if($ekip[mail] == !null || $ekip[tel] == !null) {
                                    ?>
                                    <div class="ekip-box-mail-phone">
                                        <?php if($ekip[mail] != null) {?>
                                            <p><?php echo $ekip[mail] ?></p>
                                        <?php }?>
                                        <?php if($ekip[tel] != null) {?>
                                            <p><?php echo $ekip[tel] ?></p>
                                        <?php }?>
                                    </div>
                                <?php }?>
                            </div>
                        </div>
                    </div> 
                <?php } ?>
            </div>
        <?php } ?>
    </div>
</section>