Código PHP:
<?php
require 'DataGrid.php';
function testInlineFunction($email)
{
$email = str_replace(array('@', '.'), array(' [at] ', ' [dot] '), $email);
return $email;
}
define('DB_HOST', '');
define('DB_USER', '');
define('DB_PASS', '');
define('DB_NAME', '');
$dbLinkId = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die('Cannot create mysql connection' . mysql_error());
mysql_select_db(DB_NAME, $dbLinkId);
$users = array();
$result = mysql_query("SELECT * FROM algo", $dbLinkId);
while ($row = mysql_fetch_assoc($result))
{
$users[] = $row;
}
mysql_free_result($result);
mysql_close($dbLinkId);
?>
<!DOCTYPE HTML>
<html>
<head>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<!-- modernizr enables HTML5 elements and feature detects -->
<script type="text/javascript" src="../js/modernizr-1.5.min.js"></script>
</head>
<body>
<div id="main">
<header>
</header>
<div id="site_content">
<div id="contentciiu">
<?php
Fete_ViewControl_DataGrid::getInstance($users)
->setGridAttributes(array('cellspacing' => '1', 'cellpadding' => '5', 'border' => '0'))
->enableSorting(true)
->removeColumn('id')
->removeColumn('detalle')
->setup(array(
'descripcion' => array('header' => 'DESCRIPCION')
))
->addColumnBefore('actions', '<a>$id$</a>')
->setRowClass('row')
->setAlterRowClass('alterRow')
->render();
?>
</div>
</div>
</div>
</div>
</body>
</html>