From: <sly...@us...> - 2008-07-13 18:12:51
|
Revision: 46 http://phpsqliteadmin.svn.sourceforge.net/phpsqliteadmin/?rev=46&view=rev Author: slythfox Date: 2008-07-13 11:12:55 -0700 (Sun, 13 Jul 2008) Log Message: ----------- Modified Paths: -------------- trunk/phpsqliteadmin2/changelog.txt trunk/phpsqliteadmin2/include.php trunk/phpsqliteadmin2/leftframe.php trunk/phpsqliteadmin2/row_edit.php trunk/phpsqliteadmin2/table_browse.php Modified: trunk/phpsqliteadmin2/changelog.txt =================================================================== --- trunk/phpsqliteadmin2/changelog.txt 2008-07-13 17:12:41 UTC (rev 45) +++ trunk/phpsqliteadmin2/changelog.txt 2008-07-13 18:12:55 UTC (rev 46) @@ -2,6 +2,7 @@ 0.3 (xx.xx.2008) +- Icons have been (temporarily?) embedded into the includes file. (chale) - Added really basic multiquery support with the query page. This allows one to copy&paste a sql file and execute it in one go. (chale) - The query page now displays "x rows affected/returned". Before there was not sort of confirmation when doing non SELECT queries. (chale) - Fixed query page's inconsistency in that it was not using htmlspecialchars. (chale) Modified: trunk/phpsqliteadmin2/include.php =================================================================== --- trunk/phpsqliteadmin2/include.php 2008-07-13 17:12:41 UTC (rev 45) +++ trunk/phpsqliteadmin2/include.php 2008-07-13 18:12:55 UTC (rev 46) @@ -12,6 +12,57 @@ $_SESSION['phpSQLiteAdmin_currentdb'] = $_POST['sessionvalue']; } +// Embedded Images +/* +Embed images using this function: +function encode_img($img) +{ + $fd = fopen ($img, 'rb'); + $size=filesize ($img); + $cont = fread ($fd, $size); + fclose ($fd); + $encimg = base64_encode($cont); + return $encimg; +} +*/ +if (isset($_GET['imgid'])) { + switch ($_GET['imgid']) { + case "database.png": + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAFVJREFUKFNj/P//PwN+AFQBBCcO9iyb64+MgCIQKQa49LVz2f//J0MQkA1UDVEEUgHkIEsjKyJaxcGdtWjGQGwBiqOYgeZSiCKoCmqYAQkMfL7FH2IAUp7xCV2zSGMAAAAASUVORK5CYII="; + break; + case "edit.png": + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAGxJREFUKFN1kMENwCAIRdnVY5dwFBbosWv0wKHr0K9YikSJiSbvRT6QbqoSGRlX0homMmlhVFQ3TMoGqGp57gMMR0Qmw/F1FryBJ2OJ/xw7PIyOFb3j5z5dy2EGM3vvOPww2oRftLSb9cai9ALjByf/vas8pQAAAABJRU5ErkJggg=="; + break; + case "delete.png": + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAFhJREFUKFOVUEEOwDAIcu/0x/5gr7E12hVM02SeFAiij7vLvabiFXHV2VCpBm4mgeaAog8pRRMBHRm28yLKzywpUKDTon954O5DDobourylRavs9I/+LJoHDOj+ebMh9FoAAAAASUVORK5CYII="; + break; + case "export.png": + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAElJREFUKFNj+I8KGhoa0EQYkPlAaQhAFkSogEujKUIxA818CJcBTSsmF6TiAG4AlCXODKzWQwShZgBZEHuAjKVIAEUFLmOIcgcANi4S5K6eGuUAAAAASUVORK5CYII="; + break; + case "query.png": + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAFBJREFUKFNj/P//PwN+AFRx4MCBBmwAKA7SD8RAWSCJCSDiIBVwM9YjAaA0wgyIbjST4FyQGUSpwGUA1B14rED4BdmNQDbc76T7Fi3YIL4FANr9DcnCLQhKAAAAAElFTkSuQmCC"; + break; + case "row_insert.png"; + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAEVJREFUKFNj/P//PwMGaGxsdHBwgAoDVWCChoaGAzDAQJQKoA64OiAbDYDMgAhBFAEZz1ABQgVEET4VBMwg4A5q+Ba/GQA8fBNm+WP9jwAAAABJRU5ErkJggg=="; + break; + case "table_browse.png"; + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAADBJREFUKFNjbGhoYMAPgCoO4AYg/UCMH4BU/McNoGYAFSyFATQ2QgUuUwaZGfjDAwABxvgJEsmisgAAAABJRU5ErkJggg=="; + break; + case "table_drop.png"; + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAE5JREFUKFNjbGhoYMAPgCoO4AYg/UCMH4BU/McNoGaAFDAw/EdWCmQDRf4DxcC2gFRAhCDq4AwUFRCLINJIhpFkBqY7wCYhmYHDO0SFBwAgBuY3U4A6ewAAAABJRU5ErkJggg=="; + break; + case "table_empty.png"; + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAAE5JREFUKFNjbGhoYMAPgCr+4wYg/XAV169fB7IhAMiG6EJRgaYUoghFBdwquEk4zYBIoNuCrA/Z3QhbIM5EdiAWlxL2C9ZAgdoCdwRWBgCNfACU8GKOGgAAAABJRU5ErkJggg=="; + break; + case "table_structure.png"; + $imgcode = "iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAIAAAAmzuBxAAAABGdBTUEAALGPC/xhBQAAACtJREFUKFNjbGhoYMAPgCr+4wYg/RAVB8AAyFiKBIBchApcpgxDM4BewgMAWDAIViqqPeEAAAAASUVORK5CYII="; + break; + } + + header('Content-type: image/png'); + echo base64_decode($imgcode); + exit(); +} function check_db() { global $current_db; @@ -59,27 +110,27 @@ <div id="currentdb">Database: {$_SESSION['phpSQLiteAdmin_currentdb']}</div> <p class="sqliteversion">SQLite version: $sqliteversion</p> <br /> -<a href="mainframe.php" target="mainframe"><img src="images/database.png" alt="" /> Database Info</a> | -<a href="table_structure.php?object=$current_table" target="mainframe"><img src="images/table_structure.png" alt="" /> Structure</a> | -<a href="table_browse.php?object=$current_table" target="mainframe"><img src="images/table_browse.png" alt="" /> Browse</a> | -<a href="query.php?object=$current_table" target="mainframe"><img src="images/query.png" alt="" /> Query</a> | -<a href="row_edit.php?object=$current_table" target="mainframe"><img src="images/row_insert.png" alt=\"\" /> Insert</a> | -<a href="export.php?object=$current_table" target="mainframe"><img src="images/export.png" alt=\"\" /> Export</a> | -<a href="dbaction.php?action=empty_table&object=$current_table" target="_top" onclick="return confirm_empty_table();"><img src="images/table_empty.png" alt=\"\" /> Empty</a> | -<a href="dbaction.php?action=drop_table&object=$current_table" target="_top" onclick="return confirm_drop_table();"><img src="images/table_drop.png" alt=\"\" /> Drop</a> +<a href="mainframe.php" target="mainframe"><img src="include.php?imgid=database.png" alt="" /> Database Info</a> | +<a href="table_structure.php?object=$current_table" target="mainframe"><img src="include.php?imgid=table_structure.png" alt="" /> Structure</a> | +<a href="table_browse.php?object=$current_table" target="mainframe"><img src="include.php?imgid=table_browse.png" alt="" /> Browse</a> | +<a href="query.php?object=$current_table" target="mainframe"><img src="include.php?imgid=query.png" alt="" /> Query</a> | +<a href="row_edit.php?object=$current_table" target="mainframe"><img src="include.php?imgid=row_insert.png" alt=\"\" /> Insert</a> | +<a href="export.php?object=$current_table" target="mainframe"><img src="include.php?imgid=export.png" alt=\"\" /> Export</a> | +<a href="dbaction.php?action=empty_table&object=$current_table" target="_top" onclick="return confirm_empty_table();"><img src="include.php?imgid=table_empty.png" alt=\"\" /> Empty</a> | +<a href="dbaction.php?action=drop_table&object=$current_table" target="_top" onclick="return confirm_drop_table();"><img src="include.php?imgid=table_drop.png" alt=\"\" /> Drop</a> EOT; } function print_table_action_links($current_table) { echo<<<EOT -<a href="table_structure.php?object=$current_table" target="mainframe"><img src="images/table_structure.png" alt="" /> Structure</a> | -<a href="table_browse.php?object=$current_table" target="mainframe"><img src="images/table_browse.png" alt="" /> Browse</a> | -<a href="query.php?object=$current_table" target="mainframe"><img src="images/query.png" alt="" /> Query</a> | -<a href="row_edit.php?object=$current_table" target="mainframe"><img src="images/row_insert.png" alt=\"\" /> Insert</a> | -<a href="export.php?object=$current_table" target="mainframe"><img src="images/export.png" alt=\"\" /> Export</a> | -<a href="dbaction.php?action=empty_table&object=$current_table" target="_top" onclick="return confirm_empty_table();"><img src="images/table_empty.png" alt="" /> Empty</a> | -<a href="dbaction.php?action=drop_table&object=$current_table" target="_top" onclick="return confirm_drop_table();"><img src="images/table_drop.png" alt="" /> Drop</a> +<a href="table_structure.php?object=$current_table" target="mainframe"><img src="include.php?imgid=table_structure.png" alt="" /> Structure</a> | +<a href="table_browse.php?object=$current_table" target="mainframe"><img src="include.php?imgid=table_browse.png" alt="" /> Browse</a> | +<a href="query.php?object=$current_table" target="mainframe"><img src="include.php?imgid=query.png" alt="" /> Query</a> | +<a href="row_edit.php?object=$current_table" target="mainframe"><img src="include.php?imgid=row_insert.png" alt=\"\" /> Insert</a> | +<a href="export.php?object=$current_table" target="mainframe"><img src="include.php?imgid=export.png" alt=\"\" /> Export</a> | +<a href="dbaction.php?action=empty_table&object=$current_table" target="_top" onclick="return confirm_empty_table();"><img src="include.php?imgid=table_empty.png" alt="" /> Empty</a> | +<a href="dbaction.php?action=drop_table&object=$current_table" target="_top" onclick="return confirm_drop_table();"><img src="include.php?imgid=table_drop.png" alt="" /> Drop</a> EOT; } Modified: trunk/phpsqliteadmin2/leftframe.php =================================================================== --- trunk/phpsqliteadmin2/leftframe.php 2008-07-13 17:12:41 UTC (rev 45) +++ trunk/phpsqliteadmin2/leftframe.php 2008-07-13 18:12:55 UTC (rev 46) @@ -38,7 +38,7 @@ print "<li class=\"list_title\" title=\"Tables in database $current_db\">Tables</li>\n"; $userdbh->query("select name,upper(name) from SQLITE_MASTER where type = 'table' order by 2"); while($row = $userdbh->fetchArray()) { - print "<li><a href=\"table_browse.php?object=".$row[0]."\"><img src=\"images/table_browse.png\" alt=\"Browse table\" title=\"Browse table\" /></a> <a href=\"table_structure.php?object=".$row[0]."\">$row[0]</a></li>\n"; + print "<li><a href=\"table_browse.php?object=".$row[0]."\"><img src=\"include.php?imgid=table_browse.png\" alt=\"Browse table\" title=\"Browse table\" /></a> <a href=\"table_structure.php?object=".$row[0]."\">$row[0]</a></li>\n"; } print "</ul>\n</div>\n"; } Modified: trunk/phpsqliteadmin2/row_edit.php =================================================================== --- trunk/phpsqliteadmin2/row_edit.php 2008-07-13 17:12:41 UTC (rev 45) +++ trunk/phpsqliteadmin2/row_edit.php 2008-07-13 18:12:55 UTC (rev 46) @@ -153,13 +153,14 @@ print "</tr>\n"; } } -print "</table>\n"; +print "<tr>\n<th></th>\n<th></th>\n<th>"; print "<input type=\"hidden\" name=\"row\" value=\"" .$_GET['row']. "\" />\n"; print "<input type=\"hidden\" name=\"primary_key\" value=\"" .$_GET['primary_key']. "\" />\n"; print "<input type=\"hidden\" name=\"object\" value=\"" .$_GET['object']. "\" />\n"; print "<input type=\"hidden\" name=\"type\" value=\"" .$type. "\" />\n"; print "<input type=\"submit\" name=\"\" value=\"Save\" />\n"; print "<input type=button value=\"Cancel\" onclick=\"history.back();\">"; +print "</th>\n</table>\n"; print "</form>"; /* Modified: trunk/phpsqliteadmin2/table_browse.php =================================================================== --- trunk/phpsqliteadmin2/table_browse.php 2008-07-13 17:12:41 UTC (rev 45) +++ trunk/phpsqliteadmin2/table_browse.php 2008-07-13 18:12:55 UTC (rev 46) @@ -48,8 +48,8 @@ //$rows = $userdbh->returnRows('num'); //$table->print_header(); print "<tr>\n"; - print "<td><a href=\"row_edit.php?object=" .$_GET['object']. "&primary_key=" .$primary_key. "&row=" .$row[$primary_key_order]. "\"><img src=\"images/edit.png\" alt=\"Edit\" title=\"Edit\" /></a></td> -<td><a href=\"row_edit.php?object=" .$_GET['object']. "&primary_key=" .$primary_key. "&row=" .$row[$primary_key_order]. "&type=delete\" onclick=\"return confirm_delete_row();\"><img src=\"images/delete.png\" alt=\"Delete\" title=\"Delete\" /></a></td>\n"; + print "<td><a href=\"row_edit.php?object=" .$_GET['object']. "&primary_key=" .$primary_key. "&row=" .$row[$primary_key_order]. "\"><img src=\"include.php?imgid=edit.png\" alt=\"Edit\" title=\"Edit\" /></a></td> +<td><a href=\"row_edit.php?object=" .$_GET['object']. "&primary_key=" .$primary_key. "&row=" .$row[$primary_key_order]. "&type=delete\" onclick=\"return confirm_delete_row();\"><img src=\"include.php?imgid=delete.png\" alt=\"Delete\" title=\"Delete\" /></a></td>\n"; for ($i=0; $i<$nr_fields; $i++) { if (strlen($row[$i]) > 50) { print '<td>'.substr(htmlentities($row[$i],ENT_QUOTES,$encoding),0,50)."...</td>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |