Changeset 3883 for trunk/tools/database
- Timestamp:
- Jul 21, 2000, 11:11:11 PM (25 years ago)
- Location:
- trunk/tools/database/www
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/www/Odin32DB.phtml
r3875 r3883 157 157 { 158 158 Naslov("General", "General"); 159 echo "\n<table width=100% border=3 cell spacing cellpadding=0>\n";159 echo "\n<table width=100% border=3 cellpadding=0>\n"; 160 160 Odin32DBInfoRow1("Name", $array, "name","","","",""); 161 161 if (isset($array["intname"])) … … 183 183 SELECT 184 184 name AS name, 185 type AS type 185 type AS type, 186 description AS description 186 187 FROM 187 188 parameter … … 191 192 $iRefcode); 192 193 $result2 = mysql_query($sql, $db); 193 if ($result2 && ($cParams = @mysql_num_rows($result2)) > 0)194 if ($result2 && ($cParams = mysql_num_rows($result2)) > 0) 194 195 { 195 196 while ($param = mysql_fetch_array($result2)) … … 210 211 Odin32DBDocRow1("Description", $array, "description"); 211 212 PodNaslov("Parameters"); 212 $sql = sprintf(" 213 SELECT 214 name AS name, 215 description AS description 216 FROM 217 parameter 218 WHERE 219 function = %d 220 ORDER BY sequencenbr", 221 $iRefcode); 222 $result2 = mysql_query($sql, $db); 223 if ($result2 && @mysql_num_rows($result2) > 0) 213 if ($result2 && 214 mysql_num_rows($result2) > 0 && 215 mysql_data_seek($result2, 0) 216 ) 224 217 { 225 echo "\n<table width=100% border=0 cellspacing cellpadding=0>\n";226 218 while ($param = mysql_fetch_array($result2)) 227 219 { 228 Odin32DBInfoRow1($param["name"], $param, "description", "", "","",""); 220 /*echo " <tr><td width=100%>".$param["name"]."</td></tr>\n";*/ 221 echo " <br><b>".$param["name"].":</b>\n"; 222 if (isset($param["description"])) 223 { 224 echo "\n <table width=100% border=0 cellpadding=0>\n"; 225 echo " <tr><td width=10%> </td>\n"; 226 $sDescription = str_replace("<BR>", "", str_replace("<BR><BR>\n","<br>",$param["description"])); 227 echo " <td width=90%><font size=-1>".$sDescription."</font></td></tr>\n"; 228 echo "\n</table>\n"; 229 } 230 /*else 231 echo " </tr>";*/ 229 232 } 230 echo "\n</table>\n";231 233 } 232 234 else -
trunk/tools/database/www/Odin32DBHelpers.php3
r3876 r3883 5 5 * @returns Completion percentage. Range 0-100. 6 6 * On error -1 or -2 is returned. 7 * @param $ ulDll Dll reference code.7 * @param $iDll Dll reference code. 8 8 * @param $db Database connection variable. 9 9 * @sketch Get total number of function in the dll. … … 14 14 * @remark 15 15 */ 16 function Odin32DBComputeCompletion($ ulDll, $db)16 function Odin32DBComputeCompletion($iDll, $db) 17 17 { 18 18 /* … … 26 26 f.state = s.refcode 27 27 AND dll = %d", 28 $ ulDll);28 $iDll); 29 29 $result = mysql_query($sql, $db); 30 30 if (mysql_num_rows($result) < 1) … … 42 42 /** 43 43 * Draws a completion bar. 44 * @param $ulDll Dll reference code. 44 * @param $iDll Dll reference code. 45 * If < 0 then for the entire project. 45 46 * @param $db Database connection variable. 46 47 * @sketch Get total number of function in the dll. … … 50 51 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 51 52 */ 52 function Odin32DBCompletionBar($ ulDll, $sDllName, $db)53 function Odin32DBCompletionBar($iDll, $sDllName, $db) 53 54 { 54 55 /* 55 56 * Count the total number of functions in the DLL. 56 57 */ 57 $sql = sprintf("SELECT COUNT(*) FROM function f WHERE dll = %d", 58 $ulDll); 58 if ($iDll < 0) 59 $sql = "SELECT COUNT(*) FROM function f"; 60 else 61 $sql = sprintf("SELECT COUNT(*) FROM function f WHERE dll = %d", $iDll); 59 62 $result = mysql_query($sql, $db); 60 63 if (mysql_num_rows($result) < 1) … … 91 94 * Get states and make bar. 92 95 */ 96 if ($iDll < 0) 97 $sDllCond = ""; 98 else 99 $sDllCond = "dll = %d AND "; 93 100 $sql = sprintf("SELECT COUNT(f.refcode) AS count, 94 101 f.state AS state, … … 99 106 state s 100 107 WHERE 101 dll = %d102 ANDs.refcode = f.state108 ".$sDllCond." 109 s.refcode = f.state 103 110 GROUP BY f.state 104 111 ORDER BY state", 105 $ ulDll);112 $iDll); 106 113 $result = mysql_query($sql, $db); 107 114 $rdCompletePercent = 0.0; … … 180 187 if (mysql_num_rows($result) < 1) 181 188 { 182 printf("\n\n<br>Odin32DB CompletionBar: IPE(1).<br>\n\n");189 printf("\n\n<br>Odin32DBStateLegned: IPE(1).<br>\n\n"); 183 190 return -1; 184 191 } … … 188 195 <tr><td></td></tr> 189 196 <tr> 190 <td valign=center>191 192 193 194 197 <td> 198 <center><B><font face=\"WarpSans, Arial\" color=\"#990000\"> 199 Status Legend: 200 </font></b></center> 201 </td> 195 202 </tr> 196 203 <tr> 197 <table width=100% border=0 cellspacing=10 cellpadding=0 align=right> 204 <td> 205 <table width=100% border=0 cellspacing=2 cellpadding=0 align=right> 198 206 "; 199 207 while ($row = mysql_fetch_row($result)) 200 208 { 209 if (1) 210 { 201 211 echo " 202 <tr> 203 <td width=90% align=right> 204 <font size=1 color=000099> 205 ".$row[0]." 206 </font> 207 </td> 208 <td width=1%> 209 <font size=1 color=000099> 210 211 </font> 212 </td> 213 <td width=9% bgcolor=".$row[1]."> 214 <font size=1 color=000099> 215 216 </font> 217 </td> 218 </tr> 212 <tr> 213 <td width=85% align=right> 214 <font size=1 color=000099> 215 ".$row[0]." 216 </font> 217 </td> 218 <td width=15% bgcolor=".$row[1]."> 219 <font size=-1> 220 <br> 221 222 </font> 223 </td> 224 </tr> 219 225 "; 226 } 227 else 228 { 229 echo " 230 <tr> 231 <td align=left bgcolor=".$row[1]."> 232 <font size=1 color=000000> 233 ".$row[0]." 234 </font> 235 </td> 236 </tr> 237 "; 238 } 220 239 } 221 240 222 241 echo " 223 </table> 224 </p> 242 </table> 243 </p> 244 </td> 225 245 </tr> 226 246 "; … … 232 252 233 253 254 /** 255 * Dump an SQL statement in HTML. 256 * 257 * @returns nothing. 258 * @param $sql Sql to display. 259 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 260 */ 261 function Odin32DBDumpSql($sql) 262 { 263 echo "<p><font size=1 face=\"courier\"> 264 SQL:<br> 265 ".str_replace(" ", " ", str_replace("\n", "<br>\n", $sql))." 266 <br> 267 </font> 268 </p> 269 "; 270 } 271 272 273 /** 274 * 275 * @returns 276 * @param $sName 277 * @param $array Result array. 278 * @param $sValueName Name in the $array for the value. 279 * @param $sRefName Name in the $array for the reference. 280 * @param $sOdin32DBArg Odin32DB.phtml argument. 281 * @param $sNullText Null text (if the array element is NULL display this). 282 * @param $sPostText Text to insert after the value. 283 * 284 */ 285 function Odin32DBInfoRow1($sName, $array, $sValueName, $sRefName, $sOdin32DBArg, $sNullText, $sPostText) 286 { 287 echo " 288 <tr> 289 <td width=35%><tt>".$sName."</tt></td> 290 <td valign=top>"; 291 if (isset($array[$sValueName])) 292 { 293 if ($sRefName != "" && isset($array[$sRefName]) && $sOdin32DBArg != "") 294 { 295 echo "<a href=\"Odin32DB.phtml?".$sOdin32DBArg."=".$array[$sRefName]."\">"; 296 $sPostText = "</a>".$sPostText; 297 } 298 echo $array[$sValueName]; 299 echo $sPostText; 300 } 301 else if ($sNullText != "") 302 echo "<i>".$sNullText."</i>"; 303 304 echo " 305 </td> 306 <tr>\n"; 307 } 308 309 310 /** 311 * 312 * @returns 313 * @param $sName 314 * @param $array Result array. 315 * @param $sValueName1 Name in the $array for the value. 316 * @param $sRefName1 Name in the $array for the reference. 317 * @param $sOdin32DBArg1 Odin32DB.phtml argument. 318 * @param $sNullText Null text (if the array element is NULL display this). 319 * @param $sPostText Text to insert after the value. 320 * @param $sValueName2 Name in the $array for the value. 321 * @param $sRefName2 Name in the $array for the reference. 322 * @param $sOdin32DBArg2 Odin32DB.phtml argument. 323 * 324 */ 325 function Odin32DBInfoRow2($sName, $array, $sValueName1, $sRefName1, $sOdin32DBArg1, $sNullText, $sPostText, 326 $sValueName2, $sRefName2, $sOdin32DBArg2) 327 { 328 echo " 329 <tr> 330 <td width=35%><tt>".$sName."</tt></td> 331 <td valign=top>"; 332 if (isset($array[$sValueName1])) 333 { 334 if ($sRefName1 != "" && isset($array[$sRefName1]) && $sOdin32DBArg1 != "") 335 { 336 echo "<a href=\"Odin32DB.phtml?".$sOdin32DBArg1."=".$array[$sRefName1]."\">"; 337 $sPostText = "</a>".$sPostText; 338 } 339 echo $array[$sValueName1]; 340 echo $sPostText; 341 342 if (isset($array[$sValueName2])) 343 { 344 if ($sRefName2 != "" && isset($array[$sRefName2]) && $sOdin32DBArg2 != "") 345 { 346 echo "<a href=\"Odin32DB.phtml?".$sOdin32DBArg2."=".$array[$sRefName2]."\">"; 347 echo $array[$sValueName2]."</a>"; 348 } 349 else 350 echo $array[$sValueName2]; 351 } 352 } 353 else if ($sNullText != "") 354 echo "<i>".$sNullText."</i>"; 355 356 echo "</td> 357 <tr>\n"; 358 } 359 360 361 362 /** 363 * Inserts a documentation row from database.. 364 * @param $sName Name of the information. 365 * @param $array DB result array. 366 * @param $sValueName Name in the DB result array. 367 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 368 * @remark Displays <i>not available</i> if empty field. 369 */ 370 function Odin32DBDocRow1($sName, $array, $sValueName) 371 { 372 PodNaslov($sName); 373 if (isset($array[$sValueName])) 374 { 375 echo $array[$sValueName]; 376 } 377 else 378 echo "<i>not available</i>"; 379 } 234 380 235 381 ?> 382 -
trunk/tools/database/www/Odin32WAI.phtml
r3877 r3883 195 195 196 196 TekstBeg(); 197 $sql = sprintf("SELECT UPPER(d.name) AS name 197 $sql = sprintf("SELECT UPPER(d.name) AS name, 198 refcode 198 199 FROM dll d, 199 200 tgroupdll t … … 209 210 { 210 211 printf(" To Access the %s part of the Odin32 API database, click ", $dll["name"]); 211 $lnk = sprintf("Odin32DB.phtml?dll =%s", $dll["name"]);212 $lnk = sprintf("Odin32DB.phtml?dllrefcode=%d", $dll["refcode"]); 212 213 LocLink($lnk, "here"); 213 214 printf(".<BR>\n"); … … 283 284 284 285 285 PodNaslov("Implementation Status :");286 PodNaslov("Implementation Status All Dlls:"); 286 287 $sql = "SELECT name, 287 288 refcode … … 295 296 while ($dll = @mysql_fetch_array($result)) 296 297 Odin32DBCompletionBar($dll["refcode"], $dll["name"], $db); 298 299 Odin32DBCompletionBar(-1, "Total", $db); 297 300 } 298 301 else
Note:
See TracChangeset
for help on using the changeset viewer.