function _is_approved($field) { $approved_unis = new Approveduni(); $approved_unis->where('uni', $this->{$field})->get(); if (empty($approved_unis->id)) { $this->error_message('uni', "Your UNI was not approved on the Scholars' database."); return FALSE; } else { return TRUE; } }
function removeapproval($id) { if ($id) { $a = new Approveduni(); $a->where('id', $id)->get(); if (isset($a->id)) { $a->delete(); } else { $this->session->set_flashdata('msg', 'Invalid id to remove.'); } } redirect('users/approve'); }