Вход Регистрация
Файл: dvig/qwest.php
Строк: 195
<?
$vivod
='';

 
$queryob "SELECT * FROM `raspologenie_obektob` WHERE `severobekt`='" .
             
mysql_real_escape_string($row['sever']) . "' AND `wostokobekt`='" .
             
mysql_real_escape_string($row['wostok']) . " ' and polog='qwest' " ;
 
$sqlob mysql_query($queryob) or die(mysql_error()) ;
 
$rowob mysql_fetch_assoc($sqlob) ;
class 
Qwest
{

    function 
opredelenie_qwest($row$rowob)
    {
        
$r mysql_query("select*from new_qwest where id_qw='" $rowob['number'] ." '
        and sever='"
.$row['sever']."'
                and wostok='"
.$row['wostok']."'")or(die("3"));
        if (
mysql_num_rows($r) > 0) {
            
$e 1;
        } else {
            
$e 0;
        }
        return 
$e;


        ;
    }
    function 
exiti()
    {
        
header("Location:88.php?go=do");
        exit;
    }
    function 
proverka_zapisi($row)
    {
        
$r mysql_query("select*from new_qwest_pers where name='" $row['ID'] . "'");
        if (
mysql_num_rows($r) == 0) {
            
$this->dob_zapis($row);
            
$e 0;
        }
        ;
    }
    function 
dob_zapis($row)
    {
        
mysql_query("INSERT INTO `a36667_element`.`new_qwest_pers` (`id` ,
`name` ,
`1` ,
`2` 
)
VALUES (NULL , '" 
$row['ID'] . "', '0', '0'
);"
);
        ;
    }
    function 
vibor_qwesta($row$rowob)
    {
        
$r mysql_query("select*from new_qwest_pers where name='" $row['ID'] . "' ");
        
$rowq mysql_fetch_array($r);
        return 
$rowq;
    }
    function 
