diff options
Diffstat (limited to 'list-scroll.php')
-rw-r--r-- | list-scroll.php | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/list-scroll.php b/list-scroll.php new file mode 100644 index 0000000..c69ed20 --- /dev/null +++ b/list-scroll.php @@ -0,0 +1,85 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<meta http-equiv="content-type" content="text/html;charset=utf-8"> +<link rel="stylesheet" type="text/css" href="/css/style.css"> +<link rel="stylesheet" type="text/css" href="../css/table.css"> +<title></title> +</head> +<body> +<a href="add.php" class="stb">Add Record</a><br><br><br> +<?php + +include '/home/kb0iic/config.inc'; + +$name = '$_POST[Pkgname]'; +//$name = 'linux-headers'; + +$sql = 'SELECT id, seq, name, version, configure, build, install, notes, url FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_NOT, PKG_URL WHERE PKG_CFG.pkg_id = PKG.id AND PKG_BLD.pkg_id = PKG.id AND PKG_NST.pkg_id = PKG.id AND PKG_NOT.pkg_id = PKG.id AND PKG_URL.pkg_id = PKG.id'; + +try { + $stmt = $pdo->prepare($sql); + $stmt->execute(); +} catch (PDOException $e) { + if ($e->getCode() == 1062) { + // Take some action if there is a key constraint violation, + // i.e. duplicate name + print $e->getMessage(); + } else { + echo "<pre>Have a big problem</pre>"; + throw $e; + } +} + +if ($stmt->rowCount() > 0) { + + // Data received + + // Start Table + $html_table = '<div id="constrainer"><div class="scrolltable">'; + + // Table Header + $html_table .= '<table class="header">'; + $html_table .= '<thead><th>SEQ</th><th>NAME</th><th>VERSION</th>'; + $html_table .= '<th>CONFIGURE</th><th>BUILD</th><th>INSTALL</th>'; + $html_table .= '<th>NOTES</th><th>URL</th><th>EDIT</th></thead>'; + $html_table .= '</table>'; + + // Body + $html_table .= '<div class="body"><table><tbody>'; + + // Table Rows + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $html_table .= '<tr>'; + $html_table .= '<td><a name="'.$row['seq'].'">'.$row['seq'].'</a></td>'; + $html_table .= '<td>'.$row['name'].'</td>'; + $html_table .= '<td>'.$row['version'].'</td>'; + $html_table .= '<td>'.nl2br($row['configure']).'</td>'; + $html_table .= '<td>'.nl2br($row['build']).'</td>'; + $html_table .= '<td>'.nl2br($row['install']).'</td>'; + $html_table .= '<td>'.nl2br($row['notes']).'</td>'; + $html_table .= '<td>'.nl2br($row['url']).'</td>'; + $html_table .= "<td><a href='edit.php?id=".$row['id']."'class=\"stb\">Edit</a></td>"; + $html_table .= '</tr>'; + } + + // End Table + $html_table .= '</tbody></table></div></div></div>'; + +} else { + // No Data received + echo "<pre>Nothing!</pre>"; +} + +$html_table .= '</table>'; +echo $html_table; + +?> +<!--- w3c tag --> +<p align="right"> +<a href="http://validator.w3.org/check?uri=referer"><img +src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a> +</p> +<!-- end w3c tag --> +</body> +</html> |