-
Notifications
You must be signed in to change notification settings - Fork 55
/
kuji.php
executable file
·82 lines (69 loc) · 1.83 KB
/
kuji.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
<?php
define('CURSCRIPT', 'kuji');
require './include/common.inc.php';
require './include/user.func.php';
$_REQUEST = gstrfilter($_REQUEST);
$ktype=$_REQUEST['type'];
if ($ktype=="") $ktype=0;
if (isset($_POST['choice']))
{
$choice=(int)$_POST['choice'];
if ($choice<1 || $choice>4) $choice=0;
}
else $choice=0;
$udata = udata_check();
//if(!$cuser||!$cpass) { gexit($_ERROR['no_login'],__file__,__line__); }
//
//$result = $db->query("SELECT * FROM {$gtablepre}users WHERE username='$cuser'");
//if(!$db->num_rows($result)) { gexit($_ERROR['login_check'],__file__,__line__); }
//$udata = $db->fetch_array($result);
//if($udata['password'] != $cpass) { gexit($_ERROR['wrong_pw'], __file__, __line__); }
//if($udata['groupid'] <= 0) { gexit($_ERROR['user_ban'], __file__, __line__); }
extract($udata);
$userCardData = \cardbase\get_user_cardinfo($cuser);
$oc = $userCardData['cardlist'];
if ($ktype==1 || $choice>0)
{
eval(import_module('kujibase'));
$kreq=$kujicost;
$kres=\cardbase\kuji($ktype,$udata);
if (is_array($kres)){
if ($ktype==0 || $ktype==2) //单抽可以4选1
{
$t=Array(); $tmp=Array();
for ($i=1; $i<=4; $i++)
{
if ($i==$choice)
$t[$i]=$kres[0];
else $t[$i]=\cardbase\kuji($ktype,$tmp,true)[0];
}
$kres=$t;
}
$isnew=array();
foreach($kres as $key => $val){
if (($ktype==0 || $ktype==2) && $choice!=$key) //单抽没有真正获得的卡不显示new字样
{
$isnew[$key]=""; continue;
}
if (!in_array($val,$oc)){
$isnew[$key]="<span class=\"L5\">NEW!</span>";
}else{
$isnew[$key]="";
}
}
$ishighlight=Array();
if ($ktype==0 || $ktype==2)
{
for ($i=1; $i<=4; $i++) $ishighlight[$i]=($i==$choice);
}
include template('kujiresult');
}else{
gexit($_ERROR['kuji_failure'], __file__, __line__);
}
}
else
{
//翻卡UI
include template('kujipick');
}
?>