<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
><?php defined(
'SYSPATH'
) OR
die
(
'No direct access allowed.'
);</span> <? Php didefinisikan (
'SYSPATH'
) ATAU mati (
'Tidak ada akses langsung diperbolehkan.'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
class
Album_Controller
extends
Controller</span> kelas Album_Controller meluas Pengendali</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
$album_model
;</span> $ album_model swasta;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
$genre_model
;</span> $ genre_model swasta;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
$list_view
;</span> $ list_view swasta;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
$create_view
;</span> $ create_view swasta;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
$update_view
;</span> $ update_view swasta;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
__construct()</span> fungsi publik __construct ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>parent::__construct();</span> parent :: __ construct ();</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->album_model =
new
Album_Model;</span> $ This-> album_model = Album_Model baru;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->genre_model =
new
Genre_Model;</span> $ This-> genre_model = baru Genre_Model;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->list_view =
new
View(
'list'
);</span> $ This-> list_view =
new
View (
'list'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view =
new
View(
'update'
);</span> $ This-> update_view =
new
View (
'update'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->create_view =
new
View(
'create'
);</span> $ This-> create_view =
new
View (
'membuat'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
index()</span> Indeks fungsi publik ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->show_albums_list();</span> $ This-> show_albums_list ();</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
function
show_albums_list()</span> fungsi swasta show_albums_list ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$albums_list
=
$this
->album_model->get_list();</span> $ Albums_list = $ this-> album_model-> get_list ();</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->list_view->set(
'albums_list'
,
$albums_list
);</span> $ This-> list_view-> set (
'albums_list'
, $ albums_list);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->list_view->render(TRUE);</span> $ This-> list_view-> render (TRUE);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
show_create_editor()</span> fungsi publik show_create_editor ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->create_view->set(
'genres_list'
,
$this
->get_genres_list());</span> $ This-> create_view-> set (
'genres_list'
, $ this-> get_genres_list ());</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->create_view->render(TRUE);</span> $ This-> create_view-> render (TRUE);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
show_update_editor(
$id
)</span> fungsi publik show_update_editor ($ id)</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$album_data
=
$this
->album_model->read(
$id
);</span> $ Album_data = $ this-> album_model-> baca ($ id);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view->set(
'album_id'
,
$album_data
[0]->id);</span> $ This-> update_view-> set (
'album_id'
, $ album_data [0] -> id);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view->set(
'name'
,
$album_data
[0]->name);</span> $ This-> update_view-> set (
'nama'
, $ album_data [0] -> nama);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view->set(
'author'
,
$album_data
[0]->author);</span> $ This-> update_view-> set (
'penulis'
, $ album_data [0] -> penulis);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view->set(
'genre_id'
,
$album_data
[0]->genre_id);</span> $ This-> update_view-> set (
'genre_id'
, $ album_data [0] -> genre_id);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view->set(
'genres_list'
,
$this
->get_genres_list());</span> $ This-> update_view-> set (
'genres_list'
, $ this-> get_genres_list ());</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->update_view->render(TRUE);</span> $ This-> update_view-> render (TRUE);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
create()</span> fungsi publik membuat ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$album_data
=
array
(</span> $ Album_data =
array
(</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
'name'
=>
$this
->input->post(
'name'
),</span>
'Nama'
=> $ this-> input-> pasca (
'nama'
),</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
'author'
=>
$this
->input->post(
'author'
),</span>
'Penulis'
=> $ this-> input-> pasca (
'penulis'
),</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
'genre_id'
=>
$this
->input->post(
'genre_id'
)</span>
'Genre_id'
=> $ this-> input-> pasca (
'genre_id'
)</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>);</span> );</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->album_model->create(
$album_data
);</span> $ This-> album_model-> membuat (album_data $);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>url::redirect(
'album'
);</span> url :: redirect (
'album'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
update()</span> pembaruan fungsi publik ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$album_data
=
array
(</span> $ Album_data =
array
(</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
'name'
=>
$this
->input->post(
'name'
),</span>
'Nama'
=> $ this-> input-> pasca (
'nama'
),</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
'author'
=>
$this
->input->post(
'author'
),</span>
'Penulis'
=> $ this-> input-> pasca (
'penulis'
),</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
'genre_id'
=>
$this
->input->post(
'genre_id'
)</span>
'Genre_id'
=> $ this-> input-> pasca (
'genre_id'
)</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>);</span> );</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->album_model->update(
$this
->input->post(
'album_id'
),
$album_data
);</span> $ This-> album_model-> update ($ this-> input-> pasca (
'album_id'
), $ album_data);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>url::redirect(
'album'
);</span> url :: redirect (
'album'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
public
function
delete
(
$id
)</span> fungsi publik menghapus ($ id)</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$this
->album_model->
delete
(
$id
);</span> $ This-> album_model-> menghapus ($ id);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>url::redirect(
'album'
);</span> url :: redirect (
'album'
);</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
private
function
get_genres_list()</span> fungsi swasta get_genres_list ()</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$db_genres_list
=
$this
->genre_model->get_list();</span> $ Db_genres_list = $ this-> genre_model-> get_list ();</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$genres_list
=
array
();</span> $ Genres_list =
array
();</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
if
(sizeof(
$db_genres_list
) >= 1)</span> jika (sizeof ($ db_genres_list)> = 1)</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
foreach
(
$db_genres_list
as
$item
)</span>
foreach
($ db_genres_list sebagai $ item)</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>{</span> {</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
$genres_list
[
$item
->id] =
$item
->name;</span> $ Genres_list [$ item-> id] = $ item-> nama;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>
return
$genres_list
;</span> kembali $ genres_list;</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>
<span
class
=
"notranslate"
onmouseover=
"_tipon(this)"
onmouseout=
"_tipoff()"
><span
class
=
"google-src-text"
style=
"direction: ltr; text-align: left"
>}</span> }</span>