<?PHP
/* Class extender for presell rozlicz files
 *
 */
// 'ROZLICZ' offsets 
define('PDB_OFFSET_ROZLICZ_TYP_DOK',0);
define('PDB_OFFSET_ROZLICZ_NUMER',6);
define('PDB_OFFSET_ROZLICZ_ID_KL',46);
define('PDB_OFFSET_ROZLICZ_DATA_WYST',76);
define('PDB_OFFSET_ROZLICZ_DATA_PLAT',80);
define('PDB_OFFSET_ROZLICZ_WART_BRUT',84);
define('PDB_OFFSET_ROZLICZ_DO_ZAPL',92);
define('PDB_OFFSET_ROZLICZ_DATA_ZAPL',100);
define('PDB_OFFSET_ROZLICZ_NR_KP',104);

// 'ROZLICZ' size
define('PDB_SIZE_ROZLICZ_TYP_DOK',6);
define('PDB_SIZE_ROZLICZ_NUMER',40);
define('PDB_SIZE_ROZLICZ_ID_KL',30);
define('PDB_SIZE_ROZLICZ_DATA_WYST',4);
define('PDB_SIZE_ROZLICZ_DATA_PLAT',4);
define('PDB_SIZE_ROZLICZ_WART_BRUT',8);
define('PDB_SIZE_ROZLICZ_DO_ZAPL',8);
define('PDB_SIZE_ROZLICZ_DATA_ZAPL',4);
define('PDB_SIZE_ROZLICZ_NR_KP',40);
 

class presellRozlicz extends PalmDB {
   // Constructor -- initialize the default values
   function presellRozlicz () {
      PalmDB::PalmDB('DATA', 'zaba', 'rozlicz');
   }

   // Overrides the GetRecord method.  We store data in associative arrays.
   // Just convert the data into the proper format and then return the
   // generated string.
   function GetRecord($num = false) {
      if ($num === false)
         $num = $this->CurrentRecord;
	 
      if (! isset($this->Records[$num]) /*|| ! is_array($this->Records[$num])*/)
         return PalmDB::GetRecord($num);
      
      $RecordString = '';
      
      include(sprintf("./include/rozlicz-%s",$GLOBALS["WEBSYNC_OUTPUT_MODULE"]));

      return $RecordString;
   }
}
?>
