public function messagemonthyearAction($showLayout = false) { if (!$showLayout) { $this->_helper->layout->disableLayout(); } list($key_used, $key_deleted) = $this->user->getKeywordsCountNew(); $this->view->key_used = $key_used - $key_deleted; $this->view->key_limit = $this->user->keywordlimit; $this->view->key_percent = sprintf("%d", $this->view->key_used / $this->view->key_limit * 100); $this->view->msg_limit = $this->user->messagelimit; $messageObj = new Application_Model_Report(); $userid = $this->user->getId(); //*********** Calculate startdate and end date................ $rmonth = date('m'); $ryear = date('Y'); $yearmonth = date('Y-m'); $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $rmonth, $ryear); // echo 'rmstart-'.$monthstartdate = $ryear."-".$rmonth."-1 00:00:00"; echo '<br>'; //echo 'rmend-'.$monthenddate = $ryear."-".$rmonth."-30 00:00:00"; $monthstartdate = $ryear . "-" . $rmonth . "-1 00:00:00"; $monthenddate = $ryear . "-" . $rmonth . "-" . $daysInMonth . " 00:00:00"; $this->view->msg_used = $messageObj->reportCountTotalMessagesByUserIdNew($userid, $monthstartdate, $monthenddate); $this->view->totalNewSubscribers = $messageObj->reportCountTotalSubscribersByUserIdNew($userid, $monthstartdate, $monthenddate, true); $this->view->totalKeywordSubscribers = $messageObj->reportCountRegGrpBySubscribersByUserIdNewKeys($userid, life); $this->view->totalImportedSubscribers = $this->user->totalupload; $myla = $messageObj->getMylaFoldersId(); $this->view->totalMyla = $messageObj->getMyla($userid, $myla[$userid], 'life'); $this->view->topThreeKeywordArray = $topThreeKeywordArray; /* /*one more mess wont change face of this horror*/ $this->view->dashboardKeywordsAct = $messageObj->dashboardKeyword_activity($userid); // $this->view->dashboardTotalOptins = $messageObj->dashboard_totalOptedIn($userid); $this->view->dashboardTotalOptins = $this->user->totalsubscribers; // $this->view->dashboardTotalOptinsByWebform = $messageObj->dashboard_totalOptedInsByWebform($userid); $this->view->dashboardTotalOptinsByWebform = $this->user->weboptin; $this->view->dashboardTotalMessagesSend = $messageObj->dashboard_totalMessagesSentOut($userid, $yearmonth); // $this->view->dashboardTotalCampaignSend = $messageObj->dashboard_totalCampaignSentOut($userid,$yearmonth); $msgpercent = $this->view->dashboardTotalMessagesSend / $this->view->msg_limit * 100; if ($msgpercent >= 100) { $msgpercent = 100; } $this->view->msg_percent = sprintf("%d", $msgpercent); $this->view->userid = $userid; $this->view->mylamt = $this->user->mylamt; $this->view->kwdmt = $this->user->keywordmt; $this->view->webmt = $this->user->webmt; $this->view->dobmt = $this->user->dobmt; // $this->view->totalcampsent = $this->user->totalcampsent; $this->view->totalcampsent = $messageObj->totalCampaignFromUserAccount($userid, $yearmonth); // echo $userid." : ".$yearmonth." : ".$this->view->totalcampsent; exit; $this->view->totalmt = $this->user->totalmt; $this->view->totalmrkmt = $this->user->totalmrkmt; }