Exemplo n.º 1
0
 public function add()
 {
     $play = DB::table(Playlist::$table)->insert_get_id(array('id_playlist' => null, 'name_playlist' => $this->_name_playlist, 'date_creation_playlist' => $this->_update));
     $user = Session::get('user');
     $admin = new adminPlaylist($user->get_id_user_lif(), $play, 'A');
     $admin->add();
     return $user;
 }
Exemplo n.º 2
0
 public function action_index()
 {
     $user = $this->is_logged();
     if ($user === false) {
         return Redirect::to_action('login');
     } else {
         $playlist = adminPlaylist::get_completed($user->get_id_user_lif());
         $search = "";
         if (isset($_POST['toSeek'])) {
             $search = $_POST['toSeek'];
         }
         $song = Song::all_completed($_POST['toSeek']);
         return View::make('search.index')->with('toSeek', $_POST['toSeek'])->with('playlist', $playlist)->with('count', count($song))->with('song', $song);
     }
 }
Exemplo n.º 3
0
 public function action_index()
 {
     $user = $this->is_logged();
     if ($user === false) {
         return Redirect::to_action('login');
     } else {
         $song_std = Song::from_id($user->get_id_user_lif());
         $song = array();
         $playlist = adminPlaylist::get_completed($user->get_id_user_lif());
         foreach ($song_std as $value) {
             $one = new Song($value->id_song, $value->id_user_lif, $value->title_song, $value->date_song, $value->length_song, $value->path_song, $value->track_song);
             $one->complete();
             array_push($song, $one);
         }
         return View::make('content.song.index')->with('playlist', $playlist)->with('song', $song);
     }
 }
Exemplo n.º 4
0
 public function action_remove_user_from_playlist()
 {
     $user = $this->is_logged();
     if ($user === false) {
         return Redirect::to_action('login');
     } else {
         $ap = new adminPlaylist($_POST['id_user'], $_POST['id_playlist']);
         if ($ap->check_exists() == 1) {
             if ($ap->delete() == 1) {
                 echo 1;
             } else {
                 echo 0;
             }
         } else {
             echo -1;
         }
     }
 }