Changeset 3883 for trunk/tools/database


Ignore:
Timestamp:
Jul 21, 2000, 11:11:11 PM (25 years ago)
Author:
bird
Message:

More coding....

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

Legend:

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

    r3875 r3883  
    157157                {
    158158                    Naslov("General", "General");
    159                     echo "\n<table width=100% border=3 cellspacing cellpadding=0>\n";
     159                    echo "\n<table width=100% border=3 cellpadding=0>\n";
    160160                    Odin32DBInfoRow1("Name", $array, "name","","","","");
    161161                    if (isset($array["intname"]))
     
    183183                                    SELECT
    184184                                            name                AS name,
    185                                             type                AS type
     185                                            type                AS type,
     186                                            description         AS description
    186187                                        FROM
    187188                                            parameter
     
    191192                                   $iRefcode);
    192193                    $result2 = mysql_query($sql, $db);
    193                     if ($result2 && ($cParams = @mysql_num_rows($result2)) > 0)
     194                    if ($result2 && ($cParams = mysql_num_rows($result2)) > 0)
    194195                    {
    195196                        while ($param = mysql_fetch_array($result2))
     
    210211                    Odin32DBDocRow1("Description", $array, "description");
    211212                    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                        )
    224217                    {
    225                         echo "\n<table width=100% border=0 cellspacing cellpadding=0>\n";
    226218                        while ($param = mysql_fetch_array($result2))
    227219                        {
    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%>&nbsp;</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>";*/
    229232                        }
    230                         echo "\n</table>\n";
    231233                    }
    232234                    else
  • trunk/tools/database/www/Odin32DBHelpers.php3

    r3876 r3883  
    55 * @returns     Completion percentage. Range 0-100.
    66 *              On error -1 or -2 is returned.
    7  * @param       $ulDll  Dll reference code.
     7 * @param       $iDll  Dll reference code.
    88 * @param       $db     Database connection variable.
    99 * @sketch      Get total number of function in the dll.
     
    1414 * @remark
    1515 */
    16 function Odin32DBComputeCompletion($ulDll, $db)
     16function Odin32DBComputeCompletion($iDll, $db)
    1717{
    1818    /*
     
    2626                            f.state = s.refcode
    2727                            AND dll = %d",
    28                         $ulDll);
     28                        $iDll);
    2929    $result = mysql_query($sql, $db);
    3030    if (mysql_num_rows($result) < 1)
     
    4242/**
    4343 * Draws a completion bar.
    44  * @param       $ulDll  Dll reference code.
     44 * @param       $iDll   Dll reference code.
     45 *                      If < 0 then for the entire project.
    4546 * @param       $db     Database connection variable.
    4647 * @sketch      Get total number of function in the dll.
     
    5051 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    5152 */
    52 function Odin32DBCompletionBar($ulDll, $sDllName, $db)
     53function Odin32DBCompletionBar($iDll, $sDllName, $db)
    5354{
    5455    /*
    5556     * Count the total number of functions in the DLL.
    5657     */
    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);
    5962    $result = mysql_query($sql, $db);
    6063    if (mysql_num_rows($result) < 1)
     
    9194     * Get states and make bar.
    9295     */
     96    if ($iDll < 0)
     97        $sDllCond = "";
     98    else
     99        $sDllCond = "dll = %d AND ";
    93100    $sql = sprintf("SELECT  COUNT(f.refcode)    AS count,
    94101                            f.state             AS state,
     
    99106                            state s
    100107                        WHERE
    101                             dll = %d
    102                             AND s.refcode = f.state
     108                            ".$sDllCond."
     109                            s.refcode = f.state
    103110                        GROUP BY f.state
    104111                        ORDER BY state",
    105                    $ulDll);
     112                   $iDll);
    106113    $result = mysql_query($sql, $db);
    107114    $rdCompletePercent = 0.0;
     
    180187    if (mysql_num_rows($result) < 1)
    181188    {
    182         printf("\n\n<br>Odin32DBCompletionBar: IPE(1).<br>\n\n");
     189        printf("\n\n<br>Odin32DBStateLegned: IPE(1).<br>\n\n");
    183190        return -1;
    184191    }
     
    188195            <tr><td></td></tr>
    189196            <tr>
    190                     <td valign=center >
    191                         <center><B><font face=\"WarpSans, Arial\" color=\"#990000\">
    192                         Legend:
    193                         </font></b></center>
    194                     </td>
     197                <td>
     198                    <center><B><font face=\"WarpSans, Arial\" color=\"#990000\">
     199                    Status Legend:
     200                    </font></b></center>
     201                </td>
    195202            </tr>
    196203            <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>
    198206            ";
    199207        while ($row = mysql_fetch_row($result))
    200208        {
     209            if (1)
     210            {
    201211            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                         &nbsp;
    211                         </font>
    212                     </td>
    213                     <td width=9% bgcolor=".$row[1].">
    214                         <font size=1 color=000099>
    215                         &nbsp;
    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                            &nbsp;<br>
     221                            &nbsp;
     222                            </font>
     223                        </td>
     224                    </tr>
    219225                ";
     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                }
    220239        }
    221240
    222241        echo "
    223                 </table>
    224                 </p>
     242                    </table>
     243                    </p>
     244                </td>
    225245            </tr>
    226246            ";
     
    232252
    233253
     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 */
     261function Odin32DBDumpSql($sql)
     262{
     263    echo "<p><font size=1 face=\"courier\">
     264        SQL:<br>
     265        ".str_replace(" ", "&nbsp;", 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 */
     285function 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 */
     325function 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 */
     370function 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}
    234380
    235381?>
     382
  • trunk/tools/database/www/Odin32WAI.phtml

    r3877 r3883  
    195195
    196196        TekstBeg();
    197         $sql = sprintf("SELECT  UPPER(d.name)  AS name
     197        $sql = sprintf("SELECT  UPPER(d.name)  AS name,
     198                                refcode
    198199                        FROM    dll d,
    199200                                tgroupdll t
     
    209210            {
    210211                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"]);
    212213                LocLink($lnk, "here");
    213214                printf(".<BR>\n");
     
    283284
    284285
    285         PodNaslov("Implementation Status:");
     286        PodNaslov("Implementation Status All Dlls:");
    286287        $sql = "SELECT  name,
    287288                        refcode
     
    295296            while ($dll = @mysql_fetch_array($result))
    296297                Odin32DBCompletionBar($dll["refcode"], $dll["name"],  $db);
     298
     299            Odin32DBCompletionBar(-1, "Total",  $db);
    297300        }
    298301        else
Note: See TracChangeset for help on using the changeset viewer.