Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. // Loop through and check to make sure items are valid, also get item price.
  2. $Money = 0.00;
  3. foreach($Items as $key => $value)
  4. {
  5. $res = mysql_query("SELECT * FROM rewards WHERE id='{$value->Id}' AND server='{$value->Server}'",$Con);
  6. if(mysql_num_rows($res)==0)
  7. {
  8. $value->Error.="No reward with ID {$value->Id} exists on server ID {$value->Server}. ";
  9. }
  10. else
  11. {
  12. $rew = mysql_fetch_array($res);
  13. $value->Rewardname = $rew['name'];
  14. $Money+=(float)$rew['price'];
  15. $value->Price = $rew['price'];
  16. $value->RewardInfo = $rew;
  17. if($Money>(float)$_POST['mc_gross'])
  18. {
  19. $value->Error.="Did not pay enough to include this item. Item cost: {$rew['price']} Money spent: {$_POST['mc_gross']} Total money used up: {$Money}. ";
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment