datas = $datas; $this->editions_state_id = $id; $this->my_param = $param; } public function get_datas(){ return $this->datas; } public function get_param(){ return $this->my_param; } //un simple tableau pour la classe générique... public function show(){ global $charset,$msg,$base_path; global $javascript_path; global $show_all; $html = "
".(count($this->datas)-1)."
"; $html.=" "; 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.=" "; if(!$show_all && ($i == 50)){ $html.=""; break; } } $html.="
datas[$i])."\" >".$msg["editions_state_view_tab_all"]."
"; 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); } }