set_time_limit(300); ob_start(); session_start(); include("../../config.php"); $sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']); mysql_select_db($sugar_config['dbconfig']['db_name']); function generateTree($iddir,$html) { $z="select id,name,no from ecmdocuments where iddir='".$iddir."'"; $w=mysql_query($z); //print $z; while($r=mysql_fetch_array($w)) { if($r['no']<10)$nod=0; else $nod=""; $html.="
"; } return $html; } $html=' $offset = 3600 * 24; header("Cache-Control: max-age=".$offset.", must-revalidate"); $expire = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; header($expire); $gmt_mtime = gmdate("D, d M Y H:i:s", time() ) . " GMT"; header("Last-Modified: " . $gmt_mtime ); ?>'; $html.=generateTree("0",""); print $html; $filename = "../../tree.php"; $plik = file($filename); $fp = fopen($filename,"w"); flock($fp,2); fputs($fp,$html); flock($fp,3); fclose($fp); mysql_close($sql); ?>