<?php
$bannerId=$_REQUEST['banner_id'];
if(empty($bannerId)) return '';
$banner=$modx->getObject('modResource',$bannerId);
if(empty($banner)) return '';
$link=$_REQUEST['link'];
if(empty($link)) require '';
$clicker=$modx->getObject('modTemplateVar', array('name'=>'brClick'));
$clickerValue=$banner->getTVValue('brClick');
if($clickerValue!='n'){
	$clickerNewValue = $clickerValue-1;
	$clicker->setValue($bannerId, $clickerNewValue);
	$clicker->save();
};

$modx->sendRedirect($link);