<?php
require_once(SYSTEM_LOGICS . 'registration_history/model.php');

class LogicRegistrationHistory extends RegistrationHistoryModelClass {
    
    public function __construct(){
        parent::__construct();
    }
    
    public function logic(){
        try{
            if($this -> init()){
                
                if($this -> getType() == TYPE_EXPORT){
                    $this -> list();
                    $this -> exportRegistrationHistory();
                }else
                    $this -> list();
            }
        }catch(Exception $ex){
            throw $ex;
        }
    }
    
    public function list(){
        $this -> setResult($this -> accessSelect('LIST_REGISTERED_ACCOUNTS_LTD', $this -> getWhere()));
        $this -> setTotal($this -> getColumnData($this -> getRowData($this -> accessSelect('LIST_REGISTERED_ACCOUNTS_LTD_COUNT', $this -> getWhere())), COLUMN_COUNTER));
    }
}