<html>
<head><title>Django-dataplot: examples</title></head>
<body>
<?php # header, set up variables
$EXAMPLEDIR='examples';
$e=$_GET['e'];
$dir=$EXAMPLEDIR.'/'.$e;
?>
<?php if($e) { ?>
<?php print('<h1>'.$e.'</h1>'); ?>
<table>
<tr>
<td>
<?php
include_once('geshi.php');
$models=$dir.'/models.py';
$fh = fopen($models, 'r');
$source = fread($fh,filesize($models));
fclose($fh);
$geshi =& new GeSHi($source, 'python');
echo $geshi->parse_code();
?>
</td>
<td>
<img src="<?php echo $dir.'/plot.png'; ?>" />
</td>
</tr>
</table>
<?php } ?>
<h1>List of examples</h1>
<?php
$dh = opendir($EXAMPLEDIR);
while (false !== ($filename = readdir($dh))) {
if($filename[0] != '.') {
print('<a href="examples.php?e='.$filename.'"><img src="examples/'.$filename.'/thumb.png" />'.$filename.'</a><br />');
}
}
?>
<?php include('footer.php') ?>
</body>
</html>