View Single Post
  #1  
Old 12-13-2016, 08:00 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 89,626
Dinocanid is on a distinguished road
Default Trade status not changing

For some reason, changing the trade status of any pet above level 1 or 0 doesn't seem to work. I haven't touched any code related to trades, but here's mine anyway:
PHP Code:
public function trade(){
        
$mysidia Registry::get("mysidia");        
        if(
$mysidia->input->get("confirm") == "confirm"){
            switch(
$this->adopt->getTradeStatus()){
                case 
"fortrade":
                    
$this->adopt->setTradeStatus("notfortrade""update");
                    
$message $mysidia->lang->trade_disallow;
                    break;
                case 
"notfortrade":
                    
$this->adopt->setTradeStatus("fortrade""update");
                    
$message $mysidia->lang->trade_allow;
                    break;
                default:
                    throw new 
InvalidActionException("global_action");
            }
        }
        else{
            
$message "Are you sure you wish to change the trade status of this adoptable?
                        <center><b><a href='
{$this->adopt->getAdoptID()}/confirm'>Yes I'd like to change its trade status</a></b><br /><br />
                        <b><a href='../../myadopts'>Nope I change my mind! Go back to the previous page.</a></b></center><br />"
;
        }
        
$this->setField("aid", new Integer($this->adopt->getAdoptID()));
        
$this->setField("image"$this->image);                
        
$this->setField("message", new String($message));                
    } 
PHP Code:
public function trade(){
        
$mysidia Registry::get("mysidia");
        
$aid $this->getField("aid")->getValue();        
        
$image $this->getField("image");    
        
$message $this->getField("message")->getValue();        
        
$document $this->document;
        
$document->setTitle($this->lang->trade);
        
$document->add($image);
        
$document->addLangvar($message);
    } 
__________________
Reply With Quote