Example #1
0
/**
 * getData: Outputs data to client
 *
 * @author    Ing. Jozef Sakáloš <jsakalos@aariadne.com>
 * @date      31. March 2008
 * @return    void
 * @param     PDO $osql
 */
function getData($osql)
{
    global $objects;
    $params = $objects[$_REQUEST["objName"]];
    $params["start"] = isset($_REQUEST["start"]) ? $_REQUEST["start"] : null;
    $params["limit"] = isset($_REQUEST["limit"]) ? $_REQUEST["limit"] : null;
    $params["search"] = isset($_REQUEST["fields"]) ? json_decode($_REQUEST["fields"]) : null;
    $params["query"] = isset($_REQUEST["query"]) ? $_REQUEST["query"] : null;
    $params["sort"] = isset($_REQUEST["sort"]) ? $_REQUEST["sort"] : null;
    $params["dir"] = isset($_REQUEST["dir"]) ? $_REQUEST["dir"] : null;
    $response = array("success" => true, "totalCount" => $osql->getCount($params), "rows" => $osql->getData($params));
    $osql->output($response);
}
Example #2
0
/**
 * getData: Outputs data to client
 *
 * @author    Ing. Jozef Sakáloš <jsakalos@aariadne.com>
 * @date      31. March 2008
 * @return    void
 * @param     PDO $osql
 */
function getData($osql)
{
    global $objects;
    $params = $objects[$_REQUEST["objName"]];
    $params["start"] = isset($_REQUEST["start"]) ? $_REQUEST["start"] : null;
    $params["limit"] = isset($_REQUEST["limit"]) ? $_REQUEST["limit"] : null;
    $params["search"] = isset($_REQUEST["fields"]) ? json_decode($_REQUEST["fields"]) : null;
    $params["query"] = isset($_REQUEST["query"]) ? $_REQUEST["query"] : null;
    $params["sort"] = isset($_REQUEST["sort"]) ? $_REQUEST["sort"] : null;
    $params["dir"] = isset($_REQUEST["dir"]) ? $_REQUEST["dir"] : null;
    // next line necessary for Ext 3 as it doesn't send start currently (27. April 2009)
    $params["start"] = $params["start"] ? $params["start"] : 0;
    $response = array("success" => true, "totalCount" => $osql->getCount($params), "rows" => $osql->getData($params));
    $osql->output($response);
}