qwest_vivod($row$rowob)
    {
        
$rowq $this->vibor_qwesta($row$rowob);
        if (!isset(
$_GET['st'])) {

    
           
$qw_me mysql_query("SELECT *
FROM `new_qwest` where step='0' and id_qw='" 
$rowob['number'] .
                
"' and status='" $rowq[$rowob['number']] . "' and sever='".$row['sever']."'
                and wostok='"
.$row['wostok']."'")or die("r");
        } else {
            
$qw_me mysql_query("SELECT *
FROM `new_qwest` where `step`='" 
. (int)$_GET['st'] . "' and `id_qw`='" $rowob['number'] .
                
"' and status='" $rowq[$rowob['number']] . "' and sever='".$row['sever']."'
                and wostok='"
.$row['wostok']."'")or die("r");;
        }
        ;
    
    if (
mysql_num_rows($qw_me) == 0) {

        print 
no."Я сейчас занят!<br><a href=88.php?go=do>в игру</a>".d;
    } else {
$qwest=mysql_fetch_array($qw_me);

if(isset(
$_GET['exit'])){
    print 
cat."<strong><font color=red>Ваше задание:</font></strong> ".$qwest['zadanie']."".d;
   
   
   if(
$qwest['id_qw']==1){
    
mysql_query("update new_qwest_pers set `".$rowob['number']."`='".$qwest['new_status']."',kolvo='".$qwest['kolvo']."' where name='".$row['ID']."'");
 }else{
 
mysql_query("update new_qwest_pers set `".$rowob['number']."`='".$qwest['new_status']."' where name='".$row['ID']."'");

$kol=$qwest['kolvo'];
if(
$rowob['number']==6){
    
$kol=$row['rudokop'];}
    if(
$rowob['number']==7){
    
$kol=$row['digger'];}
    if(
$qwest['status']==0){
    
mysql_query("INSERT INTO `a36667_element`.`new_qwest_kolvo` (`name` ,
`qwest` ,
`kolvo` ,
`chit`,`status` 
)
VALUES ('"
.$row['ID']."', '".$rowob['number']."', '".$kol."', '".$qwest['chit']."',''
);"
)or die("t");}
    
    
    ;}  
    if((
$rowob['number']==1)&&($qwest['status']==5)){
        
mysql_query("delete from rukzak where chit='x' and name='".$row['name']."'");
        
mysql_query("delete from rukzak where nazvanie='Петерия' and name='".$row['name']."' LIMIT 10");
        
        
     
mysql_query("INSERT INTO `rukzak` ( `name` , `tip` , `nazvanie`,`chit`,`time`,`rus_tip` ) 
VALUES (
'" 
mysql_real_escape_string($row['name']) . "', 'x', 'Зелье','x','".time()."','Для сына Нерди'
)"
) or die(mysql_error()) ;   }
if((
$rowob['number']==1)&&($qwest['status']==6)){
   
mysql_query("delete from rukzak where chit='x' and name='".$row['name']."'");
 
mysql_query("INSERT INTO `rukzak` ( `name` , `tip` , `nazvanie`,`chit`,`time`,`rus_tip` ) 
VALUES (
'" 
mysql_real_escape_string($row['name']) . "', 'x', 'Купон на скидку в бутике!','x','".time()."','Для активации написать Админу'
)"
) or die(mysql_error()) ;
        ;}
    
   if((
$rowob['number']==2)&&($qwest['status']==2)){
   
mysql_query("delete from rukzak where chit='trava' and odeto='0' and name='".$row['name']."' limit 200");
 
mysql_query("update new_qwest_pers set `2`='".$qwest['new_status']."' where name='".$row['ID']."'");

$kl=mysql_query("select*from pers_info where name='".$row['name']."'");
$kll=mysql_fetch_array($kl);
$kll['rukzak']+=200;
mysql_query("update pers_info set rukzak='".$kll['rukzak']."' where name='".$row['name']."'");
        ;} 
           if((
$rowob['number']==3)&&($qwest['status']==2)){
   
mysql_query("delete from rukzak where chit='or' and odeto='0' and name='".$row['name']."' limit 50");
 
mysql_query("update new_qwest_pers set `3`='".$qwest['new_status']."' where name='".$row['ID']."'");

$row['orugejnik']+=20;
mysql_query("update table1 set orugejnik='".$row['orugejnik']."' where name='".$row['name']."'");
        ;} 
           if((
$rowob['number']==4)&&($qwest['status']==2)){
   
mysql_query("delete from rukzak where chit='shapka' and odeto='0' and name='".$row['name']."' limit 50");
 
mysql_query("update new_qwest_pers set `4`='".$qwest['new_status']."' where name='".$row['ID']."'");

$row['skornjak']+=20;
mysql_query("update table1 set skornjak='".$row['skornjak']."' where name='".$row['name']."'");
        ;} 
         if((
$rowob['number']==5)&&($qwest['status']==2)){
   
mysql_query("delete from rukzak where chit='el' and odeto='0' and name='".$row['name']."' limit 50");
 
mysql_query("update new_qwest_pers set `5`='".$qwest['new_status']."' where name='".$row['ID']."'");

$row['alhimia']+=20;
mysql_query("update table1 set alhimia='".$row['alhimia']."' where name='".$row['name']."'");
        ;} 
        
        
/////////////////
    
if(($rowob['number']==6)&&($qwest['status']==2)){
   
mysql_query("delete from rukzak where chit='ruda' and odeto='0' and name='".$row['name']."' limit ".$row['rudokop']."");
 
mysql_query("update new_qwest_pers set `6`='".$qwest['new_status']."' where name='".$row['ID']."'");

$row['rudokop']+=20;
mysql_query("update table1 set rudokop='".$row['rudokop']."' where name='".$row['name']."'");
        ;}    
            if((
$rowob['number']==7)&&($qwest['status']==2)){
   
mysql_query("delete from rukzak where chit='gem' and odeto='0' and name='".$row['name']."' limit ".$row['digger']."");
 
mysql_query("update new_qwest_pers set `7`='".$qwest['new_status']."' where name='".$row['ID']."'");

$row['digger']+=20;
mysql_query("update table1 set digger='".$row['digger']."' where name='".$row['name']."'");
        ;}        
    
    ;}else{
$vi='';
if(
$qwest['new_status']>$qwest['status']){
  
$vi='&exit';  
     
    
    ;}

    
    
     if((
$rowob['number']==8)&&($qwest['status']==5)){
    
$b=mysql_query("select*from new_qwest_kolvo where name='".$row['ID']."' and status=4 and kolvo>0");
    if(
mysql_num_rows($b)==0){
    
    
mysql_query("UPDATE   `table1` SET `sevgorod`='".$rowob['severobekt']."',`wostokgorod`='".$rowob['wostokobekt']."',
`sever`='-5',`wostok`='5',`polog1`='780' WHERE `ID`='" 
.$row['ID'] . "' LIMIT 1 ;"
 ;
header("Location:88.php?go=do");
   
 exit ;}
    
    ;}
if((
$rowob['number']==8)&&($qwest['status']==4)){
    
    
mysql_query("UPDATE   `table1` SET `sevgorod`='".$rowob['severobekt']."',`wostokgorod`='".$rowob['wostokobekt']."',
`sever`='-5',`wostok`='5',`polog1`='780' WHERE `ID`='" 
.$row['ID'] . "' LIMIT 1 ;"
 ;
header("Location:88.php?go=do");
   
 exit ;
    
    ;}
   
if((
$rowob['number']==8)&&($qwest['status']==3)){
    
    
mysql_query("UPDATE   `table1` SET `sevgorod`='".$rowob['severobekt']."',`wostokgorod`='".$rowob['wostokobekt']."',
`sever`='-5',`wostok`='5',`polog1`='780' WHERE `ID`='" 
.$row['ID'] . "' LIMIT 1 ;"
 ;
header("Location:88.php?go=do");
   
mysql_query("INSERT INTO `a36667_element`.`new_qwest_kolvo` (`name` ,
`qwest` ,
`kolvo` ,
`chit`,`status` 
)
VALUES ('"
.$row['ID']."', '8', '100', '','4'
);"
)or die("t");
 
mysql_query("update new_qwest_pers set `8`='4' where name='".$row['ID']."'");

 
 
 exit ;
    
    ;}
$vivod=cat."<strong><font color=red>" $qwest['name'] . "</font></strong>" $qwest['text'] . "<br><font color=green><strong>".$row['name']."</strong></font>:
     <a href=88.php?go=r1&st="
.$qwest['new_step']."$vi>" $qwest['o1'] . "</a><br>" $qwest['o2'] . "".d;


;}

return 
$vivod;
        
    }
;}

}

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