Changeset 3903 for trunk/tools/database


Ignore:
Timestamp:
Jul 31, 2000, 3:25:53 AM (25 years ago)
Author:
bird
Message:

First preview? Most pages are completed.

Location:
trunk/tools/database/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/www/Odin32DB.phtml

    r3902 r3903  
    1616 */
    1717$iRefcode       = -1;                   /* Reference number. (< 0 is all members in the category) */
    18 $sCategory      = "";                   /* Category name for internal use (equal to table name). */
    19 $sCategoryName  = "";                   /* Category name for presentation. */
     18$sCategory      = "root";               /* Category name for internal use (equal to table name). */
     19$sCategoryName  = "Root Menu";          /* Category name for presentation. */
    2020$fNoData        = 0;                    /* Flag which is set if refcode don't give matches in the DB. */
    2121
     
    7878    if (!(isset($authordll) && $authordll != "" && @(int)$authordll >= 0))
    7979        $authordll = -1;
    80 } /* else: initial page */
     80}
     81else if (isset($dlls))
     82{   /* All dlls */
     83    $sCategory      = "dlls";
     84    $sCategoryName  = "Dlls";
     85}
     86else if (isset($apigroups))
     87{   /* All API Groups */
     88    $sCategory      = "apigroups";
     89    $sCategoryName  = "API Groups";
     90}
     91else if (isset($authors))
     92{   /* All authors */
     93    $sCategory      = "authors";
     94    $sCategoryName  = "Authors";
     95} /* else: root page */
    8196
    8297
     
    85100 */
    86101if ($iRefcode < 0)
    87     $sName = "All"; //FIXME
     102    $sName = ""; //FIXME
    88103else
    89104{
     
    106121
    107122require "01-PreTitle.php3";
    108 echo $Title." - ".$sCategoryName.": ".$sName;
     123if ($sName == "")   echo $Title." - ".$sCategoryName;
     124else                echo $Title." - ".$sCategoryName.": ".$sName;
    109125require "02-PostTitle.php3";
    110126
     
    113129
    114130require "05-ColumnTwoHeader.php3";
    115 echo $Title."<br>".$sCategoryName.": ".$sName;
     131if ($sName == "")   echo $Title."<br>".$sCategoryName;
     132else                echo $Title."<br>".$sCategoryName.": ".$sName;
    116133require "06-ColumnTwoHeader2.php3";
    117134
     
    124141
    125142TekstBeg();
     143
    126144if (!$fNoData)
    127145{
     
    129147    {
    130148        case "dll":
     149        {
     150            Odin32DBDllInfo($aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState);
     151            break;
     152        }
     153
     154        case "file":
     155        {
     156            Odin32DBFileInfo($aContent, $db, $iRefcode, $fFunctions, $fAPIGroups, $fAuthors, $fSortByState);
     157            break;
     158        }
     159
     160        case "function":
     161        {
     162            Odin32DBFunctionInfo($aContent, $db, $iRefcode);
     163            break;
     164        }
     165
     166        case "apigroup":
     167        {
     168            Odin32DBAPIGroupInfo(&$aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAuthors, $fSortByState);
     169            break;
     170        }
     171
     172        case "author":
     173        {
     174            Odin32DBAuthorInfo($aContent, $db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authordll);
     175            break;
     176        }
     177
     178        case "root":
     179        {
     180            /*
     181             * The root page.
     182             */
     183            Odin32DBNavigationTop("","");
     184            Odin32DBNaslov($aContent, "Welcome to the Odin32 API Database", "welcome", "");
     185            echo "This is the first Beta edition of the Odin32 API Database.<br>\n".
     186                 "There might be dead or non-functioning links. Currently feedback is <i>NOT</i> needed.\n".
     187                 "<p>\n".
     188                 "Please note that the quality of the data avilable is quite poor\n".
     189                 "for the time being. This will improve within some months.<br>\n".
     190                 "-Enjoy!<br>\n";
     191
     192            Odin32DBNaslov($aContent, "Root Menu", "menu", "");
     193            echo "<font size=3>".
     194                 "<ul>\n".
     195                 "  <li><b><a href=\"Odin32DB.phtml?dlls=1\">Dlls</a></b>\n".
     196                 "  <li><b><a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a></b>\n".
     197                 "  <li><b><a href=\"Odin32DB.phtml?authors=1\">Authors</a></b>\n".
     198                 "  <li><i><a href=\"Odin32DB.phtml?searchapi=1\">Search API (not implemeted)</a></i>\n".
     199                 "</ul>\n";
     200                 "</font>\n";
     201            Odin32DBNavigationBottom("","");
     202            break;
     203        }
     204
     205        case "dlls":
     206        {
     207            /*
     208             * List all dlls.
     209             */
     210            Odin32DBNavigationTop("","");
     211            Odin32DBNaslov($aContent, "Welcome to the Odin32 API Database", "welcome", "");
     212            echo "This is the first Beta edition of the Odin32 API Database.<br>\n".
     213                 "There might be dead or non-functioning links. Currently feedback is <i>NOT</i> needed.\n".
     214                 "<p>\n".
     215                 "Please note that the quality of the data avilable is quite poor\n".
     216                 "for the time being. This will improve within some months.<br>\n".
     217                 "-Enjoy!<br>\n";
     218
     219            Odin32DBNaslov($aContent, "All Dlls", "dlls", "");
     220            $sql = "SELECT\n".
     221                   "    d.name              AS name,\n".
     222                   "    d.refcode           AS refcode,\n".
     223                   "    COUNT(f.refcode)    AS functions\n".
     224                   "FROM\n".
     225                   "    dll d\n".
     226                   "    JOIN function f\n".
     227                   "WHERE\n".
     228                   "    f.dll = d.refcode\n".
     229                   "GROUP BY d.refcode\n".
     230                   "ORDER BY d.name\n";
     231            if ($result = mysql_query($sql, $db))
    131232            {
    132             Odin32DBDllInfo($aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState);
    133             break;
     233                if (mysql_num_rows($result) <= 0)
     234                    echo "<i>No dlls!</i>\n";
     235                else
     236                {
     237                    echo "\n<font size=-1><ul><b>";
     238                    while ($aDll = mysql_fetch_array($result))
     239                    {
     240                        echo "<li><a href=\"Odin32DB.phtml?dllrefcode=".$aDll["refcode"].
     241                             "\">".$aDll["name"]."</a> (".$aDll["functions"].")\n";
     242                    }
     243                    echo "</b></ul></font>\n";
     244                }
    134245            }
    135 
    136         case "file":
     246            else
     247                Odin32DBSqlError($sql);
     248            Odin32DBNavigationBottom("","");
     249            break;
     250        }
     251
     252        case "authors":
     253        {
     254            /*
     255             * List all authors.
     256             */
     257            Odin32DBNavigationTop("","");
     258            Odin32DBNaslov($aContent, "Welcome to the Odin32 API Database", "welcome", "");
     259            echo "This is the first Beta edition of the Odin32 API Database.<br>\n".
     260                 "There might be dead or non-functioning links. Currently feedback is <i>NOT</i> needed.\n".
     261                 "<p>\n".
     262                 "Please note that the quality of the data avilable is quite poor\n".
     263                 "for the time being. This will improve within some months.<br>\n".
     264                 "-Enjoy!<br>\n";
     265
     266            Odin32DBNaslov($aContent, "All Authors", "authors", "");
     267            $sql = "SELECT\n".
     268                   "    name,\n".
     269                   "    refcode, \n".
     270                   "    COUNT(fa.function)  AS functions\n".
     271                   "FROM\n".
     272                   "    author a\n".
     273                   "    LEFT OUTER JOIN fnauthor fa ON a.refcode = fa.author\n".
     274                   "GROUP BY name\n".
     275                   "ORDER BY name\n";
     276            if ($result = mysql_query($sql, $db))
    137277            {
    138             Odin32DBFileInfo($aContent, $db, $iRefcode, $fFunctions, $fAPIGroups, $fAuthors, $fSortByState);
    139             break;
     278                if (mysql_num_rows($result) <= 0)
     279                    echo "<i>No dlls!</i>\n";
     280                else
     281                {
     282                    echo "\n<font size=-1><ul><b>";
     283                    while ($aAuthor = mysql_fetch_array($result))
     284                    {
     285                        echo "<li><a href=\"Odin32DB.phtml?authorrefcode=".$aAuthor["refcode"].
     286                             "\">".$aAuthor["name"]."</a> (".$aAuthor["functions"].")\n";
     287                    }
     288                    echo "</ul></b></font>\n";
     289                }
    140290            }
    141 
    142         case "function":
     291            else
     292                Odin32DBSqlError($sql);
     293            Odin32DBNavigationBottom("","");
     294            break;
     295        }
     296
     297        case "apigroups":
     298        {
     299            /*
     300             * List all API Groups.
     301             */
     302            Odin32DBNavigationTop("","");
     303            Odin32DBNaslov($aContent, "Welcome to the Odin32 API Database", "welcome", "");
     304            echo "This is the first Beta edition of the Odin32 API Database.<br>\n".
     305                 "There might be dead or non-functioning links. Currently feedback is <i>NOT</i> needed.\n".
     306                 "<p>\n".
     307                 "Please note that the quality of the data avilable is quite poor\n".
     308                 "for the time being. This will improve within some months.<br>\n".
     309                 "-Enjoy!<br>\n";
     310
     311            Odin32DBNaslov($aContent, "All API Groups", "apigroups", "");
     312            $sql = "SELECT\n".
     313                   "    a.name              AS name,\n".
     314                   "    a.refcode           AS refcode,\n".
     315                   "    COUNT(f.refcode)    AS functions\n".
     316                   "FROM\n".
     317                   "    apigroup a\n".
     318                   "    JOIN function f\n".
     319                   "WHERE\n".
     320                   "    f.apigroup = a.refcode\n".
     321                   "GROUP BY a.name\n".
     322                   "ORDER BY a.name\n";
     323            if ($result = mysql_query($sql, $db))
    143324            {
    144             Odin32DBFunctionInfo($aContent, $db, $iRefcode);
    145             break;
     325                if (mysql_num_rows($result) <= 0)
     326                    echo "<i>No dlls!</i>\n";
     327                else
     328                {
     329                    echo "\n<font size=-1><ul><b>";
     330                    while ($aAPIGroup = mysql_fetch_array($result))
     331                    {
     332                        echo "<li><a href=\"Odin32DB.phtml?apigrouprefcode=".$aAPIGroup["refcode"].
     333                             "\">".$aAPIGroup["name"]."</a> (".$aAPIGroup["functions"].")\n";
     334                    }
     335                    echo "</ul></b></font>\n";
     336                }
    146337            }
    147 
    148         case "apigroup":
    149             {
    150             Odin32DBAPIGroupInfo(&$aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAuthors, $fSortByState);
    151             break;
    152             }
    153 
    154         case "author":
    155             {
    156             Odin32DBAuthorInfo($aContent, $db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authordll);
    157             break;
    158             }
     338            else
     339                Odin32DBSqlError($sql);
     340            Odin32DBNavigationBottom("","");
     341            break;
     342        }
    159343
    160344        default:
     
    163347}
    164348else
    165     echo "Sorry, but there is not data available!";
     349{
     350}
     351
    166352
    167353TekstEnd();
     
    171357require "09-ContentsTitle.php3";
    172358
    173 DBWriteContents($aContent);
     359Odin32DBWriteContents($aContent);
    174360
    175361require "10-EndOfContent.php3";
  • trunk/tools/database/www/Odin32DBHelpers.php3

    r3902 r3903  
    622622
    623623
     624/* NAVIGATION */
     625/* NAVIGATION */
     626/* NAVIGATION */
     627
     628/**
     629 * Make top of page navigation stuff for the Odin32 database pages.
     630 * @param       $sExpand    Expand arguments.
     631 * @param       $sCollapse  Collapse arguments.
     632 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     633 */
     634function Odin32DBNavigationTop($sExpand, $sCollapse)
     635{
     636    echo "\n<center><font size=1>\n";
     637
     638    echo "<a href=\"Odin32DB.phtml\">Root</a>\n".
     639         " - <a href=\"Odin32DB.phtml?dlls=1\">Dlls</a>\n".
     640         " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n".
     641         " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n";
     642
     643    if ($sExpand != "" && $sCollapse != "")
     644    {
     645        echo "<br><a href=\"Odin32DB.phtml?".$sExpand."\">Expand</a> - \n".
     646             "<a href=\"Odin32DB.phtml?".$sCollapse."\">Collapse</a>\n";
     647    }
     648
     649    echo "</font></center>\n";
     650}
     651
     652
     653/**
     654 * Make bottom of page navigation stuff for the Odin32 database pages.
     655 * @param       $sExpand    Expand arguments.
     656 * @param       $sCollapse  Collapse arguments.
     657 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     658 */
     659function Odin32DBNavigationBottom($sExpand, $sCollapse)
     660{
     661    echo "\n<p><br><center>\n".
     662         "<font size=1>\n";
     663
     664    if ($sExpand != "" && $sCollapse != "")
     665    {
     666        echo "<a href=\"Odin32DB.phtml?".$sExpand."\">Expand</a> - \n".
     667             "<a href=\"Odin32DB.phtml?".$sCollapse."\">Collapse</a><br>\n";
     668    }
     669
     670    echo
     671         "<a href=\"Odin32DB.phtml\">Root</a>\n".
     672         " - <a href=\"Odin32DB.phtml?dlls=1\">Dlls</a>\n".
     673         " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n".
     674         " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n";
     675    echo "</font></<center>\n";
     676}
     677
    624678
    625679
     
    642696function Odin32DBFunctionInfo(&$aContent, $db, $iRefcode)
    643697{
     698    Odin32DBNavigationTop("","");
     699
    644700    $sql = sprintf("SELECT\n".
    645701                   "    f.name          AS name,\n".
     
    862918        Odin32DBSqlError($sql);
    863919    }
     920    Odin32DBNavigationBottom("","");
    864921}
    865922
     
    885942function Odin32DBDllInfo(&$aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState)
    886943{
    887 
    888 
     944    /*
     945     * Navigation - TOP
     946     */
     947    $sExpand    = "dllrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";
     948    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
     949    $sCollapse  = "dllrefcode=".$iRefcode;
     950    Odin32DBNavigationTop($sExpand, $sCollapse);
     951
     952    /*
     953     * Fetch (vital) data.
     954     */
    889955    $sql = sprintf("SELECT\n".
    890956                   "    d.name          AS name,\n".
     
    901967    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
    902968    {
    903         echo "<a href=\"Odin32DB.phtml?dllrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";
    904         if ($fSortByState)  echo "&fSortByState=".$fSortByState;
    905         echo "\">Expand all.</a>\n";
    906         echo "<a href=\"Odin32DB.phtml?dllrefcode=".$iRefcode."\">Collapse all.</a>\n";
    907 
    908969        /*
    909970         * General
     
    12331294        Odin32DBSqlError($sql);
    12341295    }
     1296
     1297    /*
     1298     * Navigation - Bottom
     1299     */
     1300    Odin32DBNavigationBottom($sExpand, $sCollapse);
    12351301}
    12361302
     
    12551321function Odin32DBFileInfo(&$aContent, $db, $iRefcode, $fFunctions, $fAPIGroups, $fAuthors, $fSortByState)
    12561322{
    1257 
     1323    /*
     1324     * Navigation - TOP
     1325     */
     1326    $sExpand    = "filerefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";
     1327    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
     1328    $sCollapse  = "filerefcode=".$iRefcode;
     1329    Odin32DBNavigationTop($sExpand, $sCollapse);
     1330
     1331    /*
     1332     * Fetch (vital) data.
     1333     */
    12581334    $sql = sprintf("SELECT\n".
    12591335                   "    f.name          AS name,\n".
     
    12771353    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
    12781354    {
    1279         echo "<a href=\"Odin32DB.phtml?filerefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";
    1280         if ($fSortByState)  echo "&fSortByState=".$fSortByState;
    1281         echo "\">Expand all.</a>\n";
    1282         echo "<a href=\"Odin32DB.phtml?filerefcode=".$iRefcode."\">Collapse all.</a>\n";
    1283 
    12841355        /*
    12851356         * General
     
    15421613        Odin32DBSqlError($sql);
    15431614    }
     1615
     1616    /*
     1617     * Navigation - Bottom
     1618     */
     1619    Odin32DBNavigationBottom($sExpand, $sCollapse);
    15441620}
    15451621
     
    15671643function Odin32DBAuthorInfo(&$aContent, $db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iDllRefcode)
    15681644{
     1645    /*
     1646     * Navigation - TOP
     1647     */
     1648    $sExpand    = "authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;
     1649    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
     1650    $sCollapse  = "authorrefcode=".$iRefcode;
     1651    Odin32DBNavigationTop($sExpand, $sCollapse);
     1652
     1653    /*
     1654     * Fetch (vital) data.
     1655     */
    15691656    $sql = sprintf("SELECT\n".
    15701657                   "    a.name          AS name,\n".
     
    15831670    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
    15841671    {
    1585         echo "<a href=\"Odin32DB.phtml?authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;
    1586         if ($fSortByState)  echo "&fSortByState=".$fSortByState;
    1587         echo "\">Expand all.</a>\n";
    1588         echo "<a href=\"Odin32DB.phtml?authorrefcode=".$iRefcode."\">Collapse all.</a>\n";
    1589 
    1590 
    15911672        /*
    15921673         * General
     
    19432024        Odin32DBSqlError($sql);
    19442025    }
     2026
     2027    /*
     2028     * Navigation - Bottom
     2029     */
     2030    Odin32DBNavigationBottom($sExpand, $sCollapse);
    19452031}
    19462032
     
    19652051function Odin32DBAPIGroupInfo(&$aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAuthors, $fSortByState)
    19662052{
     2053    /*
     2054     * Navigation - TOP
     2055     */
     2056    $sExpand    = "apigrouprefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAuthors=1";
     2057    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
     2058    $sCollapse  = "apigrouprefcode=".$iRefcode;
     2059    Odin32DBNavigationTop($sExpand, $sCollapse);
     2060
     2061    /*
     2062     * Fetch (vital) data.
     2063     */
    19672064    $sql = sprintf("SELECT\n".
    19682065                   "    g.name          AS name,\n".
     
    19802077    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
    19812078    {
    1982         echo "<a href=\"Odin32DB.phtml?apigrouprefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAuthors=1";
    1983         if ($fSortByState)  echo "&fSortByState=".$fSortByState;
    1984         echo "\">Expand all.</a>\n";
    1985         echo "<a href=\"Odin32DB.phtml?apigrouprefcode=".$iRefcode."\">Collapse all.</a>\n";
    1986 
    19872079        /*
    19882080         * General
     
    22462338        Odin32DBSqlError($sql);
    22472339    }
     2340
     2341    /*
     2342     * Navigation - Bottom
     2343     */
     2344    Odin32DBNavigationBottom($sExpand, $sCollapse);
    22482345}
    22492346
     
    22602357 * @sketch      Writes the headers present in the contents array.
    22612358 */
    2262 function DBWriteContents(&$aContent)
     2359function Odin32DBWriteContents(&$aContent)
    22632360{
    22642361    TocBeg();
Note: See TracChangeset for help on using the changeset viewer.