drupal_add_js(drupal_get_path('module', 'widget_highstock') . '/highstock-globals.js');
    }
}
?>

<?php 
echo eval($node->widgetConfig->header);
$table_rows = array();
$viewAll = $_REQUEST['viewall'];
$url_path = drupal_get_path_alias($_GET['q']);
$path_params = explode('/', $url_path);
if (in_array("year", $path_params)) {
    $yr_index = array_search("year", $path_params);
    $req_year_id = $path_params[$yr_index + 1];
} else {
    $req_year_id = _getCurrentYearID();
}
$years = array();
foreach ($node->data as $row) {
    $years[$row['year_year_year_value']] = $row['year_year_year_value'];
}
asort($years);
?>
<h2><?php 
echo $node->widgetConfig->table_title;
?>
</h2>
<div class="dataTable dynamicColumns">

<table id="table_<?php 
echo widget_unique_identifier($node);
//Main table header
$tbl['header']['title'] = "<div class='tableHeader'><h3>Prime Vendor Information</h3> <span class='contCount'>Number of Prime Vendors: " . count($node->vendors_list) . " </span></div>";
$tbl['header']['columns'] = array(array('value' => WidgetUtil::generateLabelMappingNoDiv("prime_vendor_name"), 'type' => 'text'), array('value' => $node->widget_count_label, 'type' => 'number'), array('value' => WidgetUtil::generateLabelMappingNoDiv("spent_to_date"), 'type' => 'number'), array('value' => WidgetUtil::generateLabelMappingNoDiv("prime_vendor_address"), 'type' => 'text'));
$vendor_cont_count = array();
foreach ($node->vendor_contracts_count as $vendor_cont) {
    $vendor_cont_count[$vendor_cont['vendor_id']]['count'] = $vendor_cont['count'];
    $vendor_cont_count[$vendor_cont['vendor_id']]['count'] = $vendor_cont['count'];
}
$count = 0;
if (count($node->vendors_list) > 0) {
    foreach ($node->vendors_list as $vendor) {
        $spending_link = "/spending/transactions/vendor/" . $vendor['vendor_id'] . "/datasource/checkbook_oge/newwindow";
        if (preg_match("/newwindow/", $_GET['q'])) {
            $vendor_name = $vendor['vendor_name'];
        } else {
            $vendor_name = "<a href='/contracts_landing/status/A/year/" . _getCurrentYearID() . "/yeartype/B/agency/" . $vendor['agency_id'] . "/datasource/checkbook_oge/vendor/" . $vendor['vendor_id'] . "?expandBottomCont=true'>" . $vendor['vendor_name'] . "</a>";
        }
        $spent_to_date_value = custom_number_formatter_format($vendor['check_amount_sum'], 2, '$');
        if (preg_match("/newwindow/", $_GET['q'])) {
            $spent_to_date_link = custom_number_formatter_format($vendor['check_amount_sum'], 2, '$');
        } else {
            $spent_to_date_link = "<a class='new_window' target='_new' href='" . $spending_link . "'>" . custom_number_formatter_format($vendor['check_amount_sum'], 2, '$') . "</a>";
        }
        //Main table columns
        $tbl['body']['rows'][$count]['columns'] = array(array('value' => $vendor_name, 'type' => 'text'), array('value' => $vendor_cont_count[$vendor['vendor_id']]['count'], 'type' => 'number'), array('value' => $spent_to_date_value, 'type' => 'number_link', 'link_value' => $spent_to_date_link), array('value' => $vendor['address'], 'type' => 'text'));
        $count++;
    }
}
$html = WidgetUtil::generateTable($tbl);
echo $html;
?>
if ($node->data[0]["vendor_id"]) {
    $queryVendorCount = "SELECT COUNT(*) AS total_contracts_sum FROM {agreement_snapshot} WHERE latest_flag= 'Y' AND vendor_id =" . $node->data[0]["vendor_id"];
    $results2 = _checkbook_project_execute_sql($queryVendorCount);
    foreach ($results2 as $row) {
        $total_cont += $row['total_contracts_sum'];
    }
    $vendor_link = '/contracts_landing/status/A/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_id'] . '?expandBottomCont=true';
    if ($node->data[0]["mwbe_vendor"] == "Yes") {
        $vendor_link = '/contracts_landing/status/A/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_id'] . '/dashboard/mp?expandBottomCont=true';
    }
} else {
    $total_cont = 0;
    if ($node->data[0]['document_code'] == 'RCT1') {
        $vendor_link = '/contracts_pending_rev_landing/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_vendor'] . '?expandBottomCont=true';
    } else {
        $vendor_link = '/contracts_pending_exp_landing/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_vendor'] . '?expandBottomCont=true';
    }
}
?>
  <ul class="left">
    <li><span class="gi-list-item">Prime Vendor:</span> <a href="<?php 
