Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function listproposalpenilaian_post()
- {
- $username = trim($this->post('username'));
- $level = trim($this->post('level'));
- if ($username == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Username tidak ditemukan.',
- ];
- } elseif ($level == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Level tidak diketahui.',
- ];
- } else {
- if ($level == 'Member') {
- $listProposal = $this->db->order_by('propose_title', 'asc')->get_where('v_proposal', array('propose_status' => 3, 'user_username' => $username))->result();
- } elseif ($level == 'Admin') {
- $listProposal = $this->db->order_by('propose_title', 'asc')->get('v_proposalpenilaian')->result();
- } elseif ($level = 'Reviewer') {
- $this->db->select('p.*');
- $this->db->from('v_proposal p');
- $this->db->join('lemlit_reviewer t', 't.propose_id = p.propose_id');
- $this->db->where('t.user_username', $username);
- $this->db->where('p.propose_status', 3);
- $this->db->order_by('p.propose_title', 'asc');
- $listProposal = $this->db->get()->result();
- }
- if (count($listProposal) == 0) {
- $response = [
- 'resp_error' => false,
- 'resp_msg' => 'Belum Ada Proposal',
- ];
- } else {
- foreach ($listProposal as $r) {
- if ($r->status_desc == '') {
- $status = 'PROSES PENILAIAN';
- } else {
- $status = $r->status_desc;
- }
- if ($r->propose_proposal == '') {
- $berkas = '';
- } else {
- $berkas = base_url('upload_file/proposal/' . $r->propose_proposal);
- }
- $response['items'][] = [
- 'resp_error' => false,
- 'id' => $r->propose_id,
- 'tanggal' => date("d-m-Y", strtotime($r->propose_date)),
- 'user_username' => $r->user_username,
- 'nama' => trim($r->user_name),
- 'judul' => trim($r->propose_title),
- 'kategori' => trim($r->skim_name),
- 'status' => $status,
- 'berkas' => $berkas,
- ];
- }
- }
- }
- $this->response($response, 200);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement