Файл: modules/earn/ajax.php
Строк: 35
<?
if($CONFIG['uid']==0) die('Access denied.');
switch($this->Act){
case 'skiptask':
$tid = $_POST['id'];
$Task = Tasks::GetTask($_POST['id']);
if(is_numeric($Task['id']) && $Task['id']!='0'){
if($Task['isdone']=='1'){
echo Ajax::Responce(array('err'));
} else {
mysql_query("INSERT INTO `done` (`social` ,`type` ,`uid` ,`tid`, `mode`) VALUES ('".$Task['social']."', '".$Task['type']."', '".$CONFIG['uid']."', '$tid', 'skip');");
echo Ajax::Responce(array('ok'));
}
}
break;
case 'loadtask':
if($_POST['social']=='vk'){ echo json_encode(Tasks::GetRand('vk',$_POST['type'])); }
break;
case 'checktask':
$tid = mysql_real_escape_string($_POST['id']);
$uid = $CONFIG['uid'];
$Task = Tasks::GetTask($_POST['id']);
//print_r($Task);
/*$yres = mysql_query("SELECT COUNT(`tid`) AS `count` FROM `done` WHERE `tid` = '".$Task['id']."' AND `mode` = 'done';");
$ydata = mysql_fetch_assoc($yres);
$ytasks_count = $ydata['count']; */
if(is_numeric($Task['id']) && $Task['bal']>=$Task['pay']){
$Done = Core::MysqlSelect('done','`tid`',array('uid'=>$uid,'tid'=>$_POST['id']));
//print_r($Done);
if(is_array($Done) || $uid==$Task['uid']){
echo Ajax::Responce(array('done'));
} else {
$id = $_POST['id'];
$aa = parse_url($Task['url']);
if($Task['social']=='vk' && $Task['type']=='like'){
include('check/vklike.php');
} elseif($Task['social']=='vk' && $Task['type']=='repost'){
include('check/vkrepost.php');
} elseif($Task['social']=='vk' && $Task['type']=='group'){
include('check/vkgroup.php');
} elseif($Task['social']=='vk' && $Task['type']=='friend'){
include('check/vkfriend.php');
}
}//here is done!
} else {
echo Ajax::Responce(array('err'));
} //sorry, zadanie not sushestvuet
break;
}