Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14.  
  15. class functions {
  16. function POST($arg) {
  17. global $db;
  18.  
  19. return (!empty( $_POST[$arg] ) ? htmlspecialchars( $db->safesql( $_POST[$arg] ) ) : FALSE);
  20. }
  21.  
  22. function GET($arg) {
  23. global $db;
  24.  
  25. return (!empty( $_GET[$arg] ) ? htmlspecialchars( $db->safesql( $_GET[$arg] ) ) : FALSE);
  26. }
  27.  
  28. function pass($pass) {
  29. $pass .= 'Scrin_Developer)';
  30. return md5( $pass );
  31. }
  32.  
  33. function check_mail($email) {
  34. if (preg_match( '' . '/^[0-9a-zA-Z]([-_.]?[0-9a-z])*@[0-9a-zA-Z]([-.]?[0-9a-z])*\.[a-z]{2,3}$/', $email, $check )) {
  35. return TRUE;
  36. }
  37.  
  38. return FALSE;
  39. }
  40.  
  41. function error($error) {
  42. foreach ($error as $key) {
  43. echo $key . '<br/>';
  44. }
  45.  
  46. }
  47.  
  48. function ref_invest($user_id) {
  49. global $db;
  50.  
  51. $pr = $db->super_query( '' . 'SELECT sum(user_invest) as sum FROM `users` WHERE user_ref=\'' . $user_id . '\'' );
  52.  
  53. if (empty( $pr['sum'] )) {
  54. $invest = 0;
  55. } else {
  56. $invest = $pr['sum'];
  57. }
  58.  
  59. return $invest;
  60. }
  61.  
  62. function ref_proc($user_id) {
  63. $invest = $this->ref_invest( $user_id );
  64.  
  65. if ($invest < 500) {
  66. $proc = 10;
  67. } else {
  68. if ($invest < 1000) {
  69. $proc = 11;
  70. } else {
  71. if ($invest < 2000) {
  72. $proc = 12;
  73. } else {
  74. if ($invest < 5000) {
  75. $proc = 13;
  76. } else {
  77. $proc = 14;
  78. }
  79. }
  80. }
  81. }
  82.  
  83. return $proc;
  84. }
  85.  
  86. function add_dep($dep_id, $user_id, $amount, $ps, $balance) {
  87. global $db;
  88.  
  89. $dep = $db->super_query( '' . 'SELECT `dep_time` FROM `dep` WHERE `dep_id`=\'' . $dep_id . '\'' );
  90. $time = time( );
  91. $dep_end = 3600 * $dep['dep_time'] + $time;
  92. $db->query( '' . 'INSERT INTO `dep_us`( `dep_id`, `dep_start`, `dep_end`, `user_id`,`dep_sum`,`dep_system`)
  93. VALUES (\'' . $dep_id . '\',\'' . $time . '\',\'' . $dep_end . '\',\'' . $user_id . '\',\'' . $amount . '\',\'' . $ps . '\')' );
  94. $bonus = $this->bonus( $amount );
  95. $ref = $db->super_query( '' . 'SELECT `user_ref` FROM `users` WHERE `user_id`=\'' . $user_id . '\'' );
  96. $ref_id = $ref['user_ref'];
  97. $to_ref_proc = $this->ref_proc( $ref_id );
  98. $to_ref = $amount / 100 * $to_ref_proc;
  99.  
  100. if ($ps == 'pm') {
  101. $db->query( '' . 'UPDATE `users` SET `user_money_p`=user_money_p+\'' . $to_ref . '\' WHERE `user_id`=\'' . $ref_id . '\'' );
  102. $db->query( '' . 'UPDATE `users` SET `user_money_p`=user_money_p+\'' . $bonus . '\' WHERE `user_id`=\'' . $user_id . '\'' );
  103.  
  104. if ($balance == TRUE) {
  105. $db->query( '' . 'UPDATE `users` SET `user_money_p`=user_money_p-\'' . $amount . '\' WHERE `user_id`=\'' . $user_id . '\'' );
  106. }
  107. } else {
  108. $db->query( '' . 'UPDATE `users` SET `user_money_l`=user_money_l+\'' . $bonus . '\' WHERE `user_id`=\'' . $user_id . '\'' );
  109. $db->query( '' . 'UPDATE `users` SET `user_money_l`=user_money_l+\'' . $to_ref . '\' WHERE `user_id`=\'' . $ref_id . '\'' );
  110.  
  111. if ($balance == TRUE) {
  112. $db->query( '' . 'UPDATE `users` SET `user_money_l`=user_money_l-\'' . $amount . '\' WHERE `user_id`=\'' . $user_id . '\'' );
  113. }
  114. }
  115.  
  116. $db->query( 'UPDATE `stat` SET `info`=info+1 WHERE `st_id`=\'4\'' );
  117. $db->query( '' . 'UPDATE `stat` SET `info`=info+\'' . $amount . '\' WHERE `st_id`=\'2\'' );
  118. $db->query( '' . 'UPDATE `stat` SET `info`=info+\'' . $bonus . '\' WHERE `st_id`=\'3\'' );
  119.  
  120. if ($balance == TRUE) {
  121. $db->query( '' . 'INSERT INTO `history`( `user_id`, `p_ps`, `sum`, `time`, `p_type`) VALUES (\'' . $user_id . '\',\'' . $ps . '\',\'' . $amount . '\',\'' . $time . '\',\'re' . $ps . '\')' );
  122. } else {
  123. $db->query( '' . 'INSERT INTO `history`( `user_id`, `p_ps`, `sum`, `time`, `p_type`) VALUES (\'' . $user_id . '\',\'' . $ps . '\',\'' . $amount . '\',\'' . $time . '\',\'' . $ps . '\')' );
  124. }
  125.  
  126. $db->query( '' . 'INSERT INTO `history`( `user_id`, `p_ps`, `sum`, `time`, `p_type`) VALUES (\'' . $user_id . '\',\'' . $ps . '\',\'' . $bonus . '\',\'' . $time . '\',\'bonus\')' );
  127. $db->query( '' . 'UPDATE `users` SET `user_invest`=user_invest+\'' . $amount . '\' WHERE `user_id`=\'' . $user_id . '\'' );
  128. }
  129. ................................................................................
  130. .....................................
  131. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement