-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathdonate.php
159 lines (59 loc) · 2.44 KB
/
donate.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
<?php
require_once "header.php";
require_once "maincore.php";
require_once "includes/dbconnector.class.php";
$db=new DbConnector;
if( isset($_POST['PAYMENT_AMOUNT'] ) ){
$prepare=$db->mysqli->prepare("insert into tbl_donate (user_id,amount,`date`,link) values (?,?,?,?)");
$prepare->bind_param('iiis',$uid,$_POST['PAYMENT_AMOUNT'],time(),$_POST['link']);
$prepare->execute();
$insid=$prepare->insert_id;
$prepare->store_result();
$prepare->close();
$db->queryres("select * from tbl_config where header='donate_type'");
$dtype=$db->res['value'];
$db->queryres("select * from tbl_config where header='pusername'");
$pusername=$db->res['value'];
$db->queryres("select * from tbl_config where header='STORE_NAME'");
$STORE_NAME=$db->res['value'];
?>
<form action="https://www.asmoney.com/sci.aspx" method="post" id="frm">
<input type="hidden" name="USER_NAME" value="<?php echo $pusername; ?>" />
<input type="hidden" name="STORE_NAME" value="<?php echo $STORE_NAME; ?>" />
<input type="hidden" name="PAYMENT_UNITS" value="<?php echo $dtype;?>" />
<input type="hidden" name="PAYMENT_MEMO" value="Donate" />
<input type="hidden" name="PAYMENT_ID" value="<?php echo md5($insid); ?>" />
<input type="hidden" class="form-control" name="PAYMENT_AMOUNT" value="<?php echo $_POST['PAYMENT_AMOUNT'];?>">
</form>
<script>document.getElementById('frm').submit();</script>
Please wait...
<?php
}else{
$with=array();
$db->query("select * from tbl_donate where user_id='$uid' order by date desc");
while($res=$db->fetchArray()){
$ar=array('amount'=>$res['amount'],'date'=>date('Y/m/d',$res['date']),'status'=>$res['status']);
array_push($with,$ar);
}
$smarty->assign('with',$with);
$db->queryres("select * from tbl_config where header='donate_min'");
$smarty->assign('dmin',$db->res['value']);
if(isset($_SESSION['error']['over'])){
$smarty->assign('over',true);
unset($_SESSION['error']);
}
if(isset($_SESSION['error']['donate'])){
$smarty->assign('ed',true);
unset($_SESSION['error']);
}
if(isset($_SESSION['succ']['donate'])){
$smarty->assign('sd',true);
unset($_SESSION['esuccrror']);
}
if(isset($_SESSION['succ']['penging'])){
$smarty->assign('penging',true);
unset($_SESSION['succ']);
}
$smarty->display('template/donate.tpl');
}
?>