Example #1
0
 public function actionView()
 {
     $jobId = isset($_GET['job_id']) ? $_GET['job_id'] : "";
     $details = Job::getById($jobId);
     //stub values...But believe you need them
     $page_num = 1;
     $limit = 15;
     if ($details == null) {
         $this->actionSearch();
         return;
     }
     $employer = $details->getEmployer();
     $url = $details->jobId . "/" . cleanUrl($details->title);
     $fb = urlencode("http://www.yedoe.com/pc/project/" . $url);
     $fbUrl = "http://facebook.com/sharer/sharer.php?u=http://www.yedoe.com/project/" . $fb;
     $twitterText = $details->title;
     $twitterVia = "yedoe";
     $twitterUrl = "http://twitter.com/intent/tweet/?text={$twitterText}&url={$fb}&via={$twitterVia}";
     //calculate time till expiry
     $created = $details->postedDate;
     $expires = !is_null($details->expiryDate) ? $details->expiryDate : "";
     $format = "";
     if ($expires != "") {
         $from = new DateTime($created);
         $till = new DateTime($expires);
         $now = new DateTime(date('Y-m-d'));
         if ($till < $now) {
             $format = false;
         } else {
             $interval = $from->diff($till);
             $format = $interval->format('%a');
         }
     }
     $loggedUser = new StudentController();
     $applications = $details->getBids($page_num, $limit);
     $haveApplied = !Application::userJobPairExists($details->jobId, $loggedUser->me->userID);
     $num_applications = $applications['num_rows'];
     include __VIEWPATH__ . $this->views_dir . "view.php";
 }
Example #2
0
 public function apply($jobId)
 {
     if (Application::userJobPairExists($jobId, $this->userID)) {
         return false;
     }
     $app = new Application();
 }