
Bunlar Php kodlarım
<?php
include 'header.php';
include 'sidebar.php';
?>
<head>
<style>
* {
box-sizing: border-box;
}
/* Create three columns of equal width */
.columns {
float: left;
width: 33.3%;
padding: 18px;
}
/* Style the list */
.price {
list-style-type: none;
border: 1px solid #eee;
margin: 0;
padding: 0;
-webkit-transition: 0.3s;
transition: 0.3s;
}
/* Add shadows on hover */
.price:hover {
box-shadow: 0 8px 12px 0 rgba(0,0,0,0.2)
}
/* Pricing header */
.price .header {
background-color: #EB9532;
color: white;
font-size: 25px;
}
/* List items */
.price li {
border-bottom: 1px solid #eee;
padding: 10;
text-align: center;
}
/* Grey list item */
.price .grey {
background-color: #fff;
font-size: 20px;
}
/* The "Sign Up" button */
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 10px 25px;
text-align: center;
text-decoration: none;
font-size: 18px;
}
/* Change the width of the three columns to 100%
(to stack horizontally on small screens) */
@media only screen and (max-width: 600px) {
.columns {
width: 100%;
}
}
</style>
</head>
<div class="page-wrapper">
<!-- Bread crumb -->
<div class="row page-titles">
<div class="col-md-5 align-self-center">
<h3 class="text-primary">Onaylı Reklam Paketleriniz.</h3> </div>
<div class="col-md-7 align-self-center">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0)">Home</a></li>
<li class="breadcrumb-item active">Onaylı Reklam Paketleriniz.</li>
</ol>
</div>
</div>
<?php
$kullanici_id=$kullanicicek['kullanici_id'];
$packetsor=$db->prepare("SELECT * FROM gorevler where kullanici_id=:id");
$packetsor->execute(array(
'id' => $kullanici_id
));
while($packetcek=$packetsor->fetch(PDO::FETCH_ASSOC)){?>
<div class="columns">
<ul class="price">
<li class="header"><?php echo $packetcek['paket_adi'] ?></li>
<li class="grey"><strong><?php echo $packetcek['paket'] ?></strong></li>
<li><strong>+<?php echo $packetcek['gunluk_biriikim'] ?> TL Günlük Kazanç</strong></li>
<li><strong>Ana Paradan Sonra Kazanç:<?php echo $packetcek['kazanc'] ?></strong></li>
<li><strong>Görev Sayısı: <?php echo $packetcek['gorev'] ?> </strong></li>
<li><strong>Toplam Kazanç: <?php echo $packetcek['toplam'] ?> </strong></li>
<li><strong><center><?php if($packetcek['durum'] == "1"){?>
<center><b style="font-size: 25px;"><span class="label label-success">Onaylandı</span></b></center>
<?php }
elseif($packetcek['durum'] == "0") {?>
<center><b style="font-size: 25px;"><span class="label label-info">Ödeme Bekleniyor</span></b></center>
</center></strong></li>
<?php }
?>
<?php
if (isset($_POST['bonus'])) {
$bonus=$packetcek['gunluk_biriikim'];
$gorevdusur=$packetcek['dusulecek_sayi'];
$kullanici_id=$kullanicicek['kullanici_id'];
$guncelle=$db->exec("UPDATE kullanici_bank SET bakiye=bakiye+$bonus where kullanici_id='$kullanici_id'");
$gunceller=$db->exec("UPDATE gorevler SET gorev=gorev-$gorevdusur where kullanici_id='$kullanici_id'");
$bugun = date("d.m.Y H:i:s");
$aciklama= $bonus . " TL Değerinde Günlük Bonus Aldı.";
$ekle=$db->exec("INSERT INTO gunluk_bonus (id, kullanici_id, tarih, bonus) values ('', '$kullanici_id', '$bugun', '$aciklama')");
header('Refresh: 5; url=../uye/paketlerim.php');
if ($guncelle) {?>
<br>
<div class="alert alert-success"><center><b style="color: black;">Günlük Kazanç Hesabınıza Yatırıldı</b></center></div></center></br>
<?php }
else {
echo "Hata Var";
}
if ($gunceller) {?>
<div class="alert alert-info"><center><b style="color: black;">1 Görev Düşürüldü</b></center></div></center></br>
<?php }
}
$bugun1 = date("d.m.Y H:i:s");
$almismi = $db->query("SELECT * FROM gunluk_bonus where kullanici_id='$kullanici_id' ", PDO::FETCH_ASSOC);
foreach ($almismi as $alsın);
$gun = 1;
$ilktarih=$alsın['tarih']; //mysqldeki tarihi olsun
$sontarih=$bugun1; //buda şu anki tarih olsun
$ilktarihstr=strtotime($ilktarih); //ilk tarihi strtotime ile çeviriyom
$sontarihstr=strtotime($sontarih); //ilk tarihi strtotime ile çeviriyom
$fark=($sontarihstr-$ilktarihstr)/86400; // burasi günü verecektir
if ($fark < $gun) {?>
<br>
<div class="alert alert-danger"><center>Günlük Kazancı Zaten Aldınız Yarın Tekrar Deneyin</center></div></center></br>
<?php }
else {?>
<form action="" method="post">
<input type="hidden" name="bonus" value="<?php echo $packetcek['gunluk_biriikim'] ?>">
<center><button type="submit" name="krediekle" class="btn btn-info m-t-15 waves-effect">Kazancı Topla</button></center>
</form>
<?php }
?>
<br>
</ul>
</div>
<?php include 'sitejs.php'; ?>
<?php }
?>