示例#1
0
 public function indexAction()
 {
     $this->view->title = "Pages";
     //echo "sdfdfsdfsdf";exit;
     $this->view->headTitle(" - " . $this->view->title);
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $model = new Application_Model_Page();
     $page = $this->_getParam('page', 1);
     $fixedPages = implode(",", $this->fixedOtherCMSPages);
     $where = "id IS NOT NULL AND identifire NOT IN ('advice', 'work-study-volunteer')";
     $order = "addedon ASC";
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->fixedPages = $this->fixedPages;
 }
示例#2
0
 public function indexAction()
 {
     $where = "id IS NOT NULL";
     $model = new Application_Model_Content();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $type = "module";
     if ($this->_getParam('type') != "") {
         $type = $this->_getParam('type');
     }
     $this->view->type = $type;
     if ($type == "logout") {
         $where .= " AND id IN ({$this->logoutTopContents})";
     } else {
         if ($type == "login") {
             $where .= " AND id IN ({$this->loginTopContents})";
         } else {
             $where .= " AND id IN ({$this->loginModules})";
         }
     }
     //echo "ssss=".$where;exit;
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, "weight ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->fixedTextMod = $this->fixedTextMod;
     $this->view->fixedModules = $this->fixedModules;
 }
 public function amazonAction()
 {
     $this->view->title = ucfirst($this->_getParam('type')) . " - Amazon";
     $this->view->headTitle(" - " . $this->view->title);
     $type = $this->_getParam('type');
     $settings = new Admin_Model_GlobalSettings();
     $where = "identifire='{$type}_amazon_uk'";
     $settings_uk = $settings->fetchRow($where);
     $where = "identifire='{$type}_amazon_other'";
     $settings_other = $settings->fetchRow($where);
     $request = $this->getRequest();
     $form = new Admin_Form_Amazon();
     $options = $request->getPost();
     if ($request->isPost()) {
         if ($form->isValid($options)) {
             $settings_uk->setValue($options['amazon_uk']);
             $settings_uk->save();
             $settings_other->setValue($options['amazon_other']);
             $settings_other->save();
             //return $this->_helper->redirector('index','global-settings',"admin",Array('msg'=>base64_encode("'{$settings->getLabel()}' has been updated successfully!")));
             $this->view->msg = "Amazon link is updated successfully!";
         } else {
             $form->reset();
             $form->populate($options);
         }
     }
     $form->getElement('amazon_uk')->setLabel($settings_uk->getLabel());
     $form->getElement('amazon_uk')->setValue($settings_uk->getValue());
     $form->getElement('amazon_other')->setLabel($settings_other->getLabel());
     $form->getElement('amazon_other')->setValue($settings_other->getValue());
     $this->view->form = $form;
 }
示例#4
0
 public function indexAction()
 {
     $this->view->type = $type = $this->_getParam('type', "other");
     $this->view->title = ucfirst($type) . " Category ";
     //change title for Journals
     if ($type == "blog") {
         $this->view->title = "Journal Category ";
     }
     $this->view->headTitle(" -  " . $this->view->title);
     $model = new Application_Model_Category();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $where = "status!='deleted' AND type='{$type}'";
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, "weight ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     if (isset($_SESSION['errorMsg'])) {
         $this->view->msg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
 }
示例#5
0
 public function getBadwords()
 {
     $settings = new Admin_Model_GlobalSettings();
     $badwordsStr = $settings->settingValue('bad_words');
     $badwordsArr = explode(",", $badwordsStr);
     return $badwordsArr;
 }
 public function indexAction()
 {
     $model = new Block_Model_BlockRegion();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
示例#7
0
 public function getApiKey()
 {
     if (null === $this->_apiKey) {
         $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
         $apiKey = $config->google->apiKey;
         if ($apiKey == "" || is_null($apiKey)) {
             $settings = new Admin_Model_GlobalSettings();
             $apiKey = $settings->settingValue('google_map_api_key');
         }
         $this->setApiKey($apiKey);
     }
     return $this->_apiKey;
 }
示例#8
0
 public function indexAction()
 {
     $this->view->title = "Url Rewrite Management";
     $this->view->headTitle(" - " . $this->view->title);
     $model = new Application_Model_SeoUrl();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
示例#9
0
 /**
  * The default action - show the home page
  */
 public function viewAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $userModel = new Application_Model_UserLevel();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($userModel, $page, $page_size);
     $this->view->total_users = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $request = $this->getRequest();
     //$request->getControllerName();
 }
示例#10
0
 public function myPhotosAction()
 {
     $userNs = new Zend_Session_Namespace('members');
     $userId = $userNs->userId;
     $albumM = new Album_Model_UserAlbum();
     $where = "user_id = {$userId}";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($albumM, $page, $page_size, $where);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->paginator = $paginator;
 }
示例#11
0
 public function indexAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $model = new Application_Model_Widgets();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, NULL, "weight DESC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->errorMsg = "";
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     }
 }
示例#12
0
 public function indexAction()
 {
     $params['q'] = $this->_getParam('q');
     if (isset($params['q']) && $params['q'] != "" && $params['q'] != "Search Gap Daemon") {
         $this->view->searchtext = $searchtext = $params['q'];
         $settings = new Admin_Model_GlobalSettings();
         $page_size = $settings->settingValue('pagination_size');
         //$page_size				= 	1;
         $modelList = new Application_Model_SearchView();
         $searchData = $modelList->searchResult($searchtext);
         $page = $this->_getParam('page', 1);
         $pageObj = new Base_Paginator();
         $paginator = $pageObj->fetchPageDataResult($searchData, $page, $page_size);
         if ($pageObj->getTotalCount() > 0) {
             $this->view->total = $pageObj->getTotalCount();
             $this->view->paginator = $paginator;
         } else {
             $this->view->message = "No result found for this keyword.";
         }
     } else {
         $this->view->message = "Missing search parameters.";
     }
 }
 public function moreButtonPhotoAction()
 {
     /*--------------- MODELS ----------------------*/
     $objModelUser = new Application_Model_User();
     $objModelAlbum = new Album_Model_Album();
     $objModelPhotoTag = new Album_Model_PhotoTag();
     $objModelSetting = new Admin_Model_GlobalSettings();
     /*---------------------------------------------*/
     $this->view->layout()->disableLayout();
     $params = $this->getRequest()->getParams();
     $user_id = $params['user_id'];
     $offsetAlbum = $params['album_offset'];
     $this->view->user_id = $user_id;
     $pageSize = $objModelSetting->settingValue('album_public_page_size');
     $whereAlbum = "user_id='{$user_id}' AND status='1'";
     $orderAlbum = "addedon DESC";
     /*------------------------ GET NEXT ALBUM DETAIL -------------------------------*/
     $nextOffsetAlbum = $offsetAlbum + $pageSize;
     $nextPageSize = 1;
     $arrNextalbum = $objModelAlbum->fetchAll($whereAlbum, $orderAlbum, $nextPageSize, $nextOffsetAlbum);
     $this->view->nextAlbumCount = count($arrNextalbum);
     $this->view->nextOffsetAlbum = $nextOffsetAlbum;
 }
示例#14
0
 public function albumPhotosAction()
 {
     $albumId = $this->_getParam('id');
     $usersNs = new Zend_Session_Namespace("members");
     $userId = $usersNs->userId;
     $this->view->userId = $userId;
     $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
     $objModelAlbum = new Album_Model_Album();
     $objModelSetting = new Admin_Model_GlobalSettings();
     $objModelVote = new Application_Model_Vote();
     $objPage = new Base_Paginator();
     /*----------- GET ALBUM WITH PAGINATION VALUE --------------------*/
     $pageSize = $objModelSetting->settingValue('album_photo_page_size');
     $page = $this->_getParam('page', 1);
     $whereAlbumPhoto = "album_id='{$albumId}' AND user_id='{$userId}' AND status=1";
     $orderAlbumPhoto = "addedon DESC";
     $arrAlbumPhoto = $objPage->fetchPageData($objModelAlbumPhoto, $page, $pageSize, $whereAlbumPhoto, $orderAlbumPhoto);
     $this->view->totalAlbumPhoto = $objPage->getTotalCount();
     $this->view->arrAlbumPhoto = $arrAlbumPhoto;
     /*------------------- GET ALBUM DETAIL --------------------------*/
     $whereAlbum = "id='{$albumId}'";
     $arrAlbum = $objModelAlbum->fetchAll($whereAlbum);
     $this->view->arrAlbum = $arrAlbum;
     $this->view->myLatitude = $latitude = $arrAlbum[0]->latitude;
     $this->view->myLongitude = $longitude = $arrAlbum[0]->longitude;
     /*------------------- GET TAG OF ALBUM -------------------------*/
     $strTag = $this->getAlbumTags($albumId);
     $this->view->strTag = $strTag;
     /*------------------ CHECK LIKED-UNLIKED ALBUM ------------------*/
     $whereVote = "item_type='album' AND item_id='{$albumId}' AND user_id='{$userId}' AND vote='1'";
     $arrVote = $objModelVote->fetchAll($whereVote);
     if (count($arrVote) > 0) {
         $this->view->numVote = 1;
     } else {
         $this->view->numVote = 0;
     }
 }
示例#15
0
 public function albumPhotosAction()
 {
     $albumId = $this->_getParam('id');
     $usersNs = new Zend_Session_Namespace("members");
     $userId = $usersNs->userId;
     $this->view->userId = $userId;
     $this->view->albumId = $albumId;
     $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
     $objModelAlbum = new Album_Model_Album();
     $objModelSetting = new Admin_Model_GlobalSettings();
     $objModelVote = new Application_Model_Vote();
     $objPage = new Base_Paginator();
     /*---------------- Check Album Owner ----------------*/
     $valAlbum = $objModelAlbum->find($albumId);
     $albumOwnerId = $valAlbum->getUserId();
     if ($albumOwnerId != $userId) {
         $objModelUser = new Application_Model_User();
         $valUser = $objModelUser->find($albumOwnerId);
         $albumOwnerUserName = $valUser->getUsername();
         $redirectUrl = "/profile/album-photos/username/" . $albumOwnerUserName . "/id/" . $albumId;
         $this->_redirect($redirectUrl);
     }
     /*-------------- END Check Album Owner --------*/
     /*----------- GET ALBUM WITH PAGINATION VALUE --------------------*/
     $pageSize = $objModelSetting->settingValue('album_photo_page_size');
     $page = $this->_getParam('page', 1);
     $whereAlbumPhoto = "album_id='{$albumId}' AND user_id='{$userId}' AND status=1";
     $orderAlbumPhoto = "addedon DESC";
     $arrAlbumPhoto = $objPage->fetchPageData($objModelAlbumPhoto, $page, $pageSize, $whereAlbumPhoto, $orderAlbumPhoto);
     $this->view->totalAlbumPhoto = $objPage->getTotalCount();
     $this->view->arrAlbumPhoto = $arrAlbumPhoto;
     /*------------------- GET ALBUM DETAIL --------------------------*/
     $whereAlbum = "id='{$albumId}'";
     $arrAlbum = $objModelAlbum->fetchAll($whereAlbum);
     $this->view->arrAlbum = $arrAlbum;
     $this->view->myLatitude = $latitude = $arrAlbum[0]->latitude;
     $this->view->myLongitude = $longitude = $arrAlbum[0]->longitude;
     /*------------------- GET TAG OF ALBUM -------------------------*/
     $strTag = $this->getAlbumTags($albumId);
     $this->view->strTag = $strTag;
     /*------------------ CHECK LIKED-UNLIKED ALBUM ------------------*/
     $whereVote = "item_type='album' AND item_id='{$albumId}' AND user_id='{$userId}' AND vote='1'";
     $arrVote = $objModelVote->fetchAll($whereVote);
     if (count($arrVote) > 0) {
         $this->view->numVote = 1;
     } else {
         $this->view->numVote = 0;
     }
     $this->view->likeSrcUrl = Zend_Registry::get('siteurl') . "%2Falbum%2Fmy-photos%2Falbum-photos%2Fid%2F" . $albumId;
 }
示例#16
0
 /**
  * @Created By	: Mahipal Singh Adhikari
  * @Created On	: 27-Jan-2011
  * @Description	: Report Journal/Wall and other items as abuse to admin
  */
 public function reportAbuseAction()
 {
     $this->view->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     //get request parameters
     $item_id = $this->_getParam('item_id');
     $item_type = $this->_getParam('item_type');
     //get logged in user ID
     $usersNs = new Zend_Session_Namespace('members');
     $user_id = $usersNs->userId;
     if ($user_id == "" || $user_id == 0) {
         $JsonResultArray = array('error' => 1, 'response' => "Please login to report abuse.");
         echo Zend_Json::encode($JsonResultArray);
         exit;
     }
     if ($item_id == "" || $item_id == 0) {
         $JsonResultArray = array('error' => 2, 'response' => "No item is selected to report abuse.");
         echo Zend_Json::encode($JsonResultArray);
         exit;
     }
     if ($item_type == "") {
         $JsonResultArray = array('error' => 2, 'response' => "No item type is selected to report abuse.");
         echo Zend_Json::encode($JsonResultArray);
         exit;
     }
     //Get user report abuse info for item
     $modelM = new Application_Model_ReportAbuse();
     $modelRes = $modelM->fetchRow("item_id={$item_id} AND item_type='{$item_type}' AND user_id={$user_id}");
     if ($modelRes && $modelRes->getStatus() == 1) {
         $JsonResultArray = array('error' => 2, 'response' => "You've already reported this as abuse.");
         echo Zend_Json::encode($JsonResultArray);
         exit;
     } else {
         $params["itemId"] = $item_id;
         $params["itemType"] = $item_type;
         $params["userId"] = $user_id;
         $params["comment"] = "";
         $params["status"] = 1;
         $modelM->setOptions($params);
         $dbRes = $modelM->save();
         if ($dbRes) {
             //get item type information
             $itemTitle = "";
             $authorId = "";
             $author = "";
             if ($item_type == 'blog') {
                 $blogM = new Application_Model_Blog();
                 $blogRes = $blogM->find($item_id);
                 $itemTitle = $blogRes->getTitle();
                 $authorId = $blogRes->getUserId();
                 $blog_url = Zend_Registry::get('siteurl') . "/journal/view-post/blog_id/" . $item_id;
                 $itemTitle = "<a href='" . $blog_url . "' target='_blank'>" . $itemTitle . "</a>";
             } else {
                 if ($item_type == 'wall') {
                     $wallM = new Application_Model_Wall();
                     $wallRes = $wallM->find($item_id);
                     $itemTitle = $wallRes->getStatus();
                     $authorId = $wallRes->getUserId();
                 } else {
                     if ($item_type == 'photo') {
                         $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
                         $albumPhotoRes = $objModelAlbumPhoto->find($item_id);
                         $itemTitle = $albumPhotoRes->getName();
                         $authorId = $albumPhotoRes->getUserId();
                     }
                 }
             }
             //get Blog/Wall owner/author user information
             if ($authorId != "") {
                 $useAuthor = new Application_Model_User();
                 $authorRes = $useAuthor->find($authorId);
                 $author = ucfirst($authorRes->getFirstName()) . " " . ucfirst($authorRes->getLastName()) . " (" . $authorRes->getUsername() . ")";
             }
             //get user information who is reporting abuse item
             $userM = new Application_Model_User();
             $userR = $userM->find($user_id);
             $reporterName = ucfirst($userR->getFirstName()) . " " . ucfirst($userR->getLastName()) . " (" . $userR->getUsername() . ")";
             $reporterEmail = $userR->getEmail();
             //Now send report abuse email to Administrator
             $settings = new Admin_Model_GlobalSettings();
             $admin_email = $settings->settingValue('report_abuse');
             //$admin_email	= "*****@*****.**";
             $mailOptions['receiver_email'] = $admin_email;
             $mailOptions['item_type'] = ucfirst($item_type);
             $mailOptions['item_title'] = $itemTitle;
             $mailOptions['item_author'] = $author;
             $mailOptions['reporter_name'] = $reporterName;
             $mailOptions['reporter_email'] = $reporterEmail;
             //create mail class object and send the email
             $Mail = new Base_Mail();
             $Mail->sendReportAbuseEmail($mailOptions);
             //send response
             $JsonResultArray = array('error' => 3, 'response' => "Consider it reported!");
         } else {
             $JsonResultArray = array('error' => 2, 'response' => "Error occured, please try again later.");
         }
     }
     echo Zend_Json::encode($JsonResultArray);
     exit;
 }
示例#17
0
 public function userLikeThisAction()
 {
     $this->_helper->layout->setLayout('journal-layout-2column');
     //$item_id = $this->_getParam("blog_id");
     $item_id = $this->_getParam("item_id");
     $item_type = $this->_getParam("type");
     //$userNs = new Zend_Session_Namespace('members');
     //$this->view->userId = $userNs->userId;
     $item = false;
     $itemTypeText = "";
     if ($item_type != "") {
         if ($item_type == 'blog') {
             $blogM = new Application_Model_Blog();
             $this->view->blog = $item = $blogM->find($item_id);
             $itemTypeText = "Journal Post";
         }
         if ($item_type == 'status_comment' || $item_type == 'blog_comment') {
             $commentM = new Application_Model_Comment();
             $item = $commentM->find($item_id);
             $itemTypeText = "Comment";
             $item_type = "comment";
         }
         if ($item_type == 'status') {
             $wallM = new Application_Model_Wall();
             $item = $wallM->find($item_id);
             $itemTypeText = "Wall Post";
         }
         $this->view->itemTypeText = $itemTypeText;
     }
     //if item is not exists then redirect to Journal home page
     if (false === $item) {
         $this->_helper->redirector()->gotoUrl('/journal/index/');
         exit;
     }
     //Now get all positive votes of item
     //$where		= "item_id = $item_id AND vote=1 AND item_type='blog'";
     $where = "item_id = {$item_id} AND vote=1";
     if ($item_type == 'comment') {
         $where .= " AND (item_type='status_comment' OR item_type='blog_comment')";
     } else {
         $where .= " AND item_type='{$item_type}'";
     }
     $voteM = new Application_Model_Vote();
     $rawdata = $voteM->fetchAll($where);
     //Get all users ID voted on an item
     if (false !== $rawdata) {
         $user_array = array();
         foreach ($rawdata as $row) {
             $user_array[] = $row->getUserId();
         }
     }
     //get all users information from above User Ids
     $this->view->totalUsers = 0;
     if (count($user_array) > 0) {
         $usrstr = implode(",", $user_array);
         $userM = new Application_Model_User();
         $whereuser = "******";
         $userData = $userM->fetchAll($whereuser, "first_name ASC");
         $this->view->userData = $userData;
         $settings = new Admin_Model_GlobalSettings();
         $page_size = $settings->settingValue('pagination_size');
         //$page_size = 1;
         $page = $this->_getParam('page', 1);
         $pageObj = new Base_Paginator();
         $paginator = $pageObj->fetchPageData($userM, $page, $page_size, $whereuser);
         $this->view->totalUsers = $pageObj->getTotalCount();
         $this->view->paginator = $paginator;
     }
 }
示例#18
0
 public function allFriendsAction()
 {
     $userNs = new Zend_Session_Namespace('members');
     $userId = $userNs->userId;
     $where = "1=1 AND id!='{$userId}'";
     $where .= " AND status = 'active'";
     $name = "";
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         $name = $params['nickname'];
     }
     if ($name != "") {
         //$where .= " AND (username LIKE '%{$name}%' OR first_name LIKE '%{$name}%' OR  last_name LIKE '%{$name}%')";
         //$where .= " AND (CONCAT(first_name,' ',last_name ) LIKE '%$name%' OR username LIKE '%$name%')";
         $where .= " AND (CONCAT(first_name,' ',last_name ) LIKE '%{$name}%' )";
         $this->view->param = array('nickname' => $name);
     }
     $friendM = new Application_Model_Friend();
     $frienddata = $friendM->fetchAll("user_id = {$userId} AND status = 'accept'");
     if (count($frienddata) > 0) {
         foreach ($frienddata as $friend) {
             $friendids[] = $friend->getFriendId();
         }
         $friend_str = implode(',', $friendids);
         $where .= " AND id NOT IN({$friend_str})";
     }
     $userM = new Application_Model_User();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($userM, $page, $page_size, $where);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
 }
示例#19
0
 public function indexAction()
 {
     //		$this->_helper->layout->disableLayout();
     $this->view->topMenuFlag = true;
     /*$fields = array ('optimize'=> true, 'commit'=> true, 'clean'=> true);
             
     //        $curl_request = curl_init('http://pbodev.info:8983/solr/mbartists/dataimport?command=fullimport');
     //        $curl_request = curl_init('http://pbodev.info:8983/solr/dataimport?command=fullimport');
             $curl_request = curl_init('http://pbodev.info:8983/solr/select?qt=/dataimport&command=fullimpor&clean=true&commit=true&optimize=true');
             curl_setopt($curl_request, CURLOPT_HEADER, 0);
             curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1);
     //        curl_setopt($curl_request, CURLOPT_POSTFIELDS, $fields);
             $curl_response = curl_exec($curl_request);
             curl_close($curl_request);
     
             prexit($curl_response);*/
     $catid = $this->_getParam('category');
     $insuranceid = $this->_getParam('insurance', '');
     $planid = $this->_getParam('plan', '');
     $reasonid = $this->_getParam('reason');
     $sobi2SearchText = addslashes(trim($this->_getParam('searchText')));
     $search1 = trim($this->_getParam('search1'));
     $state = trim($this->_getParam('st'));
     $start_date = $this->_getParam('start_date');
     $isAjax = $this->_getParam('isAjax', 0);
     $reasons = array();
     $linkArray = array();
     $this->view->catid = $catid;
     $this->view->insuranceid = $insuranceid;
     $this->view->planid = $planid;
     $this->view->reasonid = $reasonid;
     $this->view->searchText = stripslashes(stripslashes($sobi2SearchText));
     $this->view->search1 = stripslashes(stripslashes($search1));
     $this->view->start_date = $start_date;
     $this->view->isReasontoVisit = 1;
     // fetch category
     $Category = new Application_Model_Category();
     $categories = $Category->fetchAll("status=1", "name ASC");
     $this->view->categories = $categories;
     // fetch insurance companies
     if ($catid == 7) {
         $plan_type = 'd';
     } else {
         $plan_type = 'g';
     }
     $Plan = new Application_Model_InsurancePlan();
     $plans = $Plan->fetchAll("plan_type='{$plan_type}' AND status=1");
     $planArray = array();
     foreach ($plans as $p) {
         $planArray[] = $p->getInsuranceCompanyId();
     }
     $planArray = array_unique($planArray);
     $planStr = implode(',', $planArray);
     $Insurance = new Application_Model_InsuranceCompany();
     if ($insuranceid) {
         $planStr = $planStr . "," . $insuranceid;
         // when some come from insurance company-plan sitemap directly
         $this->view->insuranceCompany = $Insurance->fetchRow("status=1 AND id ='{$insuranceid}'");
     }
     $insurances = $Insurance->fetchAll("status=1 AND id IN ({$planStr})", "company ASC");
     $this->view->insurances = $insurances;
     // fetch insurance plans
     $insuranceplans = array();
     if ($insuranceid > 0) {
         $insuranceplans = $Plan->fetchAll("insurance_company_id='{$insuranceid}' AND status=1");
         $linkArray['insurance'] = $insuranceid;
     }
     $this->view->insuranceplans = $insuranceplans;
     //$this->view->insuranceCompany = $insuranceCompany;
     if ($planid > 0) {
         $linkArray['plan'] = $planid;
     }
     if ($reasonid > 0) {
         $linkArray['reason'] = $reasonid;
     }
     if ($search1 != '') {
         $linkArray['search1'] = $search1;
     }
     if ($state != '') {
         $linkArray['st'] = $state;
     }
     if ($sobi2SearchText != '') {
         $linkArray['searchText'] = $sobi2SearchText;
     }
     $isBronze = 0;
     // 0 - paid doctor, 1 - bronze doctors
     // fetch reason for visits
     if ($catid > 0) {
         $linkArray['category'] = $catid;
         $Reason = new Application_Model_ReasonForVisit();
         $reasons = $Reason->fetchAll("category_id='{$catid}' AND status=1", "reason ASC");
     }
     $this->view->reasons = $reasons;
     // ############################################### Search Results ######################################
     $this->view->page = $page = $this->_getParam('page', 1);
     //        $Search = new Base_SearchLucene();
     $settings = new Admin_Model_GlobalSettings();
     $limit = $settings->settingValue('pagination_size');
     $searchResults = $this->searchDIH('paid', $limit);
     if (isset($searchResults['other']) && count($searchResults['other']) > 0) {
         $this->view->otherStates = $searchResults['other'];
     }
     //        prexit($searchResults);
     if (isset($searchResults['total']) && $searchResults['total'] < 1) {
         // search for bronze doctors
         $isBronze = 1;
         $searchResults = $this->searchDIH('free', $limit);
     }
     $this->view->total = $searchResults['total'];
     $this->view->allResultArray = $searchResults['allResultArray'];
     $Paginator = new Base_Paginator();
     $this->view->paginator = $paginator = $Paginator->solrPaginator($searchResults['allResultArray'], $searchResults['total'], $page, $limit);
     $this->view->isBronze = $isBronze;
     //        prexit($paginator);
     //        $this->view->sortPosition = $this->_sortPosition;
     // ############################################ Search Results ##########################################
     $ip = $_SERVER['REMOTE_ADDR'];
     $this->view->linkArray = $linkArray;
     #-----------------------------------Start set title and description as per search result--------------------------- #
     $title = "";
     $desc = "";
     $sobi2Search = "";
     if ($catid != '') {
         $catObj = $Category->find($catid);
         if (!empty($catObj)) {
             $sobi2Search = $catObj->getName();
         }
     }
     $search1 = trim(str_replace(",", " ", $this->_getParam('search1')));
     $insurance_name = "";
     $dentistCategory = array('Dentist', 'Endodontist', 'Periodontist', 'Prosthodontist', 'Oral and Maxillofacial Surgeon', 'Orthodontist');
     if ($insuranceid > 0) {
         $insuranceObj = $Insurance->fetchRow("id='{$insuranceid}'");
         $insurance_name = $insuranceObj->getCompany();
     }
     if ($insuranceid > 0 && (isset($sobi2Search) && in_array($sobi2Search, $dentistCategory))) {
         $title = "{$insurance_name}, {$insurance_name} Dentist, {$insurance_name} Dental , {$insurance_name} Dental Insurance Plan";
         $desc = "{$insurance_name} Dental Insurance Plan: For {$insurance_name}, {$insurance_name} Dentist, {$insurance_name} Dental & Dentist's that Accept {$insurance_name} Visit Doctors Improving Healthcare";
     } else {
         //if (isset ( $sobi2Search ) && $sobi2Search != "all") { // Speciality serach
         if (isset($sobi2Search) && $sobi2Search != "") {
             // Speciality serach
             if ($search1 != "") {
                 $title = "{$sobi2Search} {$search1}, {$sobi2Search} {$search1}";
                 $desc = "{$sobi2Search} {$search1}: Find the best Dentist in {$search1} with patients reviews. Choose a top rated {$sobi2Search} {$search1} for your needs. Schedule an appointment now!";
             } else {
                 $title = "{$sobi2Search} San Francisco, New York, Los Angeles(LA), San Diego, CA";
                 $desc = "Find the best {$sobi2Search} in San Francisco, Los Angeles(LA), San Diego with patients reviews, Make an instant appointment Now!";
             }
         } else {
             // City, zipcode address serch
             $title = "{$search1} Dentist, Doctor, Dermatologist, Plastic/Cosmetic Surgeon";
             if (is_numeric($search1)) {
                 //############# Is zipcode
                 $desc = "Choose from hundreds of local {$search1} Top Doctors & Dentists, Dermatologists, Plastic Surgeons, Cosmetic Surgeons & Cosmetic Dentist at Doctors Improving Healthcare.";
             } else {
                 $desc = "{$search1} Dentist: Choose from hundreds of Top {$search1} Doctors & {$search1} Dentists, Dermatologists, Plastic Surgeons, Cosmetic Surgeons & Cosmetic Dentist at Doctors Improving Healthcare.";
             }
         }
     }
     $returnArray = array();
     if ($isAjax) {
         $this->_helper->layout->disableLayout();
         //            $returnArray['middel_content'] = $this->view->render('search/middle_content.phtml');
         echo $this->view->render('search/middle_content.phtml');
         //            echo Zend_Json::encode($returnArray);
         exit;
     }
     /* -----------------------------------End set title and description as per search result--------------------------- */
 }
