<?php

require_once 'Quicty/phplib/Spreadsheet_Excel_Reader/Excel/reader.php';

class ExcelReader extends Spreadsheet_Excel_Reader {

public function ExcelReader() {
	parent::Spreadsheet_Excel_Reader();
	//$encoding = mb_internal_encoding();
	//$this->setOutputEncoding($encoding);
	$this->setUTFEncoder('mb');
}

public function rows($sheet=0) {
	return $this->sheets[$sheet]['numRows'];
}

public function colums($sheet=0) {
	return $this->sheets[$sheet]['numCols'];
}

public function cell($row,$column,$sheet=0) {
	return $this->sheets[$sheet]['cells'][$row][$column];
}

public function cell_type($row,$column,$sheet=0) {
	return $this->sheets[$sheet]['cellsInfo'][$row][$column]['type'];
}

public function cell_raw($row,$column,$sheet=0) {
	return $this->sheets[$sheet]['cellsInfo'][$row][$column]['raw'];
}

public function colspan($row,$column,$sheet=0) {
	return $this->sheets[$sheet]['cellsInfo'][$row][$column]['colspan'];
}

public function rowspan($row,$column,$sheet=0) {
	return $this->sheets[$sheet]['cellsInfo'][$row][$column]['rowspan'];
}

public function row($row,$sheet=0) {
	$colums = $this->colums($sheet);
	for($i=1; $i<=$colums; $i++) {
		$tmp = $this->cell($row,$i,$sheet);
		if($tmp) $row_data[$i] = $tmp;
	}
	return $row_data;
}

public function set_column_name($row=1,$sheet=0) {
	for($i=1; $i<=$this->colums($sheet); $i++) {
		$column_name = $this->cell($row,$i,$sheet);
		if($column_name) {
			$row_set[$column_name] = $i;
			$row_set[$i] = $column_name;
			define($column_name,$i);
		}
	}
	return $row_set;
}

} // end of class ExcelReader

?>
	