public function amcAction()
 {
     $this->_helper->layout->setLayout('reports');
     $this->view->report_id = 'AMC';
     $this->view->report_title = 'Provincial/Regional Average Monthly Consumption';
     $this->view->actionpage = 'amc';
     $this->view->parameters = 'T';
     $this->view->parameter_width = '100%';
     $item_pack_sizes = new Model_ItemPackSizes();
     $warehouses_data = new Model_WarehousesData();
     $item = $item_pack_sizes->productsReport();
     $this->view->item_id = $item;
     $items_name = $item_pack_sizes->stockOnHandItems();
     $this->view->item_name = $items_name;
     $location = new Model_Locations();
     $location_name = $location->getProvincesName();
     $this->view->location_name = $location_name;
     if (!empty($this->_request->year_sel) && !empty($this->_request->month_sel)) {
         $this->view->year_sel = $year = $this->_request->year_sel;
         $this->view->month_sel = $month = $this->_request->month_sel;
     } else {
         $year = date("Y");
         //            if (date('d') > 10) {
         //                $month = date("m", strtotime("-1"));
         //            } else {
         $month = date("m", strtotime("-2 month"));
         //            }
         $this->view->year_sel = $year;
         $this->view->month_sel = $month;
     }
     if (!empty($this->_request->rep_indicators)) {
         $this->view->sel_indicator = $sel_indicator = $this->_request->rep_indicators;
     } else {
         $this->view->sel_indicator = $sel_indicator = 1;
     }
     $this->view->prov_sel = $prov_sel = $this->_request->prov_sel;
     if (isset($this->_request->stk_sel) && !empty($this->_request->stk_sel)) {
         $this->view->stk_sel = $sel_stk = $this->_request->stk_sel;
     } else {
         $this->view->stk_sel = $sel_stk = 1;
     }
     if ($sel_indicator == 1) {
         $str_indicator = "\\'Consumption\\'";
     } else {
         if ($sel_indicator == 2) {
             $str_indicator = "\\'Stock on Hand\\'";
         } else {
             if ($sel_indicator == 3) {
                 $str_indicator = "\\'Received\\'";
             } else {
                 if ($sel_indicator == 4) {
                     $str_indicator = "\\'Issued\\'";
                 }
             }
         }
     }
     $this->view->str_indicator = $str_indicator;
     $end_date = $year . '-' . $month . '-01';
     $end_date = date('Y-m-d', strtotime("-1 days", strtotime("+1 month", strtotime($end_date))));
     $start_date = date('Y-m-d', strtotime("-364 days", strtotime($end_date)));
     // Start date and End date
     $begin = new DateTime($start_date);
     $end = new DateTime($end_date);
     $diff = $begin->diff($end);
     $interval = DateInterval::createFromDateString('1 month');
     $period = new DatePeriod($begin, $interval, $end);
     $this->view->period = $period;
     $this->view->sel_item = $this->_request->prod_sel;
     $stakeholder = new Model_Stakeholders();
     $stk = $stakeholder->nationReport();
     $this->view->stk = $stk;
     $locations = new Model_Locations();
     $lct = $locations->nationalReport();
     $this->view->location = $lct;
 }