Changeset 3903 for trunk/tools/database
- Timestamp:
- Jul 31, 2000, 3:25:53 AM (25 years ago)
- Location:
- trunk/tools/database/www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/www/Odin32DB.phtml
r3902 r3903 16 16 */ 17 17 $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. */ 20 20 $fNoData = 0; /* Flag which is set if refcode don't give matches in the DB. */ 21 21 … … 78 78 if (!(isset($authordll) && $authordll != "" && @(int)$authordll >= 0)) 79 79 $authordll = -1; 80 } /* else: initial page */ 80 } 81 else if (isset($dlls)) 82 { /* All dlls */ 83 $sCategory = "dlls"; 84 $sCategoryName = "Dlls"; 85 } 86 else if (isset($apigroups)) 87 { /* All API Groups */ 88 $sCategory = "apigroups"; 89 $sCategoryName = "API Groups"; 90 } 91 else if (isset($authors)) 92 { /* All authors */ 93 $sCategory = "authors"; 94 $sCategoryName = "Authors"; 95 } /* else: root page */ 81 96 82 97 … … 85 100 */ 86 101 if ($iRefcode < 0) 87 $sName = " All"; //FIXME102 $sName = ""; //FIXME 88 103 else 89 104 { … … 106 121 107 122 require "01-PreTitle.php3"; 108 echo $Title." - ".$sCategoryName.": ".$sName; 123 if ($sName == "") echo $Title." - ".$sCategoryName; 124 else echo $Title." - ".$sCategoryName.": ".$sName; 109 125 require "02-PostTitle.php3"; 110 126 … … 113 129 114 130 require "05-ColumnTwoHeader.php3"; 115 echo $Title."<br>".$sCategoryName.": ".$sName; 131 if ($sName == "") echo $Title."<br>".$sCategoryName; 132 else echo $Title."<br>".$sCategoryName.": ".$sName; 116 133 require "06-ColumnTwoHeader2.php3"; 117 134 … … 124 141 125 142 TekstBeg(); 143 126 144 if (!$fNoData) 127 145 { … … 129 147 { 130 148 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)) 131 232 { 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 } 134 245 } 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)) 137 277 { 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 } 140 290 } 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)) 143 324 { 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 } 146 337 } 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 } 159 343 160 344 default: … … 163 347 } 164 348 else 165 echo "Sorry, but there is not data available!"; 349 { 350 } 351 166 352 167 353 TekstEnd(); … … 171 357 require "09-ContentsTitle.php3"; 172 358 173 DBWriteContents($aContent);359 Odin32DBWriteContents($aContent); 174 360 175 361 require "10-EndOfContent.php3"; -
trunk/tools/database/www/Odin32DBHelpers.php3
r3902 r3903 622 622 623 623 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 */ 634 function 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 */ 659 function 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 624 678 625 679 … … 642 696 function Odin32DBFunctionInfo(&$aContent, $db, $iRefcode) 643 697 { 698 Odin32DBNavigationTop("",""); 699 644 700 $sql = sprintf("SELECT\n". 645 701 " f.name AS name,\n". … … 862 918 Odin32DBSqlError($sql); 863 919 } 920 Odin32DBNavigationBottom("",""); 864 921 } 865 922 … … 885 942 function Odin32DBDllInfo(&$aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState) 886 943 { 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 */ 889 955 $sql = sprintf("SELECT\n". 890 956 " d.name AS name,\n". … … 901 967 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) 902 968 { 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 908 969 /* 909 970 * General … … 1233 1294 Odin32DBSqlError($sql); 1234 1295 } 1296 1297 /* 1298 * Navigation - Bottom 1299 */ 1300 Odin32DBNavigationBottom($sExpand, $sCollapse); 1235 1301 } 1236 1302 … … 1255 1321 function Odin32DBFileInfo(&$aContent, $db, $iRefcode, $fFunctions, $fAPIGroups, $fAuthors, $fSortByState) 1256 1322 { 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 */ 1258 1334 $sql = sprintf("SELECT\n". 1259 1335 " f.name AS name,\n". … … 1277 1353 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) 1278 1354 { 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 1284 1355 /* 1285 1356 * General … … 1542 1613 Odin32DBSqlError($sql); 1543 1614 } 1615 1616 /* 1617 * Navigation - Bottom 1618 */ 1619 Odin32DBNavigationBottom($sExpand, $sCollapse); 1544 1620 } 1545 1621 … … 1567 1643 function Odin32DBAuthorInfo(&$aContent, $db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iDllRefcode) 1568 1644 { 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 */ 1569 1656 $sql = sprintf("SELECT\n". 1570 1657 " a.name AS name,\n". … … 1583 1670 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) 1584 1671 { 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 1591 1672 /* 1592 1673 * General … … 1943 2024 Odin32DBSqlError($sql); 1944 2025 } 2026 2027 /* 2028 * Navigation - Bottom 2029 */ 2030 Odin32DBNavigationBottom($sExpand, $sCollapse); 1945 2031 } 1946 2032 … … 1965 2051 function Odin32DBAPIGroupInfo(&$aContent, $db, $iRefcode, $fFunctions, $fFiles, $fAuthors, $fSortByState) 1966 2052 { 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 */ 1967 2064 $sql = sprintf("SELECT\n". 1968 2065 " g.name AS name,\n". … … 1980 2077 if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result))) 1981 2078 { 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 1987 2079 /* 1988 2080 * General … … 2246 2338 Odin32DBSqlError($sql); 2247 2339 } 2340 2341 /* 2342 * Navigation - Bottom 2343 */ 2344 Odin32DBNavigationBottom($sExpand, $sCollapse); 2248 2345 } 2249 2346 … … 2260 2357 * @sketch Writes the headers present in the contents array. 2261 2358 */ 2262 function DBWriteContents(&$aContent)2359 function Odin32DBWriteContents(&$aContent) 2263 2360 { 2264 2361 TocBeg();
Note:
See TracChangeset
for help on using the changeset viewer.