Exemple #1
0
    function get_top_nav_records_count($urlParamMap, $default_params, $table)
    {
        $where_filters = array();
        foreach ($urlParamMap as $param => $value) {
            if (_getRequestParamValue($param) != null) {
                $where_filters[] = _widget_build_sql_condition(' a1.' . $value, _getRequestParamValue($param));
            }
        }
        foreach ($default_params as $param => $value) {
            $where_filters[] = _widget_build_sql_condition(' a1.' . $param, $value);
        }
        if (count($where_filters) > 0) {
            $where_filter = ' where ' . implode(' and ', $where_filters);
        }
        $sql = 'select count(*) count
				    from ' . $table . ' a1
				   ' . $where_filter;
        $data = _checkbook_project_execute_sql($sql);
        return $data[0]['count'];
    }
Exemple #2
0
    static function getCurrentSubMWBEApplicableFilters($domain)
    {
        switch ($domain) {
            case "spending":
                $table = "aggregateon_subven_spending_coa_entities";
                $urlParamMap = array("year" => "year_id", "yeartype" => "type_of_year", "agency" => "agency_id", "subvendor" => "vendor_id", "vendor" => "prime_vendor_id", "category" => "spending_category_id");
                $where_filters = array();
                foreach ($urlParamMap as $param => $value) {
                    if (_getRequestParamValue($param) != null) {
                        $where_filters[] = _widget_build_sql_condition(' a1.' . $value, _getRequestParamValue($param));
                    }
                }
                if (count($where_filters) > 0) {
                    $where_filter = ' where ' . implode(' and ', $where_filters);
                }
                $sql = 'select a1.minority_type_id
				    from ' . $table . ' a1
				   ' . $where_filter . '
				    group by a1.minority_type_id  ';
                $data = _checkbook_project_execute_sql($sql);
                break;
            case "contracts":
                $table = "aggregateon_subven_contracts_cumulative_spending";
                $urlParamMap = array("year" => "fiscal_year_id", "agency" => "agency_id", "yeartype" => "type_of_year", "awdmethod" => "award_method_id", "vendor" => "prime_vendor_id", "subvendor" => "vendor_id", "status" => "status_flag", "csize" => "award_size_id", "cindustry" => "industry_type_id");
                $where_filters = array();
                foreach ($urlParamMap as $param => $value) {
                    if (_getRequestParamValue($param) != null) {
                        $where_filters[] = _widget_build_sql_condition(' a1.' . $value, _getRequestParamValue($param));
                    }
                }
                if (count($where_filters) > 0) {
                    $where_filter = ' where ' . implode(' and ', $where_filters);
                }
                //$where_filter .= ' and rd.document_code in (' . ContractUtil::getCurrentPageDocumentIds() . ') ';
                $sql = 'select a1.minority_type_id
				    from {' . $table . '} a1
	    				join {ref_document_code} rd on a1.document_code_id = rd.document_code_id
				   ' . $where_filter . '
				    group by a1.minority_type_id';
                $data = _checkbook_project_execute_sql($sql);
                break;
        }
        $applicable_minority_types = array();
        foreach ($data as $row) {
            $applicable_minority_types[] = $row['minority_type_id'];
        }
        return $applicable_minority_types;
    }