smart_render_action_results(smart_process_action_form($my_sql['result_actions']), $my_sql['result_actions']['resulttitle']);
smart_search_form($my_sql);
$my_sql['sql_config'] = array('TimeOut' => 60);
if (smart_process_mysql_form($my_sql)) {
    if ($export_data) {
        unset($my_sql['key']["companyname"]);
        $my_sql['return']["01|Company"] = array("source" => "cd.companyname", "column" => "companyname");
        $my_sql['return']["21|Type"] = array("source" => "td.cardtype", "column" => "cardtype");
        $my_sql['return']["22|OriginalTransDate"] = array("source" => "td.transactionDate", "column" => "transactionDate");
        $my_sql['return']["23|BankTransID"] = array("source" => "td.td_bank_transaction_id", "column" => "td_bank_transaction_id");
        if ($export_data == 'summary') {
            $my_sql['skip_query'] = true;
        }
        if ($export_data == 'transaction') {
            $my_sql['skip_subquery'] = true;
            $export_subname = '';
        }
        ob_clean();
        $filename = 'Export' . $export_subname . '.csv';
        header('Content-type: application/vnd.ms-excel');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        flush();
    }
    $result = smart_search($my_sql);
    if ($export_data) {
        smart_render_export($result, $my_sql);
        die;
    }
    smart_render_results($result, $my_sql);
}
include "includes/footer.php";
示例#2
0
 $my_sql['subquery']['queries']['01|Approved'] = array("name" => "amount_approved", "source" => "SUM(td.amount)", 'linkadd' => '&frm_td_status%5B%5D=A');
 //$my_sql['subquery']['queries']['02|Transactions'] = array("name"=>"number_transactions", "source" => "COUNT(td.amount)","hidden"=>1);
 $sizefactor = 1;
 if ($style == 'minimal') {
     $sizefactor = 0.5;
 }
 if ($style == 'tiny') {
     $sizefactor = 0.25;
 }
 if ($style == 'full') {
     $my_sql['subquery']['queries']['06|Rebills'] = array("name" => "amount_rebilled", "source" => "SUM(if(td.td_is_a_rebill = 1,td.amount,0))", 'linkadd' => '&frm_td_td_is_a_rebill%5B%5D=1');
     $my_sql['subquery']['queries']['07|New Sales'] = array("name" => "amount_newsales", "source" => "SUM(if(td.td_is_a_rebill = 0,td.amount,0))", 'linkadd' => '&frm_td_td_is_a_rebill%5B%5D=0');
 }
 $my_sql['where']['td.transactionDate'] = array("value" => "'" . date('Y-m-01 00:00:00', time() + 60 * 60 * 24 * (30 * -$monthsback)) . "' and '" . date('Y-m-01 00:00:00', time() + 60 * 60 * 24 * (30 * (1 - $monthsback))) . "'", "compare" => "between");
 $my_sql['where']['td.status'] = array("value" => "'A'", "compare" => "=");
 $daily = smart_search($my_sql);
 for ($i = 1; $i <= $daysinmonth; $i++) {
     $key = str_pad($i, 2, '0', STR_PAD_LEFT);
     if (!$daily['sub_row'][$key]) {
         $daily['sub_row'][$key] = array();
     }
 }
 ksort($daily['sub_row']);
 //etelPrint($daily['sub_row']);etelDie();
 $w = 600;
 $h = 200;
 if ($style == 'tiny') {
     $w = 300;
     $h = 150;
 } else {
     if ($style == 'full') {
示例#3
0
$my_sql['title'] = "Report Lookup";
$my_sql['pairs']['ResultsPerPage'] = array(array("display" => "50", "value" => "50"), array("display" => "25", "value" => "25"), array("display" => "10", "value" => "10"), array("display" => "100", "value" => "100"), array("display" => "All", "value" => "1000"));
$my_sql['pairs']['Company_Search_By'] = array(array("display" => "Company Name", "value" => "cn"), array("display" => "Reference ID", "value" => "ri"), array("display" => "Login UserName", "value" => "un"), array("display" => "Contact Email", "value" => "em"), array("display" => "Website Name", "value" => "wn"), array("display" => "Website Reference ID", "value" => "wr"), array("display" => "Merchant ID (List)", "value" => "id"));
/****************
Process and Render Forms
****************/
smart_search_form($my_sql);
if (smart_process_mysql_form($my_sql)) {
    $results = smart_search($my_sql);
    $report = new risk_report_main($_POST['frm_custom_report']);
    $company_ids = array();
    foreach ($results['rows'] as $key => $values) {
        foreach ($values as $index => $value) {
            $company_ids[] = $value['rc_company_id'];
        }
    }
    unset($my_sql['limit']);
    unset($my_sql['return']);
    unset($my_sql['subquery']);
    $my_sql['return']["00|Company Id"] = array("source" => "r.rc_company_id", "column" => "rc_company_id", "hidden" => 1);
    $results = smart_search($my_sql, true);
    foreach ($results['rows'] as $key => $values) {
        foreach ($values as $index => $value) {
            $all_company_ids[] = $value['rc_company_id'];
        }
    }
    echo sizeof($all_company_ids) . " companies in summary.<br>";
    $report->display_summary_report($all_company_ids);
    $report->display_risk_report($company_ids);
}
include "includes/footer.php";
示例#4
0
****************/
smart_search_form($my_sql);
if (smart_process_mysql_form($my_sql)) {
    $results = smart_search($my_sql);
    $company_ids = array();
    foreach ($results['rows'] as $key => $values) {
        foreach ($values as $index => $value) {
            $company_ids[] = $value['rc_company_id'];
        }
    }
    $sql_limit = $my_sql['limit'];
    unset($my_sql['limit']);
    unset($my_sql['return']);
    unset($my_sql['subquery']);
    $my_sql['return']["00|Company Id"] = array("source" => "r.rc_company_id", "column" => "rc_company_id", "hidden" => 1);
    $results = smart_search($my_sql, false);
    foreach ($results['rows'] as $key => $values) {
        foreach ($values as $index => $value) {
            $all_company_ids[] = $value['rc_company_id'];
        }
    }
    $_SESSION['summary_company_id'] = $all_company_ids;
    $_SESSION['custom_report'] = $_POST['frm_custom_report'];
    beginTable();
    echo sizeof($all_company_ids) . " companies in summary.<br>";
    ?>
	<iframe src="risk_summary.php" width='500px' height='400px' frameborder="0"></iframe>
<?php 
    endTable("Report Summary");
    beginTable();
    $curr_offset = $_POST["frm_" . $sql_limit['offset_source']];