Hallo zusammen,
kann mir ein erfahrener PHP Coder die oben beschriebenen Funktionen verbauen? Ich wäre sehr sehr dankbar für Hilfe.
Das Script sieht folgendermaßen aus:
Spoiler anzeigen
Alles anzeigen
Refresh:
[php]if(@$_REQUEST['action']=="add") {[/php]
Nach dem Eintragen soll ein Refresh erfolgen und somit auf Hauptseite wieder landen.
Wenn ich das Refresh einbaue, dann fügt er durchgehen Einträge hinzu, dass soll nicht passieren.
Nach "einem" Eintrag, soll der Refresh erfolgen.
Paging:
Eine Paging-Funktion, womit man beispielsweise nur 10 Einträge anzeigt und mit
<< < [1] [2] ......
Zu vorherigen oder nächsten Einträge springen kann
Buchstabenauswahl:
Eine Auswahl der Buchstaben wäre ebenfalls super
[#] [A] ....
Somit nur Einträge mit den jeweiligen Buchstabe angezeigt werden
Alphabetische Reihenfolge
Eine Alphabetische Reihenfolge für die Einträge wäre auch super
kann mir ein erfahrener PHP Coder die oben beschriebenen Funktionen verbauen? Ich wäre sehr sehr dankbar für Hilfe.
Das Script sieht folgendermaßen aus:
PHP-Quellcode
- <?php
- echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n";
- echo " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
- echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
- echo "<head>\n";
- echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
- echo "<title>Scripte</title>\n";
- echo "<link href=\"css/styles.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
- echo "</head>\n";
- echo "\n";
- echo "<body>\n";
- function refresh($content="") {
- echo "<META HTTP-EQUIV=Refresh CONTENT=\"".$content."\"; URL=\"scripts.php\">";
- }
- if(!($db=new SQLite3('sqlite/scripts.sqlite3', '0666')))
- {
- echo "<h2>Fehler</h2>";
- die();
- }
- echo "<table id=\"mytable\" cellspacing=\"0\" summary=\"Scriptauflistung\">\n";
- echo " <caption>\n";
- echo " <a href=\"scripts.php?action=add\">[Eintragen]</a>\n";
- echo " </caption>\n";
- echo " <tr>\n";
- echo " <th scope=\"col\" abbr=\"Name\" class=\"nobg\">Name</th>\n";
- echo " <th scope=\"col\" abbr=\"Version\">Version</th>\n";
- echo " <th scope=\"col\" abbr=\"Allinkwith\">Allinkwith</th>\n";
- echo " <th scope=\"col\" abbr=\"Boerse\">Boerse</th>\n";
- echo " <th scope=\"col\" abbr=\"MyGully\">MyGully</th>\n";
- echo " <th scope=\"col\" abbr=\"Leecher\">Leecher</th>\n";
- echo " <th scope=\"col\" abbr=\"Aktion\">Aktion</th>\n";
- echo " </tr>\n";
- $scriptname=$db->escapeString(@$_REQUEST['scriptname']);
- $scriptversion=$db->escapeString(@$_REQUEST['scriptversion']);
- $up_aiw=$db->escapeString(@$_REQUEST['up_aiw']);
- $up_boerse=$db->escapeString(@$_REQUEST['up_boerse']);
- $up_mygully=$db->escapeString(@$_REQUEST['up_mygully']);
- $up_leecher=$db->escapeString(@$_REQUEST['up_leecher']);
- $result=$db->query("SELECT id,scriptname,scriptversion,up_aiw,up_boerse,up_mygully,up_leecher FROM scripts ORDER BY scriptversion;");
- $i=0;
- while( $row=$result->fetchArray(SQLITE3_ASSOC) )
- {
- if($i>0)
- {
- }
- echo " <tr>\n";
- echo " <th scope=\"row\" abbr=\"Model\" class=\"spec\">".htmlspecialchars($row['scriptname'])."</th>\n";
- echo " <td class=\"version\">".htmlspecialchars($row['scriptversion'])."</td>\n";
- echo " <td><a href=\"".htmlspecialchars($row['up_aiw'])."\" target=\"_blank\"><img src=\"http://g.etfv.co/".htmlspecialchars($row['up_aiw'])."\" alt=\"n/a\" width=\"16\" height=\"16\" /></a></td>\n";
- echo " <td><a href=\"".htmlspecialchars($row['up_boerse'])."\" target=\"_blank\"><img src=\"http://g.etfv.co/".htmlspecialchars($row['up_boerse'])."\" alt=\"n/a\" width=\"16\" height=\"16\" /></a></td>\n";
- echo " <td><a href=\"".htmlspecialchars($row['up_mygully'])."\" target=\"_blank\"><img src=\"http://g.etfv.co/".htmlspecialchars($row['up_mygully'])."\" alt=\"n/a\" width=\"16\" height=\"16\" /></a></td>\n";
- echo " <td><a href=\"".htmlspecialchars($row['up_leecher'])."\" target=\"_blank\"><img src=\"http://g.etfv.co/".htmlspecialchars($row['up_leecher'])."\" alt=\"n/a\" width=\"16\" height=\"16\" /></a></td>\n";
- echo " <td><a href=\"scripts.php?action=del&id=".$row['id']."\"><img src=\"img/delete.png\" alt=\"Del\" title=\"Löschen\" width=\"16\" height=\"16\" /></a> <a href=\"scripts.php?action=edit&id=".$row['id']."\"><img src=\"img/edit.png\" alt=\"Edit\" title=\"Bearbeiten\" width=\"16\" height=\"16\" /></a></td>\n";
- echo " </tr>\n";
- $i++;
- }
- echo "</table>";
- //START: Eintrag einfügen
- if(@$_REQUEST['action']=="add") {
- if($scriptname!="") {
- $db->query("INSERT INTO scripts (scriptname,scriptversion,up_aiw,up_boerse,up_mygully,up_leecher) VALUES('$scriptname','$scriptversion','$up_aiw','$up_boerse','$up_mygully','$up_leecher')");
- }
- echo "<h3>Eintrag</h3>\n";
- echo "<form action=\"scripts.php\" method=\"get\">\n";
- echo "<input type=\"hidden\" name=\"action\" value=\"add\">\n";
- echo " <table id=\"mytable\" cellspacing=\"0\" summary=\"Scriptauflistung\">\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/textfield.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> Scriptname:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"scriptname\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/textfield.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> Version:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"scriptversion\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> AIW Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_aiw\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> BOERSE Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_boerse\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> MYGULLY Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_mygully\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> LEECHER Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_leecher\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"></th>\n";
- echo " <th class=\"nobg\"><input type=\"submit\" border=\"0\" value=\"Eintragen\"></th>\n";
- echo " </tr>\n";
- echo " </table>\n";
- echo "</form>\n";
- }
- //START: Eintrag Speichern
- if(@$_REQUEST['action']=="save")
- {
- $db->query("UPDATE scripts
- SET scriptname = '$scriptname', scriptversion = '$scriptversion', up_aiw = '$up_aiw', up_boerse = '$up_boerse', up_mygully = '$up_mygully', up_leecher = '$up_leecher'
- WHERE id=".round($_REQUEST['id']));
- refresh("0");
- }
- //START: Eintrag löschen
- if(@$_REQUEST['action']=="del")
- {
- $result=$db->query("SELECT id,scriptname,scriptversion,up_aiw,up_boerse,up_mygully,up_leecher FROM scripts WHERE id=".round($_REQUEST['id']));
- $row=$result->fetchArray(SQLITE3_ASSOC);
- echo "<h3>Löschen</h3>\n";
- echo "<form action=\"scripts.php\" method=\"post\">\n";
- echo "<input type=\"hidden\" name=\"action\" value=\"delok\">\n";
- echo "<input type=\"hidden\" name=\"id\" value=\"".$row['id']."\">\n";
- echo "<strong>".$row['scriptname']."</strong> wirklich löschen?<br /><input type=\"submit\" border=\"0\" value=\"Ja, löschen!\">";
- echo "</form>\n";
- }
- //START: Eintrag löschen OK
- if(@$_REQUEST['action']=="delok")
- {
- $db->query("DELETE FROM scripts WHERE id=".round($_REQUEST['id']));
- echo "<h3>Erolgreich gelösch</h3>\n";
- refresh("1");
- }
- //START: Eintrag editieren
- if(@$_REQUEST['action']=="edit")
- {
- $result=$db->query("SELECT id,scriptname,scriptversion,up_aiw,up_boerse,up_mygully,up_leecher FROM scripts WHERE id=".round($_REQUEST['id']));
- $row=$result->fetchArray(SQLITE3_ASSOC);
- echo "<h3>Bearbeiten</h3>\n";
- echo "<form action=\"scripts.php\" method=\"post\">\n";
- echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
- echo "<input type=\"hidden\" name=\"id\" value=\"".$row['id']."\">\n";
- echo " <table id=\"mytable\" cellspacing=\"0\" summary=\"Scriptauflistung\">\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/textfield.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> Scriptname:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"scriptname\" value=\"".$row['scriptname']."\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/textfield.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> Version:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"scriptversion\" value=\"".$row['scriptversion']."\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> AIW Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_aiw\" value=\"".$row['up_aiw']."\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> BOERSE Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_boerse\" value=\"".$row['up_boerse']."\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> MYGULLY Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_mygully\" value=\"".$row['up_mygully']."\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"><img src=\"img/link.png\" alt=\"n/a\" width=\"16\" height=\"16\" /> LEECHER Link:</th>\n";
- echo " <th class=\"nobg\"><input type=\"text\" size=\"30\" name=\"up_leecher\" value=\"".$row['up_leecher']."\"></th>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <th class=\"nobg\"></th>\n";
- echo " <th class=\"nobg\"><input type=\"submit\" border=\"0\" value=\"Bearbeiten\"></th>\n";
- echo " </tr>\n";
- echo " </table>\n";
- echo "</form>\n";
- }
- // Schließen
- $db->close();
- echo "<p><a href=\"index.php\">Startseite</a></p>\n";
- echo "</body>\n";
- echo "</html>\n";
- echo "\n";
- echo "</body>\n";
- echo "</html>\n";
- ?>
Refresh:
[php]if(@$_REQUEST['action']=="add") {[/php]
Nach dem Eintragen soll ein Refresh erfolgen und somit auf Hauptseite wieder landen.
Wenn ich das Refresh einbaue, dann fügt er durchgehen Einträge hinzu, dass soll nicht passieren.
Nach "einem" Eintrag, soll der Refresh erfolgen.
Paging:
Eine Paging-Funktion, womit man beispielsweise nur 10 Einträge anzeigt und mit
<< < [1] [2] ......
Zu vorherigen oder nächsten Einträge springen kann
Buchstabenauswahl:
Eine Auswahl der Buchstaben wäre ebenfalls super
[#] [A] ....
Somit nur Einträge mit den jeweiligen Buchstabe angezeigt werden
Alphabetische Reihenfolge
Eine Alphabetische Reihenfolge für die Einträge wäre auch super