View Single Post
  #7  
Old 06-20-2017, 04:06 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 93,837
Dinocanid is on a distinguished road
Default

I got it to work!

PHP Code:
public function index(){  
        
$mysidia Registry::get("mysidia");  
        
$document $this->document;      
        
$document->setTitle($this->lang->title);          
        
$document->addLangvar($this->lang->default);  
          
        
$readoptHeader = new Comment("Pounded Adoptables for adoption");  
        
$readoptHeader->setHeading(3);  
        
$document->add($readoptHeader);  
          
        
$readoptTable = new TableBuilder("readopttable");  
        
$readoptTable->setAlign(new Align("center""middle"));  
        
$readoptTable->buildHeaders();  
        
$readoptTable->setHelper(new AdoptTableHelper);  
          
          
        
$pounds $this->getField("pounds");          
        
$iterator $pounds->iterator();          
        while(
$iterator->hasNext()){  
            
$entry $iterator->next();  
            
$adopt $entry->getKey();  
            
$cost $entry->getValue();  
            if(
$adopt->getGender() == "m"){$gender "Male";}
            if(
$adopt->getGender() == "f"){$gender "Female";}

                
$cells = new ArrayList;  
                
$lvl $adopt->getCurrentLevel();  
                if (
$lvl == 0) { $cells->add(new Comment("<img src='{$adopt->getImage()}'></a>")); }  
                if (
$lvl == 1) { $cells->add(new Comment("<img src='{$adopt->getImage()}'></a>")); }  
                if (
$lvl >= 2) { $cells->add(new Comment("<img src='{$adopt->getImage()}' width= '200px'></a>")); }   
                
$cells->add(new Comment("<b>Name:</b> {$adopt->getName()}"));  
                
$cells->add(new Comment("<b>Gender:</b> {$gender}"));  
                
$cells->add(new Comment("<b>Total Clicks:</b> {$adopt->getTotalClicks()}"));
                
$readoptForm = new Form("readoptform""pound/adopt""post");
                
$readoptForm->add(new PasswordField("hidden","aid""{$adopt->getAdoptID()}""yes"));
                
$readoptForm->add(new Button("Adopt Me""submit""submit"));
                
$cells->add($readoptForm);
                
$aCells = new TCell($cells"cell{$index}");  
                
$aCells->setAlign(new Align("center""center"));
                
$readoptTable->add($aCells);
}  
            
$document->add($readoptTable); 
          
    } 
Now it should show more than one pet. Here's what it looks like:
__________________
Reply With Quote