View Single Post
  #1  
Old 08-25-2014, 10:09 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,537
Abronsyth is on a distinguished road
Default Alter Shop Table?

Just trying to make things less cluttered in general. I did something similar for my adoption page, but this is confusing me quite a bit.

I am trying to remove the columns "Category" "type" and "name" from the shop page. I am using Mys 1.3.3 and this is the shop file:
PHP Code:
<?php

class ShopController extends AppController{

    const 
PARAM "shop";
    private 
$view;
    private 
$subController;

    public function 
__construct(){
        
parent::__construct("member");    
        
$mysidia Registry::get("mysidia");        
        
$mysidia->user->getstatus();
        if(
$mysidia->user->status->canshop == "no"){
            throw new 
NoPermissionException($mysidia->lang->denied);
        }
        if(
$mysidia->input->action() != "index" and !$mysidia->input->get("shop")){
            throw new 
InvalidIDException($mysidia->lang->global_id);
        }
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle($mysidia->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 = new Shoplist($mysidia->input->post("shoptype"));
        
$shoplist->display();
    }
    
    public function 
browse(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();                    
        
$document->setTitle($mysidia->lang->welcome);
        
        
$shoptype $mysidia->db->select("shops", array("shoptype"), "shopname = '{$mysidia->input->get("shop")}'")->fetchColumn();
        
$shoplist = new Shoplist($shoptype);
        
$shop $shoplist->createshop($mysidia->input->get("shop"));
        
$shop->display();
    }
    
    public function 
purchase(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        if(!
$mysidia->input->post("buy")) throw new InvalidIDException($mysidia->lang->global_id);
        
        if(
$mysidia->input->post("shoptype") == "itemshop"){
            
$shop = new Itemshop($mysidia->input->get("shop"));
            
$item $shop->getitem($mysidia->input->post("itemname"));
            
$item->assign($mysidia->user->username);
            
$oldquantity $item->getoldquantity();
            
$newquantity $oldquantity $mysidia->input->post("quantity");
            
            if(!
is_numeric($mysidia->input->post("quantity"))){
                throw new 
InvalidActionException($mysidia->lang->invalid_quantity);
            }
            elseif(
$newquantity $item->cap){
                throw new 
InvalidActionException($mysidia->lang->full_quantity); 
            }
            else{
                
$shop->purchase($item);
                
$document->setTitle($mysidia->lang->global_transaction_complete);
                
$document->addLangvar("{$mysidia->lang->purchase_item}{$item->getcost($shop->salestax)} {$mysidia->settings->cost}");
            }
        }
        elseif(
$mysidia->input->post("shoptype") == "adoptshop"){
            
$shop = new Adoptshop($mysidia->input->get("shop"));
            
$adopt $shop->getadopt($mysidia->input->post("adopttype"));
            
$adopt->assign($mysidia->user->username);
            
            
$shop->purchase($adopt);
               
$document->setTitle($mysidia->lang->global_transaction_complete);
            
$document->addLangvar("{$mysidia->lang->purchase_adopt}{$adopt->getcost($shop->salestax)} {$mysidia->settings->cost}");      
        }
        else throw new 
InvalidActionException($mysidia->lang->global_action);
    }
}
?>
I just can't seem to find the place I would edit to remove these three columns?

Thanks for any help,
Abron
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote