public static function getAllProgramsFromDatabase($dbConn)
 {
     $programIds = readFromDatabase::readEntireColumnFromTable($dbConn, array(self::ID_COLUMN_NAME), self::TABLE_NAME);
     $programs = array();
     foreach ($programIds as $programId) {
         $program = new Program($dbConn, $programId[self::ID_COLUMN_NAME]);
         $programs[$program->getId()] = $program->getName();
     }
     return $programs;
 }
Ejemplo n.º 2
0
 /**
  * Display welcome information
  * Might display list of program, cycles in a program, or an application welcome page dependign on the url
  * Enter description here ...
  */
 public function actionIndex()
 {
     if (is_null($this->program)) {
         $this->setVar('programs', $this->_em->getRepository('Jazzee\\Entity\\Program')->findAllActive());
         $this->setLayoutVar('layoutTitle', 'Select a Program');
         $this->loadView($this->controllerName . '/programs');
         return true;
     }
     if (empty($this->application)) {
         $this->setLayoutVar('layoutTitle', $this->program->getName() . ' Application');
         $this->setVar('applications', $this->_em->getRepository('Jazzee\\Entity\\Application')->findByProgram($this->program, false, true));
         $this->loadView($this->controllerName . '/cycles');
         return true;
     }
     if (!$this->application->isPublished() or $this->application->getOpen() > new DateTime('now')) {
         $this->addMessage('error', $this->application->getCycle()->getName() . ' ' . $this->application->getProgram()->getName() . ' is not open for applicants');
         $this->redirectPath('apply/' . $this->application->getProgram()->getShortName());
     }
     $this->setLayoutVar('layoutTitle', $this->cycle->getName() . ' ' . $this->program->getName() . ' Application');
     $this->setVar('application', $this->application);
 }
Ejemplo n.º 3
0
 /**
  * Set program
  *
  * @param \Jazzee\Entity\Program $program
  */
 public function setProgram(Program $program)
 {
     if ($this->isGlobal) {
         throw new \Jazzee\Exception("{$this->name} is global but you are trying to set its program to " . $program->getName());
     }
     $this->program = $program;
 }
Ejemplo n.º 4
0
 /**
  * @return string
  */
 public function getProgramName()
 {
     return $this->program != null ? $this->program->getName() : "";
 }