datas = $datas; $this->editions_state_id = $id; } public function get_datas(){ return $this->datas; } //un simple tableau pour la classe générique... public function show(){ global $charset,$msg; global $javascript_path; $html = "
".(count($this->datas)-1)."
"; for($i=0 ; $idatas) ; $i++){ $html.=" "; for($j=0 ; $jdatas[$i]) ; $j++){ $html.=" <".($i==0 ? "th" : 'td')."> ".htmlentities($this->datas[$i][$j],ENT_QUOTES,$charset)." "; } $html.=" "; } $html.="
editions_state_id."&elem=xls');\" />
"; return $html; } public function render_xls_file($name="state"){ $tmp_file = tempnam(sys_get_temp_dir(),"state_"); header("Content-Type: application/x-msexcel; name=\"".$name.".xls\""); header("Content-Disposition: inline; filename=\"".$name.".xls\""); $workbook = new writeexcel_workbook($tmp_file); $worksheet = &$workbook->addworksheet(); for($i=0 ; $idatas) ; $i++){ for($j=0 ; $jdatas[$i]) ; $j++){ $worksheet->write($i,$j,$this->datas[$i][$j]); } } $workbook->close(); $fh=fopen($tmp_file, "rb"); fpassthru($fh); unlink($tmp_file); } }