Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //controller , yang ku tnyakan adalah $data['user'] = $this->user_model->getaktif();
- public function index()
- {
- if ($this->session->userdata('username')=="") {
- redirect('auth');
- }
- $data['username'] = $this->session->userdata('username');
- $data['user'] = $this->user_model->getaktif();
- $this->load->view('admin/welcome_message',$data);
- }
- //model
- function getaktif()
- {
- $username = $this->session->userdata('username');
- $this->db->where('username', $username);
- $this->db->select("*");
- $this->db->from("tabel_user");
- return $this->db->get();
- }
- //view ini bagaimana ya jika gambar itu berisi
- <?php foreach($user->result() as $detail)
- if( $detail['gambar']=='')
- {
- echo "gambar default";
- }
- else
- {
- echo "dari database ambil"
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement