<!DOCTYPE html>
<html>
<head>
<title>Megatest</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="stils.css">
</head>
<body>
<div class="CSSTableGenerator" >
<?php
/** function special 4 u **/
function myUberCoolTable($row, $run_time = 0, $elem_sep = ' | '){
$html = '';
$table_elements = array(
0 => 'ID'
,1 => 'Name'
,2 => 'Email'
,3 => 'Proc'
,4 => 'RAM'
,5 => 'HDD'
,6 => 'Office'
,7 => 'Antivirus'
,8 => 'Tilde'
,9 => 'Username'
,10 => 'Password'
,11 => 'IP'
,12 => 'Domain'
,13 => 'DVD'
);
$data = ($row) ? explode($elem_sep, $row) : false;
$tab = chr(9);
$nl = "\n";
foreach($table_elements as $key => $value){
$html .= $nl.$tab.$tab.(
( $run_time == 0) ? '<td>'.$value.'</td>' : '<td>'.(isset($data[$key]) ? trim($data[$key]) : '').'</td>'
);
}
return $nl.$tab."<tr>".$html.$nl.$tab."</tr>";
}
$table_html = myUberCoolTable(false, 0);
$file = 'data.txt';
$handle = fopen($file, "r");
$i = 1 ;
while (($buffer = fgets($handle, filesize($file))) !== false) {
$table_html .= myUberCoolTable($buffer,$i);
$i++;
}
echo ($table_html) ? '<table>'.$table_html."\n".'</table>' : 'No data';
?>
</div>
<br />
<a href='/reck/xls.php'>Download xls</a>
</body>
</html>