示例#20
0
 /**
  * @Created By : Mahipal Singh Adhikari
  * @Created On : 10-Feb-2011
  * Description : Display advice category details home page and advice listing to that category
  */
 public function categoryAction()
 {
     $params = $this->getRequest()->getParams();
     $category_id = $params["id"];
     //get category detail
     $categoryM = new Application_Model_Category();
     $category = $categoryM->find($category_id);
     if (false !== $category) {
         $this->view->name = $category->getName();
         $this->view->description = $category->getDescription();
         $this->view->param = array('id' => $category_id);
     }
     //display advices in right block associated with this category
     $this->view->category_id = $category_id;
     //now get advices associsted with category
     $adviceM = new Application_Model_Advice();
     $where = "category_id={$category_id} AND status='1'";
     $order = "addedon DESC";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     //$page_size	=	1;
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($adviceM, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->advices = $paginator;
 }
 public function detailAction()
 {
     $id = $this->_getParam("id");
     $articlesM = new Application_Model_Articles();
     $where = "category_id ={$id} AND status='1'";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $this->view->param = array('id' => $id);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($articlesM, $page, $page_size, $where, "title ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->articles = $paginator;
     $categoryM = new Application_Model_Category();
     $this->view->category = $categoryM->find($id);
 }
示例#22
0
 private function setModel($row)
 {
     $model = new Admin_Model_GlobalSettings();
     $model->setId($row->id)->setLabel($row->label)->setIdentifire($row->identifire)->setValue($row->value);
     return $model;
 }
示例#23
0
 public function albumPhotosAction()
 {
     $objModelUser = new Application_Model_User();
     $objModelAlbumPhoto = new Album_Model_AlbumPhoto();
     $objModelAlbum = new Album_Model_Album();
     $objModelSetting = new Admin_Model_GlobalSettings();
     $objModelVote = new Application_Model_Vote();
     $objPage = new Base_Paginator();
     /*---------------------------------------------*/
     $username = $this->_getParam('username');
     $user = $this->getLeftPanel($username);
     $this->view->userName = $username;
     $this->view->userObject = $user;
     $userRecord = $objModelUser->getDataByUsername($username);
     $userId = $userRecord->getId();
     $userNs = new Zend_Session_Namespace('members');
     $this->view->loggedInUserId = $loggedInUserId = $userNs->userId;
     $this->view->userFullName = $username;
     /*------------------------ CHECK RELATION -------------*/
     $relationCondition = $this->checkRelation($userId, $loggedInUserId);
     $this->view->relationCondition = $relationCondition;
     /*-------------------------------------------------*/
     $albumId = $this->_getParam('id');
     $this->view->userId = $userId;
     $this->view->albumId = $albumId;
     /*----------- GET ALBUM WITH PAGINATION VALUE --------------------*/
     $pageSize = $objModelSetting->settingValue('album_photo_page_size');
     $page = $this->_getParam('page', 1);
     $whereAlbumPhoto = "album_id='{$albumId}' AND user_id='{$userId}' AND status=1 AND ({$relationCondition})";
     $orderAlbumPhoto = "addedon DESC";
     $arrAlbumPhoto = $objPage->fetchPageData($objModelAlbumPhoto, $page, $pageSize, $whereAlbumPhoto, $orderAlbumPhoto);
     $this->view->totalAlbumPhoto = $objPage->getTotalCount();
     $this->view->arrAlbumPhoto = $arrAlbumPhoto;
     /*------------------- GET ALBUM DETAIL --------------------------*/
     $whereAlbum = "id='{$albumId}'";
     $arrAlbum = $objModelAlbum->fetchAll($whereAlbum);
     $this->view->arrAlbum = $arrAlbum;
     $this->view->myLatitude = $latitude = $arrAlbum[0]->latitude;
     $this->view->myLongitude = $longitude = $arrAlbum[0]->longitude;
     /*------------------- GET TAG OF ALBUM -------------------------*/
     $strTag = $this->getAlbumTags($albumId);
     $this->view->strTag = $strTag;
     /*------------------ CHECK LIKED-UNLIKED ALBUM ------------------*/
     $whereVote = "item_type='album' AND item_id='{$albumId}' AND user_id='{$loggedInUserId}' AND vote='1'";
     $arrVote = $objModelVote->fetchAll($whereVote);
     if (count($arrVote) > 0) {
         $this->view->numVote = 1;
     } else {
         $this->view->numVote = 0;
     }
     $this->view->likeSrcUrl = Zend_Registry::get('siteurl') . "%2Fprofile%2Falbum-photos%2Fusername%2F" . $username . "%2Fid%2F" . $albumId;
 }