Пример #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;
         }
     }
 }
Пример #2
0
 public function clientsAction()
 {
     $this->view->noAJclients = true;
     $task = $this->_getParam("task");
     $targetActionID = $this->_getParam("t");
     switch ($task) {
         case "attach":
             $this->view->dis = "attach";
             $cu = new Application_Model_DbTable_Users();
             $projectA = new Application_Model_DbTable_Projects();
             $pInfo = $cu->getUser($targetActionID);
             $cRes = $projectA->getProjects();
             $this->view->projects = $cRes;
             $this->view->userID = $targetActionID;
             $this->view->clientName = $pInfo->fullName;
             $this->view->clientEmail = $pInfo->email;
             break;
         case "new":
             $this->view->dis = "new";
             break;
         case "del":
             $this->view->dis = "del";
             $t = $this->_request->getPost('target-id');
             if ($this->getRequest()->isPost() && !empty($t)) {
                 $this->_helper->layout()->disableLayout();
                 $c = new Application_Model_DbTable_Users();
                 $c->delete("id = " . $t);
                 $reviewsObj = new Application_Model_DbTable_Reviews();
                 $DetachObj = new Application_Model_DbTable_ProjectClients();
                 $reviewsObj->deleteUser($t);
                 $DetachObj->deleteUser($t);
             }
             break;
         default:
             $this->view->dis = "list";
             $usrObj = new Application_Model_DbTable_Users();
             $res = $usrObj->fetchAll();
             $this->view->clients = $res;
     }
 }
Пример #3
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');
     }
 }
Пример #4
0
 private function newReview($projectID, $userID, $content)
 {
     if (!empty($projectID) && !empty($userID) && !empty($content)) {
         $comObj = new Application_Model_DbTable_Reviews();
         $exData = array("Browser" => $_SERVER['HTTP_USER_AGENT'], "IP" => $_SERVER['REMOTE_ADDR']);
         $exDataJSON = json_encode($exData);
         $revData = array("project_ID" => $projectID, "user_ID" => $userID, "reviewContent" => $content, "extraData" => $exDataJSON, "dateCreated" => date('Y-m-d H:i:s'));
         $comObj->addNew($revData);
         return 1;
     } else {
         return 0;
     }
 }