<?php
/**
 * [BEGIN_COT_EXT]
 * Hooks=market.user_market_cntmoderprd.update
 * Order=99
 * [END_COT_EXT]
 */

defined('COT_CODE') or die('Wrong URL.');

if($user_market_cntmoderprd_uid > 0 && $user_market_cntmoderprd > 0) {
  $marketmodersuccesssumm = explode('|', $cfg['payments']['marketmodersuccesssumm']);

  if((int)$marketmodersuccesssumm[0] > 0 && (float)$marketmodersuccesssumm[1] > 0)
  {
    if($user_market_cntmoderprd >= (int)$marketmodersuccesssumm[1] && ((int)$marketmodersuccesssumm[1] == 1 || ($user_market_cntmoderprd % (int)$marketmodersuccesssumm[1]) == 0)) {
  	{
      require_once cot_incfile('payments', 'module');
      global $db_payments, $L;

      cot_payments_updateuserbalance_hand($user_market_cntmoderprd_uid, (float)$marketmodersuccesssumm[1], $L['payments_marketmodersuccesssumm_pay_desc'], true);

  		/* === Hook === */
  	  foreach (cot_getextplugins('payments.marketmodersuccess.done') as $pl)
  	  {
  		  include $pl;
  	  }
  	  /* ===== */
  	}
  }
}