Пример #1
0
function intSetReport(&$smarty)
{
    $do_empty = TRUE;
    $smarty->assign("show_report", TRUE);
    $conds = collectConditions();
    $report_helper = new ReportHelper();
    $req = new GetCreditChanges($conds, $report_helper->getFrom(), $report_helper->getTo(), $report_helper->getOrderBy(), $report_helper->getDesc());
    $resp = $req->sendAndRecv();
    if ($resp->isSuccessful()) {
        $result = $resp->getResult();
        $report = $result["report"];
        $total_rows = $result["total_rows"];
        $total_per_user_credit = $result["total_per_user_credit"];
        $total_admin_credit = $result["total_admin_credit"];
        $do_empty = FALSE;
    } else {
        $resp->setErrorInSmarty($smarty);
    }
    if ($do_empty) {
        $report = array();
        $total_rows = 0;
        $total_per_user_credit = 0;
        $total_admin_credit = 0;
    }
    $smarty->assign_by_ref("report", $report);
    $smarty->assign("total_rows", $total_rows);
    $smarty->assign("total_per_user_credit", $total_per_user_credit);
    $smarty->assign("total_admin_credit", $total_admin_credit);
}
function intSetReport(&$smarty)
{
    $do_empty = TRUE;
    if (isInRequest("show")) {
        $conds = collectConditions();
        $report_helper = new ReportHelper(0, 30, "add_date", TRUE);
        $req = new SearchAddUserSaves($conds, $report_helper->getFrom(), $report_helper->getTo(), $report_helper->getOrderBy(), $report_helper->getDesc());
        $resp = $req->sendAndRecv();
        if ($resp->isSuccessful()) {
            $result = $resp->getResult();
            $report = $result["result"];
            $total_rows = $result["total_rows"];
            $do_empty = FALSE;
        } else {
            $resp->setErrorInSmarty($smarty);
        }
    }
    if ($do_empty) {
        $report = array();
        $total_rows = 0;
    }
    $smarty->assign_by_ref("results", $report);
    $smarty->assign("total_rows", $total_rows);
}