diff options
-rw-r--r-- | A8_srv_build/add.php | 125 | ||||
-rw-r--r-- | A8_srv_build/config.inc | 18 | ||||
-rw-r--r-- | A8_srv_build/delete.php | 52 | ||||
-rw-r--r-- | A8_srv_build/delete.php.old | 77 | ||||
-rw-r--r-- | A8_srv_build/edit.php | 114 | ||||
-rw-r--r-- | A8_srv_build/list.php | 253 | ||||
-rw-r--r-- | A8_srv_build/openfile.php | 36 | ||||
-rw-r--r-- | A8_srv_build/sessionvars.php | 61 | ||||
-rw-r--r-- | A8_srv_build/test.php | 29 |
9 files changed, 765 insertions, 0 deletions
diff --git a/A8_srv_build/add.php b/A8_srv_build/add.php new file mode 100644 index 0000000..dcad257 --- /dev/null +++ b/A8_srv_build/add.php @@ -0,0 +1,125 @@ +<?php +session_start(); +?> +<!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"> +<title></title> +</head> +<body> +<?php +//Debug +//echo 'Session: ' . session_id() . ' Count: ' . $_SESSION['counter'] . '<br>'; +//var_dump($_SESSION); +?> +<br><fieldset> +<legend><span>Add Record</span></legend> +<br> +<?php +include('config.inc'); +if(isset($_POST['submit'])) +{ + if(!empty($_POST['name'])) + { + $seq=($_POST['seq']); + $name=($_POST['name']); + $version=($_POST['version']); + $configure=($_POST['configure']); + $build=($_POST['build']); + $install=($_POST['install']); + $setup=($_POST['setup']); + $notes=($_POST['notes']); + $url=($_POST['url']); + + //PKG TABLE + $sqlpkg = 'INSERT INTO PKG (id, seq, name, version) '; + $sqlpkg .= 'VALUES (null, :seq, :name, :version);'; + + //PKG_CFG TABLE + $sqlcfg = 'INSERT INTO PKG_CFG (pkg_id, configure) '; + $sqlcfg .= 'VALUES (:pkg_id, :configure);'; + + //PKG_BLD TABLE + $sqlbld = 'INSERT INTO PKG_BLD (pkg_id, build) '; + $sqlbld .= 'VALUES (:pkg_id, :build);'; + + //PKG_NST TABLE + $sqlnst = 'INSERT INTO PKG_NST (pkg_id, install) '; + $sqlnst .= 'VALUES (:pkg_id, :install);'; + + //PKG_SET TABLE + $sqlset = 'INSERT INTO PKG_SET (pkg_id, setup) '; + $sqlset .= 'VALUES (:pkg_id, :setup);'; + + //PKG_NOT TABLE + $sqlnot = 'INSERT INTO PKG_NOT (pkg_id, notes) '; + $sqlnot .= 'VALUES (:pkg_id, :notes);'; + + //PKG_URL TABLE + $sqlurl = 'INSERT INTO PKG_URL (pkg_id, url) '; + $sqlurl .= 'VALUES (:pkg_id, :url);'; + + try{ + $pdo->beginTransaction(); + $stmt = $pdo->prepare($sqlpkg); + $stmt->execute(['seq' => $seq, 'name' => $name, 'version' => $version]); + $pkgid = $pdo->lastInsertId(); + //echo "PKGID: '$pkgid' '$seq' '$name' '$version'"; + + $stmt = $pdo->prepare($sqlcfg); + $stmt->execute(['pkg_id' => $pkgid, 'configure' => $configure]); + $stmt = $pdo->prepare($sqlbld); + $stmt->execute(['pkg_id' => $pkgid, 'build' => $build]); + $stmt = $pdo->prepare($sqlnst); + $stmt->execute(['pkg_id' => $pkgid, 'install' => $install]); + $stmt = $pdo->prepare($sqlset); + $stmt->execute(['pkg_id' => $pkgid, 'setup' => $setup]); + $stmt = $pdo->prepare($sqlnot); + $stmt->execute(['pkg_id' => $pkgid, 'notes' => $notes]); + $stmt = $pdo->prepare($sqlurl); + $stmt->execute(['pkg_id' => $pkgid, 'url' => $url]); + + $pdo->commit(); + + } catch(Exception $e) { + $pdo->rollBack(); + throw $e; + } + + header("location:list.php#$seq"); + + } else { + echo '<pre style="color:Red">'; + echo 'Need at least the following attributes: Sequence, Name'; + echo '</pre>'; + } +} +?> +<form method="post" action=""> +<label for="seq">Sequence: </label> +<input type="text" name="seq" value="" id="seq"><br> +<label>Name: </label> +<input type="text" name="name" value="" id="name"><br> +<label>Version: </label> +<input type="text" name="version" value="" id="version"><br><br> +<label>Configure: </label> +<textarea name="configure" rows="2" cols="80"></textarea><br><br> +<label>Build: </label> +<textarea name="build" rows="2" cols="80"></textarea><br><br> +<label>Install: </label> +<textarea name="install" rows="2" cols="80"></textarea><br><br> +<label>Setup: </label> +<textarea name="setup" rows="2" cols="80"></textarea><br><br> +<label>Notes: </label> +<textarea name="notes" rows="2" cols="80"></textarea><br><br> +<label>Url: </label> +<textarea name="url" rows="2" cols="80"></textarea><br><br> +<br> +<br> +<input type="submit" name="submit" id="isub" value="Add"> +</form> +</fieldset> +</body> +</html> diff --git a/A8_srv_build/config.inc b/A8_srv_build/config.inc new file mode 100644 index 0000000..ffea00e --- /dev/null +++ b/A8_srv_build/config.inc @@ -0,0 +1,18 @@ +<?php + +//For Databases +$host = 'localhost'; +$db = 'A8_srv_build'; +$user = 'username'; +$pass = 'password'; +$charset = 'utf8'; + +$dsn = "mysql:host=$host;dbname=$db;charset=$charset"; +$opt = [ + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + PDO::ATTR_EMULATE_PREPARES => false, + ]; +$pdo = new PDO($dsn, $user, $pass, $opt); + +?> diff --git a/A8_srv_build/delete.php b/A8_srv_build/delete.php new file mode 100644 index 0000000..cfa52a3 --- /dev/null +++ b/A8_srv_build/delete.php @@ -0,0 +1,52 @@ +<?php +session_start(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html> +<head> +<meta http-equiv="content-type" content="text/html;charset=utf-8"> +<link rel="stylesheet" type="text/css" href="/css/table.css"> +<link rel="stylesheet" type="text/css" href="/css/style.css"> +<title>Delete ID</title> +</head> +<body> +<?php +//Debug +//echo 'Session: ' . session_id() . ' Count: ' . $_SESSION['counter'] . '<br>'; +//var_dump($_SESSION); +?> + +<pre> +<?php +include('config.inc'); + +print_r($_POST['delid']); + +if (!empty($_POST['delid'])) { + $delid = isset($_POST['delid']) ? $delid = $_POST['delid'] : null; + $nc = count($delid); + for ($i=0;$i<$nc;$i++) + { + $did = $delid[$i]; + echo "Removing $did\n"; +$sql = 'DELETE PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, PKG_URL FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, 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_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id = PKG.id AND PKG_URL.pkg_id = PKG.id AND PKG.id=:id ;'; + + try { + $stmt = $pdo->prepare($sql); + $stmt->execute(['id' => $did]); + } catch (PDOException $e) { + echo '<font color="D00"><pre>Have a big problem</pre></font>'; + throw $e; + } + + } +} else { + echo "No rows selected to delete!"; +} +?> +</pre> +<form action="list.php" method="POST"> +<input type="submit" name="select" value="OK"> +</form> +</body> +</html> diff --git a/A8_srv_build/delete.php.old b/A8_srv_build/delete.php.old new file mode 100644 index 0000000..cb342aa --- /dev/null +++ b/A8_srv_build/delete.php.old @@ -0,0 +1,77 @@ +<?php +session_start(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html> +<head> +<meta http-equiv="content-type" content="text/html;charset=utf-8"> +<link rel="stylesheet" type="text/css" href="/css/table.css"> +<link rel="stylesheet" type="text/css" href="/css/style.css"> +<title>Delete ID</title> +</head> +<body> +<?php +//Debug +//echo 'Session: ' . session_id() . ' Count: ' . $_SESSION['counter'] . '<br>'; +//var_dump($_SESSION); +?> +<p><fieldset> +<legend><span>Delete Record</span></legend> +<br> +<?php +include('config.inc'); + +if(!empty($_GET['id'])) +{ + $id=$_GET['id']; + if(isset($_POST['submit'])) + { + $sql = 'DELETE PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, PKG_URL FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, 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_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id = PKG.id AND PKG_URL.pkg_id = PKG.id AND PKG.id=:id ;'; + + try { + $stmt = $pdo->prepare($sql); + $stmt->execute(['id' => $id]); + } catch (PDOException $e) { + echo '<font color="D00"><pre>Have a big problem</pre></font>'; + throw $e; + } + header("location:list.php"); + } + + $sql = 'SELECT id, seq, name, version, configure, build, install, setup, notes, url FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, 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_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id=PKG.id AND PKG_URL.pkg_id=id AND PKG.id=:id'; + try { + + $stmt = $pdo->prepare($sql); + $stmt->execute(['id' => $id]); + } catch (PDOException $e) { + echo '<font color="D00"><pre>Have a big problem</pre></font>'; + throw $e; + } + + $row = $stmt->fetch(PDO::FETCH_ASSOC) +?> + <form method="post" action=""> + <label for="sequence">Sequence: </label><input type="text" name="seq" value="<?php echo $row['seq']; ?>" id="seq" readonly> + <br> + <label for="name">Name: </label><input type="text" name="name" value="<?php echo $row['name']; ?>" id="name" readonly> + <br> + <label for="version">Version: </label><input type="text" name="version" value="<?php echo $row['version']; ?>" id="version" readonly> + <br><br> + <label for="configure">Configure: </label><textarea readonly name="configure" rows="2" cols="80"><?php echo htmlspecialchars($row['configure']); ?></textarea><br><br> + <label for="configure">Build: </label><textarea readonly name="build" rows="2" cols="80"><?php echo htmlspecialchars($row['build']); ?></textarea><br><br> + <label for="install">Install: </label><textarea readonly name="install" rows="2" cols="80"><?php echo htmlspecialchars($row['install']); ?></textarea><br><br> + <label for="setup">Setup: </label><textarea readonly name="setup" rows="2" cols="80"><?php echo htmlspecialchars($row['setup']); ?></textarea><br><br> + <label for="notes">Notes: </label><textarea readonly name="notes" rows="2" cols="80"><?php echo htmlspecialchars($row['notes']); ?></textarea><br><br> + <label for="url">Url: </label><textarea readonly name="url" rows="2" cols="80"><?php echo htmlspecialchars($row['url']); ?></textarea><br><br> + <br> + <br> + <input type="submit" name="submit" id="isub" value="Delete" /> + </form> +<?php +} else { + echo '<font color="#D00"><pre>No ID given to delete!</pre></font>'; +} +?> +</fieldset> +</body> +</html> diff --git a/A8_srv_build/edit.php b/A8_srv_build/edit.php new file mode 100644 index 0000000..c3fda52 --- /dev/null +++ b/A8_srv_build/edit.php @@ -0,0 +1,114 @@ +<?php +session_start(); + +if( isset( $_SESSION['counter'] )) { + $_SESSION['counter'] += 1; +} else { + $_SESSION['counter'] = 1; +} +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html> +<head> +<meta http-equiv="content-type" content="text/html;charset=utf-8"> +<link rel="stylesheet" type="text/css" href="/css/table.css"> +<link rel="stylesheet" type="text/css" href="/css/style.css"> +<title>Edit ID</title> +</head> +<body> +<?php +//Debug +//echo 'Session: ' . session_id() . ' Count: ' . $_SESSION['counter'] . '<br>'; +//var_dump($_SESSION); +?> +<p><fieldset> +<legend><span>Update Record</span></legend> +<br> +<?php +include('config.inc'); +if(!empty($_GET['id'])) +{ + $id=$_GET['id']; + if(isset($_POST['submit'])) + { + $seq=($_POST['seq']); + $name=($_POST['name']); + $version=($_POST['version']); + $configure=($_POST['configure']); + $build=($_POST['build']); + $install=($_POST['install']); + $setup=($_POST['setup']); + $notes=($_POST['notes']); + $url=($_POST['url']); + + + $sql = 'UPDATE PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, PKG_NOT, '; + $sql .= 'PKG_URL SET PKG.seq=:seq, PKG.name=:name, '; + $sql .= 'PKG.version=:version, PKG_CFG.configure=:configure, '; + $sql .= 'PKG_BLD.build=:build, PKG_NST.install=:install, '; + $sql .= 'PKG_SET.setup=:setup, PKG_NOT.notes=:notes, '; + $sql .= 'PKG_URL.url=:url WHERE PKG_CFG.pkg_id=PKG.id AND '; + $sql .= 'PKG_BLD.pkg_id=PKG.id AND PKG_NST.pkg_id=PKG.id AND '; + $sql .= 'PKG_SET.pkg_id=PKG.id AND PKG_NOT.pkg_id=PKG.id AND '; + $sql .= 'PKG_URL.pkg_id=PKG.id AND PKG.id=:id'; + + try { + $stmt = $pdo->prepare($sql); + $stmt->execute(['seq' => $seq, 'name' => $name, 'version' => $version, 'configure' => $configure, 'build' => $build, 'install' => $install, 'setup' => $setup, 'notes' => $notes, 'url' => $url, 'id' => $id]); + } catch (PDOException $e) { + echo '<pre style="color:Red">Have a big problem</pre>'; + throw $e; + } + header("location:list.php#$seq"); + exit(); + } + + + $sql = 'SELECT id, seq, name, version, configure, build, install, setup, notes, url FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, 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_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id=PKG.id AND PKG_URL.pkg_id=id AND PKG.id=:id'; + + try { + + $stmt = $pdo->prepare($sql); + $stmt->execute(['id' => $id]); + } catch (PDOException $e) { + echo '<pre style="color:Red">Have a big problem</pre>'; + throw $e; + } + + $row = $stmt->fetch(PDO::FETCH_ASSOC) +?> + <form method="post" action=""> + <label for="sequence">Sequence: </label> +<input type="text" name="seq" value="<?php echo $row['seq']; ?>" id="seq"/><br> + <label for="name">Name: </label> +<input type="text" name="name" value="<?php echo $row['name']; ?>" id="name"/><br> + <label for="version">Version: </label> +<input type="text" name="version" value="<?php echo $row['version']; ?>" id="version"/><br><br> + <label for="configure">Configure: </label> +<textarea name="configure" rows="2" cols="80"><?php echo htmlspecialchars($row['configure']); ?></textarea><br><br> + <label for="configure">Build: </label> +<textarea name="build" rows="2" cols="80"><?php echo htmlspecialchars($row['build']); ?></textarea><br><br> + <label for="install">Install: </label> +<textarea name="install" rows="2" cols="80"><?php echo htmlspecialchars($row['install']); ?></textarea><br><br> + <label for="setup">Setup: </label> +<textarea name="setup" rows="2" cols="80"><?php echo htmlspecialchars($row['setup']); ?></textarea><br><br> + <label for="notes">Notes: </label> +<textarea name="notes" rows="2" cols="80"><?php echo htmlspecialchars($row['notes']); ?></textarea><br><br> + <label for="url">Url: </label> +<textarea name="url" rows="2" cols="80"><?php echo htmlspecialchars($row['url']); ?></textarea><br><br> + <br> + <br> + <input type="submit" name="submit" id="isub" value="Update" /> + </form> + <form action="list.php#<?php echo $row['seq']; ?>" method="POST"> + <input type="submit" name="select" value="OK"/> + </form> +<?php +} else { + echo '<pre style="color:Red">No ID given to edit!</pre>'; +} +?> +</fieldset> + +</body> +</html> diff --git a/A8_srv_build/list.php b/A8_srv_build/list.php new file mode 100644 index 0000000..0bac433 --- /dev/null +++ b/A8_srv_build/list.php @@ -0,0 +1,253 @@ +<?php +session_start(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<?php +if( isset( $_SESSION['counter'] )) { + $_SESSION['counter'] += 1; +} else { + $_SESSION['counter'] = 1; +} + +$con = isset($_SESSION['con']) ? $_SESSION['con'] : null; +$bul = isset($_SESSION['bul']) ? $_SESSION['bul'] : null; +$nst = isset($_SESSION['nst']) ? $_SESSION['nst'] : null; +$set = isset($_SESSION['set']) ? $_SESSION['set'] : null; +$not = isset($_SESSION['not']) ? $_SESSION['not'] : null; +$url = isset($_SESSION['url']) ? $_SESSION['url'] : null; + +?> + + <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> +<?php +//DEBUG +//echo 'Session: ' . session_id() . '<br>'; +//echo '$_SESSION' . var_dump($_SESSION) . '<br>'; +//echo '$_POST' . var_dump($_POST) . '<br>'; +?> + + <a href="add.php" class="stb">Add Record</a><br><br> + <form action="sessionvars.php" method="post"> + Select columns:<br> + <input type="checkbox" name="con" value="Configure" + <?php echo isSet($con)?" checked":"";?>/>Configure + <input type="checkbox" name="bul" value="Build" + <?php echo isSet($bul)?" checked":"";?>/>Build + <input type="checkbox" name="nst" value="Install" + <?php echo isSet($nst)?" checked":"";?>/>Install + <input type="checkbox" name="set" value="Setup" + <?php echo isSet($set)?" checked":"";?>/>Setup + <input type="checkbox" name="not" value="Notes" + <?php echo isSet($not)?" checked":"";?>/>Notes + <input type="checkbox" name="url" value="URL" + <?php echo isSet($url)?" checked":"";?>/>URL<br> + <input type="submit" name="submit" value="Submit"/> + </form> + +<?php +include 'config.inc'; + +$sqlselect = 'SELECT id, seq, name, version'; +$sqlfrom = ' FROM PKG'; +$sqlwhere = ''; + +#if columns are selected +if($con || $bul || $nst || $set || $not || $url) { + $sqlwhere = ' WHERE'; +} +$sqlorder = ' ORDER BY seq ASC'; + +#if configure is checked +if($con) { + $sqlselect .= ', configure'; + $sqlfrom .= ', PKG_CFG'; + $sqlwhere .= ' PKG_CFG.pkg_id = PKG.id'; + if($bul || $nst || $set || $not || $url) { + $sqlwhere .= ' AND'; + } +} + +#if build is checked +if($bul) { + $sqlselect .= ', build'; + $sqlfrom .= ', PKG_BLD'; + $sqlwhere .= ' PKG_BLD.pkg_id = PKG.id'; + if($nst || $set || $not || $url) { + + $sqlwhere .= ' AND'; + } + +} + +#if install is checked +if($nst) { + $sqlselect .= ', install'; + $sqlfrom .= ', PKG_NST'; + $sqlwhere .= ' PKG_NST.pkg_id = PKG.id'; + if($set || $not || $url) { + + $sqlwhere .= ' AND'; + } + +} + +#if setup is checked +if($set) { + $sqlselect .= ', setup'; + $sqlfrom .= ', PKG_SET'; + $sqlwhere .= ' PKG_SET.pkg_id = PKG.id'; + if($not || $url) { + + $sqlwhere .= ' AND'; + } + +} + +#if notes is checked +if($not) { + $sqlselect .= ', notes'; + $sqlfrom .= ', PKG_NOT'; + $sqlwhere .= ' PKG_NOT.pkg_id = PKG.id'; + if($url) { + + $sqlwhere .= ' AND'; + } + +} + +#if url is checked +if($url) { + $sqlselect .= ', url'; + $sqlfrom .= ', PKG_URL'; + $sqlwhere .= ' PKG_URL.pkg_id = PKG.id'; +} + +$sql = $sqlselect . $sqlfrom . $sqlwhere . $sqlorder; +try { + $stmt = $pdo->prepare($sql); + $stmt->execute(); +} catch (PDOException $e) { + echo '<pre style="color:Red">Have a big problem</pre>'; + throw $e; + echo "$e->getMessage()"; +} + +if ($stmt->rowCount() > 0) { + + // Data received + + echo '<form method="post" action="delete.php" onSubmit="return confirm(\'Do you really want to delete the selected record(s)?\')">'; + + // Begin Table + $html_table = '<table class="bdb"><caption>A8-3800 CLFS Server</caption>'; + + // Table Header + $html_table .= '<thead><tr><th>ACTION</th><th>SEQ</th><th>NAME</th>'; + $html_table .= '<th>VERSION</th>'; + if($con){$html_table .= '<th>CONFIGURE</b></th>';} + if($bul){$html_table .= '<th>BUILD</th>';} + if($nst){$html_table .= '<th>INSTALL</th>';} + if($set){$html_table .= '<th>SETUP</th>';} + if($not){$html_table .= '<th>NOTES</th>';} + if($url){$html_table .= '<th>URL</th>';} + $html_table .= '<th>DELETE</th></tr></thead>'; + + // Table Footer + $html_table .= '<tfoot><tr><th>ACTION</th><th>SEQ</th><th>NAME</th>'; + $html_table .= '<th>VERSION</th>'; + if($con){$html_table .= '<th>CONFIGURE</th>';} + if($bul){$html_table .= '<th>BUILD</th>';} + if($nst){$html_table .= '<th>INSTALL</th>';} + if($set){$html_table .= '<th>SETUP</th>';} + if($not){$html_table .= '<th>NOTES</th>';} + if($url){$html_table .= '<th>URL</th>';} + $html_table .= '<th>DELETE</th></tr></tfoot>'; + + // Table Body + $html_table .= '<tbody>'; + + // Table Rows + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $rowid = $row['id']; + $rowseq = $row['seq']; + $rownm = $row['name']; + $rowver = $row['version']; + if($con) { + $rowcfg = nl2br(str_replace(' ', ' ', $row['configure'])); + } + if($bul) { + $rowbld = nl2br(str_replace(' ', ' ', $row['build'])); + } + if($nst) { + $rownst = nl2br(str_replace(' ', ' ', $row['install'])); + } + if($set) { + $rowset = nl2br(str_replace(' ', ' ', $row['setup'])); + } + if($not) { + $rownot = nl2br(str_replace(' ', ' ', $row['notes'])); + } + if($url) { + $rowurl = nl2br(str_replace(' ', ' ', $row['url'])); + } + $html_table .= '<tr>'; + $html_table .= "<td><a href='edit.php?id=".$rowid."'>View</a></td>"; + $html_table .= '<td><a name="'.$rowseq.'">'.$rowseq.'</a></td>'; + $html_table .= '<td><a href="openfile.php?name='.$rownm.'" title="installed-files"/'.$rownm.'" title="Installed files list" target="_blank">'.($rownm).'</a></td>'; + $html_table .= '<td>'.($rowver).'</td>'; + if($con){$html_table .= '<td>'.($rowcfg).'</td>';} + if($bul){$html_table .= '<td>'.($rowbld).'</td>';} + if($nst){$html_table .= '<td>'.($rownst).'</td>';} + if($set){$html_table .= '<td>'.($rowset).'</td>';} + if($not){$html_table .= '<td>'.($rownot).'</td>';} + if($url){$html_table .= '<td>'.($rowurl).'</td>';} + //$html_table .= "<td><a href='delete.php?id=".$rowid."'>Delete</a></td>"; + $html_table .= '<td align="center"><input type="checkbox" name="delid[]" class="checks" value="'.($rowid).'"/></td>'; + $html_table .= '</tr>'; + } + + // End Table Body + $html_table .= '</tbody>'; + + // End Table + $html_table .= '</table>'; + + //Output Table + echo $html_table; + +} else { + // No Data received + echo '<font color="#D00"><pre>No data found!</pre></font>'; +} +?> + <input id="submit" type="submit" value="Submit" disabled="disabled"/> + <input type="checkbox" id="selectall"/>Check All + </form> + <!--- 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 --> + <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> + <script type='text/javascript'> +$('#submit').prop("disabled", true); +$('input:checkbox').click(function() { + if ($(this).is(':checked')) { + $('#submit').prop("disabled", false); + } else { + if ($('.checks').filter(':checked').length < 1){ + $('#submit').attr('disabled',true);} + } +}); +i </script> + </body> + </html> diff --git a/A8_srv_build/openfile.php b/A8_srv_build/openfile.php new file mode 100644 index 0000000..3ad1c1f --- /dev/null +++ b/A8_srv_build/openfile.php @@ -0,0 +1,36 @@ +<?php +session_start(); + +include('config.inc'); +$name = $_GET['name']; +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html> +<head> +<meta http-equiv="content-type" content="text/html;charset=utf-8"> +<link rel="stylesheet" type="text/css" href="/css/table.css"> +<link rel="stylesheet" type="text/css" href="/css/style.css"> +<title>File List</title> +</head> +<body> +<p><fieldset> +<legend><span>Installed File List for +<?php echo $name ?> +</span></legend> +<br> +<?php +if(!empty($name)) { + //echo '<pre style="color:green">Name found</pre>'; + $myfile = fopen("/sources/installed-files/$name", "r") + or die("Unable to open file!"); + echo "<textarea readonly name='txtbox' rows='24'>"; + echo fread($myfile,filesize("/sources/installed-files/$name")); + echo "</textarea>"; + fclose($myfile); +} else { + echo '<pre style="color:Red">No NAME given to list installed files!</pre>'; +} +?> +</fieldset> +</body> +</html> diff --git a/A8_srv_build/sessionvars.php b/A8_srv_build/sessionvars.php new file mode 100644 index 0000000..dca0bb0 --- /dev/null +++ b/A8_srv_build/sessionvars.php @@ -0,0 +1,61 @@ +<?php +session_start(); +?> +<!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> +<?php +var_dump($_GET); +if( isset($_POST['con']) ) +{ + $_SESSION['con'] = $_POST['con']; +} else { + unset($_SESSION['con']); +} + +if( isset($_POST['bul']) ) +{ + $_SESSION['bul'] = $_POST['bul']; +} else { + unset($_SESSION['bul']); +} + +if( isset($_POST['nst']) ) +{ + $_SESSION['nst'] = $_POST['nst']; +} else { + unset($_SESSION['nst']); +} + +if( isset($_POST['set']) ) +{ + $_SESSION['set'] = $_POST['set']; +} else { + unset($_SESSION['set']); +} + +if( isset($_POST['not']) ) +{ + $_SESSION['not'] = $_POST['not']; +} else { + unset($_SESSION['not']); +} + +if( isset($_POST['url']) ) +{ + $_SESSION['url'] = $_POST['url']; +} else { + unset($_SESSION['url']); +} + +header("location:list.php"); +exit(); +?> +</body> +</html> diff --git a/A8_srv_build/test.php b/A8_srv_build/test.php new file mode 100644 index 0000000..a7fc5ff --- /dev/null +++ b/A8_srv_build/test.php @@ -0,0 +1,29 @@ +<!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 'config.inc'; + +$name = '$_POST[Pkgname]'; + +$sql = 'SELECT id, seq, name, version, configure, build, install, setup, notes, url FROM PKG, PKG_CFG, PKG_BLD, PKG_NST, PKG_SET, 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_SET.pkg_id = PKG.id AND PKG_NOT.pkg_id = PKG.id AND PKG_URL.pkg_id = PKG.id ORDER BY seq ASC'; + + $stmt = $pdo->prepare($sql); + $stmt->execute(); +echo 'test'; +?> +<!--- 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> |