Вход Регистрация
Файл: __system/pages/go.php
Строк: 65
<?

       $reclame 
$db -> query
                            
("
                              SELECT `id`,`restrictionDay`,`transitionsDay`,`url` FROM  `reclame` WHERE `money` > '0' and `id` = '"
.filtration::int($_GET['id'])."' and `status` = '1' LIMIT 1
                            "
);

             if(
$reclame -> rowCount() == 1)
             {

              
$money 0.10;
              
$click 1;

              
$r $reclame->fetch(PDO::FETCH_ASSOC);

              
$ip_isset $db -> query
                            
("

                             SELECT `id` FROM `note_host_reclame` WHERE `siteID` = '"
.$r['id']."' AND `ip` = '".$ip."' and `date`='".date("Y-m-d",time())."'

                            "
);





             if ((
$ip_isset -> rowCount()) == 0)

              {

                
$operator $db -> query
                            
("

                             SELECT `on` FROM `ip` WHERE INET_ATON('"
.$ip."') BETWEEN `min` AND `max`

                            "
);

                if(
$operator -> rowCount() > 0)

                  {
                     
$o $operator -> fetch(PDO::FETCH_ASSOC);
                     
$operator_note $o['on'];
                  }

                    else

                  {
                    
$operator_note 1000;
                  }


                if(
$r['restrictionDay'] == 0)

                  {


                            
$reclameUpdate $db->prepare("UPDATE `reclame` SET `money` = (`money` -  :money),
                            `transitionsDay` = (`transitionsDay` + :transitionsDay) WHERE `id` = :id LIMIT 1"
);
                            
$reclameUpdate->bindParam(':money'$money);
                            
$reclameUpdate->bindParam(':transitionsDay'$click);
                            
$reclameUpdate->bindParam(':id'$r['id']);
                            
$reclameUpdate->execute();

                     
$stmt $db->prepare("INSERT INTO `note_host_reclame` (`id`,`siteID`,`ip`,`browser`,`operator`,`date`,`time`) VALUES (?,?,?,?,?,?,?)");
                     
$stmt -> execute(array('',''.$r['id'].'',''.$ip.'',''.$browser.'',''.$operator_note.'',''.date("Y-m-d",time()).'',''.time().''));
                  
header('Location: http://'.$r['url'].'');exit;
                  }

                    else

                  {
                      if(
$r['transitionsDay'] < $r['restrictionDay'])

                      {

                       
$reclameUpdate $db->prepare("UPDATE `reclame` SET `money` = (`money` -  :money),
                            `transitionsDay` = (`transitionsDay` + :transitionsDay) WHERE `id` = :id LIMIT 1"
);
                            
$reclameUpdate->bindParam(':money'$money);
                            
$reclameUpdate->bindParam(':transitionsDay'$click);
                            
$reclameUpdate->bindParam(':id'$r['id']);
                            
$reclameUpdate->execute();

                         
$stmt $db->prepare("INSERT INTO `note_host_reclame` (`id`,`siteID`,`ip`,`browser`,`operator`,`date`,`time`) VALUES (?,?,?,?,?,?,?)");
                         
$stmt -> execute(array('',''.$r['id'].'',''.$ip.'',''.$browser.'',''.$operator_note.'',''.date("Y-m-d",time()).'',''.time().''));
                      
header('Location: http://'.$r['url'].'');exit;
                      }

                        else

                      {
                      
header('Location: /');exit;

                      }

                  }





              }

              else

              {
                  
header('Location: http://'.$r['url'].'');exit;

              }

             }

               else

             {

             
header('Location: /');exit;

             }



?>
Онлайн: 4
Реклама