<?php
include ("ust.php");
session_start(); ## -> Oturum Başlatıldı
$giris_kontrol = $_SESSION['kullanici_id']; if(empty($giris_kontrol)){echo '<meta http-equiv="refresh" content="0;URL=index.php">';}else{
?>
       

            <div class="container-fluid">
            <?php // Bakım modu aktif ise tüm sayfalarda bakım uyarısı verir.
			if($geayar_bakim == "evet"){include("moduller/bakim-modul.php");} 
			$genel_getir=mysql_query("SELECT * FROM genelayarlar WHERE id='1'"); 
			$getir=mysql_fetch_array($genel_getir); 
			$geayar_guncelleme = $getir['geayar_guncelleme'];
			$geayar_surum = $getir['geayar_surum'];
			$geayar_surum_yeni = $getir['geayar_surum_yeni'];
			if($geayar_guncelleme == "acik"){
			if($geayar_surum == $geayar_surum_yeni){}else{
			?>
			<div class="row">
			<div class="col-md-12">
			<div class="alert alert-danger" role="alert">
			<h4 class="alert-heading">Yeni Güncelleme Var ! (Versiyon : <?php echo $geayar_surum_yeni;?>) </h4>
			<p>Sisteminiz için yeni bir güncelleme yayınlandı, güncellemeleri başlatarak sisteminizi son sürüme güncelleyebilirsiniz.</p>
			<hr>
			<p class="mb-0"><a class="btn btn-primary" href="update.php"> Güncellemeyi Başlat</a></p>
			</div>
			
			</div>
			</div>
			
			<?php }} ?>
			
			
			<div class="row">
            <div class="col-12">
			<div class="card">
            <div class="card-body">
            <h5><strong>Hoşgeldiniz </strong></h5>
			<p>Bu panel sitenizi kolay bir şekilde yönetmeniz ve her alana erişebilmeniz için hazırlanmıştır. Sol tarafta bulunan menü ile sitenizde bulunan alanları ve modülleri yönetebilirsiniz.</p>
            </div>
            </div>
			
			<div class="card-group">
			
			<?php
			$genel_getir=mysql_query("SELECT * FROM genelayarlar WHERE id='1'"); 
			$getir=mysql_fetch_array($genel_getir); 
			$geayar_odeme_durum = $getir['geayar_odeme_durum'];
			
			$siparis_getir=mysql_query("SELECT * FROM siparisler WHERE siparis_odeme_durum='bekliyor'"); 
			$getir=mysql_fetch_array($siparis_getir); 
			$siparis_odeme_durum = $getir['siparis_odeme_durum'];
			
			if($geayar_odeme_durum == "evet"){
			if($siparis_odeme_durum == "bekliyor"){
			?>
			<div class="card">
			<div class="card-body">
			<a href="siparisler.php">
			<div class="row">
			<div class="col-12">
			<h4>Bekleyen Ödeme Var</h4>
			<h6 class="card-subtitle">Yeni Ürün Siparişleri</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-danger" role="progressbar" style="width: 100%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</a>
			</div>
			</div>
			<?php }else{?> 
			
			<div class="card">
			<div class="card-body">
			<a href="siparisler.php">
			<div class="row">
			<div class="col-12">
			<h4>Bekleyen Ödeme Yok</h4>
			<h6 class="card-subtitle">Yeni Sipariş Yok</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-danger" role="progressbar" style="width: 0%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</a>
			</div>
			</div>
			
			<?php  } }  ?>
			
			<?php
			$m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='iletisim'"); 
			$getir=mysql_fetch_array($m_kontrol); 
			$iletisim_m_durum = $getir['modul_durum'];
			if($iletisim_m_durum == "acik"){ ?>
			<?php
			$icerik_getir=mysql_query("SELECT * FROM iletisim WHERE iletisim_durum='okunmadi'"); 
			$getir=mysql_fetch_array($icerik_getir); 
			$i_kont_id = $getir['id'];
			if(empty($i_kont_id)){ ?>
			<div class="card">
			<div class="card-body">
			<a href="iletisim.php">
			<div class="row">
			<div class="col-12">
			<h4> Yeni Mesaj Yok</h4>
			<h6 class="card-subtitle">Yeni Mesaj Yok</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-danger" role="progressbar" style="width: 0%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</a>
			</div>
			</div>
			<?php }else{?>
			<div class="card">
			<div class="card-body">
			<a href="iletisim.php">
			<div class="row">
			<div class="col-12">
			<h4><i class="fa fa-exclamation"></i> Yeni Mesaj</h4>
			<h6 class="card-subtitle">Yeni Mesajlarınız Var</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-danger" role="progressbar" style="width: 100%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</a>
			</div>
			</div>
			<?php } } ?>
					
			<?php
			$sorgu = mysql_query("SELECT * FROM bloglar");
			$sa1  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM blog_kategori");
			$sa2  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM diller");
			$sa3  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM duyurular");
			$sa4  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM foto_galeri");
			$sa5  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM giris_kayit");
			$sa6  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM hizmetler");
			$sa7  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM iletisim");
			$sa8  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM islemkayit");
			$sa9  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM kullanicilar");
			$sa10  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM menuler");
			$sa11  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM moduller");
			$sa12  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM musteri_yorumlari");
			$sa13  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM projeler");
			$sa14  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM proje_kategori");
			$sa15  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM proje_slider");
			$sa16  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM referanslar");
			$sa17  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM sayaclar");
			$sa18  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM sayfalar");
			$sa19  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM servisler");
			$sa20  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM sliderler");
			$sa21  = mysql_num_rows($sorgu);
			
			$sorgu = mysql_query("SELECT * FROM sorular");
			$sa22  = mysql_num_rows($sorgu);
			
			$t_sayi = $sa1+$sa2+$sa3+$sa4+$sa5+$sa6+$sa7+$sa8+$sa9+$sa10+$sa11+$sa12+$sa13+$sa14+$sa15+$sa16+$sa17+$sa18+$sa19+$sa20+$sa21+$sa22;
			?>
			
			
			<div class="card">
			<div class="card-body">
			<div class="row">
			<div class="col-12">
			<h4><i class="fa fa-database"></i>  <?php echo $t_sayi;?></h4>
			<h6 class="card-subtitle">Anlık Veri Miktarı</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-info" role="progressbar" style="width: <?php echo $t_sayi;?>%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</div>
			</div>
              
			<?php
			$sorgu = mysql_query("SELECT * FROM moduller WHERE modul_durum='acik'");
			$sa23  = mysql_num_rows($sorgu);
			?>
			<div class="card">
			<div class="card-body">
			<div class="row">
			<div class="col-12">
			<h4><i class="fa fa-bullseye"></i> <?php echo $sa23;?></h4>
			<h6 class="card-subtitle">Aktif Modül Miktarı</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo $sa23;?>%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</div>
			</div>
			
			<?php if($geayar_odeme_durum == "evet"){}else{?>
			<div class="card">
			<div class="card-body">
			<div class="row">
			<div class="col-12">
			<h4><i class="fa fa-language"></i> <?php echo $sa3;?></h4>
			<h6 class="card-subtitle">Mevcut Dil Miktarı</h6></div>
			<div class="col-12">
			<div class="progress">
			<div class="progress-bar bg-inverse" role="progressbar" style="width: <?php echo $sa3;?>%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
			</div>
			</div>
			</div>
			</div>
			</div>
			<?php } ?>
			
			</div>
            </div>
            </div>
			
	<div class="row">
	
	<div class="col-md-6">
	<div class="card">
	<div class="card-body">
	<div class="row">
	<div class="col-md-9">
	<h4 class="card-title"><i class="mdi mdi-clock-alert"></i> İşlem Kayıtları</h4>
	<h6 class="card-subtitle">Sitenizde son yapılan 10 işlem</h6>
	</div>
	<div class="col-md-3"><a class="btn btn-block btn-warning btn-sm" href="islem_kayitlari.php">Tümünü Gör</a></div>
	</div>
	<div class="table-responsive">
	<table class="table table-striped">
	<thead>
	<tr>
	<th>Kullanıcı</th>
	<th>İşlem</th>
	<th>İp</th>
	</tr>
	</thead>
	<tbody>
	<?php
	$sil_m_al = mysql_query("SELECT * FROM islemkayit ORDER BY id DESC limit 0,10");
	while($yaz=mysql_fetch_array($sil_m_al)){
	$id = $yaz['id'];
	$islemk_sahip = $yaz['islemk_sahip'];	
	$islemk_islem = $yaz['islemk_islem'];	
	$islemk_ip = $yaz['islemk_ip'];	
			
	echo '
	<tr>
	<td>'.$islemk_sahip.'</td>
	<td>'.$islemk_islem.'</td>
	<td>'.$islemk_ip.'</td>
	</tr>
	';
	}?> 
	</tbody>
	</table>
	</div>
	</div>
	</div>
	</div>
	
	<div class="col-md-6">
	<div class="card">
	<div class="card-body">
	<div class="row">
	<div class="col-md-9">
	<h4 class="card-title"><i class="mdi mdi-account-convert"></i> Giriş Kayıtları</h4>
	<h6 class="card-subtitle">Yönetici giriş kayıtları</h6>
	</div>
	<div class="col-md-3"><a class="btn btn-block btn-danger btn-sm" href="giris_kayitlari.php">Tümünü Gör</a></div>
	</div>
	<div class="table-responsive">
	<table class="table table-striped">
	<thead>
	<tr>
	<th>Kullanıcı</th>
	<th>İp Adresi</th>
	<th>Tarih</th>
	</tr>
	</thead>
	<tbody>
	<?php
	$sil_m_al = mysql_query("SELECT * FROM giris_kayit ORDER BY id DESC limit 0,10");
	while($yaz=mysql_fetch_array($sil_m_al)){
	$id = $yaz['id'];
	$giris_kullanici = $yaz['giris_kullanici'];	
	$giris_ip = $yaz['giris_ip'];	
	$giris_tarih = $yaz['giris_tarih'];	
			
	echo '
	<tr>
	<td>'.$giris_kullanici.'</td>
	<td>'.$giris_ip.'</td>
	<td>'.$giris_tarih.'</td>
	</tr>
	';
	}?> 
	</tbody>
	</table>
	</div>
	</div>
	</div>
	</div>
           
					
					
	<div class="col-md-12">
	<div class="card">
	<div class="card-body">
	<h4 class="card-title">Çekirdek Optimizasyonu & Sunucu</h4><hr>
	<ul class="country-state">
	
	<li>
	<h3>%100 </h3>
	<small>Çekirdek Yapısı tam uyumlu şekilde aktif durumda. </small>
	<div class="pull-right">100% </div>
	<div class="progress">
	<div class="progress-bar bg-success" role="progressbar" style="width: 100%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
	</div>
	</li>
                             
	<li>
	<h3><?php echo $_SERVER['HTTP_HOST']; ?></h3>
	<small>Bağlantı noktası</small>
	<div class="pull-right">Doğrulandı </div>
	<div class="progress">
	<div class="progress-bar bg-info" role="progressbar" style="width: 100%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
	</div>
	</li>
								
	<li>
	<h4><?php echo $_SERVER['SERVER_SOFTWARE']; ?></h4>
	<small>Server dili </small>
	<div class="pull-right">100% </div>
	<div class="progress">
	<div class="progress-bar bg-inverse" role="progressbar" style="width: 100%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
	</div>
	</li>
								
	<li>
	<h3><?php echo $_SERVER['SERVER_PROTOCOL']; ?></h3>
	<small>Erişim Protokolü </small>
	<div class="pull-right"><i class="fa fa-check" aria-hidden="true"></i></div>
	<div class="progress">
	<div class="progress-bar bg-warning" role="progressbar" style="width: 100%; height: 6px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
	</div>
	</li>
								
	</ul>
	</div>
	</div>
	</div>
					
		
					
					
					
					</div>
            </div>
           
<?php
include ("alt.php");
} ##Oturum Kontrolü
?>