View Single Post
  #4  
Old 12-31-2014, 11:15 AM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,381
IntoRain is on a distinguished road
Default

Your index() function in shopview is broken, repeated code and two while's with no matching ending curly brackets, maybe it doesn't work because of that?
The original seems to work well:

shopview

PHP Code:
        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");  
        
$document->addLangvar($this->lang->select); 
        
$shopTable = new TableBuilder("shoplist"); 
        
$shopTable->setAlign(new Align("center""middle")); 
        
$shopTable->buildHeaders("Image""Category""Type""Name""Description""Sales Tax""Enter");     
        
$shopTable->setHelper(new ShopTableHelper);                 
         
        
$iterator $shopList->iterator(); 
        while(
$iterator->hasNext()){ 
            
$entry $iterator->next(); 
            
$shop $shopList->createshop($entry->getKey()); 
            
$cells = new LinkedList
             
            
$cells->add(new TCell($shopList->getshopimage($shop->imageurl))); 
            
$cells->add(new TCell($shop->category)); 
            
$cells->add(new TCell($shop->shoptype)); 
            
$cells->add(new TCell($shop->shopname)); 
            
$cells->add(new TCell($shop->description)); 
            
$cells->add(new TCell($shopTable->getHelper()->getSalestax($shop->salestax))); 
            
$cells->add(new TCell($shopTable->getHelper()->getShopStatus($shop))); 
            
$shopTable->buildRow($cells); 
        } 
        
$document->add($shopTable);   
    } 
If the original still throws errors:

shop

PHP Code:
public function index(){ 
        
$mysidia Registry::get("mysidia");
        
$hasShop = ($mysidia->input->post("shoptype") != "")? 0;
        
        
$this->setField("hasShop", new Integer($hasShop));
        
        if(
$mysidia->input->post("shoptype") != ""){
            
$shopList = new Shoplist($mysidia->input->post("shoptype"));
            if(
$shopList->gettotal() == 0) throw new InvalidIDException("none");
            
$this->setField("shopList"$shopList);
       } 
shopview

PHP Code:
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);
        
$hasShop $this->getField("hasShop")->getValue(); 
        
        if(
$hasShop){
        
$shopList $this->getField("shopList"); 
        
$document->addLangvar($this->lang->select);
        
$shopTable = new TableBuilder("shoplist");
        
$shopTable->setAlign(new Align("center""middle"));
        
$shopTable->buildHeaders("Image""Category""Type""Name""Description""Sales Tax""Enter");    
        
$shopTable->setHelper(new ShopTableHelper);         
        
        
$iterator $shopList->iterator();
        while(
$iterator->hasNext()){
            
$entry $iterator->next();
            
$shop $shopList->createshop($entry->getKey());
            
$cells = new LinkedList;
            
            
$cells->add(new TCell($shopList->getshopimage($shop->imageurl)));
            
$cells->add(new TCell($shop->category));
            
$cells->add(new TCell($shop->shoptype));
            
$cells->add(new TCell($shop->shopname));
            
$cells->add(new TCell($shop->description));
            
$cells->add(new TCell($shopTable->getHelper()->getSalestax($shop->salestax)));
            
$cells->add(new TCell($shopTable->getHelper()->getShopStatus($shop)));
            
$shopTable->buildRow($cells);
        }
        
$document->add($shopTable);  
        }

__________________


asp.net stole my soul.
Reply With Quote