public function getgraphAction() { if ($result = $this->getRequest()->isPost()) { $form = new Application_Form_Content(); $data = $this->getRequest()->getPost(); if ($form->isValid($data)) { echo "shreejana"; } else { $currencyId = $form->getValue('currency_id'); $graphs = new Application_Model_DbTable_Rate(); $graph = $graphs->getAverageRate($currencyId); $dataArray = array(); $dataArray[0]['name'] = "Buying price"; $dataArray[1]['name'] = "Selling price"; $i = 0; foreach ($graph as $graphArray) { $dataArray[0]['data'][$i] = (double) $graphArray['avgbuy']; $dataArray[1]['data'][$i] = (double) $graphArray['avgsell']; $months[$i] = $graphArray['month']; $year['yr'] = $graphArray['year']; $currencyName['nm'] = $graphArray['name']; $i++; } $this->view->dataArray = $dataArray; $this->view->months = $months; $this->view->year = $year; $this->view->currencyName = $currencyName; } } }