echo $vendor_link;
?>
 " ><?php 
echo $node->data[0]['vendor_name'];
?>
</a></li>
  <?php 
$address = $node->data[0]['address_line_1'];
$address .= " " . $node->data[0]['address_line_2'];
$address .= " " . $node->data[0]['city'];
Exemple #4
0
* 
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
* 
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$budget_parameter_mapping = _checkbook_smart_search_domain_fields('budget');
$linkable_fields = array("agency_name" => "/budget/year/" . _getCurrentYearID() . "/yeartype/B/agency/" . $budget_results["agency_id"], "expenditure_object_name" => "/budget/year/" . _getCurrentYearID() . "/yeartype/B/expcategory/" . $budget_results["expenditure_object_id"]);
if ($budget_results['fiscal_year'][0] < 2010) {
    $linkable_fields = array();
}
$amount_fields = array("adopted_amount", "current_budget_amount", "total_expenditure", "pre_encumbered_amount", "encumbered_amount", "accrued_expense_amount", "cash_expense_amount", "post_closing_adjustment_amount");
$count = 1;
$row = array();
$rows = array();
foreach ($budget_parameter_mapping as $key => $title) {
    $value = $budget_results[$key];
    if ($key == 'expenditure_object_name') {
        $value = $budget_results[$key][0];
    }
    if ($key == 'fiscal_year') {
        $value = $budget_results[$key][0];
    }
Exemple #5
0
 static function getLandingPageUrl($domain, $year = null, $yearType = null)
 {
     if ($year == null) {
         $year = _getCurrentYearID();
     }
     if ($yearType == null) {
         $yearType = 'B';
     }
     switch ($domain) {
         case "contracts":
             $path = "contracts_landing/status/A/yeartype/" . $yearType . "/year/" . $year;
             break;
         case "spending":
             $path = "spending_landing/yeartype/" . $yearType . "/year/" . $year;
             break;
         case "payroll":
             $path = "payroll/yeartype/B/year/" . $year;
             break;
         case "budget":
             $path = "budget/yeartype/B/year/" . $year;
             break;
         case "revenue":
             $path = "revenue/yeartype/B/year/" . $year;
             break;
     }
     return $path;
 }
if (_getRequestParamValue("datasource") == "checkbook_oge") {
    $datasource = "/datasource/checkbook_oge";
    $oge_class = "oge-ca-details";
} else {
    $oge_class = "cb-ca-details";
}
if (_getRequestParamValue("doctype") == "RCT1") {
    $vendor_link = '/contracts_revenue_landing' . $status . '/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_id_checkbook_vendor_history'] . '?expandBottomCont=true';
    $agency_link = '/contracts_revenue_landing' . $status . '/year/' . _getCurrentYearID() . $datasource . '/yeartype/B/agency/' . $node->data[0]['agency_id_checkbook_agency'] . '?expandBottomCont=true';
} else {
    if (_is_mwbe_vendor(_getRequestParamValue("agid"))) {
        $vendor_link = '/contracts_landing' . $status . '/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_id_checkbook_vendor_history'] . '/dashboard/mp?expandBottomCont=true';
    } else {
        $vendor_link = '/contracts_landing' . $status . '/year/' . _getCurrentYearID() . '/yeartype/B/vendor/' . $node->data[0]['vendor_id_checkbook_vendor_history'] . '?expandBottomCont=true';
    }
    $agency_link = '/contracts_landing' . $status . '/year/' . _getCurrentYearID() . $datasource . '/yeartype/B/agency/' . $node->data[0]['agency_id_checkbook_agency'] . '?expandBottomCont=true';
}
$spending_link = "/spending/transactions/agid/" . _getRequestParamValue("agid") . $datasource . "/newwindow";
if (_getRequestParamValue("datasource") != "checkbook_oge") {
    $contract_number = $node->data[0]['contract_number'];
    $querySubVendorCount = "SELECT  COUNT(DISTINCT vendor_id) AS sub_vendor_count  FROM sub_agreement_snapshot\n                            WHERE contract_number = '" . $contract_number . "'\n                            AND latest_flag = 'Y'\n                            LIMIT 1";
    $results3 = _checkbook_project_execute_sql_by_data_source($querySubVendorCount, _get_current_datasource());
    $res->data = $results3;
    $total_subvendor_count = $res->data[0]['sub_vendor_count'];
}
?>
<div class="contract-details-heading <?php 
echo $oge_class;
?>
">
  <div class="contract-id">
    <h4>
        Sub Vendor Information
    </h4>
    <div class="spent-to-date">
        <?php 
    if (!preg_match('/newwindow/', $_GET['q'])) {
        ?>
        <a class="new_window" href="/contract/spending/transactions/contnum/<?php 
        echo $contract_number;
        echo $status;
        ?>
/dashboard/ss/yeartype/B/year/<?php 
        echo _getCurrentYearID();
        ?>
/syear/<?php 
        echo _getCurrentYearID();
        ?>
/smnid/721/newwindow"><?php 
        echo custom_number_formatter_format($total_spent_todate, 2, "\$");
        ?>
</a>
        <?php 
    } else {
        echo custom_number_formatter_format($total_spent_todate, 2, "\$");
        ?>
        <?php 
    }
    ?>
        <div class="amount-title">Total Spent
            to Date
        </div>
