Index: etiquetas-portatiles/trunk/ods/VERSION
===================================================================
--- etiquetas-portatiles/trunk/ods/VERSION	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/VERSION	(revision 191)
@@ -0,0 +1 @@
+0.0.2
\ No newline at end of file
Index: etiquetas-portatiles/trunk/ods/class/odsTableRow.php
===================================================================
--- etiquetas-portatiles/trunk/ods/class/odsTableRow.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/class/odsTableRow.php	(revision 191)
@@ -0,0 +1,50 @@
+<?php
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+class odsTableRow {
+	private $styleName;
+	private $cells;
+	
+	public function __construct(odsStyleTableRow $odsStyleTableRow = null) {
+		if($odsStyleTableRow) $this->styleName = $odsStyleTableRow->getName;
+		else                  $this->styleName = "ro1";
+		$this->cells                           = array();
+	}
+	
+	public function addCell(odsTableCell $odsTableCell) {
+		array_push($this->cells,$odsTableCell);
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_row = $dom->createElement('table:table-row');
+			$table_table_row->setAttribute("table:style-name", $this->styleName);
+		
+			if(count($this->cells)) {
+				foreach($this->cells as $cell) {
+					$table_table_row->appendChild($cell->getContent($ods, $dom));
+					if($cell->getNumberColumnsSpanned() > 1) {
+						$odsCoveredTableCell = new odsCoveredTableCell();
+						$odsCoveredTableCell->setNumberColumnsRepeated($cell->getNumberColumnsSpanned()-1);
+						$table_table_row->appendChild($odsCoveredTableCell->getContent($ods, $dom));
+					}
+				}
+					
+			} else {
+				$cell = new odsTableCellEmpty();
+				$table_table_row->appendChild($cell->getContent($ods, $dom));
+			}
+		
+		return $table_table_row;
+	}
+	
+}
+
+
+
+
+
+
+?>
Index: etiquetas-portatiles/trunk/ods/class/odsStyle.php
===================================================================
--- etiquetas-portatiles/trunk/ods/class/odsStyle.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/class/odsStyle.php	(revision 191)
@@ -0,0 +1,1365 @@
+<?php
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+abstract class odsStyle {
+	protected $name;
+	protected $family; // table-column, table-row, table, table-cell
+	
+	protected function __construct($name, $family) {
+		if($name == null) $name = $this->getType().'-'.$this->randString();
+		
+		$this->name   = $name;
+		$this->family = $family;
+	}
+	
+	protected function getContent(ods $ods, DOMDocument $dom) {
+		$style_style = $dom->createElement('style:style');
+			$style_style->setAttribute("style:name", $this->name);
+			$style_style->setAttribute("style:family", $this->family);
+		return $style_style;
+	} 
+
+	public function getName() {
+		return $this->name;
+	}
+	
+	public function __clone() {
+		$this->name = 'clone-'.$this->name.'-'.rand(0,99999999999);
+	}
+	
+	public function setName($name) {
+		$this->name = $name;
+	}
+	
+	abstract protected function getType();
+	
+	protected function randString() {
+		return md5(time().rand().$this->getType());
+	}
+	
+}
+
+class odsStyleTableColumn extends odsStyle {
+	private $breakBefore;         // auto
+	private $columnWidth;         // 2.267cm
+	
+	public function __construct($name = null) {
+		parent::__construct($name, "table-column");
+		$this->breakBefore = "auto";
+		$this->columnWidth = "2.267cm";
+	}
+	
+	public function getContent(ods $ods,DOMDocument $dom) {
+		$style_style = parent::getContent($ods,$dom);
+			
+			// style:table-column-properties
+			$style_table_column_properties = $dom->createElement('style:table-column-properties');
+				$style_table_column_properties->setAttribute("fo:break-before", $this->breakBefore);
+				$style_table_column_properties->setAttribute("style:column-width", $this->columnWidth);
+				$style_style->appendChild($style_table_column_properties);
+
+		return $style_style;
+	}
+	
+	public function getType() {
+		return 'odsStyleTableColumn';
+	}
+	
+	public function setColumnWidth($columnWidth) {
+		$this->columnWidth = $columnWidth;
+	}
+	
+	public function setBreakBefore($breakBefore) {
+		$this->breakBefore = $breakBefore;
+	}
+}
+
+class odsStyleTable extends odsStyle {
+	private $masterPageName;      // Default
+	private $display;             // true
+	private $writingMode;         // lr-tb
+
+	public function __construct($name = null) {
+		parent::__construct($name, "table");
+		$this->masterPageName = "Default";
+		$this->display        = "true";
+		$this->writingMode    = "lr-tb";
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$style_style = parent::getContent($ods,$dom);
+			$style_style->setAttribute("style:master-page-name", $this->masterPageName);
+			
+			// style:table-properties
+			$style_table_properties = $dom->createElement('style:table-properties');
+				$style_table_properties->setAttribute("table:display", $this->display);
+				$style_table_properties->setAttribute("style:writing-mode", $this->writingMode);
+				$style_style->appendChild($style_table_properties);
+		return $style_style;
+	}
+	
+	public function getType() {
+		return 'odsStyleTable';
+	}
+}
+
+class odsStyleTableRow extends odsStyle {
+	private $rowHeight;           // 0.52cm
+	private $breakBefore;         // auto
+	private $useOptimalRowHeight; // true, false
+	
+	public function __construct($name = null) {
+		parent::__construct($name, "table-row");
+		$this->rowHeight           = "0.52cm";
+		$this->breakBefore         = "auto";
+		$this->useOptimalRowHeight = "true";
+	}
+
+	public function setRowHeight($rowHeight) {
+		$this->rowHeight = $rowHeight;
+	}
+
+	public function setBreakBefore($breakBefore) {
+		$this->breakBefore = $breakBefore;
+	}
+
+	public function setUseOptimalRowHeight($useOptimalRowHeight) {
+		$this->useOptimalRowHeight = $useOptimalRowHeight;
+	}
+
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$style_style = parent::getContent($ods,$dom);
+			
+			// style:table-row-properties
+			$style_table_row_properties = $dom->createElement('style:table-row-properties');
+				$style_table_row_properties->setAttribute("style:row-height", $this->rowHeight);
+				$style_table_row_properties->setAttribute("fo:break-before", $this->breakBefore);
+				$style_table_row_properties->setAttribute("style:use-optimal-row-height", $this->useOptimalRowHeight);
+				$style_style->appendChild($style_table_row_properties);
+				
+		return $style_style; 
+	}
+	
+	public function getType() {
+		return 'odsStyleTableRow';
+	}
+}
+
+class odsStyleTableCell extends odsStyle {
+	private $parentStyleName;     // Default
+	private $textAlignSource;     // fix
+	private $repeatContent;       // true, false
+	private $color;               // opt: #ffffff
+	private $backgroundColor;     // opt: #ffffff
+	private $border;              // opt: 0.002cm solid #000000
+	private $textAlign;           // opt: center
+	private $marginLeft;          // opt: 0cm
+	private $fontWeight;          // opt: bold
+	private $fontSize;            // opt: 18pt;
+	private $fontStyle;           // opt: italic, normal
+	private $underline;           // opt: font-color, #000000, null
+	private $fontFace;            // opt: fontFace
+	private $styleDataName;       // opt: interne
+	
+	public function __construct($name = null) {
+		parent::__construct($name, "table-cell");
+		$this->parentStyleName     = "Default";
+		$this->textAlignSource     = "fix";
+		$this->repeatContent       = "false";
+		$this->color               = false;
+		$this->backgroundColor     = false;
+		$this->border              = false;
+		$this->textAlign           = false;
+		$this->marginLeft          = false;
+		$this->fontWeight          = false;
+		$this->fontSize            = false;
+		$this->fontStyle           = false;
+		$this->underline           = false;
+		$this->fontFace            = false;
+		$this->styleDataName       = false;
+	}
+	
+	public function setColor($color) {
+		$this->color = $color;
+	}
+	
+	public function setBackgroundColor($color) {
+		$this->backgroundColor = $color;
+	}
+
+	public function setBorder($border) {
+		$this->border = $border;
+	}
+	
+	public function setTextAlign($textAlign) {
+		$this->textAlign = $textAlign;
+	}
+	
+	public function setFontWeight($weight) {
+		$this->fontWeight = $weight;
+	}
+	
+	public function setFontStyle($fontStyle) {
+		$this->fontStyle = $fontStyle;
+	}
+	
+	public function setUnderline($underline) {
+		$this->underline = $underline;
+	}
+	
+	public function setStyleDataName($styleDataName) {
+		$this->styleDataName = $styleDataName;
+	}
+	
+	public function setFontSize($fontSize) {
+		$this->fontSize = $fontSize;
+	}
+	
+	public function setFontFace(odsFontFace $fontFace) {
+		$this->fontFace = $fontFace;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		// style:style
+		$style_style = parent::getContent($ods,$dom);
+			$style_style->setAttribute("style:parent-style-name", $this->parentStyleName);
+			if($this->styleDataName)
+				$style_style->setAttribute("style:data-style-name", $this->styleDataName);
+			
+			// style:table-cell-properties
+			$style_table_cell_properties = $dom->createElement('style:table-cell-properties');
+				$style_table_cell_properties->setAttribute("style:text-align-source", $this->textAlignSource);
+				$style_table_cell_properties->setAttribute("style:repeat-content", $this->repeatContent);
+				
+				if($this->backgroundColor)
+					$style_table_cell_properties->setAttribute("fo:background-color", $this->backgroundColor);
+					
+				if($this->border)
+					$style_table_cell_properties->setAttribute("fo:border", $this->border);
+				
+				$style_style->appendChild($style_table_cell_properties);
+
+				if($this->textAlign) {
+					// style:paragraph-properties
+					$style_paragraph_properties = $dom->createElement('style:paragraph-properties');
+						$style_paragraph_properties->setAttribute("fo:text-align", $this->textAlign);
+						$style_paragraph_properties->setAttribute("fo:margin-left", "0cm");
+						$style_style->appendChild($style_paragraph_properties);
+				}
+				
+				if($this->color OR $this->fontWeight OR $this->fontStyle OR $this->underline OR $this->fontSize OR $this->fontFace) {
+					// style:text-properties
+					$style_text_properties = $dom->createElement('style:text-properties');
+					
+						if($this->color)
+							$style_text_properties->setAttribute("fo:color", $this->color);
+							
+						if($this->fontWeight) {
+							$style_text_properties->setAttribute("fo:font-weight", $this->fontWeight);
+							$style_text_properties->setAttribute("style:font-weight-asian", $this->fontWeight);
+							$style_text_properties->setAttribute("style:font-weight-complex", $this->fontWeight);
+						}
+						
+						if($this->fontStyle) {
+							$style_text_properties->setAttribute("fo:font-style", $this->fontStyle);
+							$style_text_properties->setAttribute("fo:font-style-asian", $this->fontStyle);
+							$style_text_properties->setAttribute("fo:font-style-complex", $this->fontStyle);
+						}
+						
+						if($this->underline) {
+							$style_text_properties->setAttribute("style:text-underline-style", 'solid');
+							$style_text_properties->setAttribute("style:text-underline-width", 'auto');
+							$style_text_properties->setAttribute("style:text-underline-color", $this->underline);
+						}
+						
+						if($this->fontSize) {
+							$style_text_properties->setAttribute("fo:font-size", $this->fontSize);
+							$style_text_properties->setAttribute("style:font-size-asian", $this->fontSize);
+							$style_text_properties->setAttribute("style:font-size-complex", $this->fontSize);
+						}
+						
+						if($this->fontFace) {
+							$style_text_properties->setAttribute("style:font-name", $this->fontFace->getFontName());
+						}
+						
+						$style_style->appendChild($style_text_properties);
+				}
+				
+				
+		return $style_style;
+	}
+	 
+	public function getType() {
+		return 'odsStyleTableCell';
+	}
+}
+
+class odsStyleGraphic extends odsStyle {
+	private $stroke;    // none
+	private $fill;      // none
+ 	private $luminance; // 0%
+ 	private $contrast;  // 0%
+ 	private $gamma;     // 100%
+ 	private $red;       // 0%
+ 	private $green;     // 0%
+ 	private $blue;      // 0%  
+ 	private $opacity;   // 100%
+
+	public function __construct($name = null) {
+		parent::__construct($name, "graphic");
+		$this->stroke    = "none";
+		$this->fill      = "none";
+		$this->luminance = "0%";
+		$this->contrast  = "0%";
+		$this->gamma     = "100%";
+		$this->red       = "0%";
+		$this->green     = "0%";
+		$this->blue      = "0%";
+		$this->opacity   = "100%";
+	}
+	
+	public function setStroke($stroke) {
+		$this->stroke = $stroke;
+	}
+	
+	public function setFill($fill) {
+		$this->fill = $fill;
+	}
+	
+	public function setLuminance($luminance) {
+		$this->luminance = $luminance;
+	}
+	
+	public function setContrast($contrast) {
+		$this->contrast = $contrast;
+	}
+	
+	public function setGamma($gamma) {
+		$this->gamma = $gamma;
+	}
+	
+	public function setRed($red) {
+		$this->red = $red;
+	}
+	
+	public function setGreen($green) {
+		$this->green = $green;
+	}
+	
+	public function setBlue($blue) {
+		$this->blue = $blue;
+	}
+	
+	public function setOpacity($opacity) {
+		$this->opacity = $opacity;
+	}
+	
+	public function getContent(ods $ods,DOMDocument $dom) {
+		$style_style = parent::getContent($ods,$dom);
+		
+			// style:table-row-properties
+			$style_graphic_properties = $dom->createElement('style:graphic-properties');
+				$style_graphic_properties->setAttribute("draw:stroke",        $this->stroke);
+				$style_graphic_properties->setAttribute("draw:fill",          $this->fill);
+				$style_graphic_properties->setAttribute("draw:textarea-horizontal-align", "center");
+				$style_graphic_properties->setAttribute("draw:textarea-vertical-align", "middle");
+				$style_graphic_properties->setAttribute("draw:color-mode", "standard");
+				$style_graphic_properties->setAttribute("draw:luminance",     $this->luminance);
+				$style_graphic_properties->setAttribute("draw:contrast",      $this->contrast);
+				$style_graphic_properties->setAttribute("draw:gamma",         $this->gamma);
+				$style_graphic_properties->setAttribute("draw:red",           $this->red);
+				$style_graphic_properties->setAttribute("draw:green",         $this->green);
+				$style_graphic_properties->setAttribute("draw:blue",          $this->blue);
+				$style_graphic_properties->setAttribute("fo:clip", "rect(0cm, 0cm, 0cm, 0cm)");
+				$style_graphic_properties->setAttribute("draw:image-opacity", $this->opacity);
+				$style_graphic_properties->setAttribute("style:mirror", "none");
+				$style_style->appendChild($style_graphic_properties);
+				
+		return $style_style;
+	}
+
+	public function getType() {
+		return 'odsStyleGraphic';
+	}
+	
+}
+
+
+abstract class odsStyleMoney extends odsStyle {
+	//abstract protected function __construct();
+	//abstract protected function getContent();
+	//abstract protected function getType();
+}
+
+
+class odsStyleMoneyEUR extends odsStyleMoney {
+	
+	public function __construct() {
+		$this->name='NCur-EUR-P0';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_currency_style = $dom->createElement('number:currency-style');
+			$number_currency_style->setAttribute("style:name", "NCur-EUR-P0");
+			$number_currency_style->setAttribute("style:volatile", "true");
+		
+			$number_number = $dom->createElement('number:number');
+				$number_number->setAttribute("number:decimal-places", "2");
+				$number_number->setAttribute("number:min-integer-digits", "1");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_number);
+				
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_currency_style->appendChild($number_text);
+		
+			$number_currency_symbol = $dom->createElement('number:currency-symbol', '€');
+				$number_currency_symbol->setAttribute("number:language", "fr");
+				$number_currency_symbol->setAttribute("number:country", "FR");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_currency_symbol);
+		return $number_currency_style;
+	}
+	
+	public function getType() {
+		return 'odsStyleMoneyEUR';
+	}
+}
+
+class odsStyleMoneyEURNeg extends odsStyleMoney {
+	
+	public function __construct() {
+		$this->name='NCur-EUR';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+	
+		$number_currency_style = $dom->createElement('number:currency-style');
+			$number_currency_style->setAttribute("style:name", "NCur-EUR");
+	
+			$style_text_properties = $dom->createElement('style:text-properties');
+				$style_text_properties->setAttribute("fo:color", "#ff0000");
+				$number_currency_style->appendChild($style_text_properties);
+	
+			$number_text = $dom->createElement('number:text', '-');
+				$number_currency_style->appendChild($number_text);
+		
+			$number_number = $dom->createElement('number:number');
+				$number_number->setAttribute("number:decimal-places", "2");
+				$number_number->setAttribute("number:min-integer-digits", "1");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_number);
+				
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_currency_style->appendChild($number_text);
+		
+			$number_currency_symbol = $dom->createElement('number:currency-symbol', '€');
+				$number_currency_symbol->setAttribute("number:language", "fr");
+				$number_currency_symbol->setAttribute("number:country", "FR");
+				$number_currency_style->appendChild($number_currency_symbol);
+		
+			$style_map = $dom->createElement('style:map');
+				$style_map->setAttribute("style:condition", "value()>=0");
+				$style_map->setAttribute("style:apply-style-name", "NCur-EUR-P0");
+				$number_currency_style->appendChild($style_map);
+
+		return $number_currency_style;
+	}
+
+	public function getType() {
+		return 'odsStyleMoneyEURNeg';
+	}
+}
+
+class odsStyleMoneyUSD extends odsStyleMoney {
+	
+	public function __construct() {
+		$this->name='NCur-USD-P0';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_currency_style = $dom->createElement('number:currency-style');
+			$number_currency_style->setAttribute("style:name", "NCur-USD-P0");
+			$number_currency_style->setAttribute("style:volatile", "true");
+
+			$number_currency_symbol = $dom->createElement('number:currency-symbol', '$');
+				$number_currency_symbol->setAttribute("number:language", "en");
+				$number_currency_symbol->setAttribute("number:country", "US");
+				$number_currency_symbol->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_currency_symbol);
+		
+			$number_number = $dom->createElement('number:number');
+				$number_number->setAttribute("number:decimal-places", "2");
+				$number_number->setAttribute("number:min-integer-digits", "1");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_number);
+		return $number_currency_style;
+		
+	}
+	
+	public function getType() {
+		return 'odsStyleMoneyUSD';
+	}
+}
+
+class odsStyleMoneyUSDNeg extends odsStyleMoney {
+	
+	public function __construct(){
+		$this->name='NCur-USD';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_currency_style = $dom->createElement('number:currency-style');
+			$number_currency_style->setAttribute("style:name", "NCur-USD");
+
+			$style_text_properties = $dom->createElement('style:text-properties');
+				$style_text_properties->setAttribute("fo:color", "#ff0000");
+				$number_currency_style->appendChild($style_text_properties);
+
+			$number_text = $dom->createElement('number:text', '-');
+				$number_currency_style->appendChild($number_text);
+		
+			$number_currency_symbol = $dom->createElement('number:currency-symbol', '$');
+				$number_currency_symbol->setAttribute("number:language", "en");
+				$number_currency_symbol->setAttribute("number:country", "US");
+				$number_currency_style->appendChild($number_currency_symbol);
+		
+			$number_number = $dom->createElement('number:number');
+				$number_number->setAttribute("number:decimal-places", "2");
+				$number_number->setAttribute("number:min-integer-digits", "1");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_number);
+								
+			$style_map = $dom->createElement('style:map');
+				$style_map->setAttribute("style:condition", "value()>=0");
+				$style_map->setAttribute("style:apply-style-name", "NCur-USD-P0");
+				$number_currency_style->appendChild($style_map);
+		return $number_currency_style;
+	}
+	
+	public function getType() {
+		return 'odsStyleMoneyUSDNeg';
+	}
+}
+
+class odsStyleMoneyGBP extends odsStyleMoney {
+	
+	public function __construct() {
+		$this->name='NCur-GBP-P0';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_currency_style = $dom->createElement('number:currency-style');
+			$number_currency_style->setAttribute("style:name", "NCur-GBP-P0");
+			$number_currency_style->setAttribute("style:volatile", "true");
+
+			$number_currency_symbol = $dom->createElement('number:currency-symbol', '£');
+				$number_currency_symbol->setAttribute("number:language", "en");
+				$number_currency_symbol->setAttribute("number:country", "GB");
+				$number_currency_style->appendChild($number_currency_symbol);
+		
+			$number_number = $dom->createElement('number:number');
+				$number_number->setAttribute("number:decimal-places", "2");
+				$number_number->setAttribute("number:min-integer-digits", "1");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_number);
+		return $number_currency_style;
+	}
+	
+	public function getType() {
+		return 'odsStyleMoneyGBP';
+	}
+}
+
+class odsStyleMoneyGBPNeg extends odsStyleMoney {
+	
+	public function __construct() {
+		$this->name='NCur-GBP';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_currency_style = $dom->createElement('number:currency-style');
+			$number_currency_style->setAttribute("style:name", "NCur-GBP");
+
+			$style_text_properties = $dom->createElement('style:text-properties');
+				$style_text_properties->setAttribute("fo:color", "#ff0000");
+				$number_currency_style->appendChild($style_text_properties);
+
+			$number_text = $dom->createElement('number:text', '-');
+				$number_currency_style->appendChild($number_text);
+		
+			$number_currency_symbol = $dom->createElement('number:currency-symbol', '£');
+				$number_currency_symbol->setAttribute("number:language", "en");
+				$number_currency_symbol->setAttribute("number:country", "GB");
+				$number_currency_style->appendChild($number_currency_symbol);
+		
+			$number_number = $dom->createElement('number:number');
+				$number_number->setAttribute("number:decimal-places", "2");
+				$number_number->setAttribute("number:min-integer-digits", "1");
+				$number_number->setAttribute("number:grouping", "true");
+				$number_currency_style->appendChild($number_number);
+								
+			$style_map = $dom->createElement('style:map');
+				$style_map->setAttribute("style:condition", "value()>=0");
+				$style_map->setAttribute("style:apply-style-name", "NCur-GBP-P0");
+				$number_currency_style->appendChild($style_map);
+		return $number_currency_style;
+	}
+	
+	public function getType() {
+		return 'odsStyleMoneyGBPNeg';
+	}
+}
+
+abstract class odsStyleDate extends odsStyle {
+	protected $language;
+	
+	protected function setLanguage($number_date_style) {
+		if(!isset($this->language)) return;
+		$number_date_style->setAttribute("number:language", $this->language);
+		$number_date_style->setAttribute("number:country", $this->language);
+	}
+}
+
+class odsStyleDateMMDDYYYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-MMDDYYYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_day = $dom->createElement('number:day');
+				$number_day->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_year->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateMMDDYYYY';
+	}
+}
+
+class odsStyleDateMMDDYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-MMDDYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_day = $dom->createElement('number:day');
+				$number_day->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateMMDDYY';
+	}
+}
+
+class odsStyleDateDDMMYYYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-DDMMYYYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_day->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+	
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_year->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDDMMYYYY';
+	}
+}
+
+class odsStyleDateDDMMYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-DDMMYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_day->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+	
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDDMMYY';
+	}
+}
+
+class odsStyleDateDMMMYYYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-DMMMYYYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+	
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:textual", "true");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_year->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDMMMYYYY';
+	}
+}
+
+class odsStyleDateDMMMYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-DMMMYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+	
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:textual", "true");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDMMMYY';
+	}
+}
+
+class odsStyleDateDMMMMYYYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-DMMMMYYYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+	
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:textual", "true");
+				$number_month->setAttribute(" number:style", "long");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_year->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDMMMMYYYY';
+	}
+}
+
+class odsStyleDateDMMMMYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-DMMMMYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+	
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:textual", "true");
+				$number_month->setAttribute(" number:style", "long");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDMMMMYY';
+	}
+}
+
+class odsStyleDateMMMDYYYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-MMMDYYYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:textual", "true");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);	
+
+			$number_text = $dom->createElement('number:text', ', ');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_year->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDMMMMYY';
+	}
+}
+
+class odsStyleDateMMMDYY extends odsStyleDate {
+	public function __construct($language) {
+		$this->name='Date-MMMDYY';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_month->setAttribute("number:textual", "true");
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);	
+
+			$number_text = $dom->createElement('number:text', ', ');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateDMMMM';
+	}
+}
+
+abstract class odsStyleTime extends odsStyle {
+}
+
+class odsStyleTimeHHMMSS extends odsStyleTime {
+	public function __construct() {
+		$this->name='Time-HHMMSS';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_time_style = $dom->createElement('number:time-style');
+			$number_time_style->setAttribute("style:name", $this->name);
+			
+			$number_hours = $dom->createElement('number:hours');
+				$number_hours->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_time_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+				$number_minutes->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_minutes);	
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_time_style->appendChild($number_text);
+
+			$number_seconds = $dom->createElement('number:seconds');
+				$number_seconds->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_seconds);	
+			
+		return $number_time_style;
+	}
+
+	public function getType() {
+		return 'odsStyleTimeHHMMSS';
+	}
+}
+
+class odsStyleTimeHHMM extends odsStyleTime {
+	public function __construct() {
+		$this->name='Time-HHMM';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_time_style = $dom->createElement('number:time-style');
+			$number_time_style->setAttribute("style:name", $this->name);
+			
+			$number_hours = $dom->createElement('number:hours');
+				$number_hours->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_time_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+				$number_minutes->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_minutes);	
+			
+		return $number_time_style;
+	}
+
+	public function getType() {
+		return 'odsStyleTimeHHMM';
+	}
+}
+
+class odsStyleTimeHHMMSSAMPM extends odsStyleTime {
+	public function __construct() {
+		$this->name='Time-HHMMSSAMPM';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_time_style = $dom->createElement('number:time-style');
+			$number_time_style->setAttribute("style:name", $this->name);
+			
+			$number_hours = $dom->createElement('number:hours');
+				$number_hours->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_time_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+				$number_minutes->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_minutes);	
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_time_style->appendChild($number_text);
+
+			$number_seconds = $dom->createElement('number:seconds');
+				$number_seconds->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_seconds);	
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_time_style->appendChild($number_text);
+
+			$number_am_pm = $dom->createElement('number:am-pm');
+				$number_am_pm->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_am_pm);	
+			
+		return $number_time_style;
+	}
+
+	public function getType() {
+		return 'odsStyleTimeHHMMSSAMPM';
+	}
+}
+
+class odsStyleTimeHHMMAMPM extends odsStyleTime {
+	public function __construct() {
+		$this->name='Time-HHMMAMPM';
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_time_style = $dom->createElement('number:time-style');
+			$number_time_style->setAttribute("style:name", $this->name);
+			
+			$number_hours = $dom->createElement('number:hours');
+				$number_hours->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_time_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+				$number_minutes->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_minutes);	
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_time_style->appendChild($number_text);
+			
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_am_pm = $dom->createElement('number:am-pm');
+				$number_am_pm->setAttribute("number:style", "long");
+				$number_time_style->appendChild($number_am_pm);	
+			
+		return $number_time_style;
+	}
+
+	public function getType() {
+		return 'odsStyleTimeHHMMAMPM';
+	}
+}
+
+abstract class odsStyleDateTime extends odsStyleDate {
+}
+
+class odsStyleDateTimeMMDDYYHHMMSSAMPM extends odsStyleDateTime {
+	public function __construct($language) {
+		$this->name='DateTime-MMDDYYHHMMSSAMPM';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);	
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_hours = $dom->createElement('number:hours');
+			$number_hours->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_date_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+			$number_minutes->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_minutes);
+				
+			$number_text = $dom->createElement('number:text', ':');
+				$number_date_style->appendChild($number_text);
+
+			$number_seconds = $dom->createElement('number:seconds');
+				$number_seconds->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_seconds);
+				
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+			
+			$number_am_pm = $dom->createElement('number:am-pm');
+				$number_date_style->appendChild($number_am_pm);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateTimeMMDDYYHHMMSSAMPM';
+	}
+}
+
+class odsStyleDateTimeMMDDYYHHMMAMPM extends odsStyleDateTime {
+	public function __construct($language) {
+		$this->name='DateTime-MMDDYYHHMMAMPM';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);	
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_hours = $dom->createElement('number:hours');
+			$number_hours->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_date_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+			$number_minutes->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_minutes);
+			
+			$number_am_pm = $dom->createElement('number:am-pm');
+				$number_date_style->appendChild($number_am_pm);
+			
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateTimeMMDDYYHHMMAMPM';
+	}
+}
+
+class odsStyleDateTimeDDMMYYHHMMSS extends odsStyleDateTime {
+	public function __construct($language) {
+		$this->name='DateTime-DDMMYYHHMMSS';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);	
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_hours = $dom->createElement('number:hours');
+			$number_hours->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_date_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+			$number_minutes->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_minutes);
+				
+			$number_text = $dom->createElement('number:text', ':');
+				$number_date_style->appendChild($number_text);
+
+			$number_seconds = $dom->createElement('number:seconds');
+				$number_seconds->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_seconds);
+				
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateTimeDDMMYYHHMMSS';
+	}
+}
+
+class odsStyleDateTimeDDMMYYHHMM extends odsStyleDateTime {
+	public function __construct($language) {
+		$this->name='DateTime-DDMMYYHHMM';
+		$this->language = $language;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$number_date_style = $dom->createElement('number:date-style');
+			$number_date_style->setAttribute("style:name", $this->name);
+			$number_date_style->setAttribute("number:automatic-order", "true");
+			$this->setLanguage($number_date_style);
+			
+			$number_day = $dom->createElement('number:day');
+				$number_date_style->appendChild($number_day);	
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+			
+			$number_month = $dom->createElement('number:month');
+				$number_date_style->appendChild($number_month);
+
+			$number_text = $dom->createElement('number:text', '/');
+				$number_date_style->appendChild($number_text);
+
+			$number_year = $dom->createElement('number:year');
+				$number_date_style->appendChild($number_year);
+
+			$number_text = $dom->createElement('number:text', ' ');
+				$number_date_style->appendChild($number_text);
+
+			$number_hours = $dom->createElement('number:hours');
+			$number_hours->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_hours);
+
+			$number_text = $dom->createElement('number:text', ':');
+				$number_date_style->appendChild($number_text);
+
+			$number_minutes = $dom->createElement('number:minutes');
+			$number_minutes->setAttribute("number:style", "long");
+				$number_date_style->appendChild($number_minutes);
+				
+		return $number_date_style;
+	}
+
+	public function getType() {
+		return 'odsStyleDateTimeDDMMYYHHMM';
+	}
+}
+
+?>
\ No newline at end of file
Index: etiquetas-portatiles/trunk/ods/class/odsFontFace.php
===================================================================
--- etiquetas-portatiles/trunk/ods/class/odsFontFace.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/class/odsFontFace.php	(revision 191)
@@ -0,0 +1,37 @@
+<?php
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+class odsFontFace {
+	private $fontName; // = "Nimbus Sans L";
+	private $fontFamilyGeneric;
+	private $fontPitch;
+	
+	public function __construct($fontName, $fontFamilyGeneric = null, $fontPitch = 'variable') {
+		$this->fontName          = $fontName;
+		$this->fontFamilyGeneric = $fontFamilyGeneric;
+		$this->fontPitch         = $fontPitch;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$style_font_face = $dom->createElement('style:font-face');
+			$style_font_face->setAttribute("style:name", $this->fontName);
+			$style_font_face->setAttribute("svg:font-family", "'".$this->fontName."'");
+			$style_font_face->setAttribute("style:font-family-generic", $this->fontFamilyGeneric);
+			$style_font_face->setAttribute("style:font-pitch", $this->fontPitch);
+		return $style_font_face;
+	}
+	
+	public function getFontName() {
+		return $this->fontName;
+	}
+	
+	public function getStyles(ods $ods, DOMDocument $dom) {
+		return $this->getContent($ods,$dom);
+	}
+}
+
+
+?>
Index: etiquetas-portatiles/trunk/ods/class/odsTableColumn.php
===================================================================
--- etiquetas-portatiles/trunk/ods/class/odsTableColumn.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/class/odsTableColumn.php	(revision 191)
@@ -0,0 +1,47 @@
+<?php
+
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+class odsTableColumn {
+	//private $styleName;
+	private $repeated;
+	private $odsStyleTableColumn;
+	
+	public function __construct(odsStyleTableColumn $odsStyleTableColumn) {
+		$this->odsStyleTableColumn = $odsStyleTableColumn;
+		$this->repeated = null;
+	}
+	
+	public function getContent(ods $ods,DOMDocument $dom) {
+		if(!$ods->getStyleByName($this->odsStyleTableColumn->getName()))
+			$ods->addTmpStyles($this->odsStyleTableColumn);
+		
+		$table_table_column = $dom->createElement('table:table-column');
+			$table_table_column->setAttribute("table:style-name", $this->odsStyleTableColumn->getName());
+			if($this->repeated)
+				$table_table_column->setAttribute("table:number-columns-repeated", $this->repeated);
+			$table_table_column->setAttribute("table:default-cell-style-name", "Default");
+		return $table_table_column;
+	}
+
+	public function setRepeated($repeated) {
+		$this->repeated = $repeated;
+	}
+	
+	function getOdsStyleTableColumn() {
+		return $this->odsStyleTableColumn;
+	}
+}
+
+class odsTableColumnWithWidth extends odsTableColumn {
+	public function __construct($width) {
+		$styleColumn = new odsStyleTableColumn();
+		$styleColumn->setColumnWidth($width);
+		parent::__construct($styleColumn);
+	}
+}
+
+?>
Index: etiquetas-portatiles/trunk/ods/class/odsTable.php
===================================================================
--- etiquetas-portatiles/trunk/ods/class/odsTable.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/class/odsTable.php	(revision 191)
@@ -0,0 +1,221 @@
+<?php
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+class odsTable {
+	private $name;
+	private $styleName;
+	private $print;
+	
+	private $cursorPositionX;
+	private $cursorPositionY;
+	private $horizontalSplitMode;
+	private $verticalSplitMode;
+	private $horizontalSplitPosition;
+	private $verticalSplitPosition;
+	private	$positionLeft;
+	private	$positionRight;
+	private	$positionTop;
+	private	$positionBottom;
+	
+	
+	private $tableColumns;
+	private $rows;
+	
+	public function __construct($name, $odsStyleTable = null) {
+		$this->name                         = $name;
+		if($odsStyleTable) $this->styleName = $odsStyleTable->getName;
+		else               $this->styleName = "ta1";
+		$this->print                        = "false";
+		
+		$this->cursorPositionX              = 0;
+		$this->cursorPositionY              = 0;
+		$this->horizontalSplitMode          = 0;
+		$this->verticalSplitMode            = 0;
+		$this->horizontalSplitPosition      = 0;
+		$this->verticalSplitPosition        = 0;
+		$this->positionLeft                 = 0;
+		$this->positionRight                = 0;
+		$this->positionTop                  = 0;
+		$this->positionBottom               = 0;
+		
+		$this->tableColumns                 = array();
+		$this->rows                         = array();
+	}
+	
+	public function getName() {
+		return $this->name;
+	}
+	
+	public function setHorizontalSplit($colones = 1) {
+		$this->setHorizontalSplitMode(2);
+		$this->setHorizontalSplitPosition($colones);
+		$this->setPositionRight($colones);
+	}
+	
+	public function setVerticalSplit($lines = 1) {
+		$this->setVerticalSplitMode(2);
+		$this->setVerticalSplitPosition($lines);
+		$this->setPositionBottom($lines);
+	}
+	
+	public function addRow($odsTableRow) {
+		array_push($this->rows,$odsTableRow);
+	}
+	
+	public function addTableColumn($odsTableColumn) {
+		array_push($this->tableColumns, $odsTableColumn);
+	}
+	
+	public function setCursorPositionX($cursorPositionX) {
+		$this->cursorPositionX = $cursorPositionX;
+	}
+
+	public function setCursorPositionY($cursorPositionY) {
+		$this->cursorPositionY = $cursorPositionY;
+	}
+	
+	public function setHorizontalSplitMode($horizontalSplitMode) {
+		$this->horizontalSplitMode = $horizontalSplitMode;
+	}
+
+	public function setVerticalSplitMode($verticalSplitMode) {
+		$this->verticalSplitMode = $verticalSplitMode; 
+	}
+	
+	public function setHorizontalSplitPosition($horizontalSplitPosition) {
+		$this->horizontalSplitPosition = $horizontalSplitPosition;
+	}
+	
+	public function setVerticalSplitPosition($verticalSplitPosition) {
+		$this->verticalSplitPosition = $verticalSplitPosition;
+	}
+	
+	public function setPositionLeft($positionLeft) {
+		$this->positionLeft = $positionLeft;
+	}
+	
+	public function setPositionRight($positionRight) {
+		$this->positionRight = $positionRight;
+	}
+	
+	public function setPositionTop($positionTop) {
+		$this->positionTop = $positionTop;
+	}
+	
+	public function setPositionBottom($positionBottom) {
+		$this->positionBottom = $positionBottom;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table = $dom->createElement('table:table');
+			$table_table->setAttribute("table:name", $this->name);
+			$table_table->setAttribute("table:style-name", $this->styleName);
+			$table_table->setAttribute("table:print", $this->print);
+			
+			if(count($this->tableColumns)) {
+				foreach($this->tableColumns as $tableColumn) 
+					$table_table->appendChild($tableColumn->getContent($ods,$dom));
+			} else {
+				$column = new odsTableColumn($ods->getStyleByName('co1'));
+				$table_table->appendChild($column->getContent($ods,$dom));
+			}
+
+			if(count($this->rows)) {
+				foreach($this->rows as $row) 
+					$table_table->appendChild($row->getContent($ods,$dom));
+			} else {
+				$row = new odsTableRow();
+				$table_table->appendChild($row->getContent($ods,$dom));
+			}
+				
+		return $table_table;
+	}
+	
+	public function getSettings(ods $ods, DOMDocument $dom) {
+		$config_config_item_map_entry2 = $dom->createElement('config:config-item-map-entry');
+			$config_config_item_map_entry2->setAttribute("config:name", $this->name);
+			//$config_config_item_map_named->appendChild($config_config_item_map_entry2);
+			
+			$config_config_item = $dom->createElement('config:config-item',$this->cursorPositionX);
+				$config_config_item->setAttribute("config:name", "CursorPositionX");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+			
+			$config_config_item = $dom->createElement('config:config-item',$this->cursorPositionY);
+				$config_config_item->setAttribute("config:name", "CursorPositionY");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+	
+			$config_config_item = $dom->createElement('config:config-item',$this->horizontalSplitMode);
+				$config_config_item->setAttribute("config:name", "HorizontalSplitMode");
+				$config_config_item->setAttribute("config:type", "short");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item', $this->verticalSplitMode);
+				$config_config_item->setAttribute("config:name", "VerticalSplitMode");
+				$config_config_item->setAttribute("config:type", "short");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',$this->horizontalSplitPosition);
+				$config_config_item->setAttribute("config:name", "HorizontalSplitPosition");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+		
+			$config_config_item = $dom->createElement('config:config-item',$this->verticalSplitPosition);
+				$config_config_item->setAttribute("config:name", "VerticalSplitPosition");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',2);
+				$config_config_item->setAttribute("config:name", "ActiveSplitRange");
+				$config_config_item->setAttribute("config:type", "short");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',$this->positionLeft);
+				$config_config_item->setAttribute("config:name", "PositionLeft");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',$this->positionRight);
+				$config_config_item->setAttribute("config:name", "PositionRight");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',$this->positionTop);
+				$config_config_item->setAttribute("config:name", "PositionTop");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',$this->positionBottom);
+				$config_config_item->setAttribute("config:name", "PositionBottom");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',0);
+				$config_config_item->setAttribute("config:name", "ZoomType");
+				$config_config_item->setAttribute("config:type", "short");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',100);
+				$config_config_item->setAttribute("config:name", "ZoomValue");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',60);
+				$config_config_item->setAttribute("config:name", "PageViewZoomValue");
+				$config_config_item->setAttribute("config:type", "int");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+
+			$config_config_item = $dom->createElement('config:config-item',"true");
+				$config_config_item->setAttribute("config:name", "ShowGrid");
+				$config_config_item->setAttribute("config:type", "boolean");
+				$config_config_item_map_entry2->appendChild($config_config_item);
+		
+		return $config_config_item_map_entry2;
+	}
+}
+
+?>
Index: etiquetas-portatiles/trunk/ods/class/odsTableCell.php
===================================================================
--- etiquetas-portatiles/trunk/ods/class/odsTableCell.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/class/odsTableCell.php	(revision 191)
@@ -0,0 +1,503 @@
+<?php
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+abstract class odsTableCell {
+	protected $styleName;
+	protected $numberColumnsSpanned;
+	protected $numberRowsSpanned;
+	protected $formula;
+	protected $numberColumnsRepeated;
+	
+	abstract protected function __construct();
+	
+	protected function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_cell = $dom->createElement('table:table-cell');
+		if( $this->styleName ) {
+			$ods->addTmpStyles($this->styleName);
+			$table_table_cell->setAttribute("table:style-name", $this->styleName->getName());
+		}
+		$this->cellOpts($table_table_cell);
+		return $table_table_cell;
+	}
+	
+	protected function cellOpts( $table_table_cell ) {
+		if($this->numberColumnsSpanned)
+			$table_table_cell->setAttribute("table:number-columns-spanned", $this->numberColumnsSpanned);
+		if($this->numberRowsSpanned)
+			$table_table_cell->setAttribute("table:number-rows-spanned", $this->numberRowsSpanned);
+		if($this->formula)
+			$table_table_cell->setAttribute("table:formula", "of:=".$this->formula);
+		if($this->numberColumnsRepeated)
+			$table_table_cell->setAttribute("table:number-columns-repeated", $this->numberColumnsRepeated);
+	}
+	
+	public function setNumberColumnsSpanned($numberColumnsSpanned) {
+		$this->numberColumnsSpanned = $numberColumnsSpanned;
+	}
+	
+	public function getNumberColumnsSpanned() {
+		if(!$this->numberColumnsSpanned) return 1;
+		return $this->numberColumnsSpanned;
+	}
+	
+	public function setNumberRowsSpanned($numberRowsSpanned) {
+		$this->numberRowsSpanned = $numberRowsSpanned;
+	}
+	
+	public function setFormula($formula) {
+		$this->formula = $formula;
+	}
+	
+	public function setNumberColumnsRepeated($numberColumnsRepeated) {
+		$this->numberColumnsRepeated = $numberColumnsRepeated;
+	}
+	
+}
+
+class odsTableCellEmpty extends odsTableCell {
+	
+	public function __construct(odsStyleTableCell $odsStyleTableCell = null) {
+		$this->styleName = $odsStyleTableCell;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		return odsTableCell::getContent($ods,$dom);
+	}
+}
+
+class odsCoveredTableCell extends odsTableCell {
+	public function __construct() {}
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_cell = $dom->createElement('table:covered-table-cell');
+		$this->cellOpts($table_table_cell); 
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellStringHttp extends odsTableCell {
+	public $value;
+	public $styleName;
+	
+	public function __construct($value,odsStyleTableCell $odsStyleTableCell = null) {
+		$this->value = $value;
+		$this->styleName = $odsStyleTableCell;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_cell = odsTableCell::getContent($ods,$dom);
+			$table_table_cell->setAttribute("office:value-type", "string");
+			
+			// text:p
+			$text_p = $dom->createElement('text:p',$this->value);
+				$table_table_cell->appendChild($text_p);
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellString extends odsTableCellStringHttp {
+	public function __construct($value,odsStyleTableCell $odsStyleTableCell = null) {
+		$this->value = str_replace('&', '&amp;', $value);
+		$this->styleName = $odsStyleTableCell;
+	}
+}
+
+class odsTableCellStringEmail extends odsTableCellString {
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_cell = odsTableCell::getContent($ods,$dom);
+			$table_table_cell->setAttribute("office:value-type", "string");
+			
+			// text:p
+			$text_p = $dom->createElement('text:p');
+				$table_table_cell->appendChild($text_p);
+				
+				// text:a
+				$text_a = $dom->createElement('text:a',$this->value);
+					$text_a->setAttribute("xlink:href", "mailto:".$this->value);
+					$text_p->appendChild($text_a);
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellStringUrl extends odsTableCellString {
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_cell = odsTableCell::getContent($ods,$dom);
+			$table_table_cell->setAttribute("office:value-type", "string");
+			
+			// text:p
+			$text_p = $dom->createElement('text:p');
+				$table_table_cell->appendChild($text_p);
+				
+				// text:a
+				$text_a = $dom->createElement('text:a',$this->value);
+					$text_a->setAttribute("xlink:href", (substr($this->value,0,7)=="http://"?'':"http://").$this->value);
+					$text_p->appendChild($text_a);
+		return $table_table_cell;
+	}
+}
+
+
+
+class odsTableCellFloat extends odsTableCell {
+	public $value;
+	public $styleName;
+	
+	public function __construct($value,odsStyleTableCell $odsStyleTableCell = null) {
+		$this->value = $value;
+		$this->styleName = $odsStyleTableCell;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		$table_table_cell = odsTableCell::getContent($ods,$dom);
+			$table_table_cell->setAttribute("office:value-type", "float");
+			$table_table_cell->setAttribute("office:value", $this->value);
+			
+			// text:p
+			$text_p = $dom->createElement('text:p',$this->value);
+				$table_table_cell->appendChild($text_p);
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellCurrency extends odsTableCell {
+	public $value;
+	public $styleName;
+	public $currency;
+	
+	public function __construct($value, $currency, $odsStyleTableCell = null) {
+		$this->value    = $value;
+		$this->currency = $currency;
+		$this->styleName = $odsStyleTableCell;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		switch($this->currency) {
+		case 'EUR':
+			$ods->addTmpStyles(new odsStyleMoneyEUR());
+			$ods->addTmpStyles(new odsStyleMoneyEURNeg());
+			break;
+		case 'USD':
+			$ods->addTmpStyles(new odsStyleMoneyUSD());
+			$ods->addTmpStyles(new odsStyleMoneyUSDNeg());
+			break;
+		case 'GBP':
+			$ods->addTmpStyles(new odsStyleMoneyGBP());
+			$ods->addTmpStyles(new odsStyleMoneyGBPNeg());
+			break;
+		default:
+			//FIXME: send error;
+		}
+
+		$table_table_cell = $dom->createElement('table:table-cell');
+		$this->cellOpts($table_table_cell);
+			if( $this->styleName ) {
+				$style = $ods->getStyleByName($this->styleName->getName()."-".$this->currency);
+				if(!$style) {
+					$style = clone $this->styleName;
+					$style->setName($this->styleName->getName()."-".$this->currency);
+					$style->setStyleDataName('NCur-'.$this->currency);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			} else {
+				$style = $ods->getStyleByName("ce1-".$this->currency);
+				if(!$style) {
+					$style = clone $ods->getStyleByName("ce1");
+					$style->setName("ce1-".$this->currency);
+					$style->setStyleDataName('NCur-'.$this->currency);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			}
+			
+			$table_table_cell->setAttribute("office:value-type", "currency");
+			$table_table_cell->setAttribute("office:currency", $this->currency);
+			$table_table_cell->setAttribute("office:value", $this->value);
+			
+			// text:p
+			$text_p = $dom->createElement('text:p');
+				$table_table_cell->appendChild($text_p);
+			
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellDate extends odsTableCell {
+	private $date;
+	private $format;
+	private $language;
+	
+	public function __construct($date,  $format="MMDDYYYY", $language=null, odsStyleGraphic $odsStyleCellDate = null) {
+		$this->date = $date;
+		$this->format = $format;
+		$this->language = $language;
+		$this->styleName = $odsStyleCellDate;
+	}
+		
+	public function getContent(ods $ods, DOMDocument $dom) {
+		switch($this->format) {
+		case 'DDMMYYYY':
+			$ods->addTmpStyles(new odsStyleDateDDMMYYYY($this->language));
+			break;
+		case 'DDMMYY':
+			$ods->addTmpStyles($style = new odsStyleDateDDMMYY($this->language));
+			break;
+		case 'MMDDYYYY':
+			$ods->addTmpStyles($style = new odsStyleDateMMDDYYYY($this->language));
+			break;
+		case 'MMDDYY':
+			$ods->addTmpStyles($style = new odsStyleDateMMDDYY($this->language));
+			break;
+		case 'DMMMYYYY':
+			$ods->addTmpStyles($style = new odsStyleDateDMMMYYYY($this->language));
+			break;
+		case 'DMMMYY':
+			$ods->addTmpStyles($style = new odsStyleDateDMMMYY($this->language));
+			break;
+		case 'DMMMMYYYY':
+			$ods->addTmpStyles($style = new odsStyleDateDMMMMYYYY($this->language));
+			break;
+		case 'DMMMMYY':
+			$ods->addTmpStyles($style = new odsStyleDateDMMMMYY($this->language));
+			break;
+		case 'MMMDYYYY':
+			$ods->addTmpStyles($style = new odsStyleDateMMMDYYYY($this->language));
+			break;
+		case 'MMMDYY':
+			$ods->addTmpStyles($style = new odsStyleDateMMMDYY($this->language));
+			break;
+		default:
+			//FIXME: send error;
+		}
+		
+		$table_table_cell = $dom->createElement('table:table-cell');
+		$this->cellOpts($table_table_cell);
+		
+		if( $this->styleName ) {
+				$style = $ods->getStyleByName($this->styleName->getName()."-".$this->format);
+				if(!$style) {
+					$style = clone $this->styleName;
+					$style->setName($this->styleName->getName()."-".$this->format);
+					$style->setStyleDataName('Date-'.$this->format);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			} else {
+				$style = $ods->getStyleByName("ce1-".$this->format);
+				if(!$style) {
+					$style = clone $ods->getStyleByName("ce1");
+					$style->setName("ce1-".$this->format);
+					$style->setStyleDataName('Date-'.$this->format);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			}
+		
+		$table_table_cell->setAttribute("office:value-type","date");
+		$table_table_cell->setAttribute("office:date-value",$this->date);
+		return $table_table_cell;
+	}
+	
+}
+
+class odsTableCellTime extends odsTableCell {
+	private $time;
+	private $format;
+	
+	public function __construct($time, $format="HHMM", odsStyleGraphic $odsStyleCellDate = null) {
+		$this->time = $time;
+		$this->format = $format;
+		$this->styleName = $odsStyleCellDate;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		switch($this->format) {
+		case 'HHMMSS':
+			$ods->addTmpStyles(new odsStyleTimeHHMMSS());
+			break;
+		case 'HHMM':
+			$ods->addTmpStyles(new odsStyleTimeHHMM());
+			break;
+		case 'HHMMSSAMPM':
+			$ods->addTmpStyles(new odsStyleTimeHHMMSSAMPM());
+			break;
+		case 'HHMMAMPM':
+			$ods->addTmpStyles(new odsStyleTimeHHMMAMPM());
+			break;
+		default:
+			//FIXME: send error;
+		}
+		
+		$table_table_cell = $dom->createElement('table:table-cell');
+		$this->cellOpts($table_table_cell);
+		
+		if( $this->styleName ) {
+				$style = $ods->getStyleByName($this->styleName->getName()."-".$this->format);
+				if(!$style) {
+					$style = clone $this->styleName;
+					$style->setName($this->styleName->getName()."-".$this->format);
+					$style->setStyleDataName('Time-'.$this->format);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			} else {
+				$style = $ods->getStyleByName("ce1-".$this->format);
+				if(!$style) {
+					$style = clone $ods->getStyleByName("ce1");
+					$style->setName("ce1-".$this->format);
+					$style->setStyleDataName('Time-'.$this->format);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			}
+		
+		$table_table_cell->setAttribute("office:value-type","time");
+		$table_table_cell->setAttribute("office:time-value",$this->time);
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellDateTime extends odsTableCell {
+	private $dateTime;
+	private $format;
+	
+	public function __construct($dateTime, $format="MMDDYYHHMMAMPM", $language=null, odsStyleGraphic $odsStyleCellDate = null) {
+		$this->dateTime = $dateTime;
+		$this->format = $format;
+		$this->language = $language;
+		$this->styleName = $odsStyleCellDate;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		switch($this->format) {
+		case 'MMDDYYHHMMSSAMPM':
+			$ods->addTmpStyles(new odsStyleDateTimeMMDDYYHHMMSSAMPM($this->language));
+			break;
+		case 'MMDDYYHHMMAMPM':
+			$ods->addTmpStyles(new odsStyleDateTimeMMDDYYHHMMAMPM($this->language));
+			break;
+		case 'DDMMYYHHMMSS':
+			$ods->addTmpStyles(new odsStyleDateTimeDDMMYYHHMMSS($this->language));
+			break;
+		case 'DDMMYYHHMM':
+			$ods->addTmpStyles(new odsStyleDateTimeDDMMYYHHMM($this->language));
+			break;
+		default:
+			//FIXME: send error;
+		}
+		
+		$table_table_cell = $dom->createElement('table:table-cell');
+		$this->cellOpts($table_table_cell);
+		
+		if( $this->styleName ) {
+				$style = $ods->getStyleByName($this->styleName->getName()."-".$this->format);
+				if(!$style) {
+					$style = clone $this->styleName;
+					$style->setName($this->styleName->getName()."-".$this->format);
+					$style->setStyleDataName('DateTime-'.$this->format);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			} else {
+				$style = $ods->getStyleByName("ce1-".$this->format);
+				if(!$style) {
+					$style = clone $ods->getStyleByName("ce1");
+					$style->setName("ce1-".$this->format);
+					$style->setStyleDataName('DateTime-'.$this->format);
+					$ods->addTmpStyles($style);
+				}
+				$table_table_cell->setAttribute("table:style-name", $style->getName());
+			}
+		
+		$table_table_cell->setAttribute("office:value-type","date");
+		$table_table_cell->setAttribute("office:date-value",$this->dateTime);
+		return $table_table_cell;
+	}
+}
+
+class odsTableCellImage extends odsTableCell {
+	private $file;
+	private $width;
+	private $heigth;
+	
+	private $zIndex;
+	private $x;
+	private $y;
+	
+	public function __construct($file, odsStyleGraphic $odsStyleGraphic = null) {
+		$this->styleName = $odsStyleGraphic;
+		$this->file      = $file;
+		$im = imagecreatefromstring( file_get_contents( $file )); 
+		$this->width  = (imagesx($im)*0.035276875)."cm";
+		$this->height = (imagesy($im)*0.035276875)."cm";
+		imagedestroy($im);
+		
+		$this->zIndex = "0";
+		$this->x      = "0cm";
+		$this->y      = "0cm";
+	}
+	
+	public function setWidth($width) {
+		$this->width = $width;
+	}
+	
+	public function setHeight($heigth) {
+		$this->heigth = $heigth;
+	}
+	
+	public function setZIndex($zIndex) {
+		$this->zIndex = $zIndex;
+	}
+	
+	public function setX($x) {
+		$this->$x = $x;
+	}
+	
+	public function setY($y) {
+		$this->$y = $y;
+	}
+	
+	public function getContent(ods $ods, DOMDocument $dom) {
+		if($this->styleName)
+			$style = $this->styleName;
+		else 
+			$style = new odsStyleGraphic("gr1");
+			
+		$ods->addTmpStyles($style);
+		
+		$table_table_cell = $dom->createElement('table:table-cell');
+		$this->cellOpts($table_table_cell);
+
+			$draw_frame = $dom->createElement('draw:frame');
+				//$draw_frame->setAttribute("table:end-cell-address", "Feuille1.AA85");
+				//$draw_frame->setAttribute("table:end-x", "1.27cm");
+				//$draw_frame->setAttribute("table:end-y", "0.472cm");
+				$draw_frame->setAttribute("draw:z-index", $this->zIndex);
+				$draw_frame->setAttribute("draw:name", "Images ".md5(time().rand()));
+				$draw_frame->setAttribute("draw:style-name", $style->getName());
+				$draw_frame->setAttribute("draw:text-style-name", "P1");
+				$draw_frame->setAttribute("svg:width", $this->width);
+				$draw_frame->setAttribute("svg:height", $this->height);
+				$draw_frame->setAttribute("svg:x", $this->x);
+				$draw_frame->setAttribute("svg:y", $this->y);
+				$table_table_cell->appendChild($draw_frame);
+				
+				$draw_image = $dom->createElement('draw:image');
+					$draw_image->setAttribute("xlink:href", $ods->addTmpPictures($this->file));
+					$draw_image->setAttribute("xlink:type", "simple");
+					$draw_image->setAttribute("xlink:show", "embed");
+					$draw_image->setAttribute("xlink:actuate", "onLoad");
+					$draw_frame->appendChild($draw_image);
+					
+					$text_p = $dom->createElement('text:p');
+						$draw_image->appendChild($text_p);
+						
+		return $table_table_cell;
+	}
+}
+
+?>
Index: etiquetas-portatiles/trunk/ods/COPYING
===================================================================
--- etiquetas-portatiles/trunk/ods/COPYING	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/COPYING	(revision 191)
@@ -0,0 +1,165 @@
+		   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
Index: etiquetas-portatiles/trunk/ods/ods.php
===================================================================
--- etiquetas-portatiles/trunk/ods/ods.php	(nonexistent)
+++ etiquetas-portatiles/trunk/ods/ods.php	(revision 191)
@@ -0,0 +1,1190 @@
+<?php
+/*-
+ * Copyright (c) 2009 Laurent VUIBERT
+ * License : GNU Lesser General Public License v3
+ */
+
+require_once("class/odsFontFace.php");
+require_once("class/odsStyle.php");
+require_once("class/odsTable.php");
+require_once("class/odsTableColumn.php");
+require_once("class/odsTableRow.php");
+require_once("class/odsTableCell.php");
+
+class ods {
+	private $defaultTable;
+	
+	private $scripts;        // FIXME: Looking
+	private $fontFaces;
+	private $styles;
+	private $tmpStyles;
+	private $tmpPictures;
+	private $tables;
+	
+	private $title;
+	private $subject;
+	private $keyword;
+	private $description;
+	
+	public function __construct() {
+		$this->title         = null;
+		$this->subject       = null;
+		$this->keyword       = null;
+		$this->description   = null;
+		$this->path2OdsFiles = ".";
+		
+		$this->defaultTable = null;
+		
+		$this->scripts   = array();
+		$this->fontFaces = array();
+		$this->styles    = array();
+		$this->tables    = array();
+		
+		$this->addFontFaces( new odsFontFace( "Nimbus Sans L", "swiss" ) );
+		$this->addFontFaces( new odsFontFace( "Bitstream Vera Sans", "system" ) );
+		
+		$this->addStyles( new odsStyleTableColumn("co1") );
+		$this->addStyles( new odsStyleTable("ta1") );
+		$this->addStyles( new odsStyleTableRow("ro1") );
+		$this->addStyles( new odsStyleTableCell("ce1") );
+		
+	}
+	
+	public function setTitle($title) {
+		$this->title = $title;
+	}
+	
+	public function setSubject($subject) {
+		$this->subject = $subject;
+	}
+	
+	public function setKeyword($keyword) {
+		$this->keyword = $keyword;
+	}
+	
+	public function setDescription($description) {
+		$this->description = $description;
+	}
+	
+	// Deprecated
+	public function setPath2OdsFiles($path) {}
+	
+	public function addFontFaces(odsFontFace $odsFontFace) {
+		if(in_array($odsFontFace,$this->fontFaces)) return;
+		$this->fontFaces[$odsFontFace->getFontName()] = $odsFontFace;
+	}
+	
+	public function addStyles(odsStyle $odsStyle) {
+		if(in_array($odsStyle,$this->styles)) return;
+		$this->styles[$odsStyle->getName()] = $odsStyle;
+	}
+	
+	public function addTmpStyles(odsStyle $odsStyle) {
+		if(in_array($odsStyle,$this->styles)) return;
+		if(in_array($odsStyle,$this->tmpStyles)) return;
+		$this->tmpStyles[$odsStyle->getName()] = $odsStyle;
+	}
+	
+	public function addTmpPictures($file) {
+		if(in_array($file,$this->tmpPictures)) return;
+		$this->tmpPictures[$file] = "Pictures/".md5(time().rand()).'.jpg';
+		return $this->tmpPictures[$file];
+	}
+	
+	public function getStyleByName($name) {
+		if(isset($this->styles[$name])) return $this->styles[$name];
+		if(isset($this->tmpStyles[$name])) return $this->tmpStyles[$name];
+		return null; 
+	}
+	
+	public function addTable(odsTable $odsTable) {
+		if(in_array($odsTable,$this->tables)) return;
+		$this->tables[$odsTable->getName()] = $odsTable;
+	}
+	
+	public function setDefaultTable(odsTable $odsTable) {
+		$this->defaultTable = $odsTable;
+	}
+	
+	private function getDefaultTableName() {
+		if($this->defaultTable) {
+			return $this->defaultTable->getName();
+		} elseif(count($this->tables)){
+			$keys = array_keys($this->tables);
+			//var_dump($keys);
+			return $this->tables[$keys[0]]->getName();
+		} else {
+			return "feuille1";
+		}
+	}
+	
+	public function getContent() {
+		$this->tmpStyles = array();
+		$this->tmpPictures = array();
+		
+		$dom = new DOMDocument('1.0', 'UTF-8');
+		$root = $dom->createElement('office:document-content');
+			$root->setAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+			$root->setAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+			$root->setAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+			$root->setAttribute("xmlns:table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0");
+			$root->setAttribute("xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
+			$root->setAttribute("xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
+			$root->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+			$root->setAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
+			$root->setAttribute("xmlns:meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
+			$root->setAttribute("xmlns:number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
+			$root->setAttribute("xmlns:presentation", "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0");
+			$root->setAttribute("xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
+			$root->setAttribute("xmlns:chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0");
+			$root->setAttribute("xmlns:dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0");
+			$root->setAttribute("xmlns:math", "http://www.w3.org/1998/Math/MathML");
+			$root->setAttribute("xmlns:form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0");
+			$root->setAttribute("xmlns:script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0");
+			$root->setAttribute("xmlns:ooo", "http://openoffice.org/2004/office");
+			$root->setAttribute("xmlns:ooow", "http://openoffice.org/2004/writer");
+			$root->setAttribute("xmlns:oooc", "http://openoffice.org/2004/calc");
+			$root->setAttribute("xmlns:dom", "http://www.w3.org/2001/xml-events");
+			$root->setAttribute("xmlns:xforms", "http://www.w3.org/2002/xforms");
+			$root->setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
+			$root->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
+			$root->setAttribute("xmlns:rpt", "http://openoffice.org/2005/report");
+			$root->setAttribute("xmlns:of", "urn:oasis:names:tc:opendocument:xmlns:of:1.2");
+			$root->setAttribute("xmlns:rdfa", "http://docs.oasis-open.org/opendocument/meta/rdfa#");
+			$root->setAttribute("xmlns:field", "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:field:1.0");
+			$root->setAttribute("xmlns:formx", "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0");
+			$root->setAttribute("office:version", "1.2");
+			$dom->appendChild($root);
+
+		// office:scripts
+		$root->appendChild($dom->createElement('office:scripts'));
+		
+		//office:font-face-decls
+		$office_font_face_decls =  $dom->createElement('office:font-face-decls');
+		$root->appendChild($office_font_face_decls);
+		
+			foreach($this->fontFaces as $fontFace)
+				$office_font_face_decls->appendChild($fontFace->getContent($this,$dom));
+
+		// office:automatic-styles
+		$office_automatic_styles =  $dom->createElement('office:automatic-styles');
+			$root->appendChild($office_automatic_styles);
+			
+			foreach($this->styles as $style)
+				$office_automatic_styles->appendChild($style->getContent($this,$dom));
+
+		// office:body
+		$office_body =  $dom->createElement('office:body');
+			$root->appendChild($office_body);
+		
+			// office:spreadsheet
+			$office_spreadsheet = $dom->createElement('office:spreadsheet');
+				$office_body->appendChild($office_spreadsheet);
+
+					foreach($this->tables as $table)
+						$office_spreadsheet->appendChild($table->getContent($this,$dom));
+		
+			foreach($this->tmpStyles as $style)
+				$office_automatic_styles->appendChild($style->getContent($this,$dom));
+		
+		return $dom->saveXML();
+	}
+	
+	public function getMeta() {
+		$dom = new DOMDocument('1.0', 'UTF-8');
+		
+		$root = $dom->createElement('office:document-meta');
+			$root->setAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+			$root->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+			$root->setAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
+			$root->setAttribute("xmlns:meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
+			$root->setAttribute("xmlns:ooo", "http://openoffice.org/2004/office");
+			$root->setAttribute("office:version", "1.2");
+			$dom->appendChild($root);
+		
+		$meta =  $dom->createElement('office:meta');
+			$root->appendChild($meta);
+		
+		$meta->appendChild($dom->createElement('meta:creation-date',date("Y-m-d\TH:j:s")));
+		$meta->appendChild($dom->createElement('meta:generator','ods générator'));
+		$meta->appendChild($dom->createElement('dc:date',date("Y-m-d\TH:j:s")));
+		$meta->appendChild($dom->createElement('meta:editing-duration','PT1S'));
+		$meta->appendChild($dom->createElement('meta:editing-cycles','1'));
+		if($this->title)
+			$meta->appendChild($dom->createElement('dc:title',$this->title));
+		if($this->subject)
+			$meta->appendChild($dom->createElement('dc:subject',$this->subject));
+		if($this->keyword)
+			$meta->appendChild($dom->createElement('meta:keyword',$this->keyword));
+		if($this->description)
+			$meta->appendChild($dom->createElement('dc:description',$this->description));
+		$elm = $dom->createElement('meta:document-statistic');
+			$elm->setAttribute("meta:table-count", "1");
+			$elm->setAttribute("meta:cell-count", "4");
+			$elm->setAttribute("meta:object-count", "0");
+			$meta->appendChild($elm);
+		
+		return $dom->saveXML();
+	}
+	
+	public function getSettings() {
+		$dom = new DOMDocument('1.0', 'UTF-8');
+		
+		$root = $dom->createElement('office:document-settings');
+			$root->setAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+			$root->setAttribute("xmlns:xlink",  "http://www.w3.org/1999/xlink");
+			$root->setAttribute("xmlns:config", "urn:oasis:names:tc:opendocument:xmlns:config:1.0");
+			$root->setAttribute("xmlns:ooo",    "http://openoffice.org/2004/office");
+			$root->setAttribute("office:version", "1.2");
+			$dom->appendChild($root);
+		
+			$office_settings =  $dom->createElement('office:settings');
+				$root->appendChild($office_settings);
+			
+				$config_config_item_set = $dom->createElement('config:config-item-set');
+					$config_config_item_set->setAttribute("config:name", "ooo:view-settings");
+					$office_settings->appendChild($config_config_item_set);
+				
+					$config_config_item = $dom->createElement('config:config-item',0);
+						$config_config_item->setAttribute("config:name", "VisibleAreaTop");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+			
+					$config_config_item = $dom->createElement('config:config-item',0);
+						$config_config_item->setAttribute("config:name", "VisibleAreaLeft");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item',10018);
+						$config_config_item->setAttribute("config:name", "VisibleAreaWidth");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item',2592);
+						$config_config_item->setAttribute("config:name", "VisibleAreaHeight");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+					
+					$config_config_item_map_indexed = $dom->createElement('config:config-item-map-indexed');
+						$config_config_item_map_indexed->setAttribute("config:name", "Views");
+						$config_config_item_set->appendChild($config_config_item_map_indexed);
+			
+						$config_config_item_map_entry1 = $dom->createElement('config:config-item-map-entry');
+							$config_config_item_map_indexed->appendChild($config_config_item_map_entry1);
+			
+							//<config:config-item config:name="ViewId" config:type="string">View1</config:config-item>
+							$config_config_item = $dom->createElement('config:config-item', 'View1');
+								$config_config_item->setAttribute("config:name", "ViewId");
+								$config_config_item->setAttribute("config:type", "string");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+								
+							//<config:config-item-map-named config:name="Tables">
+							$config_config_item_map_named = $dom->createElement('config:config-item-map-named');
+								$config_config_item_map_named->setAttribute("config:name", "Tables");
+								$config_config_item_map_entry1->appendChild($config_config_item_map_named);
+								
+								foreach($this->tables as $table)
+									$config_config_item_map_named->appendChild($table->getSettings($this,$dom));
+
+							$config_config_item = $dom->createElement('config:config-item', $this->getDefaultTableName());
+								$config_config_item->setAttribute("config:name", "ActiveTable");
+								$config_config_item->setAttribute("config:type", "string");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '270');
+								$config_config_item->setAttribute("config:name", "HorizontalScrollbarWidth");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+
+							$config_config_item = $dom->createElement('config:config-item', '0');
+								$config_config_item->setAttribute("config:name", "ZoomType");
+								$config_config_item->setAttribute("config:type", "short");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '100');
+								$config_config_item->setAttribute("config:name", "ZoomValue");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '60');
+								$config_config_item->setAttribute("config:name", "PageViewZoomValue");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'false');
+								$config_config_item->setAttribute("config:name", "ShowPageBreakPreview");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "ShowZeroValues");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "ShowNotes");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "ShowGrid");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '12632256');
+								$config_config_item->setAttribute("config:name", "GridColor");
+								$config_config_item->setAttribute("config:type", "long");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "ShowPageBreaks");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+										
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "HasColumnRowHeaders");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "HasSheetTabs");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "IsOutlineSymbolsSet");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'false');
+								$config_config_item->setAttribute("config:name", "IsSnapToRaster");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'false');
+								$config_config_item->setAttribute("config:name", "RasterIsVisible");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '1000');
+								$config_config_item->setAttribute("config:name", "RasterResolutionX");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '1000');
+								$config_config_item->setAttribute("config:name", "RasterResolutionY");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '1');
+								$config_config_item->setAttribute("config:name", "RasterSubdivisionX");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', '1');
+								$config_config_item->setAttribute("config:name", "RasterSubdivisionY");
+								$config_config_item->setAttribute("config:type", "int");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+							$config_config_item = $dom->createElement('config:config-item', 'true');
+								$config_config_item->setAttribute("config:name", "IsRasterAxisSynchronized");
+								$config_config_item->setAttribute("config:type", "boolean");
+								$config_config_item_map_entry1->appendChild($config_config_item);
+
+				$config_config_item_set = $dom->createElement('config:config-item-set');
+					$config_config_item_set->setAttribute("config:name", "ooo:configuration-settings");
+					$office_settings->appendChild($config_config_item_set);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "ShowZeroValues");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "ShowNotes");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "ShowGrid");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '12632256');// test 0
+						$config_config_item->setAttribute("config:name", "GridColor");
+						$config_config_item->setAttribute("config:type", "long");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "ShowPageBreaks");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '3');
+						$config_config_item->setAttribute("config:name", "LinkUpdateMode");
+						$config_config_item->setAttribute("config:type", "short");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "HasColumnRowHeaders");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "HasSheetTabs");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "IsOutlineSymbolsSet");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'false');
+						$config_config_item->setAttribute("config:name", "IsSnapToRaster");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'false');
+						$config_config_item->setAttribute("config:name", "RasterIsVisible");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '1000');
+						$config_config_item->setAttribute("config:name", "RasterResolutionX");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '1000');
+						$config_config_item->setAttribute("config:name", "RasterResolutionY");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '1');
+						$config_config_item->setAttribute("config:name", "RasterSubdivisionX");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '1');
+						$config_config_item->setAttribute("config:name", "RasterSubdivisionY");
+						$config_config_item->setAttribute("config:type", "int");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "IsRasterAxisSynchronized");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "AutoCalculate");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item');
+						$config_config_item->setAttribute("config:name", "PrinterName");
+						$config_config_item->setAttribute("config:type", "string");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item');
+						$config_config_item->setAttribute("config:name", "PrinterSetup");
+						$config_config_item->setAttribute("config:type", "base64Binary");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "ApplyUserData");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', '0');
+						$config_config_item->setAttribute("config:name", "CharacterCompressionType");
+						$config_config_item->setAttribute("config:type", "short");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'false');
+						$config_config_item->setAttribute("config:name", "IsKernAsianPunctuation");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'false');
+						$config_config_item->setAttribute("config:name", "SaveVersionOnClose");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "UpdateFromTemplate");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'true');
+						$config_config_item->setAttribute("config:name", "AllowPrintJobCancel");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'false');
+						$config_config_item->setAttribute("config:name", "LoadReadonly");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+					$config_config_item = $dom->createElement('config:config-item', 'false');
+						$config_config_item->setAttribute("config:name", "IsDocumentShared");
+						$config_config_item->setAttribute("config:type", "boolean");
+						$config_config_item_set->appendChild($config_config_item);
+
+			return $dom->saveXML();
+	}
+
+	public function getStyles() {
+		$dom = new DOMDocument('1.0', 'UTF-8');
+		
+		$root = $dom->createElement('office:document-styles');
+			$root->setAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+			$root->setAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+			$root->setAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+			$root->setAttribute("xmlns:table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0");
+			$root->setAttribute("xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
+			$root->setAttribute("xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
+			$root->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+			$root->setAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
+			$root->setAttribute("xmlns:meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
+			$root->setAttribute("xmlns:number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
+			$root->setAttribute("xmlns:presentation", "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0");
+			$root->setAttribute("xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
+			$root->setAttribute("xmlns:chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0");
+			$root->setAttribute("xmlns:dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0");
+			$root->setAttribute("xmlns:math", "http://www.w3.org/1998/Math/MathML");
+			$root->setAttribute("xmlns:form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0");
+			$root->setAttribute("xmlns:script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0");
+			$root->setAttribute("xmlns:ooo", "http://openoffice.org/2004/office");
+			$root->setAttribute("xmlns:ooow", "http://openoffice.org/2004/writer");
+			$root->setAttribute("xmlns:oooc", "http://openoffice.org/2004/calc");
+			$root->setAttribute("xmlns:dom", "http://www.w3.org/2001/xml-events");
+			$root->setAttribute("xmlns:rpt", "http://openoffice.org/2005/report");
+			$root->setAttribute("xmlns:of", "urn:oasis:names:tc:opendocument:xmlns:of:1.2");
+			$root->setAttribute("xmlns:rdfa", "http://docs.oasis-open.org/opendocument/meta/rdfa#");
+			$root->setAttribute("office:version", "1.2");
+			$dom->appendChild($root);
+		
+		
+			$office_font_face_decls = $dom->createElement('office:font-face-decls');
+				$root->appendChild($office_font_face_decls);
+				
+				foreach($this->fontFaces as $fontFace)
+					$office_font_face_decls->appendChild($fontFace->getStyles($this,$dom));
+			
+			$office_styles = $dom->createElement('office:styles');
+				$root->appendChild($office_styles);
+				
+				$style_default_style = $dom->createElement('style:default-style');
+					$style_default_style->setAttribute("style:family", "table-cell");
+					$office_styles->appendChild($style_default_style);
+				
+					$style_table_cell_properties = $dom->createElement('style:table-cell-properties');
+						$style_table_cell_properties->setAttribute("style:decimal-places", "2");
+						$style_default_style->appendChild($style_table_cell_properties);
+						
+					$style_paragraph_properties = $dom->createElement('style:paragraph-properties');
+						$style_paragraph_properties->setAttribute("style:tab-stop-distance", "1.25cm");
+						$style_default_style->appendChild($style_paragraph_properties);
+				
+					$style_text_properties = $dom->createElement('style:text-properties');
+						$style_text_properties->setAttribute("style:font-name", "Nimbus Sans L");
+						$style_text_properties->setAttribute("fo:language", "fr");
+						$style_text_properties->setAttribute("fo:country", "FR");
+						$style_text_properties->setAttribute("style:font-name-asian", "Bitstream Vera Sans");
+						$style_text_properties->setAttribute("style:language-asian", "zxx");
+						$style_text_properties->setAttribute("style:country-asian", "none");
+						$style_text_properties->setAttribute("style:font-name-complex", "Bitstream Vera Sans");
+						$style_text_properties->setAttribute("style:language-complex", "zxx");
+						$style_text_properties->setAttribute("style:country-complex", "none");
+						$style_default_style->appendChild($style_text_properties);
+
+				$style_default_style = $dom->createElement('style:default-style');
+					$style_default_style->setAttribute("style:family", "graphic");
+					$office_styles->appendChild($style_default_style);
+				
+					$style_graphic_properties = $dom->createElement('style:graphic-properties');
+						$style_graphic_properties->setAttribute("draw:shadow-offset-x", "0.3cm");
+						$style_graphic_properties->setAttribute("draw:shadow-offset-y", "0.3cm");
+						$style_default_style->appendChild($style_graphic_properties);
+					
+					$style_paragraph_properties = $dom->createElement('style:paragraph-properties');
+						$style_paragraph_properties->setAttribute("style:text-autospace", "ideograph-alpha");
+						$style_paragraph_properties->setAttribute("style:punctuation-wrap", "simple");
+						$style_paragraph_properties->setAttribute("style:line-break", "strict");
+						$style_paragraph_properties->setAttribute("style:writing-mode", "page");
+						$style_paragraph_properties->setAttribute("style:font-independent-line-spacing", "false");
+						$style_default_style->appendChild($style_paragraph_properties);
+						
+						$style_tab_stops = $dom->createElement('style:tab-stops');
+							$style_paragraph_properties->appendChild($style_tab_stops);
+							
+					$style_text_properties =  $dom->createElement('style:text-properties');
+						$style_text_properties->setAttribute("style:use-window-font-color", "true");
+						$style_text_properties->setAttribute("fo:font-family", "'Nimbus Roman No9 L'");
+						$style_text_properties->setAttribute("style:font-family-generic", "roman");
+						$style_text_properties->setAttribute("style:font-pitch", "variable");
+						$style_text_properties->setAttribute("fo:font-size", "12pt");
+						$style_text_properties->setAttribute("fo:language", "fr");
+						$style_text_properties->setAttribute("fo:country", "FR");
+						$style_text_properties->setAttribute("style:letter-kerning", "true");
+						$style_text_properties->setAttribute("style:font-size-asian", "24pt");
+						$style_text_properties->setAttribute("style:language-asian", "zxx");
+						$style_text_properties->setAttribute("style:country-asian", "none");
+						$style_text_properties->setAttribute("style:font-size-complex", "24pt");
+						$style_text_properties->setAttribute("style:language-complex", "zxx");
+						$style_text_properties->setAttribute("style:country-complex", "none");
+						$style_default_style->appendChild($style_text_properties);
+
+				//<number:number-style style:name="N0">
+				$number_number_style = $dom->createElement('number:number-style');
+					$number_number_style->setAttribute("style:name", "N0");
+					$office_styles->appendChild($number_number_style);
+
+					$number_number = $dom->createElement('number:number');
+						$number_number->setAttribute("number:min-integer-digits", "1");
+						$number_number_style->appendChild($number_number);				
+
+				$style_style = $dom->createElement('style:style');
+					$style_style->setAttribute("style:name", "Default");
+					$style_style->setAttribute("style:family", "table-cell");
+					$office_styles->appendChild($style_style);
+					
+				$style_style = $dom->createElement('style:style');
+					$style_style->setAttribute("style:name", "Result");
+					$style_style->setAttribute("style:family", "table-cell");
+					$style_style->setAttribute("style:parent-style-name", "Default");
+					$office_styles->appendChild($style_style);
+					
+					$style_text_properties = $dom->createElement('style:text-properties');
+						$style_text_properties->setAttribute("fo:font-style", "italic");
+						$style_text_properties->setAttribute("style:text-underline-style", "solid");
+						$style_text_properties->setAttribute("style:text-underline-width", "auto");
+						$style_text_properties->setAttribute("style:text-underline-color", "font-color");
+						$style_text_properties->setAttribute("fo:font-weight", "bold");
+						$style_style->appendChild($style_text_properties);
+
+				$style_style = $dom->createElement('style:style');
+					$style_style->setAttribute("style:name", "Result2");
+					$style_style->setAttribute("style:family", "table-cell");
+					$style_style->setAttribute("style:parent-style-name", "Result");
+					$style_style->setAttribute("style:data-style-name", "N106");
+					$office_styles->appendChild($style_style);
+						
+				$style_style = $dom->createElement('style:style');
+					$style_style->setAttribute("style:name", "Heading");
+					$style_style->setAttribute("style:family", "table-cell");
+					$style_style->setAttribute("style:parent-style-name", "Default");
+					$office_styles->appendChild($style_style);
+
+					$style_table_cell_properties = $dom->createElement('style:table-cell-properties');
+						$style_table_cell_properties->setAttribute("style:text-align-source", "fix");
+						$style_table_cell_properties->setAttribute("style:repeat-content", "false");
+						$style_style->appendChild($style_table_cell_properties);
+					
+					$style_paragraph_properties = $dom->createElement('style:paragraph-properties');
+						$style_paragraph_properties->setAttribute("fo:text-align", "center");
+						$style_style->appendChild($style_paragraph_properties);
+						
+					$style_text_properties = $dom->createElement('style:text-properties');
+						$style_text_properties->setAttribute("fo:font-size", "16pt");
+						$style_text_properties->setAttribute("fo:font-style", "italic");
+						$style_text_properties->setAttribute("fo:font-weight", "bold");
+						$style_style->appendChild($style_text_properties);
+
+				$style_style = $dom->createElement('style:style');
+					$style_style->setAttribute("style:name", "Heading1");
+					$style_style->setAttribute("style:family", "table-cell");
+					$style_style->setAttribute("style:parent-style-name", "Heading");
+					$office_styles->appendChild($style_style);
+
+					$style_table_cell_properties = $dom->createElement('style:table-cell-properties');
+						$style_table_cell_properties->setAttribute("style:rotation-angle", "90");
+						$style_style->appendChild($style_table_cell_properties);
+
+			$office_automatic_styles = $dom->createElement('office:automatic-styles');
+				$root->appendChild($office_automatic_styles);
+				
+				$style_page_layout = $dom->createElement('style:page-layout');
+					$style_page_layout->setAttribute("style:name", "Mpm1");
+					$office_automatic_styles->appendChild($style_page_layout);
+				
+					$style_page_layout_properties = $dom->createElement('style:page-layout-properties');
+						$style_page_layout_properties->setAttribute("style:writing-mode", "lr-tb");
+						$style_page_layout->appendChild($style_page_layout_properties);
+					
+					$style_header_style = $dom->createElement('style:header-style');
+						$style_page_layout->appendChild($style_header_style);
+			
+						$style_header_footer_properties = $dom->createElement('style:header-footer-properties');
+							$style_header_footer_properties->setAttribute("fo:min-height", "0.751cm");
+							$style_header_footer_properties->setAttribute("fo:margin-left", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-right", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-bottom", "0.25cm");
+							$style_header_style->appendChild($style_header_footer_properties);
+					
+					$style_footer_style = $dom->createElement('style:footer-style');
+						$style_page_layout->appendChild($style_footer_style);
+			
+						$style_header_footer_properties = $dom->createElement('style:header-footer-properties');
+							$style_header_footer_properties->setAttribute("fo:min-height", "0.751cm");
+							$style_header_footer_properties->setAttribute("fo:margin-left", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-right", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-top", "0.25cm");
+							$style_footer_style->appendChild($style_header_footer_properties);
+					
+				$style_page_layout = $dom->createElement('style:page-layout');
+					$style_page_layout->setAttribute("style:name", "Mpm2");
+					$office_automatic_styles->appendChild($style_page_layout);
+
+					$style_page_layout_properties = $dom->createElement('style:page-layout-properties');
+						$style_page_layout_properties->setAttribute("style:writing-mode", "lr-tb");
+						$style_page_layout->appendChild($style_page_layout_properties);
+				
+					$style_header_style = $dom->createElement('style:header-style');
+						$style_page_layout->appendChild($style_header_style);
+				
+						$style_header_footer_properties = $dom->createElement('style:header-footer-properties');
+							$style_header_footer_properties->setAttribute("fo:min-height", "0.751cm");
+							$style_header_footer_properties->setAttribute("fo:margin-left", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-right", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-bottom", "0.25cm");
+							$style_header_footer_properties->setAttribute("fo:border", "0.088cm solid #000000");
+							$style_header_footer_properties->setAttribute("fo:padding", "0.018cm");
+							$style_header_footer_properties->setAttribute("fo:background-color", "#c0c0c0");
+							$style_header_style->appendChild($style_header_footer_properties);
+						
+							$style_background_image = $dom->createElement('style:background-image');
+								$style_header_footer_properties->appendChild($style_background_image);
+				
+					$style_footer_style = $dom->createElement('style:footer-style');
+						$style_page_layout->appendChild($style_footer_style);
+				
+						$style_header_footer_properties = $dom->createElement('style:header-footer-properties');
+							$style_header_footer_properties->setAttribute("fo:min-height", "0.751cm");
+							$style_header_footer_properties->setAttribute("fo:margin-left", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-right", "0cm");
+							$style_header_footer_properties->setAttribute("fo:margin-top", "0.25cm");
+							$style_header_footer_properties->setAttribute("fo:border", "0.088cm solid #000000");
+							$style_header_footer_properties->setAttribute("fo:padding", "0.018cm");
+							$style_header_footer_properties->setAttribute("fo:background-color", "#c0c0c0");
+							$style_footer_style->appendChild($style_header_footer_properties);
+						
+							$style_background_image = $dom->createElement('style:background-image');
+								$style_header_footer_properties->appendChild($style_background_image);
+
+			$office_master_styles = $dom->createElement('office:master-styles');
+				$root->appendChild($office_master_styles);
+		
+				$style_master_page = $dom->createElement('style:master-page');
+					$style_master_page->setAttribute("style:name", "Default");
+					$style_master_page->setAttribute("style:page-layout-name", "Mpm1");
+					$office_master_styles->appendChild($style_master_page);
+
+					$style_header = $dom->createElement('style:header');
+						$style_master_page->appendChild($style_header);
+
+						$text_p = $dom->createElement('text:p');
+							$style_header->appendChild($text_p);
+						
+							$text_sheet_name = $dom->createElement('text:sheet-name', '???');
+								$text_p->appendChild($text_sheet_name);
+
+					$style_header_left = $dom->createElement('style:header-left');
+						$style_header_left->setAttribute("style:display", "false");
+						$style_master_page->appendChild($style_header_left);
+
+					$style_footer = $dom->createElement('style:footer');
+						$style_master_page->appendChild($style_footer);
+						
+						$text_p = $dom->createElement('text:p', "Page");
+							$style_footer->appendChild($text_p);
+						
+							$text_page_number = $dom->createElement('text:page-number', '1');
+								$text_p->appendChild($text_page_number);
+
+					$style_footer_left = $dom->createElement('style:footer-left');
+						$style_footer_left->setAttribute("style:display", "false");
+						$style_master_page->appendChild($style_footer_left);
+
+				$style_master_page = $dom->createElement('style:master-page');
+					$style_master_page->setAttribute("style:name", "Report");
+					$style_master_page->setAttribute("style:page-layout-name", "Mpm2");
+					$office_master_styles->appendChild($style_master_page);
+
+					$style_header = $dom->createElement('style:header');
+						$style_master_page->appendChild($style_header);
+
+						$style_region_left = $dom->createElement('style:region-left');
+							$style_header->appendChild($style_region_left);
+						
+							$text_p = $dom->createElement('text:p');
+								$style_region_left->appendChild($text_p);
+								
+								$text_sheet_name = $dom->createElement('text:sheet-name', '???');
+									$text_p->appendChild($text_sheet_name);
+
+								$note_text = $dom->createTextNode('(');
+									$text_p->appendChild($note_text);
+
+								$text_title = $dom->createElement('text:title', '???');
+									$text_p->appendChild($text_title);
+									
+								$note_text = $dom->createTextNode(')');
+									$text_p->appendChild($note_text);
+
+						$style_region_right = $dom->createElement('style:region-right');
+							$style_header->appendChild($style_region_right);	
+							
+							$text_p = $dom->createElement('text:p');
+								$style_region_right->appendChild($text_p);
+								
+								$text_date = $dom->createElement('text:date','31/10/2009');
+									$text_date->setAttribute("style:data-style-name", "N2");
+									$text_date->setAttribute("text:date-value", "2009-10-31");
+									$text_p->appendChild($text_date);
+						
+								$note_text = $dom->createTextNode(',');
+									$text_p->appendChild($note_text);
+									
+								$text_date = $dom->createElement('text:time','18:09:40');
+									$text_p->appendChild($text_date);
+					
+					$style_header_left = $dom->createElement('style:header-left');
+						$style_header_left->setAttribute("style:display", "false");
+						$style_master_page->appendChild($style_header_left);
+
+					$style_footer = $dom->createElement('style:footer');
+						$style_master_page->appendChild($style_footer);
+						
+						$text_p = $dom->createElement('text:p', 'Page');
+							$style_footer->appendChild($text_p);
+							
+							$text_page_number = $dom->createElement('text:page-number','1');
+								$text_p->appendChild($text_page_number);
+								
+							$note_text = $dom->createTextNode('/');
+								$text_p->appendChild($note_text);
+						
+							$text_page_count = $dom->createElement('text:page-count','99');
+								$text_p->appendChild($text_page_count);
+						
+					$style_footer_left = $dom->createElement('style:footer-left');
+						$style_footer_left->setAttribute("style:display", "false");
+						$style_master_page->appendChild($style_footer_left);
+				
+		
+		return $dom->saveXML();
+	}
+	
+	private function getMimeType() {
+		return "application/vnd.oasis.opendocument.spreadsheet";
+	}
+	
+	private function getAcceleratorCurrent() {
+		return "";
+	}
+	
+	private function getManifest() {
+		$dom = new DOMDocument('1.0', 'UTF-8');
+		$root = $dom->createElement('manifest:manifest');
+			$root->setAttribute("xmlns:manifest", "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0");
+			$dom->appendChild($root);
+		
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "application/vnd.oasis.opendocument.spreadsheet");
+				$manifest_file_entry->setAttribute("manifest:version", "1.2");
+				$manifest_file_entry->setAttribute("manifest:full-path", "/");
+				$root->appendChild($manifest_file_entry);
+			
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "text/xml");
+				$manifest_file_entry->setAttribute("manifest:full-path", "content.xml");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "text/xml");
+				$manifest_file_entry->setAttribute("manifest:full-path", "styles.xml");
+				$root->appendChild($manifest_file_entry);
+			
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "text/xml");
+				$manifest_file_entry->setAttribute("manifest:full-path", "meta.xml");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Thumbnails/thumbnail.png");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Thumbnails/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/accelerator/current.xml");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/accelerator/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/progressbar/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/floater/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/popupmenu/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/menubar/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/toolbar/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/images/Bitmaps/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/images/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/statusbar/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "application/vnd.sun.xml.ui.configuration");
+				$manifest_file_entry->setAttribute("manifest:full-path", "Configurations2/");
+				$root->appendChild($manifest_file_entry);
+
+			$manifest_file_entry = $dom->createElement("manifest:file-entry");
+				$manifest_file_entry->setAttribute("manifest:media-type", "text/xml");
+				$manifest_file_entry->setAttribute("manifest:full-path", "settings.xml");
+				$root->appendChild($manifest_file_entry);
+
+		return $dom->saveXML();
+	}
+	
+	private function getThumbnail() {
+		return base64_decode("
+			iVBORw0KGgoAAAANSUhEUgAAALoAAAEACAYAAAAEKGxWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz
+			AAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURB
+			VHic7Z152F3T9cc/K3PMNcUUMZQ0hFJRQypiFmOpuai21NRWfmhNpWooRVDaGmqe1VDUUC1iaFHS
+			0BojIaExlRAlEQlZvz/WvnlPznuGO4/r8zz3ue89e+9z1r33e/e7z95rryWqiuO0Oz0abYDj1AMX
+			utMRuNCdjsCF7nQELnSnI3ChOx2BC93pCFzoTkfgQnfqhhg/F5G/isjvRWRo3a7tK6NOPRCRnsCN
+			wO6Rw68Bw1T1w1pf33t0p15sy/wiB1gFGFKPi7vQnXqxZXh+L3JMgVfqcXEXulMvvgjPewP3AS8B
+			O6vq+/W4uI/RnbogImsDzwK7q+pt9b6+9+hOTRGRr4vIb4E3gduAo0Wkd73tcKE7teZXwGHAROAD
+			YEPg0nob4UMXp2aIyCjg3pTic4GfquoXKeVVxXt0pyaISA/gjIwqRwKPisigWLveIrJzte1xoTu1
+			Yh/gqzl1Ngb+JSI/EpFe4dgvgTtEZP1qGuNDF6fqiIgAE4AvAaOA9YEjgMEZzV4DxgF7ALep6m5V
+			tcmF7tQCERkCLKiq48LrHsB3gdOBARlNZwFDVHVKVe1xoTv1REQWAU4Efgz0SahymqqeWPXrutCd
+			RiAiqwHnAdtHDr8JDFbVGVW/ngvdqTYiMhxYGVgW+Ay4Q1XfSKk7GhM8wL6qen1NbHKhO9VCRDbD
+			phQ3SCh+Gvixqj4Za7MKMAl4EhiuNRKkTy86VUFEzgAeIlnk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iTojCl8SgWSjnLv9pxyqLmCXVFZH1sKmpPksfu44ATtPrh5BxnHnXLHB0c9DfBnL6m
+			Fx6qOrEuBjgdTculSHeccmiqAEaOUytc6E5H4EJ3OgIXutMRuNCdjsCF7nQELnSnI/h/RFS3BiKq
+			JXMAAAAASUVORK5CYII=");
+	}
+	
+	public function genOdsFile($file) {
+		$zip = new ZipArchive();
+		
+		if ($zip->open($file, ZIPARCHIVE::OVERWRITE)!==TRUE) {
+		   exit("cannot open $file\n");
+		}
+		
+		$zip->addFromString("meta.xml", $this->getMeta());
+		$zip->addFromString("content.xml", $this->getContent());
+		$zip->addFromString("files/mimetype", $this->getMimeType());
+		$zip->addFromString("settings.xml", $this->getSettings());
+		$zip->addFromString("styles.xml", $this->getStyles());
+		$zip->addFromString("files/Configurations2/accelerator/current.xml", $this->getAcceleratorCurrent());
+		$zip->addFromString("META-INF/manifest.xml", $this->getManifest());
+		$zip->addFromString("files/Thumbnails/thumbnail.png", $this->getThumbnail());
+		
+		foreach($this->tmpPictures AS $imgfile => $name)
+			$zip->addFile($imgfile,$name);
+		
+		$zip->close();
+	}
+	
+	public function downloadOdsFile($fileName) {
+		header('Content-type: application/vnd.oasis.opendocument.spreadsheet');
+		header('Content-Disposition: attachment; filename="'.$fileName.'"');
+		$tmpfile = tempnam("tmp", "genods");
+		$this->genOdsFile($tmpfile);
+		readfile($tmpfile);
+		unlink($tmpfile);
+	}
+
+
+}
+ 
+?>
Index: etiquetas-portatiles/trunk/backend.php
===================================================================
--- etiquetas-portatiles/trunk/backend.php	(revision 190)
+++ etiquetas-portatiles/trunk/backend.php	(revision 191)
@@ -23,7 +23,7 @@
 
 	$user="cn=".$_GET["userLDAP"].",ou=People,dc=instituto,dc=extremadura,dc=es";
 
-	$conex = @ldap_connect("ldaps://".$_GET["hostLDAP"], 636);
+	$conex = ldap_connect("ldaps://".$_GET["hostLDAP"], 636);
 	if (!$conex){
 		$responce->msg = "noConnect";
 		die(json_encode($responce)); 
Index: etiquetas-portatiles/trunk/index.php
===================================================================
--- etiquetas-portatiles/trunk/index.php	(revision 190)
+++ etiquetas-portatiles/trunk/index.php	(revision 191)
@@ -176,6 +176,83 @@
 		}
 		$pdf->Output();
 		exit();
+	} elseif($_POST["action"]=="generate_spreadsheet"){
+		require_once('ods/ods.php');
+
+		// Conectamos con LDAP
+		$user="cn=".$_POST["userLDAP"].",ou=People,dc=instituto,dc=extremadura,dc=es";
+
+		$conex=ldap_connect("ldaps://".$_POST["hostLDAP"], 636) or die ("No ha sido posible conectarse al servidor<br><br><input type='button' value='Volver' onClick='location.href=\"index.php\"'/>");
+		  
+		if (!@ldap_set_option($conex, LDAP_OPT_PROTOCOL_VERSION, 3))
+			 die("Falló la configuracion de protocolo version 3<br><br><input type='button' value='Volver' onClick='location.href=\"index.php\"'/>");
+
+	   if (!@ldap_bind($conex, $user, $_POST["password"]))
+			die("Upsss, fall&oacute; la autenticaci&oacute;n. Vuelve a intentarlo otra vez.<br><br><input type='button' value='Volver' onClick='location.href=\"index.php\"'/>");
+
+		// Obtenemos la info de LDAP
+		$dn = "ou=Group,dc=instituto,dc=extremadura,dc=es";
+
+		$filter="(|";
+		for($i=0;$i<count($_POST["classroomGroup"]);$i++){
+			$filter.="(cn=".$_POST["classroomGroup"][$i].")";
+		}
+		$filter.=")";
+
+		$fields = array("cn","grouptype","memberuid");
+		$sr=ldap_search($conex, $dn, $filter,$fields);
+		$groups = ldap_get_entries($conex, $sr);
+
+		for($i=0;$i<count($groups);$i++){
+			if($groups[$i]["grouptype"][0]=="school_class"){
+				for($j=0;$j<count($groups[$i]["memberuid"]);$j++){
+					if($groups[$i]["memberuid"][$j]!=""){
+						$listGroups[$groups[$i]["cn"][0]][] = $groups[$i]["memberuid"][$j];
+					}
+				}
+			}
+		}
+
+		ksort($listGroups);
+		
+		$filter = "";
+		if($_POST["filter"]!="")
+			$filter = $_POST["filter"]."*";
+
+		$dn = "ou=People,dc=instituto,dc=extremadura,dc=es";
+		$fields = array("uid","cn","employeenumber");
+		$sr=ldap_search($conex, $dn, "uid=*".$filter, $fields);
+		$students_tmp = ldap_get_entries($conex, $sr);
+		
+		$completeListGroups = array();
+		foreach($listGroups as $key=>$value){
+			sort($value);
+			
+			$students = array();
+			for($i=0;$i<count($students_tmp);$i++){
+				if(in_array($students_tmp[$i]["uid"][0],$value))
+					$students[$students_tmp[$i]["uid"][0]] = array("class"=>$key,"cn"=>$students_tmp[$i]["cn"][0],"uid"=>$students_tmp[$i]["uid"][0],"nie"=>$students_tmp[$i]["employeenumber"][0]);
+			}
+			ksort($students);			
+			$completeListGroups[$key] = $students;
+		}
+
+		$ods  = new ods();
+		$ods->setPath2OdsFiles('ods');
+
+		$table = new odsTable('table 1');
+
+		foreach($completeListGroups as $key=>$group)
+			foreach($group as $key2=>$list){
+				$row   = new odsTableRow();			
+				$row->addCell( new odsTableCellString($list["class"]) );
+				$row->addCell( new odsTableCellString($list["cn"]) );
+				$table->addRow($row);
+			}
+		
+		$ods->addTable($table);
+
+		$ods->downloadOdsFile("ListadoAlumnos.ods");
 	}
 ?>
 	<html>
