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; }
$rep->activateUserproperty($accounts_id[$uid], $usrprop[6], $val_totaloptout); } for ($uid = 0; $uid < $countusrid; $uid++) { $val_kwd = $rep->getUserMarketingInfo_Mo($accounts_id[$uid]); $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[0], $val_kwd); $val_web = $rep->getUserMarketingInfo(202, $accounts_id[$uid]); $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[1], $val_web); $val_bod = $rep->getUserMarketingInfo(303, $accounts_id[$uid]); $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[2], $val_bod); $val_mrk = $rep->getUserMarketingInfo(404, $accounts_id[$uid]); $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[3], $val_mrk); $val_mla = $rep->getUserMarketingInfo(505, $accounts_id[$uid]); $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[4], $val_mla); // $val_camp = $rep->getUserTotalCampaign($accounts_id[$uid]); $yearmonth = date('Y-m'); $val_camp = $rep->totalCampaignFromUserAccount($accounts_id[$uid], $yearmonth); // this is temporarly $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[5], $val_camp); /* mo mts comes from from mt_for_mo_request table and we need to add it to the total sms*/ $val_totalmrk = $rep->getTotalMarketingMt($accounts_id[$uid], 'ym'); $totalsms = $val_kwd + $val_totalmrk; $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[6], $totalsms); $val_dailymt = $rep->getTotalMarketingMt($accounts_id[$uid], 'ymd'); $rep->activateUserproperty($accounts_id[$uid], $mrkinfo[7], $val_dailymt); } // $val_camp = $rep->$rep->getUserTotalCampaign($accounts_id[$uid]); // $rep->activateUserproperty($accounts_id[$uid], $usrprop[4], $val_camp); } //for($uid = 0; $uid < $countusrid; $uid++ ){ // $val = $rep->reportCountRegGrpBySubscribersByUserIdNewKeys($accounts_id[$uid]); // $rep->activateUserproperty($accounts_id[$uid], $usrprop[0], $val);