Exemple #8
0
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
* 
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$spending_parameter_mapping = _checkbook_smart_search_domain_fields('spending', $IsOge);
if ($spending_results['fiscal_year_id'] != '') {
    $fiscal_year_id = $spending_results['fiscal_year_id'][0];
} else {
    $fiscal_year_id = _getCurrentYearID();
}
if ($IsOge) {
    $linkable_fields = array("oge_agency_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . '/datasource/checkbook_oge' . "/year/" . _getFiscalYearID() . "/yeartype/B/agency/" . $spending_results["agency_id"], "vendor_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . '/datasource/checkbook_oge' . '/agency/' . $spending_results['agency_id'] . "/year/" . _getFiscalYearID() . "/yeartype/B/vendor/" . $spending_results["vendor_id"]);
} else {
    if ($spending_results['spending_category_name'] == 'Payroll') {
        $linkable_fields = array("agency_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/agency/" . $spending_results["agency_id"], "vendor_name" => $spending_results['vendor_name']);
    } elseif ($spending_results['vendor_id'] == 1) {
        $linkable_fields = array("agency_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/agency/" . $spending_results["agency_id"], "vendor_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/vendor/" . $spending_results["vendor_id"]);
    } elseif ($spending_results['is_prime_or_sub'] == 'Yes' && SpendingUtil::getLatestMwbeCategoryBySpendingVendorByTransactionYear($spending_results["vendor_id"], $fiscal_year_id, 'B') == '') {
        $linkable_fields = array("agency_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/agency/" . $spending_results["agency_id"], "vendor_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/subvendor/" . $spending_results["vendor_id"] . "/dashboard/ss");
    } elseif ($spending_results['is_prime_or_sub'] == 'No' && SpendingUtil::getLatestMwbeCategoryBySpendingVendorByTransactionYear($spending_results["vendor_id"], $fiscal_year_id, 'B') != '') {
        $linkable_fields = array("agency_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/agency/" . $spending_results["agency_id"], "vendor_name" => "/spending_landing/yeartype/B/year/" . $fiscal_year_id . "/category/" . $spending_results['spending_category_id'] . "/mwbe/2~3~4~5~9/dashboard/mp/vendor/" . $spending_results["vendor_id"]);
    } elseif ($spending_results['is_prime_or_sub'] == 'Yes' && SpendingUtil::getLatestMwbeCategoryBySpendingVendorByTransactionYear($spending_results["vendor_id"], $fiscal_year_id, 'B') != '') {
        $linkable_fields = array("agency_name" => "/spending_landing/category/" . $spending_results['spending_category_id'] . "/year/" . $fiscal_year_id . "/yeartype/B/agency/" . $spending_results["agency_id"], "vendor_name" => "/spending_landing/yeartype/B/year/" . $fiscal_year_id . "/category/" . $spending_results['spending_category_id'] . "/mwbe/2~3~4~5~9/dashboard/ms/subvendor/" . $spending_results["vendor_id"]);
    } else {
Exemple #9
0
 /**
  * Returns Prime Vendor Name Link Url based on values from current path & data row.
  * This is for the advanced search page, if no year is provided, we use the current year
  *
  * @param $node
  * @param $row
  * @return string
  */
 static function getPayeeNameLinkUrl($node, $row)
 {
     $year = _getRequestParamValue("year");
     $calyear = _getRequestParamValue("calyear");
     $year_type = isset($calyear) ? "C" : "B";
     $year_id = isset($calyear) ? $calyear : (isset($year) ? $year : _getCurrentYearID());
     $vendor_id = $row["vendor_id"];
     $agency_id = $row["agency_id"];
     $dashboard = _getRequestParamValue("dashboard");
     return $row["is_sub_vendor"] == "No" ? self::getPrimeVendorLink($vendor_id, $agency_id, $year_id, $year_type, $dashboard, true) : self::getSubVendorLink($vendor_id, $agency_id, $year_id, $year_type, $dashboard, true);
 }
Exemple #10
0
$rows = array();
foreach ($revenue_parameter_mapping as $key => $title) {
    $value = $revenue_results[$key];
    if ($key == 'fiscal_year') {
        $value = $revenue_results[$key][0];
    }
    if (strpos(strtoupper($value), strtoupper($SearchTerm)) !== FALSE) {
        $temp = substr($value, strpos(strtoupper($value), strtoupper($SearchTerm)), strlen($SearchTerm));
        $value = str_ireplace($SearchTerm, '<em>' . $temp . '</em>', $value);
        $value = _checkbook_smart_search_str_html_entities($value);
    }
    if (in_array($key, $amount_fields)) {
        $value = custom_number_formatter_format($value, 2, '$');
    } else {
        if (array_key_exists($key, $linkable_fields)) {
            $value = "<a href='/revenue/year/" . _getCurrentYearID() . $linkable_fields[$key] . "'>" . $value . "</a>";
        }
    }
    if ($count % 2 == 0) {
        if ($title) {
            $row[] = '<div class="field-label">' . $title . ':</div><div class="field-content">' . $value . '</div>';
        }
        $rows[] = $row;
        $row = array();
    } else {
        if ($title) {
            $row[] = '<div class="field-label">' . $title . ':</div><div class="field-content">' . $value . '</div>';
        }
    }
    $count++;
}
Exemple #11
0
 private function generate_field(Field $field, $form, $data_source)
 {
     $domain = $data_source . '_' . $this->domain_name;
     $year_range = "'-" . (date("Y") - 1900) . ":+" . (2500 - date("Y")) . "'";
     $column_left_class = "column column-left " . str_replace('_', '-', $data_source);
     $column_right_class = "column column-right " . str_replace('_', '-', $data_source);
     switch ($field->field_coordinates) {
         case 1:
             $field->prefix = '<div class="' . $column_left_class . '">';
             break;
         case 2:
             $field->suffix = '</div>';
             break;
         case 3:
             $field->prefix = '<div class="' . $column_right_class . '">';
             break;
         case 4:
             $field->suffix = '</div>';
             break;
     }
     switch ($field->field_type) {
         case FieldType::DateFilter:
             //date_filter
             $domain_field = "{$data_source}_{$this->domain_name}_date_filter";
             //$domain_field = 'date_filter';
             $form[$domain][$domain_field]['#type'] = FieldType::RadioButtons;
             $form[$domain][$domain_field]['#title'] = t('Date Filter');
             $form[$domain][$domain_field]['#options'] = array('Year', 'Issue Date');
             $form[$domain][$domain_field]['#prefix'] = $field->prefix . '<div class="datafield datefilter clearfix">';
             $form[$domain][$domain_field]['#suffix'] = '</div>';
             $form[$domain][$domain_field]['#attributes'] = array('class' => array('watch'));
             $form[$domain][$domain_field]['#default_value'] = '';
             //year_filter_start
             //$domain_field = 'year_filter_start';
             $domain_field = "{$data_source}_{$this->domain_name}_year_filter_start";
             $form[$domain][$domain_field]['#markup'] = '<div class="datafield year-filters last-item">';
             //issue_date_from
             //$domain_field = "{$this->domain_name}_issue_date_from";
             $domain_field = "{$data_source}_{$this->domain_name}_issue_date_from";
             $form[$domain][$domain_field]['#type'] = FieldType::DatePopup;
             $form[$domain][$domain_field]['#date_format'] = 'Y-m-d';
             $form[$domain][$domain_field]['#date_year_range'] = $year_range;
             $form[$domain][$domain_field]['#prefix'] = '<div class="datafield datarange issueddate"><div class="ranges">';
             $form[$domain][$domain_field]['#default_value'] = '';
             //                //Hidden Field
             //                $domain_field = "{$data_source}_{$this->domain_name}_issue_date_from_exact";
             //                $form[$domain][$domain_field]['#type'] = FieldType::HiddenField;
             //                $form[$domain][$domain_field]['#name'] = $domain_field;
             //issue_date_to
             //$domain_field = "{$this->domain_name}_issue_date_to";
             $domain_field = "{$data_source}_{$this->domain_name}_issue_date_to";
             $form[$domain][$domain_field]['#type'] = FieldType::DatePopup;
             $form[$domain][$domain_field]['#title'] = t('to');
             $form[$domain][$domain_field]['#date_format'] = 'Y-m-d';
             $form[$domain][$domain_field]['#date_year_range'] = $year_range;
             $form[$domain][$domain_field]['#suffix'] = '</div></div>';
             $form[$domain][$domain_field]['#default_value'] = '';
             //Hidden Field
             //                $domain_field = "{$data_source}_{$this->domain_name}_issue_date_to_exact";
             //
             //                $form[$domain][$domain_field]['#type'] = FieldType::HiddenField;
             //                $form[$domain][$domain_field]['#name'] = $domain_field;
             //fiscal_year
             //$domain_field = "{$this->domain_name}_fiscal_year";
             $domain_field = "{$data_source}_{$this->domain_name}_fiscal_year";
             $form[$domain][$domain_field]['#type'] = FieldType::DropDown;
             $form[$domain][$domain_field]['#options'] = _checkbook_advanced_search_get_year($this->domain_name, $data_source);
             $form[$domain][$domain_field]['#default_value'] = 'fy~' . _getCurrentYearID();
             $form[$domain][$domain_field]['#attributes'] = array('class' => array('watch'), 'default_selected_value' => 'fy~' . _getCurrentYearID());
             $form[$domain][$domain_field]['#prefix'] = '<div class="datafield year">';
             $form[$domain][$domain_field]['#suffix'] = '</div>';
             //year_filter_end
             // $domain_field = 'year_filter_end';
             $domain_field = "{$data_source}_{$this->domain_name}_year_filter_end";
             if (!is_null($field->suffix)) {
                 $form[$domain][$domain_field]['#markup'] = '</div>' . $field->suffix;
             } else {
                 $form[$domain][$domain_field]['#markup'] = '</div>';
             }
             break;
         case FieldType::DropDown:
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}";
             if (!is_null($field->prefix)) {
                 $form[$domain][$domain_field]['#prefix'] = $field->prefix;
             }
             if (!is_null($field->suffix)) {
                 $form[$domain][$domain_field]['#suffix'] = $field->suffix;
             }
             $form[$domain][$domain_field]['#type'] = $field->field_type;
             $form[$domain][$domain_field]['#title'] = $field->getFieldTitle();
             $form[$domain][$domain_field]['#default_value'] = $field->getDropDownDefault();
             $form[$domain][$domain_field]['#options'] = $field->getDropDownOptions();
             $form[$domain][$domain_field]['#validated'] = true;
             if (!is_null($field->disabled)) {
                 $form[$domain][$domain_field]['#disabled'] = $field->disabled;
             }
             if (!is_null($field->option_attributes)) {
                 $form[$domain][$domain_field]['#option_attributes'] = $field->option_attributes;
             }
             break;
         case FieldType::RadioButtons:
             $domain_field = "{$this->domain_name}_{$field->field_name}";
             if (!is_null($field->prefix)) {
                 $form[$domain][$domain_field]['#prefix'] = $field->prefix;
             }
             $form[$domain][$domain_field]['#type'] = FieldType::RadioButtons;
             if (!is_null($field->default_value)) {
                 $form[$domain][$domain_field]['#default_value'] = $field->default_value;
             }
             if (!is_null($field->options)) {
                 $form[$domain][$domain_field]['#options'] = $field->options;
             }
             break;
         case FieldType::RangeField:
             //From
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}_from";
             $css_name = str_replace('_', '-', $field->field_name);
             $form[$domain][$domain_field]['#type'] = FieldType::TextField;
             if (!is_null($field->size)) {
                 $form[$domain][$domain_field]['#size'] = $field->size;
             } else {
                 $form[$domain][$domain_field]['#size'] = 30;
             }
             //Default
             if (!is_null($field->maxlength)) {
                 $form[$domain][$domain_field]['#maxlength'] = $field->maxlength;
             } else {
                 $form[$domain][$domain_field]['#maxlength'] = 32;
             }
             //Default
             if (!is_null($field->prefix)) {
                 $form[$domain][$domain_field]['#prefix'] = $field->prefix . '<div class="form-item form-item-' . $css_name . '"><label>' . $field->getFieldTitle() . '</label><div class="ranges">';
             } else {
                 $form[$domain][$domain_field]['#prefix'] = '<div class="form-item form-item-' . $css_name . '"><label>' . $field->getFieldTitle() . '</label><div class="ranges">';
             }
             //To
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}_to";
             $form[$domain][$domain_field]['#type'] = FieldType::TextField;
             $form[$domain][$domain_field]['#title'] = t('TO');
             if (!is_null($field->size)) {
                 $form[$domain][$domain_field]['#size'] = $field->size;
             } else {
                 $form[$domain][$domain_field]['#size'] = 30;
             }
             //Default
             if (!is_null($field->maxlength)) {
                 $form[$domain][$domain_field]['#maxlength'] = $field->maxlength;
             } else {
                 $form[$domain][$domain_field]['#maxlength'] = 32;
             }
             //Default
             if (!is_null($field->suffix)) {
                 $form[$domain][$domain_field]['#suffix'] = '</div></div>' . $field->suffix;
             } else {
                 $form[$domain][$domain_field]['#suffix'] = '</div></div>';
             }
             break;
         case FieldType::RangeDateField:
             //From
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}_from";
             $css_name = str_replace('_', '-', $field->field_name);
             $form[$domain][$domain_field]['#type'] = FieldType::DatePopup;
             $form[$domain][$domain_field]['#date_format'] = 'Y-m-d';
             $form[$domain][$domain_field]['#date_year_range'] = $year_range;
             if (!is_null($field->prefix)) {
                 $form[$domain][$domain_field]['#prefix'] = $field->prefix . '<div class="form-item form-item-' . $css_name . '"><label>' . $field->getFieldTitle() . '</label><div class="ranges">';
             } else {
                 $form[$domain][$domain_field]['#prefix'] = '<div class="form-item form-item-' . $css_name . '"><label>' . $field->getFieldTitle() . '</label><div class="ranges">';
             }
             //To
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}_to";
             $form[$domain][$domain_field]['#type'] = FieldType::DatePopup;
             $form[$domain][$domain_field]['#date_format'] = 'Y-m-d';
             $form[$domain][$domain_field]['#title'] = t('TO');
             if (!is_null($field->suffix)) {
                 $form[$domain][$domain_field]['#suffix'] = '</div></div>' . $field->suffix;
             } else {
                 $form[$domain][$domain_field]['#suffix'] = '</div></div>';
             }
             break;
         case FieldType::SubmitField:
             $submit_class = "{$this->domain_name}-submit " . str_replace('_', '-', $data_source);
             //Next Button - visible for create alerts
             $domain_field = "{$this->domain_name}_next";
             $form[$domain][$domain_field]['#type'] = 'button';
             $form[$domain][$domain_field]['#name'] = $domain_field;
             $form[$domain][$domain_field]['#value'] = t('Next');
             $form[$domain][$domain_field]['#prefix'] = t('<div class="' . $submit_class . '">');
             $form[$domain][$domain_field]['#ajax'] = array('callback' => '_checkbook_advanced_search_create_alert_results_ajax', 'event' => 'click', 'progress' => array('type' => 'none'));
             //Submit Button
             $domain_field = "{$this->domain_name}_submit";
             $form[$domain][$domain_field]['#type'] = $field->field_type;
             $form[$domain][$domain_field]['#name'] = $domain_field;
             $form[$domain][$domain_field]['#value'] = t('Submit');
             //Clear All Button
             $domain_field = "{$this->domain_name}_clear";
             $form[$domain][$domain_field]['#type'] = $field->field_type;
             $form[$domain][$domain_field]['#value'] = t('Clear All');
             end($this->contents);
             $endKey = key($this->contents);
             if ($data_source == $endKey) {
                 $form[$domain][$domain_field]['#suffix'] = '</div></div>';
             } else {
                 $form[$domain][$domain_field]['#suffix'] = '</div>';
             }
             break;
         case FieldType::TextField:
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}";
             $form[$domain][$domain_field]['#type'] = FieldType::TextField;
             $form[$domain][$domain_field]['#title'] = $field->getFieldTitle();
             if (!is_null($field->size)) {
                 $form[$domain][$domain_field]['#size'] = $field->size;
             } else {
                 $form[$domain][$domain_field]['#size'] = 30;
             }
             //Default
             if (!is_null($field->maxlength)) {
                 $form[$domain][$domain_field]['#maxlength'] = $field->maxlength;
             } else {
                 $form[$domain][$domain_field]['#maxlength'] = 32;
             }
             //Default
             if (!is_null($field->prefix)) {
                 $form[$domain][$domain_field]['#prefix'] = $field->prefix;
             }
             //Hidden
             $domain_field = "{$data_source}_{$this->domain_name}_{$field->field_name}_exact";
             $form[$domain][$domain_field]['#type'] = FieldType::HiddenField;
             $form[$domain][$domain_field]['#name'] = $domain_field;
             if (!is_null($field->suffix)) {
                 $form[$domain][$domain_field]['#suffix'] = $field->suffix;
             }
             break;
     }
     return $form;
 }
