예제 #1
0
파일: index.php 프로젝트: piiskop/pstk
 /**
  * This function is the stn.
  *
  * @access public
  * @author Rasmus <*****@*****.**>
  * @uses PupilView for the visual part
  */
 public static function start()
 {
     require_once dirname(__FILE__) . '/Pupil.php';
     require_once dirname(__FILE__) . '/PupilView.php';
     $search = \students\Pupil::binarySearch();
     if (isset($_GET['lastName']) && $search['guess'] > 0) {
         echo \students\PupilView::buildView(array('title' => 'Students', 'student-class' => 'Visible', 'steps' => "Korduste arv: " . $search['guesstimes'], 'guess' => $search['guess']));
     } elseif (isset($_GET['lastName']) && $search['guess'] < 0) {
         echo \students\PupilView::buildView(array('title' => 'Students', 'student-class' => 'Invisible', 'no-student' => "Sellist õpilast pole.", 'steps' => "Korduste arv: " . $search['guesstimes']));
     } elseif (isset($_GET['lastName']) && $_GET['lastName'] === "") {
         echo \students\PupilView::buildView(array('title' => 'Students', 'student-class' => 'Invisible', 'no-student' => "Sisesta otsinguks õpilase nimi."));
     } else {
         echo \students\PupilView::buildView(array('title' => 'Students', 'student-class' => 'Invisible'));
     }
 }