Example #1
0
 public function readAction()
 {
     $targetID = $this->_getParam('t');
     $getWhat = $this->_getParam('g');
     if (!empty($targetID) && !empty($getWhat)) {
         $rObj = new Application_Model_DbTable_Reviews();
         switch ($getWhat) {
             case "client":
                 $userOBJ = new Application_Model_DbTable_Users();
                 $userInfo = $userOBJ->getUser($targetID);
                 $pRes = $rObj->getReviews($targetID, 'user_ID');
                 if ($pRes) {
                     $this->view->projectsReviews = $pRes;
                 }
                 $this->view->success = 1;
                 $this->view->targetName = $userInfo->fullName . " - " . $userInfo->email;
                 $this->view->targetType = "client";
                 break;
             case "project":
                 $projectObj = new Application_Model_DbTable_Projects();
                 $pinfo = $projectObj->getById($targetID);
                 $pRes = $rObj->getReviews($targetID, 'project_ID');
                 if ($pRes) {
                     $this->view->projectsReviews = $pRes;
                 }
                 $this->view->success = 1;
                 $this->view->targetName = $pinfo->projectName;
                 break;
             default:
                 $this->view->success = 0;
         }
     }
 }
Example #2
0
 public function projectAction()
 {
     $projectID = (int) $this->_getParam("v");
     $target = $this->_getParam("target");
     $fullUrl = $_SERVER['REQUEST_URI'];
     $exVal = explode("/f/", $fullUrl, 2);
     $fileToView = $exVal[1];
     if (!empty($projectID)) {
         $dir = new Application_Model_Project_GetProject();
         $iFrameOBJ = new Application_Model_Project_Iframe();
         $reviewObj = new Application_Model_DbTable_Reviews();
         $this->view->letItFade = true;
         $this->view->projectID = $projectID;
         $this->view->numberOfComments = " (" . count($reviewObj->getReviews($projectID, "project_ID")) . ") ";
         if ($target == 'iframe') {
             $this->_helper->layout()->disableLayout();
             $this->view->display = 'ifc';
             $this->view->projectContent = $dir->getProject($projectID, $fileToView);
         }
     } else {
         $this->_redirect('preview');
     }
 }