{% extends "layout-private.html" %} {% block title %} Materi - {{ parent() }} {% endblock %} {% block content %}

Materi

{{ get_flashdata('materi')|raw }}
{% if is_siswa() == false %}
{{ anchor('materi/add/tertulis', 'Tambah Materi Tertulis', {'class' : 'btn btn-primary'})|raw }} {{ anchor('materi/add/file', 'Tambah Materi File', {'class' : 'btn btn-primary'})|raw }}
{% endif %} Filter
{{ form_open('materi')|raw }}
Mapel
    {% for m in mapel %}
  • {% endfor %}
Kelas
    {% for k in kelas %}
  • {% endfor %}
Tipe
Judul
Konten
Pembuat

{% for no, m in materi %} {% if is_admin() == true %} {% set action_edit = true %} {% set action_delete = true %} {% elseif is_pengajar() == true %} {% if m.pengajar_id == get_sess_data('user', 'id') %} {% set action_edit = true %} {% set action_delete = true %} {% else %} {% set action_edit = false %} {% set action_delete = false %} {% endif %} {% elseif is_siswa() == true %} {% if m.siswa_id == get_sess_data('user', 'id') %} {% set action_edit = true %} {% set action_delete = true %} {% else %} {% set action_edit = false %} {% set action_delete = false %} {% endif %} {% endif %} {% endfor %}
ID Informasi Materi Tipe Materi
{{ m.id }} {{ m.judul }}
{{ m.mapel.nama }} {% for mk in m.materi_kelas %} , {{ mk.nama }} {% endfor %}
Pembuat : {{ m.pembuat.nama }}, {{ tgl_jam_indo(m.tgl_posting) }} , {{ (m.file is empty) ? 'Dibaca' : 'Diunduh' }} : {{ m.views }}
{{ (m.file is not empty) ? 'File' : 'Tertulis' }}
{% if m.file is not empty %} {% set url_type = 'file' %} {% else %} {% set url_type = 'tertulis' %} {% endif %} {{ anchor('materi/detail/' ~ m.id, ' Detail', {'class' : 'btn btn-default btn-small', 'target' : '_blank'})|raw }} {% if action_edit == true %} {{ anchor('materi/edit/' ~ url_type ~ '/' ~ m.id ~ '/' ~ enurl_redirect(current_url()), ' Edit', {'class' : 'btn btn-default btn-small'})|raw }} {% endif %} {% if action_delete == true %} {{ anchor('materi/delete/' ~ m.id ~ '/' ~ enurl_redirect(current_url()), ' Hapus', {'class' : 'btn btn-default btn-small', 'onclick' : "return confirm('Anda yakin ingin menghapus?')"})|raw }} {% endif %}

{{ pagination|raw }}
{% endblock %}