Advertisement
StevenG89

Untitled

May 30th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.55 KB | None | 0 0
  1. <?php
  2. include(__DIR__."/config.php");
  3. global $_CONFIG;
  4. define("MONO_ON", 1);
  5. require "class/class_db_{$_CONFIG['driver']}.php";
  6. $db=new database;
  7. $db->configure($_CONFIG['hostname'],
  8. $_CONFIG['username'],
  9. $_CONFIG['password'],
  10. $_CONFIG['database'],
  11. $_CONFIG['persistent']);
  12. $db->connect();
  13. $c=$db->connection_id;
  14.  
  15. $db->query("TRUNCATE TABLE lottolast;");
  16.  
  17. $num1 = rand(1, 15);
  18. $num2 = rand(1, 15);
  19. $num3 = rand(1, 15);
  20. $num4 = rand(1, 15);
  21. $num5 = rand(1, 15);
  22. $uc = $db->query("SELECT * FROM `lotto`");
  23. while($cl = $db->fetch_row($uc))
  24. {
  25.     $pc = $db->query("SELECT `lotto1` FROM `users` WHERE `userid` = {$cl['userid']}");
  26.     $pl = $db->fetch_row($pc);
  27.     if($cl['lottery1'] == $num1) { $cor1="1000000"; } else { $cor1="0"; }
  28.     if($cl['lottery2'] == $num2) { $cor2="1000000"; } else { $cor2="0"; }
  29.     if($cl['lottery3'] == $num3) { $cor3="1000000"; } else { $cor3="0"; }
  30.     if($cl['lottery4'] == $num4) { $cor4="1000000"; } else { $cor4="0"; }
  31.     if($cl['lottery5'] == $num5) { $cor5="1000000"; } else { $cor5="0"; }
  32.     if($pl['lotto1'] == 1)
  33.     {
  34.         $prize = $cor1+$cor2+$cor3+$cor4+$cor5;
  35.     }
  36.     else
  37.     {
  38.         $prize=0;
  39.     }
  40.     $db->query("UPDATE `users` SET `bankmoney` = `bankmoney` + $prize WHERE `userid` = {$cl['userid']}");
  41.     $db->query("UPDATE `users` SET `lotto1` = '0'");
  42.     $db->query("INSERT INTO `lottolast` SET
  43.     `lotto1` = '$num1', `lotto2` = '$num2', `lotto3` = '$num3', `lotto4` = '$num4', `lotto5` = '$num5'");
  44. }
  45. print "
  46. Prize: $prize
  47. Number 1: $num1
  48. Number 2: $num2
  49. Number 3: $num3
  50. Number 4: $num4
  51. Number 5: $num5
  52. Users {$cl['userid']}
  53. ";
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement