}
return $perc;
}
+ public static function getProgressbarData($pbId) {
+
+ $query = "SELECT * FROM civicrm_wci_progress_bar where id=".$pbId;
+ $params = array();
+
+ $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget');
+
+ $pbData = array();
+ while ($dao->fetch()) {
+ $pbData["starting_amount"] = $dao->starting_amount;
+ $pbData["goal_amount"] = $dao->goal_amount;
+ }
+ return $pbData;
+ }
}
if (isset($format)) {
$jsonvar .= $cpageId;
} else {
- $data = CRM_Wci_BAO_Widget::getWidgetData($widgetId);
+ $widData = CRM_Wci_BAO_Widget::getWidgetData($widgetId);
+ $pbData = CRM_Wci_BAO_ProgressBar::getProgressbarData($widData["progress_bar_id"]);
+ $data = array_merge($widData, $pbData);
$template->assign('wciform', $data);
$template->assign('cpageId', $data['button_link_to']);
</div>
{/if}
<div class="crm-amounts">
- <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high"></div>
- <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low"></div>
- <div id="crm_wid_{$wciform.widgetId}_percentage" class="crm-percentage"></div>
+ <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high">${$wciform.goal_amount}</div>
+ <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low">${$wciform.starting_amount}</div>
+ <div id="crm_wid_{$wciform.widgetId}_percentage" class="crm-percentage">{$wciform.pb_percentage}%</div>
</div>
<div class="crm-amount-bar">
<div class="crm-amount-fill" id="crm_wid_{$wciform.widgetId}_amt_fill"></div>