cot_cfg_paytop - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of cot_cfg_paytop.php

  1. <?php
  2. function cot_get_paytop ($area='', $count=0, $order = "s.service_id ASC")
  3. {
  4.         global $db, $cfg, $sys, $db_payments_services, $db_users;
  5.        
  6.         $pt_cfg = cot_cfg_paytop();
  7.        
  8.         if ($area не існує в cot_cfg_paytop)
  9.         {
  10.                 cot_die(404);
  11.         }
  12.  
  13.         if($count == 0)
  14.         {
  15.                 $count = $pt_cfg[$area]['count'];
  16.         }
  17.        
  18.         if (empty($area) && !isset($pt_cfg[$area]['cost']))
  19.         {
  20.                 return false;
  21.         }
  22.        
  23.  
  24.         $paytopcount = $db->query("SELECT COUNT(*) FROM $db_payments_services as s
  25.                 LEFT JOIN $db_users AS u ON u.user_id=s.service_userid
  26.                 WHERE u.user_id>0 AND s.service_area='paytop.".$db->prep($area)."' AND service_expire > " . $sys['now'])->fetchColumn();
  27.        
  28.  
  29.         $paytops = $db->query("SELECT * FROM $db_payments_services as s
  30.                 LEFT JOIN $db_users AS u ON u.user_id=s.service_userid
  31.                 WHERE u.user_id>0 AND s.service_area='paytop.".$db->prep($area)."' AND service_expire > " . $sys['now'] . " ORDER BY $order LIMIT " . $count)->fetchAll();
  32.        
  33. }
  34.  
File Description
  • cot_cfg_paytop
  • PHP Code
  • 03 Jul-2021
  • 924 Bytes
You can Share it: