Файл: vigre/bonus.php
Строк: 47
<?php
function vgrInt_deliverBonus($voteId, $voteDate, $voteIp, $voteChar, $sms)
{
vgrInt_openGameSQLConnection();
$voteId = intval($voteId);
$voteDate = intval($voteDate);
$sms = intval($sms);
$req = mysql_query("SELECT * FROM `votes_kol` WHERE `nick`='$voteChar' LIMIT 1");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto==1){
$rs = mysql_fetch_array($req);
$rs['fa']=$rs['fa']+1;
/////////////////
mysql_query("UPDATE `votes_kol` SET `fa`='".$rs['fa']."' WHERE `nick`='$voteChar'");
$time = date("H:i d.m.y");
mysql_query("INSERT INTO `msg_r` SET `user_from` = 'Sistema', `user_to` = '$voteChar', `time` = '$time', `read` = 1, `mail_msg` = 'Zachisleno 1 Festival Aden za golosovanie.'");
}else{
$rs = mysql_fetch_array($req);
/////////////////
mysql_query("INSERT INTO `votes_kol` SET `fa`='1', `nick` = '$voteChar'");
$time = date("H:i d.m.y");
mysql_query("INSERT INTO `msg_r` SET `user_from` = 'Sistema', `user_to` = '$voteChar', `time` = '$time', `read` = 1, `mail_msg` = 'Zachisleno 1 Festival Aden za golosovanie.'");
}
return true;
}
function vgrInt_deliverBonusInit()
{
try
{
vgrInt_openGameSQLConnection();
}
catch (Exception $e)
{
vgrInt_printMessage(null, VGR_INT_MESSAGE_WARN, $e->getMessage());
}
}
function vgrInt_deliverBonusDeinit()
{
vgrInt_closeGameSQLConnection();
}
?>