amoasband) about living the flip phone life. This episode of Tech Bites (@techbiteshrn) is sponsored by Joule Sous Vide by ChefSteps (@chefsteps).
<gh_stars>0
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login_model extends CI_Model
{
	public function __construct() {

        parent::__construct();
        $this->load->database('amti');
    }
	
	public function login() {

		$users_uname=$this->input->post('users_uname');
		$users_pass=$this->input->post('users_pass');

		$this->db->select('*');
		$this->db->from('users');
		$this->db->where('users_uname',$users_uname);
		$this->db->where('users_pass',md5($users_pass));

		$query = $this->db->get();
		$row = $query->result_array();
		$num_rows=$query->num_rows();
		
		if($num_rows == 1){

            if ($row[0]['users_status']=="active") {

            	$sessions = array(
	                'username' => $row[0]['users_uname'],
	                'role' => $row[0]['users_role'],
	                'fname' => $row[0]['users_fname'],
	                'lname' => $row[0]['users_lname'],
	               'status' => $row[0]['users_status'],
	                'userid' => $row[0]['users_id'],
	                'empno' => $row[0]['users_empno'],
	                'is_logged' => 1
	            );
	            $this->session->set_userdata($sessions);

	            redirect('main/');
	            
            } else {

            	$alert = '
	                <div class="row">
	                    <div class="col-md-12">
	                        <div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: 10px;">
	                            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	                            <span class="fa fa-exclamation-triangle"></span>
	                                &nbspThis account is currently deactivated
	                        </div>
	                    </div>
	                </div>
	            ';

	            $this->session->set_flashdata('alert', $alert);
	            redirect('main/login');
            }

		} else {

			$alert = '
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: 10px;">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <span class="fa fa-exclamation-triangle"></span>
                                &nbspInvalid username or password
                        </div>
                    </div>
                </div>
            ';

            $this->session->set_flashdata('alert', $alert);
            redirect('main/login');
		}	
	} 

	public function login_status($users_uname) {

		$this->db->select('users_uname, users_pass');
		$this->db->from('users');
		$this->db->where('users_uname',$users_uname);
		$this->db->where('users_status','active');

		$query = $this->db->get();
		if($query->num_rows() == 1){
			return true;
		}
		else{
			return false;
		}
	}
}

?>Totally agreed. If some rando beats the game with cheats, whatever. If they came to this sub to brag about it they'd be downvoted into oblivion but it doesn't really matter. This isn't about letting people enjoy things the way that they prefer.

This person is a game journalist, paid to play games and review them. Why would I trust the opinion of a "professional" that couldn't finish the game that they were assigned? What's the point of paying this person to write about a game that they cheated to beat?Tuesday, May 24, 2011
28 things - things 14, 15, 16 & 17
No it doesn't hurt, I just like making weird faces.
15. Sometimes I am really bad at following through with things. Case in point...these 28 things! I had great plans to do an awesome photo for each one but sometimes things get a little busy. I'm sure everyone can relate to this!
16. As much as I love animals I can't watch movies that are heavily based on animals because I get too upset if they die. Spoiler alert: 'I am Legend' made me sob. Not just during that one part either...but for the whole rest of the movie anytime I thought about it. I'm so wimpy!!
17. I am famously bad at dealing with change. Before when my mom was thinking of moving, everyone in my family that she mentioned it to responded with "Have you told elycia? Is she ok with this?" I feel like over the years I have become better at dealing but I have earned myself quite a reputation!
♥elycia
thing 1... thing 2... thing 3... thing 4... thing 5... thing 6... thing 7... thing 8... thing 9...thing 10... thing 11... thing 12... thing 13
Oh I sobbed sohard at I Am Legend, we almost had to turn it off :(
If you have that feeling with 'I am Legend', I sure hope you haven't seen 'Marley and me' yet.
I think I never cried that hard before during a movie!
haha youve got some stretch armstrong hands!
<3 steffy
Steffys Pros and Cons
I feel the same about animals, I just can't handle anything bad happening to them!
wow!!! that is crazy! and awesome.
i always fail at following through with stuff like that. hmph! it makes me angry too.
omg, i am the same way about change. i am so sentimental. & every time my mom even mentions moving out of our child hood home i am like NOOOOOO.
XOOXO
hahaha this is so much fun. when i read this post i also tried to do this with my hand... but it didn´t work... it´s amazing. :D
I'm the same way about animals dying in movies. I heard that the dog dies in 'I Am Legend,' so I've purposefully avoided it!
I can totally relate to thing 15, 16 and 17! Really, it's like you're talking about me!!!
:)
Yes, "I Am Legend" was soooo sad! I've started to think all of Will Smith's movies are sad lately, I cried so hard during "Seven Pounds." I remember reading "Old Yeller" as a child and also crying. A lot.
Movies and books are supposed to be happy!!!!!!!!!
I can do the same thing with my fingers! Glad I'm not the only one!!!
♡ Brooke
You're definitely not along with the I Am Legend thing. I sobbed too... in the middle of a flight. That was a tad embarrassing.
my brother can bend his fingers back like that! only his fingers can touch his arm. my special talent: double-jointed elbows. :)
~chantillysongs
I was wondering where your 28 things post had gone. Glad it's back. :)
♥ sécia
Same way with animal movies. And scary movies are the WORST because 100% of the time an animal dies. Hate hate hate it. I'm a cry baby that way.
this blog is absolutely fabulous...nothing more i can say...i found so many great blogs in one day!!!! lol :))
You have a new follower...can't wait to read more!! :))
♥
Vendella
I balled my eyes out in I Am Legend! In the middle of the movie theatre I was sobbing and even Corey was looking at me wierd.
Ahh!! I gasped at your fingers! That's quite scary.
I don't like the movie I am Legend. I don't like any movies that don't have a happy ending, or where the main character dies or something at the end:
I am Legend
Million Dollar Baby
Blow
Pan's Labyrinth is the exception, because it's sad but also sort of happy. And awesome.
Crazy Girl!
Ewww Haha double jointed-ness sorta freaks me out :)
glad to hear i'm not the only wimp ;)
miss vendella, welcome! thanks for stopping by, you're so sweet :)
I CAN BEND MY FINGERS BACK TOO!!! Not that far though, that is IMPRESSIVE