| Paste number 64972: | Some code |
| Pasted by: | energY |
| When: | 10 months, 3 weeks ago |
| Share: | Tweet this! | http://paste.lisp.org/+1E4S |
| Channel: | None |
| Paste contents: |
<?
include "vsys.php";
$user=getUserDetails($_SESSION['userinfo'],"*");
// Repair Weapons
if($_POST[doatrepair]){
if($_POST[atrepair0] > 0){$wepid=0;$wal=$_POST[atrepair0];}
if($_POST[atrepair1] > 0){$wepid=1;$wal=$_POST[atrepair1];}
if($_POST[atrepair2] > 0){$wepid=2;$wal=$_POST[atrepair2];}
if($_POST[atrepair3] > 0){$wepid=3;$wal=$_POST[atrepair3];}
if($_POST[atrepair4] > 0){$wepid=4;$wal=$_POST[atrepair4];}
if($_POST[atrepair5] > 0){$wepid=5;$wal=$_POST[atrepair5];}
if($_POST[atrepair6] > 0){$wepid=6;$wal=$_POST[atrepair6];}
$detail=RepairWeapon($wepid,$wal,$user,1);
header("Location: armory.php?strErr=$detail");}
if($_POST[dodefrepair]){
if($_POST[defrepair0] > 0){$wepid=0;$wal=$_POST[defrepair0];}
if($_POST[defrepair1] > 0){$wepid=1;$wal=$_POST[defrepair1];}
if($_POST[defrepair2] > 0){$wepid=2;$wal=$_POST[defrepair2];}
if($_POST[defrepair3] > 0){$wepid=3;$wal=$_POST[defrepair3];}
if($_POST[defrepair4] > 0){$wepid=4;$wal=$_POST[defrepair4];}
if($_POST[defrepair5] > 0){$wepid=5;$wal=$_POST[defrepair5];}
$detail=RepairWeapon($wepid,$wal,$user,0);
header("Location: armory.php?strErr=$detail");}
// Sell Weapons
if($_POST[doatscrapsell]){
if($_POST[atscrapsell0] > 0){$wepid=0;$wal=$_POST[atscrapsell0];}
if($_POST[atscrapsell1] > 0){$wepid=1;$wal=$_POST[atscrapsell1];}
if($_POST[atscrapsell2] > 0){$wepid=2;$wal=$_POST[atscrapsell2];}
if($_POST[atscrapsell3] > 0){$wepid=3;$wal=$_POST[atscrapsell3];}
if($_POST[atscrapsell4] > 0){$wepid=4;$wal=$_POST[atscrapsell4];}
if($_POST[atscrapsell5] > 0){$wepid=5;$wal=$_POST[atscrapsell5];}
if($_POST[atscrapsell6]){$wepid=6;$wal=$_POST[atscrapsell6];}
ScrapSell($wepid,$wal,$_POST[doscrapsell],$user,1);
}
if($_POST[dodefscrapsell]){
if($_POST[defscrapsell0] > 0){$wepid=0;$wal=$_POST[defscrapsell0];}
if($_POST[defscrapsell1] > 0){$wepid=1;$wal=$_POST[defscrapsell1];}
if($_POST[defscrapsell2] > 0){$wepid=2;$wal=$_POST[defscrapsell2];}
if($_POST[defscrapsell3] > 0){$wepid=3;$wal=$_POST[defscrapsell3];}
if($_POST[defscrapsell4] > 0){$wepid=4;$wal=$_POST[defscrapsell4];}
if($_POST[defscrapsell5]){$wepid=5;$wal=$_POST[defscrapsell5];}
ScrapSell($wepid,$wal,$_POST[doscrapsell],$user,0);
}
//Buy weapons
if($_POST[buybut]){
if($_POST[buy_w0] > 0) {
$detail=BuyWeapon(0,$_POST[buy_w0],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_w1] > 0) {
$detail=BuyWeapon(1,$_POST[buy_w1],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_w2] > 0){
$detail=BuyWeapon(2,$_POST[buy_w2],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_w3] > 0) {
$detail=BuyWeapon(3,$_POST[buy_w3],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_w4] > 0) {
$detail=BuyWeapon(4,$_POST[buy_w4],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_w5] > 0) {
$detail=BuyWeapon(5,$_POST[buy_w5],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_w6] > 0) {
$detail=BuyWeapon(6,$_POST[buy_w6],1,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_dw0] > 0){
$detail=BuyWeapon(0,$_POST[buy_dw0],0,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_dw1] > 0){
$detail=BuyWeapon(1,$_POST[buy_dw1],0,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_dw2] > 0){
$detail=BuyWeapon(2,$_POST[buy_dw2],0,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_dw3] > 0){
$detail=BuyWeapon(3,$_POST[buy_dw3],0,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_dw4] > 0){
$detail=BuyWeapon(4,$_POST[buy_dw4],0,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
if($_POST[buy_dw5] > 0){
$detail=BuyWeapon(5,$_POST[buy_dw5],0,$user);
$user=getUserDetails($_SESSION['userinfo'],"*");
}
header("Location: armory.php?strErr=$detail");}
//Upgrade Fortification
if($_POST[upgrade_fortification])
{$detail=Upgrade($user,'fortification',$_POST[upgrade_fortification]);header("Location: armory.php?strErr=$detail");}
//Upgrade Siege
if($_POST[upgrade_siege])
{$detail=Upgrade($user,'siege',$_POST[upgrade_siege]);header("Location: armory.php?strErr=$detail");}
?>
<HTML><HEAD><TITLE>Test v0.0</TITLE>
<LINK href="css/main.css" type=text/css rel=stylesheet>
</HEAD>
<BODY>
<?
include "top.php";
include "left.php";
//Get rid of god damn tables, and get rid of useless hash!
?>
<div id=stor>
<H3>Armory</H3>
<? echo $_POST["strErr"];?>
<TABLE class=table_lines cellSpacing=0 cellPadding=6 width="100%" border=0>
<TBODY>
<TR>
<TH align=middle colSpan=6>Current Weapon Inventory</TH></TR>
<TR>
<TH class=subh align=left>Attack Weapons</TH>
<TH class=subh align=right>Quantity</TH>
<TH class=subh>Strength</TH>
<TH class=subh>Repair</TH>
<TH class=subh>Scrap/Sell</TH></TR>
<? $wep=getUserWeapon($user);
for($i=0;$i<count($wep);$i++){
printf ("<TR><TD>%s</TD>",$conf["race"][$user->race]["weapon"][$wep[$i]->weaponID]["name"]);?>
<TD align=right><? numecho($wep[$i]->weaponCount) ?></TD>
<? $x=$wep[$i]->weaponStrength;
$y=$conf["race"][$user->race]["weapon"][$wep[$i]->weaponID]["strength"];?>
<TD align=middle><? numecho($x) ?>/<? numecho($y) ?></TD>
<FORM action=armory.php method=post>
<TD><TABLE cellSpacing=0 cellPadding=2 width=\"100%\" border=0><TBODY><TR>
<? $rem=round(700/$y)*$wep[$i]->weaponCount;$id=$wep[$i]->weaponID;?>
<TD style="BORDER-BOTTOM: medium none"><INPUT type=input maxLength=4 size=2 value=0 name=atrepair<? echo $id; ?> ></TD>
<TD style="BORDER-BOTTOM: medium none" width="100%"><INPUT style="WIDTH: 100%" type=submit
value="<? numecho($rem) ?> Gold Per Point" name=doatrepair>
</TD></TR></TBODY></TABLE></TD><INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash></FORM>
<FORM action=armory.php method=post><TD><TABLE cellSpacing=0 cellPadding=1 width="100%" border=0><TBODY><TR>
<TD style="BORDER-BOTTOM: medium none"><INPUT type=input maxLength=6 size=2 value=0 name=atscrapsell<? echo $id; ?> ></TD>
<TD style="BORDER-BOTTOM: medium none" width="100%"><INPUT style="WIDTH: 100%" type=submit value="<?
$pr=round(($conf["race"][$user->race]["weapon"][$wep[$i]->weaponID]["price"])*($x/$y-0.2));
if($pr>0){echo "Sell for ";numecho($pr);echo " Gold";}
else echo "Scrap"; ?>" name=doatscrapsell>
</TD></TR></TBODY></TABLE></TD><INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash></FORM></TR><? }?>
<TR>
<TH class=subh align=left>Defense Weapons</TH>
<TH class=subh align=right>Quantity</TH>
<TH class=subh>Strength</TH>
<TH class=subh>Repair</TH>
<TH class=subh>Scrap/Sell</TH></TR>
<? $wep=getDefUserWeapon($user);
for($i=0;$i<count($wep);$i++){
printf ("<TR><TD>%s</TD>",$conf["race"][$user->race]["defenseweapon"][$wep[$i]->weaponID]["name"]);?>
<TD align=right><? numecho($wep[$i]->weaponCount) ?></TD>
<? $x=$wep[$i]->weaponStrength;
$y=$conf["race"][$user->race]["defenseweapon"][$wep[$i]->weaponID]["strength"];?>
<TD align=middle><? numecho($x) ?>/<? numecho($y) ?></TD>
<FORM action=armory.php method=post>
<TD><TABLE cellSpacing=0 cellPadding=2 width=\"100%\" border=0><TBODY><TR>
<? $rem=round(700/$y)*$wep[$i]->weaponCount;$id=$wep[$i]->weaponID;?>
<TD style="BORDER-BOTTOM: medium none"><INPUT type=input maxLength=4 size=2 value=0 name=defrepair<? echo $id; ?> ></TD>
<TD style="BORDER-BOTTOM: medium none" width="100%"><INPUT style="WIDTH: 100%" type=submit
value="<? numecho($rem) ?> Gold Per Point" name=dodefrepair>
</TD></TR></TBODY></TABLE></TD><INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash></FORM>
<FORM action=armory.php method=post><TD><TABLE cellSpacing=0 cellPadding=1 width="100%" border=0><TBODY><TR>
<TD style="BORDER-BOTTOM: medium none"><INPUT type=input maxLength=6 size=2 value=0 name=defscrapsell<? echo $id; ?> ></TD>
<TD style="BORDER-BOTTOM: medium none" width="100%"><INPUT style="WIDTH: 100%" type=submit value="<?
$pr=round(($conf["race"][$user->race]["defenseweapon"][$wep[$i]->weaponID]["price"])*($x/$y-0.2));
if($pr>0){echo "Sell for ";numecho($pr);echo " Gold";}
else echo "Scrap"; ?>" name=dodefscrapsell>
</TD></TR></TBODY></TABLE></TD><INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash></FORM></TR><? }?>
</TBODY></TABLE>
<P>
<TABLE width="100%">
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 25px" vAlign=top width="50%">
<TABLE class=table_lines cellSpacing=0 cellPadding=6 width="100%" border=0>
<TBODY>
<TR>
<TH colSpan=3>Military Effectiveness</TH></TR>
<TR>
<TD><B>Strike Action</B></TD>
<TD align=right><? numecho (getStrikeAction($user)) ?></TD>
<TD align=right>Ranked <?
if ($userR->strikeActionRank){
numecho ($userR->strikeActionRank);
}
else echo "#unranked";
?></TD></TR>
<TR>
<TD><B>Defensive Action</B></TD>
<TD align=right><? numecho (getDefenseAction($user)) ?></TD>
<TD align=right>Ranked <?
if ($userR->defenceActionRank ){
numecho ($userR->defenceActionRank );
}
else echo "#unranked";
?></TD></TR>
<TR>
<TD><B>Covert Action</B></TD>
<TD align=right><? numecho (getCovertAction($user)) ?></TD>
<TD align=right>Ranked <?
if ($userR->covertActionRank ){
numecho ($userR->covertActionRank );
}
else echo "#unranked";
?></TD></TR>
</TBODY>
</TABLE><BR>
</TD>
<TD vAlign=top width="50%">
<FORM action=armory.php method=post>
<TABLE class=table_lines cellSpacing=0 cellPadding=6 width="100%" border=0>
<TBODY>
<TR>
<TH colSpan=4>Buy Weapons</TH>
</TR>
<TR>
<TH class=subh align=left>Attack Weapons</Th>
<TH class=subh align=right>Strength</Th>
<TH class=subh align=right>Price</Th>
<TH class=subh>Buy</Th>
</TR>
<? for($i=0;$i<7;$i++){
printf ("<TR><TD>%s</TD>",$conf["race"][$user->race]["weapon"][$i]["name"]);?>
<TD align=right><? numecho($conf["race"][$user->race]["weapon"][$i]["strength"])?></TD>
<TD align=right><? numecho($conf["race"][$user->race]["weapon"][$i]["price"])?> Gold</TD>
<? echo "<TD align=middle><INPUT size=3 value=0 name=buy_w$i></TD></TR>";}
?>
<TR>
<TH class=subh align=left>Defense Weapons</Th>
<TH class=subh align=right>Strength</Th>
<TH class=subh align=right>Price</Th>
<TH class=subh>Buy</Th></TR>
<? for($i=0;$i<6;$i++){
printf ("<TR><TD>%s</TD>",$conf["race"][$user->race]["defenseweapon"][$i]["name"]);?>
<TD align=right><? numecho($conf["race"][$user->race]["defenseweapon"][$i]["strength"])?></TD>
<TD align=right><? numecho($conf["race"][$user->race]["defenseweapon"][$i]["price"])?> Gold</TD>
<? echo "<TD align=middle><INPUT size=3 value=0 name=buy_dw$i></TD></TR>";}
?>
<TR>
<TD align=middle colSpan=5><INPUT type=submit value="Process Order" name=buybut></TD></TR>
</TBODY></TABLE>
<INPUT
type=hidden value=93aa2b6a02603399396203313b45827e name=hash>
</FORM></TD></TR></TBODY></TABLE>
<FORM action=armory.php method=post>
Upgrade Defense
<? $fl=$conf["race"][$user->race]["fortification"][$user->fortificationLevel]["name"];
if($conf["race"][$user->race]["fortification"][$user->fortificationLevel+1]["price"])
{$kn=$conf["race"][$user->race]["fortification"][$user->fortificationLevel+1]["price"].' Gold For '.$conf["race"][$user->race]["fortification"][$user->fortificationLevel+1]["name"].' (+'.$conf["race"][$user->race]["fortification"][$user->fortificationLevel+1]["defence"].'%)';}
else
{$kn='No more upgrades available';}
?>
<?=$fl?><INPUT type=submit size=5 value="<?=$kn?>" width="100%" name=upgrade_fortification>
<INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash></FORM>
<FORM action=armory.php method=post>
//Various upgrades
<ul><li>Upgrade Attack Technology <? $sl=$conf["race"][$user->race]["siege"][$user->siegeLevel]["name"];
if($conf["race"][$user->race]["siege"][$user->siegeLevel+1]["price"]) {$kn=$conf["race"][$user->race]["siege"][$user->siegeLevel+1]["price"].' Gold For '.$conf["race"][$user->race]["siege"][$user->siegeLevel+1]["name"].' (+'.$conf["race"][$user->race]["siege"][$user->siegeLevel+1]["attack"].'%)';}
else
{$kn='No more upgrades available';}?>
<?=$sl?><INPUT type=submit size=5 value="<?=$kn?>" width="100%" name=upgrade_siege></li></ul>
</FORM>
</div>
<?
include ("bottom.php");
?>
</BODY></HTML>
This paste has no annotations.