| Код | class fight extends userinfo{ public $fight_id; public $oldfight; public $friend; public $agressor_id; public $type_info; public $why_is_it; public $id_friend; public $force; public $fight; public $_damage; public $type_fight; public $bot_id; public $who_walked; public $who_goes_first; public $_last_move; public $ability_id; public $id_course; public $first_fight; public $_opponents; public $name_abilit; public $_turnir_opponents; public $id_bot_vkontakte; public $id_user_vkontakte; /** * @var $fight_id - идентификатор боя * @var $type_fight - тип боя * @var $ability_id - id используемого умения * @var $id_user_vkontakte - id пользователя вконтакте * @var $id_bot_vkontakte - id бота вконтакте * @var $type_info= - тип информации * @var $friend - id друга vkontakte * @var $blue_kit- синяя аптечка * @var $red_kit - красная аптечка * */ public function __CONSTRUCT($fight_id,$type_fight,$ability_id,$id_user,$id_bot,$id_friend,$auto_fight,$red_kit,$blue_kit,$fight){ $this->fight_id=$fight_id; $this->type_fight=$type_fight; $this->ability_id=$ability_id; $this->id_user_vkontakte=$id_user; $this->id_bot_vkontakte=$id_bot; $this->friend=$id_friend; $this->auto_fight=$auto_fight; $this->blue_kit=$blue_kit; $this->red_kit=$red_kit; $this->oldfight=$fight; $_opponents=array(); $_last_move=array(); }
|
| Код | $this->oldfight=$fight;
|
Добавлено через 14 минут и 17 секунд NLspieler, это переменная $_get она передаётся через заголовок ,а потом происходит снова вызов функции и кстате ,вы ещё забыли вот это
| Код | $obg=new fight($_POST['fight_id'],$_POST['type_fight'],$_POST['ability_id'],$_POST['id_user_vkontakte'],$_POST['id_bot_vkontakte'],$_POST['id_friend'],$_POST['auto_fight'],$_POST['red_kit'],$_POST['blu_kit'],$_GET['fight_id']);
|
| Код | public function newfight(){ echo '{"fight_id":"'.$this->oldfight.'"}'; var_dump($this->oldfight); $this->user_id=$this->getuserid($this->id_user_vkontakte); if(isset($this->user_id)){ $this->getopponents($this->user_id); $this->withdrawal_opponents(); $next_course=$this->who_goes_first($this->_opponents,1); echo $next_course; if($next_course==$this->user_id){$first_course='user'; } elseif ($next_course==$this->bot_id){$first_course='bot';} if($this->type_fight and count($this->_opponents)>0 and $this->user_id){ $type_fight=mysql_escape_string($this->type_fight); $string=implode(",",$this->_opponents); $string=mysql_escape_string($string); $this->last_fight_id(); $this->fight_id=$this->fight_id+1; $link=$this->sql_query("select `fight_id`,`type_fight` from ".T_FIGHT." where Id_bots IN ($string) and User_id='$this->user_id' and type_fight='$type_fight' and win='' and Who_win='0'") or die(mysql_error()); if($this->sql_num_rows($link)==0){ foreach($this->_opponents as $value){ $this->sql_query("insert into ".T_FIGHT." (`time`,`User_id`,`Id_bots`,`type_fight`,`fight_id`,`who_goes_first`,`who_id_it`) VALUES('UNIX_TIMESTAMP()','$this->user_id','$value','$type_fight','$this->fight_id','$next_course','$first_course')") or die(mysql_error());} header("location:class.fight.php?fight_id=$this->fight_id&go=new_fight"); }} }else{echo 'id пользователя вконтакте не введён';} }
|
|