Example #1
0
 public function tuote_search()
 {
     self::check_logged_in();
     $params = $_POST;
     $empty_parameters_counter = 0;
     if (empty($params['tuote_id'])) {
         // Tuote_id:tä ei ole annettu.
         $empty_parameters_counter++;
     } else {
         TuoteController::find_tuote_post_tuote_id($params['tuote_id']);
         // Mikäli löytyy, ohjataan tuotesivulle
     }
     if (empty($params['tuotteen_nimi'])) {
         $empty_parameters_counter++;
         // Tuotteen nimeä ei ole annettu
     } else {
         TuoteController::find_tuote_post_tuotteennimi($params['tuotteen_nimi']);
         // Mikäli löytyy, ohjataan tuotteiden listaussivulle
     }
     if ($empty_parameters_counter == 2) {
         $errors = 'Et antanut hakuehtoja';
         View::make('Tuote/Tuotteenhakeminen.html', array('errors' => $errors));
     }
 }