<?php
/**
 * @package db 
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */
 
 




class DBWorkKurseStatistic extends DBWorkKurse
{
  
	function __construct($pDBTyp = 1, $pNewInstance = false)  { 
    parent::__construct($pDBTyp, $pNewInstance);
    $this->select = 'nr, kurs_art, kurs_ziel, ferienkal, koop, anrechen, abw_anrechen,
                     dozstdreal, abrechnung, koop_dvv, tag_woche, pruef_dvv, tag_abend, uebernacht, ein_mehrw, ausst_tage, zielgr_dvv, ausstell, auftrag ';               
  }
  
  
  function getActualRow($pRefreshCache = false)
  {
    $tmp = $this->getNewObject();
    $tmp->id = $this->getDatamodulValue("nr");
    
    $tmp->kurs_art 				= $this->getDatamodulValue('kurs_art');
    $tmp->kurs_ziel				= $this->getDatamodulValue('kurs_ziel');
    $tmp->ferienkal				= $this->getDatamodulValue('ferienkal');
    $tmp->koop  	 			= $this->getDatamodulValue('koop');
    $tmp->anrechen 				= $this->getDatamodulValue('anrechen');
    $tmp->abw_anrechen 			= $this->getDatamodulValue('abw_anrechen');
    $tmp->dozstdreal 			= $this->getDatamodulValue('dozstdreal');
    $tmp->abrechnung 			= $this->getDatamodulValue('abrechnung');
    $tmp->koop_dvv 				= $this->getDatamodulValue('koop_dvv');
    $tmp->tag_woche 			= $this->getDatamodulValue('tag_woche');
    $tmp->tag_abend 			= $this->getDatamodulValue('tag_abend');
    $tmp->pruef_dvv 			= $this->getDatamodulValue('pruef_dvv');
    $tmp->uebernacht 			= $this->getDatamodulValue('uebernacht');
    $tmp->ein_mehrw 			= $this->getDatamodulValue('ein_mehrw');
    $tmp->ausst_tage			= $this->getDatamodulValue('ausst_tage');
    $tmp->zielgr_dvv 			= $this->getDatamodulValue('zielgr_dvv');
    $tmp->auftrag				= $this->getDatamodulValue('auftrag'); 
    $tmp->ausstell    			= $this->getDatamodulValue('ausstell'); 

    return $tmp;    
  }

  protected function postGetAllRowsHook($pDatamodules, $pRefreshCache = false) 
  {
    return DBWork::postGetAllRowsHook($pDatamodules, $pRefreshCache);
  }
  
	function getNewObject()
  { 
    return new KursStatistic(); 
  }
  
  
  

  function getStatistik4Kurs($pKurs_id) 
  { 
  	$kurs_id = $this->dboperation->getString4Sql($pKurs_id);
  	$this->dboperation->clear();
    $this->dboperation->query(" SELECT ".$this->select."\n".
          " FROM kurse k WHERE k.nr='".$kurs_id."'");
    return $this->getfirstRow();
  }  
}
?>