fungsi minta dan lihat minta delete aja ganti ini:
public function permintaan()
{ //daftar permintaan barang oleh user
$crud = new grocery_CRUD();
$crud->set_table('permintaan');
$crud->set_relation('user_id','user','nama');
$crud->set_subject('Permintaan ');
$crud->where('permintaan.user_id',$this->session->userdata('user_id'));
$crud->where('permintaan.status','0'));
$crud->callback_field('user_id',array($this,'_user_id')); $crud->display_as('user_id','Nama Peminta');
$crud->callback_column('status',array($this,'_callback_status_minta'));
$output = $crud->render();
$this->load->view('main.php',$output);
}
public function accept_minta()
{ //daftar permintaan yang sudah di accept
$crud = new grocery_CRUD();
$crud->set_table('permintaan');
$crud->set_relation('user_id','user','nama');
$crud->set_subject('Permintaan ');
$crud->where('permintaan.user_id',$this->session->userdata('user_id'));
$crud->where('permintaan.status','1'));
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
$crud->display_as('user_id','Nama Peminta');
$crud->callback_column('status',array($this,'_callback_status_minta'));
$output = $crud->render();
$this->load->view('main.php',$output);
}
public function daftar_minta()
{ //daftar permintaan yang pending ,untuk admin
$crud = new grocery_CRUD();
$crud->set_table('permintaan');
$crud->set_relation('user_id','user','nama');
$crud->set_subject('Permintaan ');
$crud->where('permintaan.status','0'));
$crud->display_as('user_id','Nama Peminta');
$crud->callback_column('status',array($this,'_callback_status_minta'));
$output = $crud->render();
$this->load->view('main.php',$output);
}
public function daftar_accept_minta()
{ //daftar permintaan yang sudah di accept ,untuk admin
$crud = new grocery_CRUD();
$crud->set_table('permintaan');
$crud->set_relation('user_id','user','nama');
$crud->set_subject('Permintaan ');
$crud->where('permintaan.status','1'));
$crud->unset_add();
$crud->display_as('user_id','Nama Peminta');
$crud->callback_column('status',array($this,'_callback_status_minta'));
$output = $crud->render();
$this->load->view('main.php',$output);
}
Tidak ada komentar:
Posting Komentar
pembaca yang baik selalu menginggalkan jejak