I'm attempting to make a feature where users can release a pet to the wild, which basically just means permanently deleting it.
I've just copied and modified my pets' bio functions in their myadopts.php and myadoptsview.php to look like below. In class_ownedadoptables.php, I just have a blank public function "doReleasePet()" because I'm honestly just scared to try experimenting with deleting things. Afraid I'll end up deleting a whole database table or something lol. Can someone help me out? ;-; Am I going in the right direction at least?
myadopts.php
myadoptsview.php
class_ownedadoptables's doReleasePet()
I've just copied and modified my pets' bio functions in their myadopts.php and myadoptsview.php to look like below. In class_ownedadoptables.php, I just have a blank public function "doReleasePet()" because I'm honestly just scared to try experimenting with deleting things. Afraid I'll end up deleting a whole database table or something lol. Can someone help me out? ;-; Am I going in the right direction at least?
myadopts.php
PHP:
public function releasepet(){
$mysidia = Registry::get("mysidia");
if($mysidia->input->post("submit")){
$this->adopt->doReleasePet();
}
$this->setField("adopt", $this->adopt);
$this->setField("image", $this->image);
}
myadoptsview.php
PHP:
public function releasepet(){
$mysidia = Registry::get("mysidia");
$adopt = $this->getField("adopt");
$image = $this->getField("image");
$document = $this->document;
if($mysidia->input->post("submit")){
$document->setTitle("Successfully Released Pet");
$document->add($image);
$document->add(new Comment("<br/>You've successfully released your creature to the wild, where it will live out the rest of its days. "));
return;
}
$document->setTitle("Release ".$adopt->getName());
$document->add($image);
$document->addLangvar("<br/>You can release {$adopt->getName()} to the wilderness here. Are you sure you want to do this?<br/>");
$releaseButton = new FormBuilder("releasebutton", "", "post");
$releaseButton->buildButton("Release!", "submit", "submit");
$document->add($releaseButton);
}
class_ownedadoptables's doReleasePet()
PHP:
public function doReleasePet(){
}