-
Notifications
You must be signed in to change notification settings - Fork 0
/
confirmmod.php
175 lines (140 loc) · 5.2 KB
/
confirmmod.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php include("header.php"); ?>
<?php
$prs=mysql_query("select * from soe_membership where memshipid=".$_GET['memshipid']);
$prsrow=mysql_fetch_array($prs);
$prevsubs=$prsrow['subscription'];
$prevprice=$prsrow['price_exc_vat'];
if($_SERVER['REQUEST_METHOD']=="POST")
{
$sql="update soe_stores set packageid='".$_POST['package']."' where sto_id=".$_GET['stoid']."";
mysql_query($sql) or die(mysql_error());
$rs=mysql_query("select * from soe_settings where field='price_vat'");
$row=mysql_fetch_array($rs);
$price_vat=$row[2];
$rs=mysql_query("select * from soe_packages where packageid=".$_POST['package']) or die(mysql_error());
$row=mysql_fetch_array($rs);
if($_GET['diff']=="true")
$row['price']=$row['addstorediffstate'];
elseif($_GET['diff']=="false")
$row['price']=$row['addstoresamestate'];
else
$row['price']=$row['price'];
$price=$row['price'];
$package=$_POST['package'];
if($_POST['subscription']=='monthly')
$price_exc_vat = $price;
if($_POST['subscription']=='sixmonthly')
$price_exc_vat = $price*6;
if($_POST['subscription']=='yearly')
$price_exc_vat = $price*12;
if(empty($price_vat))
{
$vat = 0;
$total = $price_exc_vat;
}
else
{
$vat = (($price_exc_vat*$price_vat)/100);
$total = $price_exc_vat+$vat;
}
mysql_query("delete from temp_membership where memshipid=".$_GET['memshipid']) or die(mysql_error());
mysql_query("insert into temp_membership select * from soe_membership where memshipid=".$_GET['memshipid']) or die(mysql_error());
$sql="update soe_membership set mem_id='".$_SESSION['memberid']."',sto_id=".$_GET['stoid'].",packageid='".$_POST['package']."',price_exc_vat='".floatval($price_exc_vat)."',vat='".floatval($vat)."',total='".floatval($total)."',subscription='".$_POST['subscription']."',payment='notpaid' where memshipid=".$_GET['memshipid'];
mysql_query($sql) or die(mysql_error());
$memshipid=$_GET['memshipid'];
?>
<script>
location.href='confirmmod.php?memshipid=<?php echo $memshipid; ?>';
</script>
<?php
}
?>
<style type="text/css">
<!--
.style2 {
color: #FF0000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: x-small;
font-weight: bold;
}
-->
</style>
<div class="container">
<script type="text/javascript">
$().ready(function()
{
$("#object").animate({
top: "0px"
}, 2000 ).fadeOut(11111);
});
</script>
<div style="top: 0px; display: none;" id="object" class="message_box">
<span class="msg">Your account registration has done successfully.</span> </div>
<?php include("left3.php"); ?>
<script type="text/javascript">
$(document).ready(function() {
$("#account_payment").validate({
rules: {
package: "required"
},
messages: {
package: "<br/>"
}
});
});
</script>
<div id="content_area_mid_inner2">
<div>
<h2>Confirm Package Switch</h2>
</div>
<div class="sbdatabase">
<div class="edittable">
<form class="form" id="account_payment" name="account_payment" method="post" action="">
<input name="sto_id" value="10" id="sto_id" type="hidden">
<div class="input_title"><label for="package">Listing packages</label></div>
<div class="input">
<?php
$prs=mysql_query("select * from soe_membership where memshipid=".$_GET['memshipid']);
$prsrow=mysql_fetch_array($prs);
if($prsrow['subscription']=='monthly')
$price_exc_vat= $prsrow['price_exc_vat'];
if($prsrow['subscription']=='sixmonthly')
$price_exc_vat = round($prsrow['price_exc_vat']/6);
if($prsrow['subscription']=='yearly')
$price_exc_vat =round($prsrow['price_exc_vat']/12);
$rs=mysql_query("select * from soe_packages where price > ".$price_exc_vat);
while($row=mysql_fetch_array($rs))
{
if($_GET['diff']=="true")
$row['price']=$row['addstorediffstate'];
elseif($_GET['diff']=="false")
$row['price']=$row['addstoresamestate'];
else
$row['price']=$row['price'];
if($prsrow['packageid']==$row['packageid'])
$c='checked';
else
$c='';
?>
<input name="package" value="<?php echo $row['packageid']; ?>" type="radio" <?php echo $c; ?> /><?php echo ucfirst($row['name']); ?> (<?php echo $row['code']; ?>) Listing $<?php echo $row['price']; ?> USD per month<br>
<?php
}
?>
<label for="package" class="error"><br> Please choose a package.</label>
</div>
<br class="clear">
<input name="subscription" type="hidden" value="<?php echo $prsrow['subscription']; ?>" />
<span class="style2">NOTE: Your Subscription Will Remain : <?php echo strtoupper($prsrow['subscription']); ?> </span>
<div class="input_title"><label for="package"></label>
</div>
<div class="input_title"> </div>
<div class="input"><input type="image" src="http://images.paypal.com/images/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it’s fast, free and secure!" /></div>
<br class="clear">
</form>
</div>
</div>
</div>
<div class="clear"></div>
<!-- Content Area End -->
<div class="hei"></div>
<?php include("footer.php"); ?>