Exemple #12
0
 public static function getLatestMwbeCategoryByVendor($vendor_id, $agency_id = null, $year_id = null, $year_type = null, $is_prime_or_sub = "P")
 {
     static $contract_vendor_latest_mwbe_category;
     if ($agency_id == null) {
         $agency_id = _getRequestParamValue('agency');
     }
     if ($year_type == null) {
         $year_type = _getRequestParamValue('yeartype');
     }
     if ($year_id == null) {
         $year_id = _getRequestParamValue('year');
     }
     if ($year_id == null) {
         $year_id = _getRequestParamValue('calyear');
     }
     if ($year_id == null) {
         $year_type = "B";
         $year_id = _getCurrentYearID();
     }
     $latest_minority_type_id = null;
     $agency_query = isset($agency_id) ? "agency_id = " . $agency_id : "agency_id IS NULL";
     if (!isset($contract_vendor_latest_mwbe_category)) {
         $query = "SELECT vendor_id, agency_id, year_id, type_of_year, minority_type_id, is_prime_or_sub\n                      FROM contract_vendor_latest_mwbe_category\n                      WHERE minority_type_id IN (2,3,4,5,9) AND year_id = " . $year_id . " AND type_of_year = '" . $year_type . "'" . "  AND " . $agency_query . " AND is_prime_or_sub = '" . $is_prime_or_sub . "'" . " GROUP BY vendor_id, agency_id, year_id, type_of_year, minority_type_id, is_prime_or_sub";
         $results = _checkbook_project_execute_sql_by_data_source($query, 'checkbook');
         foreach ($results as $row) {
             if (isset($row['agency_id'])) {
                 $contract_vendor_latest_mwbe_category[$row['vendor_id']][$row['agency_id']][$row['is_prime_or_sub']]['minority_type_id'] = $row['minority_type_id'];
             } else {
                 $contract_vendor_latest_mwbe_category[$row['vendor_id']][$row['is_prime_or_sub']]['minority_type_id'] = $row['minority_type_id'];
             }
         }
     }
     $latest_minority_type_id = isset($agency_id) ? $contract_vendor_latest_mwbe_category[$vendor_id][$agency_id][$is_prime_or_sub]['minority_type_id'] : $contract_vendor_latest_mwbe_category[$vendor_id][$is_prime_or_sub]['minority_type_id'];
     return $latest_minority_type_id;
 }
 public function prepareActRegContractsSliderFilter($page, $status)
 {
     $pathParams = explode('/', drupal_get_path_alias($_GET['q']));
     $url = $page;
     if (strlen($status) > 0) {
         $url .= "/status/" . $status;
     }
     $url .= _checkbook_append_url_params();
     if (preg_match("/^contracts_pending/", drupal_get_path_alias($_GET['q']))) {
         $allowedFilters = array("agency", "vendor", "awrdmthd", "csize", "cindustry", "agid", "dashboard", "subvendor", "mwbe");
         $url .= "/yeartype/B/year/" . _getCurrentYearID();
     } else {
         $allowedFilters = array("year", "calyear", "agency", "yeartype", "awdmethod", "vendor", "csize", "cindustry", "agid", "dashboard", "subvendor", "mwbe");
     }
     for ($i = 1; $i < count($pathParams); $i++) {
         if (in_array($pathParams[$i], $allowedFilters)) {
             $newPathParams = explode('/', $url);
             $url .= !in_array($pathParams[$i], $newPathParams) ? '/' . $pathParams[$i] . '/' . $pathParams[$i + 1] : '';
         }
         $i++;
     }
     return $url;
 }