A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Cream Porcupine, 9 Years ago, written in Python.
Embed
  1. import collections
  2. import decimal
  3.  
  4. from webmaster.models import WebmasterRegistrationBonus, WebmasterPayment
  5. from webmaster.models import DemandForWithdrawal
  6. from account.models import UserProfile
  7.  
  8. on_balances = collections.defaultdict(decimal.Decimal)
  9. on_hold = collections.defaultdict(decimal.Decimal)
  10. on_payouts = collections.defaultdict(decimal.Decimal)
  11.  
  12. profiles = UserProfile.objects.filter(registration_bonus__name__contains="balan")
  13.  
  14. for profile in profiles:
  15.         user = profile.user
  16.  
  17.         payouts = user.demandforwithdrawal_set.filter(status__in=['processed', 'pending'])
  18.         for payout in payouts:
  19.                 on_payouts[payout.finally_currency_id] += payout.finally_payment_sum
  20.  
  21.         payments = WebmasterPayment.objects.filter(
  22.                 user=user, processed=False, banned=False, status__in=['approved', 'pending'])
  23.  
  24.         for payment in payments:
  25.                 on_hold[payment.currency_id] += payment.payment_to_webmaster_final
  26.  
  27.         balances = user.userbalance_set.all()
  28.         for balance in balances:
  29.                 on_balances[balance.currency_id] += balance.balance
  30.  
  31. print 'WEBMASTERS'
  32. print 'total', profiles.count()
  33. print 'active', profiles.filter(user__is_active=True).count()
  34. print 'inactive', profiles.filter(user__is_active=False).count()
  35. print '*' * 10
  36.  
  37. print 'BALANCES'
  38. for currency_id, balance in on_balances.items():
  39.         if not balance:
  40.                 continue
  41.         print currency_id, balance
  42. print '*' * 10
  43.  
  44. print 'HOLD'
  45. for currency_id, balance in on_hold.items():
  46.         if not balance:
  47.                 continue
  48.         print currency_id, balance
  49. print '*' * 10
  50.  
  51. print 'PAYOUTS'
  52. for currency_id, balance in on_payouts.items():
  53.         if not balance:
  54.                 continue
  55.         print currency_id, balance
  56. print '*' * 10
  57.