public function badnumbersAction() { if ($this->request->isPost()) { $rep = new Application_Model_Report(); $usrfolders = $this->request->getParam('folders'); $folders = explode(',', $usrfolders); $totalfolders = count($folders); $totalsubscribers = array(); for ($sbr = 0; $sbr < $totalfolders; $sbr++) { // $folder = new Application_Model_Folder($this->user, $folders[$sbr]); $msg = new Application_Model_Message(); $subscribers = $msg->subscribersByFolderid($folders[$sbr]); foreach ($subscribers as $usr_fid => $v) { $totalsubscribers[$v['phonenumber']] = $v['phonenumber']; } } $res = $rep->getBadNumbers($this->user->getId(), $totalsubscribers); } if ($res) { echo $res; } else { echo "Nothing is selected"; } exit; }