View Single Post
  #3  
Old 12-07-2016, 11:39 AM
lotus's Avatar
lotus lotus is offline
Member
 
Join Date: Oct 2016
Posts: 7
Gender: Female
Credits: 1,043
lotus is on a distinguished road
Default

Here's my code for /view/shopview.php:
PHP Code:
<?php

use Resource\Collection\LinkedList;

class 
ShopView extends View{
    
    public function 
index(){
        
$document $this->document;
        
$document->setTitle($this->lang->access);
        
        
$typeForm = new Form("shoptypes""shop""post");
        
$typeSelection = new DropdownList("shoptype");
        
$typeSelection->add(new Option("Itemshop""itemshop"));
        
$typeSelection->add(new Option("Adoptshop""adoptshop"));
        
$typeForm->add($typeSelection);
        
$typeForm->add(new Button("Go""submit""submit"));
        
$document->add($typeForm);
        
        
$shopList $this->getField("shopList");
        
        
$iterator $shopList->iterator();
        while(
$iterator->hasNext()){
            
$entry $iterator->next();
            
$shop $shopList->createshop($entry->getKey());
            
                    
# Display Shop...
            
$document->add(new Comment("<div style='display: inline-table;'>
            <a href='/shop/browse/
{$shop->shopname}'>
                <img src='
{$shop->imageurl}' rel='tooltip' title=\"{$shop->shopname}<br>
               <strong>Location:</strong> 
{$shop->category}<br>
               
{$shop->description}\">
               </a></div>"
FALSE));
        }
    }
    
    public function 
browse(){
        
$document $this->document;                    
        
$document->setTitle($this->lang->welcome);
        
$shop $this->getField("shop");
        
$shop->display();
    }
    
    public function 
purchase(){
        
$mysidia Registry::get("mysidia");
        
$cost $this->getField("cost");
        
$document $this->document;        
        
        if(
$mysidia->input->post("shoptype") == "itemshop"){
            
$document->setTitle($this->lang->global_transaction_complete);
            
$document->addLangvar("{$this->lang->purchase_item}{$cost->getValue()} {$mysidia->settings->cost}");
        }
        elseif(
$mysidia->input->post("shoptype") == "adoptshop"){
               
$document->setTitle($this->lang->global_transaction_complete);
            
$document->addLangvar("{$this->lang->purchase_adopt}{$cost->getValue()} {$mysidia->settings->cost}");      
        }
        else return;
    }
}
?>
I've taken the tables away entirely and replaced them with only linked pictures. Try setting the div width to 20% so it only takes up 1/5 of the page.

Last edited by lotus; 12-07-2016 at 11:44 AM.
Reply With Quote