-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdailyReward2.php
161 lines (145 loc) · 4.77 KB
/
dailyReward2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
define('_VALID_PHP', true);
$pname = 'Daily Reward';
$menu = 'dailyGold';
$pagemenu = 'DASH';
$submenu = '';
require_once 'init.php';
use Carbon\Carbon;
// $AllDailyReward = $list->FEgetAllDailyReward($user->uid);
// pre($AllDailyReward);
$AllDailyReward = $list->FEgetAllDailyReward2($user->uid);
$msg = '';
if (isset($_GET['day'])) {
$msg = $list->FEgetDailyReward($_GET['day'], $user->uid);
}
// if (!$user->logged_in) {
// redirect_to(SITEURL.'/index.php');
// }
?>
<?php
include 'fehead.php';
?>
<!-- Page container -->
<div class="page-container bg-white">
<!-- Page content -->
<div class="page-content">
<!-- Main content -->
<div class="content-wrapper">
<div class="col-md-12 col-sm-12 col-xs-12">
<?php foreach ($AllDailyReward as $key => $value):
$today=explode(' ',Carbon::now())[0]== $value->date_check? 1:0;
if($today){
$type=$value->done?3:1;
if($type==1&&!$user->uid)$type=2;
}elseif ($value->done) {
$type=4;
}
else {
$type=5;
}
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 ">
<div class="panel panel-flat <?php echo $today? 'today' : 'not-today';?>">
<div class="panel-heading" style="padding:10px 10px;">
<div class="text-center daily-title bg-yellow-gold img-rounded">Day <?php echo $value->day_num;?></div>
</div>
<div class="container-fluid">
<div class="row text-center">
<div class="col-md-10 col-md-offset-1 col-xs-12 reward-area">
<div class="each-reward">
<?php
if($value->gold_check){
?>
<div class="text-center">
<img class="gold-coin" src="<?php echo FRONTIMAGE;?>gold-coin-icon.png">
<div class="daily-gold-text">100</div>
</div>
<?php
}
if($value->spin_check){
?>
<div class="text-center">
<img class="gold-coin" src="<?php echo FRONTIMAGE;?>slot_machine.png" >
<div class="daily-gold-text">100</div>
</div>
<?php
} ?>
</div>
</div>
<div class="col-md-12">
<div class="text-center ">
<?php switch ($type) {
// $type
// 1 = today not done
// 2 = today not done no login
// 3 = today done
// 4 = yesterday
// 5 = forwardday
case '1':
case '2':
?>
<span class="img-rounded daily-gold-claim pointer"onclick="dailyreward('<?php echo $value->day_num;?>');">Claim Now</span>
<?php
break;
case '3':
case '4':
?>
<span class="img-rounded daily-gold-claim claim-disabled">Claimed</span>
<?php
break;
case '5':
?>
<span class=" daily-gold-claim claim-disabled" style="background-color:transparent"></span>
<?php
break;
}?>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<!-- /main content -->
</div>
<div class="clearfix"></div>
<!-- /page content -->
</div>
<!-- /page container -->
<script type="text/javascript">
function dailyreward(day){
var a=verifylogin();
if(a){
location.href="dailyReward.php?day="+day;
}
}
<?php
if ($msg) {
?>
bootbox.confirm({
message: "<?php echo $msg; ?>",
buttons: {
confirm: {
label: 'Yes',
className: 'btn-success'
}
},
callback: function (result) {
console.log('This was logged in the callback: ' + result);
location.href="dailyReward.php";
}
});
<?php
}
?>
</script>
<?php
include 'fefoot.php';
?>
</div>
</body>
</html>