示例#1
0
 public static function hide_place($id)
 {
     $user = getenv('BACKEND_USER');
     $pass = getenv('BACKEND_PASS');
     if (http_login($user, $pass)) {
         $place = Place::find($id);
         $place->confirmed = 0;
         $place->save();
     }
     Flight::redirect('/backend/places', 302);
 }
示例#2
0
 public static function update_place($id)
 {
     $user = getenv('BACKEND_USER');
     $pass = getenv('BACKEND_PASS');
     if (http_login($user, $pass)) {
         $post_data = Flight::request()->data;
         $place = Place::find($id);
         $place->name = $post_data['name'];
         $place->address = $post_data['address'];
         $place->start_hour = $post_data['start_hour'];
         $place->end_hour = $post_data['end_hour'];
         $place->days = $post_data['days'];
         $place->comments = $post_data['comments'];
         $place->save();
     }
     Flight::redirect('/backend/places', 302);
 }