Ignore:
Timestamp:
08/20/09 14:43:59 (15 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/ctamcinfo.php

    r9486 r9498  
    11<?php
    22{
    3     function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs, $timelimits)
     3    function CreateQuery($alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs, $timelimits)
    44    {
    55        $fromtable="MCRunData";
     
    1515                $statusgroups++;
    1616
    17         $query0 = "SELECT ";
     17        $query0 = "SELECT SQL_CALC_FOUND_ROWS ";
    1818
    1919        if ($groups>0 || $statusgroups>0)
     
    204204
    205205        if (empty($_GET["fNumStart"]))
    206             $_GET["fNumStart"]=0;
     206            $start=0;
     207        else
     208            $start=$_GET["fNumStart"];
    207209
    208210        if (empty($_GET["fSendTxt"]))
    209             $query0 .= " LIMIT " . $_GET["fNumStart"] . ", " . $_GET["fNumResults"];
     211            $query0 .= " LIMIT " . $start . ", " . $_GET["fNumResults"];
    210212
    211213        return $query0;
    212214    }
    213215
    214     function InitGet($_GET)
     216    function InitGet()
    215217    {
    216218        // Find out whether it is the first call to the php script
     
    220222    }
    221223
    222     function PrintForm($_GET, $host, $user, $pw, $db)
     224    function PrintForm($host, $user, $pw, $db)
    223225    {
    224226        printf("<center>\n");
     
    279281        mysql_query("SET BIG_TABLES=1"); // necessary for mySQL <= 4
    280282
    281         $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs, $timelimits);
     283        $query0 = CreateQuery($alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs, $timelimits);
    282284
    283285        $result0 = mysql_query($query0, $db_id);
     286        $result1 = mysql_query("SELECT FOUND_ROWS()", $db_id);
    284287
    285288        if ($result0)
    286289        {
    287290            if ($html=="1" || $html=="2")
    288                 PrintMagicTable($result0, $alias, $rightalign, "", "", "", "", $_GET);
     291                PrintMagicTable($result0, $alias, $rightalign, "", "", "", $result1);
    289292            else
    290293                PrintText($result0);
    291294
    292295            mysql_free_result($result0);
     296            mysql_free_result($result1);
    293297        }
    294298        mysql_close($db_id);
     
    298302
    299303    include ("include.php");
    300     include ("db.php");
     304    include ("db2.php");
    301305    include ("menu.php");
    302306    include ("ctadefs.php");
     
    319323        $environment = sizeof($_GET);
    320324
    321         InitGet($_GET);
     325        InitGet();
    322326        if (empty($_GET["fPrintTable"]))
    323             PrintForm($_GET, $host, $user, $pw, $db);
     327            PrintForm($host, $user, $pw, $db);
    324328
    325329        if ($environment==0)
Note: See TracChangeset for help on using the changeset viewer.