<?php

class NewsMod extends DbMod{
	var $ArrMsSp = '';

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