@@ -302,7 +379,7 @@
 
 		function getGroups(){
 			$.getJSON("backend.php?hostLDAP="+$("#hostLDAP").val()+"&userLDAP="+$("#userLDAP").val()+"&password="+$("#password").val(),
-				function(data){					
+				function(data){		
 					switch(data.msg){
 						case 'noConnect':{ error("No se pudo conectar con el Host"); break;	}
 						case 'noProtocol':{ error("Falló la configuracion de protocolo"); break; }
@@ -325,7 +402,6 @@
 	<body>
 	<h1 style="text-align:center;">Generador de etiquetas - Centros Educativos de Extremadura</h1>
 	<form id='form_labels' method='POST' action="index.php">
-		<input type="hidden" id="action" name="action" value="generate_labels"/>
 		<table  style="width:100%;">
 		<tr>
 			<td colspan="2" style="width:33%; vertical-align:top;">
@@ -429,8 +505,17 @@
 			</td>
 		</tr>
 		<tr>
-			<td colspan="4" style="text-align:center;"><br><div id="buttonLabels"><input type="submit" value="Generar Etiquetas"></div></td>
+			<td colspan="4" style="text-align:center;"><p>Tipo&nbsp;&nbsp;
+				<select id="action" name="action">
+					<option value="generate_labels">Etiquetas</option>
+					<option value="generate_spreadsheet">Hoja de C&aacute;lculo</option>
+				</select>
+				</p>
+			</td>
 		</tr>
+		<tr>
+			<td colspan="4" style="text-align:center;"><br><div id="buttonLabels"><input type="submit" value="Generar"></div></td>
+		</tr>
 		</table>
 	</form>
 	</body>
