Exemplo n.º 1
0
 public function fetchItemReview($itemid)
 {
     try {
         $db = $this->getDbTable();
         $select = $db->select()->where('iritemid_fk_miid =?', $itemid)->order('ircreateddateandtime DESC');
         $itemreviewdata = $select->query()->fetchAll();
         $reviewdata = array();
         $cusmapper = new User_Model_CustomerMapper();
         foreach ($itemreviewdata as $record) {
             $cusdata = $cusmapper->getcusdata($record['iruserid_fk_userid']);
             $customer_name = "";
             if (is_array($cusdata)) {
                 if (array_key_exists(0, $cusdata)) {
                     $customer_name = $cusdata[0]['cusfirst_name'];
                 } else {
                     $customer_name = "User";
                 }
             } else {
                 $customer_name = "User";
             }
             $reviewdata[] = array("irid" => $record['irid'], "ir_reviewdate" => $record['ircreateddate'], "userid" => $record['iruserid_fk_userid'], "review" => $record['ir_review_text'], "rating" => $record['ir_review_rating'], "cusname" => $customer_name);
         }
         return $reviewdata;
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
Exemplo n.º 2
0
 public function dashboardAction()
 {
     try {
         $auth = Zend_Auth::getInstance();
         if ($auth->hasIdentity()) {
             $_resservice = new Application_Service_Restaurant();
             $storage = new Zend_Auth_Storage_Session();
             $userArr = $storage->read();
             $userid = $userArr['User_Id'];
             $cusmapper = new User_Model_CustomerMapper($userid);
             $cusname = $cusmapper->getcusdata($userid);
             $this->view->cusname = $cusname;
             $this->view->userid = $userid;
             $this->view->isLoggedin = true;
             $shortlisted = $_resservice->showshortlist($userid, $this->view->baseUrl());
             $this->view->shortlist = $shortlisted;
             $likedres = $_resservice->showlikedreslist($userid, $this->view->baseUrl());
             $this->view->likedreslist = $likedres;
             $resreviews = array();
             $resreviews = $_resservice->resReviewsByUserid($userid, $this->view->baseUrl());
             $this->view->resreviews = $resreviews;
             $itemreviews = $_resservice->itemReviewsByUserid($userid, $this->view->baseUrl());
             //print_r($itemreviews);die();
             $this->view->itemreviews = $itemreviews;
             $cusname = $_resservice->usernameByUserid($userid);
             $this->view->cusname = $cusname;
         } else {
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
Exemplo n.º 3
0
 public function itemreviewfetch($request)
 {
     try {
         $itemid = $request->getPost('itemid');
         $resid = $request->getPost('resid');
         $itemReviewMapper = new Restaurant_Model_ItemReviewMapper();
         $itemreviewdata = $itemReviewMapper->fetchItemReview($itemid, $resid);
         $cusmapper = new User_Model_CustomerMapper();
         foreach ($itemreviewdata as $itemdata) {
             $itemreviewdata[0]['cusname'] = $cusmapper->getcusdata($itemdata['userid']);
         }
         return $itemreviewdata;
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }