Ejemplo n.º 1
0
 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;
         }
     }
 }
Ejemplo n.º 2
0
 public function csvAction($newData)
 {
     $currency = new Application_Model_DbTable_Rate();
     $exportData = $currency->fetchDataRate();
     //var_dump($exportData);die;
     $newData[0] = array('Name', 'Date', 'Buying Price', 'Selling Price');
     $i = 1;
     foreach ($exportData as $data) {
         $newData[$i][0] = $data['name'];
         $newData[$i][1] = $data['date'];
         $newData[$i][2] = $data['buy_price'];
         $newData[$i][3] = $data['sell_price'];
         $i++;
     }
 }
Ejemplo n.º 3
0
 public function recentAction()
 {
     $presentData = new Application_Model_DbTable_Rate();
     $data = $presentData->getRecentRate();
     $this->view->data = $data;
     //var_dump($data);die;
 }