<?php
session_start(); //session işlemini başlatıyoruz.
if(!isset($_SESSION['user_nick']))//session varmı die kontrol ediyoruz. yok ise buraya giricek
{
header("Location:index.php");//eğer session yok ise bizi giris.php gönderecek.
}
?>
<?php
if (!file_exists("baglanti.php")){
require("install.php");
die;
}
include("baglanti.php");
include("Websend.php");
include("meta.php");
error_reporting(0);
session_start();
ob_start();
$ayarsor=$db->prepare("SELECT * FROM ayar where ayar_id = ?");
$ayarsor->execute(array(0));
$ayarcek=$ayarsor->fetch();
$kullanicisor = $db->prepare("select * from authme where username=:username");
$kullanicisor->execute(array('username' => $_SESSION['user_nick']));
$kullanici = $kullanicisor->fetch(PDO::FETCH_ASSOC);
$sunucu = $_GET["sunucu"];
if (!empty($_GET['uid'])) {
$ayarsor=$db->prepare("SELECT * FROM ayar where ayar_id = ?");
$ayarsor->execute(array(0));
$ayarcek=$ayarsor->fetch();
$urunsor=$db->prepare("SELECT * FROM urunler WHERE urun_id=:id");
$urunsor->execute(array('id' => $_GET['uid']));
$uruncek=$urunsor->fetch(PDO::FETCH_ASSOC);
$sec = $db->prepare("SELECT * FROM Sunucular WHERE sunucu_link = ?");
$sec->execute(array($uruncek["sunucu_link"]));
$oku = $sec->fetch();
$kullanicisor = $db->prepare("select * from authme where username=:username");
$kullanicisor->execute(array('username' => $_SESSION['user_nick']));
$kullanici = $kullanicisor->fetch(PDO::FETCH_ASSOC);
if ($kullanici['kredi'] >= $uruncek['urun_fiyat']) {
$komut=$uruncek['urun_komut'];
$komut2=$uruncek['urun_komut2'];
$komut3=$uruncek['urun_komut3'];
$ws = new Websend("".$oku['ip']."");
$ws->password = "".$oku['sunucu_sifre']."";
$ws->port = "".$oku['port']."";
if($ws->connect()) {
$ws->doCommandAsConsole(str_ireplace("%player%","".$_SESSION['user_nick']."","".$komut.""));
if (!empty($komut2)) {
$ws->doCommandAsConsole(str_ireplace("%player%","".$_SESSION['user_nick']."","".$komut2.""));
}
if (!empty($komut3)) {
$ws->doCommandAsConsole(str_ireplace("%player%","".$_SESSION['user_nick']."","".$komut3.""));
}
$ykredi= $kullanici['kredi'] - $uruncek['urun_fiyat'];
$duzenle=$db->prepare("UPDATE authme SET kredi=:kredi WHERE id=:id");
$azalt=$duzenle->execute(array('kredi' => $ykredi, 'id' => $kullanici['id']));
$ekle=$db->prepare("INSERT INTO alinanurun SET urun_isim=:urun_isim, username=:username, urun_fiyat=:urun_fiyat");
$yeniekle=$ekle->execute(array('urun_isim' => $uruncek['urun_isim'], 'username' => $kullanici['username'], 'urun_fiyat' => $uruncek['urun_fiyat']));
?>
<?php
echo "<script>alert('Ürünü Başarılı Şekilde Satın Aldınız.')</script>";
echo '<meta http-equiv="refresh" content="0;URL=index.php">';
?>
<?php
}
else
{
?>
<div>
<script src="arsiv-2/themes/alert.js"></script>
<script type="text/javascript">swal.fire("İşlem Başarısız", "Sunucuya bağlanırken bir sorun oluştu..", "error");
</script>
</div>
<?php $sunucu = $_GET["sunucu"];?>
<meta http-equiv="refresh" content="0;URL=market2.php?sunucu=<?php echo($sunucu);?>">
<?php
}
$ws->disconnect();
}
else
{
?>
<?php
echo "<script>alert('Yetersiz Bakiye. :(')</script>";
echo '<meta http-equiv="refresh" content="0;URL=market.php">';?><?php
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Slient Developers">
<link rel="shortcut icon" type="image/x-icon" href="arsiv-2/img/img/bb2d30859adfa303df28779ef04fe69a.jpg">
<meta name="description" content="">
<meta name="keywords" content="">
<base>
<title><?php echo $ayarcek['site_title']; ?></title>
<link rel="stylesheet" href="arsiv-2/themes/2020/assets/css/bootstrap.css">
<link rel="stylesheet" href="arsiv-2/themes/2020/assets/css/mdi.css">
<link rel="stylesheet" href="arsiv-2/themes/2020/assets/css/swiper.css">
<link rel="stylesheet" href="arsiv-2/themes/2020/assets/css/style.css">
<style type="text/css">
:root {
--body: #202230;
--footer: #1E202B;
--primary: #F3755D;
--secondary: #9498BA;
--tertiary: #32354C;
--white: #FFFFFF;
--success: #61DF69;
--blue: #7F9DFF;
--slice-bg: url('arsiv-2/img/img/6b54538a365c9d543a667664a50551cc.jpg');
}
</style>
</head>
<body style=" background-image: url(arsiv-2/img/background-2.png); background-position: top left; background-size: 20; background-repeat: repeat;">
<?php include("baslik.php"); ?>
<?php include("topbar.php"); ?>
<section id="news-list" class="min-height-500">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="card <?php echo $ayarcek['tema']; ?>">
<div class="card-header <?php echo $ayarcek['tema']; ?> text-dark" style=" background-image: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.2)); background-position: top left; background-size: 100%; background-repeat: repeat;">Sunucular</div>
<div class="card-body">
<div class="row">
<?php
$urun_cek = $db->prepare("SELECT * FROM Urunler WHERE sunucu_link = ?");
$urun_cek->execute(array($sunucu));
if($urun_cek->rowCount() != 0){
echo "<br>";
foreach ($urun_cek as $urun_oku) {
?>
<div class="col-lg-3 col-md-12 mb-3">
<div class="card-info position-relative text-center">
<a href="javascript:;" onclick="ajaxModal('10')" type="button" data-toggle="modal" data-target="#storeModal">
<img data-toggle="tooltip" data-placement="top" title="" data-original-title="Detayları Görüntüle" src="arsiv-2/img/gold.png" class="img-fluid rounded">
</a>
<span class="card-heading text-dark"><?php echo $urun_oku['urun_isim']; ?><br><small><?php echo $urun_oku['urun_acikla']; ?></small></span>
<div class="card-price">
<span class="price-actual"><?php echo $urun_oku['urun_fiyat']; ?> Kredi</span>
</div>
<a href="market2.php?uid=<?php echo $urun_oku['urun_id']; ?>"><button onclick="ajaxModal('10')" type="button" class="btn btn-success" data-toggle="modal" data-target="#storeModal">
<i class="mdi mdi-plus"></i> Satın Al </button></a>
</div>
</div>
<?php //slient ?>
<?php
}
}
if(($urun_cek->rowCount() == 0)){
if (empty($_GET['uid'])) {
?><div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<script type="text/javascript">swal.fire("Hata", "Markete hiç ürün eklenmemiş.", "error");
</script>
</div><?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section><small>
<section class="slice"></section>
<?php include("footer.php");?>
<script>
var realPath = "arsiv-2/themes/2020/index.html";
</script>
<script src="arsiv-2/themes/2020/assets/js/jquery.js"></script>
<script src="arsiv-2/themes/2020/assets/js/jquery-ui.js"></script>
<script src="arsiv-2/themes/2020/assets/js/popper.js"></script>
<script src="arsiv-2/themes/2020/assets/js/bootstrap.js"></script>
<script src="arsiv-2/themes/2020/assets/js/swiper.js"></script>
<script src="arsiv-2/themes/2020/assets/js/pages/index.js"></script>
<script src="arsiv-2/themes/2020/assets/js/script.js" style=""></script>
</small>
</body>
</html>fakat sayfaya girdiğimde hiç bir ürün bulunamadı hatası alıyorum ürün olmasına rağmen. Not: Localhost'ta denediğimde çalışıyor 4 farklı hosting denedim sorun aynı.