<?php

class TipkatMod extends DbMod{

	function TipkatMod($ArrMsSp){
		parent::__construct($ArrMsSp);
		return true;
	}
	
	function GetFromDb($VarSqlName = 'SqlAll', $VarSqlGet = 'GetAll', $VarWhere = '', $VarOrder = '', $VarLimit = ''){
    $ArrSqlArray['SqlAll']['select'] = 'a.TIPKAT_ID, a.TIPKAT_NAME_'. $this->ArrMsSp->Sp_Lang .' AS TIPKAT_NAME';
    $ArrSqlArray['SqlAll']['from'] = $this->VarTableTipkat .' AS a';
    $ArrSqlArray['SqlAll']['where'] = '';
    if('' != $VarWhere){
      $ArrSqlArray['SqlAll']['where'] = $VarWhere;
    }
    if('' != $VarOrder){
      $ArrSqlArray['SqlAll']['order'] = $VarOrder;
    }
    if('' != $VarLimit){
      $ArrSqlArray['SqlAll']['limit'] = $VarLimit;
    }
    ///
//    $ArrSqlArray['SqlRow']['select'] = 'a.TIPKAT_ID, a.TIPKAT_NAME_'. $this->ArrMsSp->Sp_Lang .' AS TIPKAT_NAME';
//    $ArrSqlArray['SqlRow']['from'] = $this->VarTableTipkat .' AS a';
//    $ArrSqlArray['SqlRow']['where'] = '';
//    if('' != $VarWhere){
//      $ArrSqlArray['SqlRow']['where'] = $VarWhere;
//    }
    ///
    $ArrSqlArray['SqlCount']['select'] = 'count(*) AS vartotal';
    $ArrSqlArray['SqlCount']['from'] = $this->VarTableTipkat .' AS a';
    $ArrSqlArray['SqlCount']['where'] = '';
    if('' != $VarWhere){
      $ArrSqlArray['SqlCount']['where'] = $VarWhere;
    }
    ///
    $ArrResult = $this->DbGet($ArrSqlArray[$VarSqlName], $VarSqlGet);
  	return $ArrResult;
	}
}
?>