<?php echo !defined("GUVENLIK") ? die("Erisim Engellendi!.") : null;?>
<?php 
$page = @intval($_GET['s']);
if(!$page) $page = 1;
$ttsorgu = $db->prepare("SELECT COUNT(*) FROM ekibimiz WHERE durum = ? AND dil = ?");
$ttsorgu->execute(array("1",$_SESSION['k_dil']));
$total = $ttsorgu->fetchColumn();
$limit= $limitayar['limit_sayfaekibimiz'];
$page_count = ceil($total/$limit);
if($page > $page_count) $page = 1;
$show = $page * $limit - $limit;
$BSorgu = $db->prepare("SELECT * FROM ekibimiz WHERE durum = ? AND dil = ? ORDER BY sira ASC LIMIT $show,$limit");
$BSorgu->execute(array("1",$_SESSION['k_dil']));
$Bislem = $BSorgu->fetchALL(PDO::FETCH_ASSOC);
$menubul 	= $db->query("SELECT * FROM menu WHERE menu_url = '".$htc['ekiburl']."' OR link = '".$htc['ekiburl']."' AND dil = '{$_SESSION['k_dil']}'")->fetch(PDO::FETCH_ASSOC);
$menubas 	= $db->query("SELECT * FROM menu WHERE id = '{$menubul['menu_ust']}' AND dil = '{$_SESSION['k_dil']}'")->fetch(PDO::FETCH_ASSOC);	
?>
<!-- Start main-content -->
<div class="main-content">

    <!-- Section: inner-header -->
    <section class="inner-header bg-lighter">
		<div class="container pt-10 pb-10">
			<!-- Section Content -->
			<div class="section-content">
				<div class="row d-ortala">
					<div class="col-md-11">
						<h3 class="font-30 mb-0 mt-10"><?=@$dil['txt87'];?></h3>
						<ol class="breadcrumb text-black mt-0 mb-10">
							<li><a href="<?php echo $htc['anaurl'];?><?php echo $html;?>"><?=@$dil['txt56'];?></a></li>
							<?php if($menubas['menu_isim'] != ""){?>
							<li><a href="<?php echo($menubas['menu_url'] == "0" ? $menubas['link'] : $menubas['menu_url'].$html);?>"><?php echo ilkbuyuk($menubas['menu_isim']);?></a></li>
							<?php }?>
							<li class="active text-theme-colored"><?=@$dil['txt87'];?></li>
						</ol>
					</div>
					<div class="col-md-1">
						<a href="javascript:history.back();" class="sayfa-geri"><span class="icon"><i class="fas fa-arrow-left"></i></span><?=@$dil['txt57'];?></a>
					</div>
				</div>
			</div>
		</div>
	</section>

    <!-- Section: Team -->
    <section id="team">
        <div class="container pt-50 pb-50">
			<?php if($BSorgu->rowCount() != "0"){?>
            <div class="row mtli-row-clearfix">
				<?php foreach ( $Bislem as $BSonuc ){?>
                <div class="col-xs-12 col-lg-<?php echo $limitayar['limit_ekip'];?> col-md-<?php echo $limitayar['limit_ekip'];?> sm-text-center mb-30 mb-sm-30">
                    <div class="team-members maxwidth400">
						<div class="team-thumb">
							<img class="img-fullwidth" alt="<?php echo $BSonuc['adi']; ?>" src="<?php echo tema;?>/uploads/ekibimiz/<?php echo $BSonuc['resim']; ?>">
						</div>
						<div class="team-bottom-part border-bottom-theme-color-2-2px bg-lighter border-1px text-center p-10 pt-20 pb-10">
							<h4 class="font-raleway font-weight-600 m-0">
								<a <?php if($BSonuc['detay'] == 1){?>class="text-theme-color-2" href="<?php echo $htc['ekibdetayurl']; ?>/<?php echo $BSonuc['seo']; ?><?php echo $html;?>" <?php }else{?> class="text-theme-color-2 image-popup-vertical-fit" href="<?php echo tema;?>/uploads/ekibimiz/<?php echo $BSonuc['resim']; ?>"  <?php }?>>
									<?php echo $BSonuc['adi']; ?>
								</a>
							</h4>
							<h5 class="text-theme-color"><?php echo $BSonuc['gorev']; ?></h5>
							<ul class="styled-icons icon-sm icon-dark icon-theme-colored">
								<?php if($BSonuc['facebook']){?><li><a target="_blank" href="<?php echo $BSonuc['facebook']; ?>" class="fab fa-facebook-f" title="facebook"></a></li><?php }?>
								<?php if($BSonuc['twitter']){?><li><a href="<?php echo $BSonuc['twitter']; ?>" class="fab fa-telegram-plane" title="telegram"></a></li><?php }?>
								<?php if($BSonuc['instagram']){?><li><a href="<?php echo $BSonuc['instagram']; ?>" class="fab fa-instagram" title="instagram"></a></li><?php }?>
								<?php if($BSonuc['linkedin']){?><li><a href="<?php echo $BSonuc['linkedin']; ?>" class="fab fa-linkedin" title="linkedin"></a></li><?php }?>
								<?php if($BSonuc['youtube']){?><li><a href="<?php echo $BSonuc['youtube']; ?>" class="fab fa-youtube" title="youtube"></a></li><?php }?>
							</ul>
						</div>
					</div>
                </div>
				<?php }?>
            </div>
			<?php }else{?>
			<div class="alert alert-warning text-left " style="width:100%;" role="alert">
				<p><strong><?=@$dil['txt59'];?></strong></p>
				<?=@$dil['txt60'];?></br>
				<?=@$dil['txt61'];?>
			</div>
			<?php }?>
			
			<div class="row">
                <div class="col-sm-12">
					<p><?php echo $total;?> <?=@$dil['txt62'];?>  <?php echo $page;?> - <?php echo $limitayar['limit_sayfaekibimiz'];?> <?=@$dil['txt63'];?></p>
                    <nav>
                        <ul class="pagination theme-colored xs-pull-center m-0">
						<?php
						if($limitayar['limit_sayfaekibimiz'] < $total && $limitayar['limit_sayfaekibimiz'] > 0){
						$showing = 3;
						if($page > 1){?>
						<?php $previous = $page - 1;?>
						<li><a href="<?php echo $htc['ekiburl'];?>/<?php echo $previous;?><?php echo $html;?>" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li>
						<?php }
						for($i= $page - $showing; $i < $page + $showing + 1; $i++){
						if($i > 0 and $i <= $page_count){
						if($i == $page){?>
						<li class="active"><a href="javascript:void(0);"><?php echo $i; ?></a></li>
						<?php }else{?>
						<li><a href="<?php echo $htc['ekiburl'];?>/<?php echo $i; ?><?php echo $html;?>"><?php echo $i; ?></a></li>
						<?php }
						}
						}
						if($page != $page_count){?>
						<?php  $next = $page +1;?>
						<li> <a href="<?php echo $htc['ekiburl'];?>/<?php echo $next; ?><?php echo $html;?>" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li>
						<?php }} ?>	
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </section>

</div>
<!-- end main-content -->