Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by @_@ ( 14 years ago )
<?php
require_once 'Zend/Layout.php';

class IndexController extends Zend_Controller_Action
{


    public function init()
    {
       Zend_Layout::startMvc();
       $categoryTable = new Application_Model_DbTable_Category;
       $this ->getContent();
       $this->view->categories = $categoryTable->fetchAll();
       $this->view->category = array();
       foreach ($this->view->categories as $current_category)
       {
           if ($current_category->parent_id == '0'){
               $this->view->category[$current_category->id]["name"] = $current_category->title;
           }
           else{
               $parent_id = $current_category->parent_id;
               $this->view->category[$parent_id]["subcategories"][$current_category->id]= $current_category->title; 
           }
       }
      
    }
    
    public function getContent()
    {
        $categoryTable = new Application_Model_DbTable_Category;
        $columns = "`id`,`parent_id`,`title`";   
        if($handle = fopen&#40;'content/demo_date_Amiro-CMS.csv',"r"&#41;){
            while ($this->view->data = fgetcsv($handle,0,";")){
                $this->view->insertValues = array();
                foreach ($this->view->data as $value) {
                    $this->view->insertValues[] = "'" . addslashes(trim($value)) . "'";                    
                }
                $this->view->values = implode(',', $this->view->insertValues);
                var_dump("hghghg");
                //  var_dump($this->view->values);
            }
            fclose($handle);
        }
    }
            

    public function indexAction()
    {
         
       $this->view->title='Bike Store';       
    }

     public function categoryAction()
    {        
       $this->view->title='Bike Parts';
       $productTable = new Application_Model_DbTable_Product();
       $this->view->products = $productTable->fetchAll();
    }
    
     public function categorywithsubcategoriesAction()
    {        
       $this->view->title='Clothing';
    }
    
    public function contactAction()
    {        
       $this->view->title='Contact';
    }
    
     public function loginAction()
    {        
       $this->view->title='Log in';
    }
    
       public function accountAction()
    {        
       $this->view->title='My account';
    }
    
    public function aboutAction()
    {        
       $this->view->title='About Us';
    }
    public function manufacturerAction()
    {        
       $this->view->title='Adipisicing elit';
    }
}
DF

 

Revise this Paste

Parent: 55465
Your Name: Code Language: