コード例 #1
0
 public function sufficientReportAction()
 {
     $base_url = Zend_Registry::get('baseurl');
     $this->view->inlineScript()->appendFile($base_url . '/js/all_level_combos.js');
     $this->view->role_id = $this->_identity->getRoleId();
     $stock_master = new Model_StockMaster();
     $result = $stock_master->getSufficientProductReport();
     $today_date = new DateTime(date("Y-m-d"));
     $last_year = $today_date->modify("-1 year");
     $this->view->from_date = $from_date = $last_year->format('d F, Y');
     $this->view->to_date = $to_date = date("d F, Y");
     $this->view->result = $result;
     $this->view->headTitle("Stock Sufficiency Report, {$from_date} - {$to_date}");
     $xmlstore = "<chart exportEnabled='1' exportAction='Download' bgColor='white' caption='Stock Sufficiency Graph'\n         exportFileName='District wise percentage of UCs having wastage > 50% " . date('Y-m-d H:i:s') . "' yAxisName='MOS (Avg. Issuance)' showValues='1' formatNumberScale='0' theme='fint' numberSuffix=''>";
     foreach ($result as $data) {
         echo $data['avg_issue'];
         $month6 = ROUND($data['soh'] / $data['amc'], 1);
         $month = $month6 > 0 ? $month6 . " months" : '';
         $xmlstore .= "<set label='{$data['item_name']}' value='" . $month . "' />";
     }
     $xmlstore .= "</chart>";
     $this->view->xml_store = $xmlstore;
 }