<?php
/**
 * Open Source - Content Managment System
 * Next Generation v2
 * @Coder:  Mutzii
 * @copyright  Copyright (c) 2012-2013 by Mutzii
 * File: AuktionList.modul.php
 */
class AuktionList extends Modul
{
   public function onEnable()
   {
      $API = $this->getInstance()->getAPI("auktion");	  
	  if($this->isWebsite("index")){
	  
	     $table = "auktion";
	     $liste = "";
		 
	            if(isset($_GET["nav"])){
				
		  	        if(!empty($_GET["nav"])){ $liste = $API->navigation($table,$_GET["nav"]);    
                  	}else{
								              $liste = $API->navigation($table,1);
                  	}
                   
                }else{ $liste = $API->navigation($table,1);}

				
                  if(isset($_GET["byID"])){
                     if(!empty($_GET["byID"])){
					 
                               $liste = $API->navigation($table,100,$_GET['byID']);
                     }
                  }

                  if(isset($_GET["byName"])){
                     if(!empty($_GET["byName"])){
                            
			                  $liste = $API->navigation($table,101,$_GET['byName']); 
                     }
                  }

                 
                  if(isset($_GET["byID"]) && isset($_GET["nav"])){
                    if(!empty($_GET["byID"]) || !empty($_GET["nav"])){

						      $liste = $API->navigation($table,100,$_GET['byID'],$_GET['nav']); 
                    }
                  }

                  if(isset($_GET["byName"]) && isset($_GET["nav"])){
                    if(!empty($_GET["byName"]) || !empty($_GET["nav"])){
				 
						      $liste = $API->navigation($table,101,$_GET['byName'],$_GET['nav']); 
                    }
                  }
	  
	  
	     $this->ViewListe($liste);
	  }
	  
  
   }
   
     public function onDisable(){}

     public function isWebsite($site){
           
         if($this->getInstance()->getLogin()->Login()){
             if($this->getInstance()->LoginStatus() == 3){
                if($this->getInstance()->getIndexContent() == $site){
                      return true;
                }
             }
         }

       return false;
    }
	
	public function ViewListe($liste){
	
	  $array = array( 
	      "{auktionsliste}" =>  $liste
		 );
		 
       $this->getPlaceHolder()->fill($array);
	}

   
   
}





?>