Ejemplo n.º 1
0
        $db->query("SELECT COUNT(*) as total from SupportParts where " . $query);
        $db->next_record();
        if ($db->f("total") < $q->start_row - $q->row_count) {
            $q->start_row = $db->f("total") - $q->row_count;
        }
        if ($q->start_row < 0) {
            $q->start_row = 0;
        }
        if (!$sortorder) {
            $sortorder = "id";
        }
        $query .= " LIMIT " . $q->start_row . "," . $q->row_count;
        // In any case we must display that form now. Note that the
        // "x" here and in the call to $q->where must match.
        // Tag everything as a CSS "query" class.
        printf($q->form("x", $t->map_cols, "query"));
        printf("<hr>");
        // if (!$query) { $query="id!='0'"; }
        // Do we have a valid query string?
        if ($query) {
            // Show that condition
            printf("Query Condition = %s<br>\n", $query);
            // Do that query
            $db->query("select * from SupportParts where " . $query);
            // Dump the results (tagged as CSS class default)
            printf("Query Results = %s<br>\n", $db->num_rows());
            $t->show_result($db, "default");
        }
}
// switch $cmd
page_close();
Ejemplo n.º 2
0
            $sortorder = "Created";
        }
        $query .= " group by id order by {$sortorder}";
        #$query .= " LIMIT ".$q->start_row.",".$q->row_count;
        $query .= " LIMIT 0,100";
        echo "<input name=total value={$total} type=hidden>\n</form>\n";
        // In any case we must display that form now. Note that the
        // "x" here and in the call to $q->where must match.
        // Tag everything as a CSS "query" class.
        //  printf($q->form("x", $t->map_cols, "query"));
        printf("<hr>");
        // if (!$query) { $query="id!='0'"; }
        // Do we have a valid query string?
        if ($query) {
            // Show that condition
            if ($perm->have_perm("admin")) {
                printf("Query Condition = %s<br>\n", $query);
            }
            // Do that query
            $db->query("select SupportTickets.*, MAX(SupportComments.TimeStamp) as Updated \n\t\tfrom SupportTickets LEFT JOIN (SupportComments) on (SupportComments.TicketNo=SupportTickets.id)\n\t\twhere " . $query);
            // Dump the results (tagged as CSS class default)
            printf("Query Results = %s of %s<br>\n", $db->num_rows(), $total);
            $t->show_result($db, "default");
        }
}
// switch $cmd
echo "</table>";
echo "</td></tr></table>\n";
//  echo "<hr>\n";
//  $cart->show_all();
page_close();