Welcome Guest, Not a member yet? Register   Sign In
Switch not going to last case
#1

(This post was last modified: 07-07-2017, 05:50 AM by wolfgang1983.)

On my page I can see who's online and away. How every it does not switch to offline.

Does not go to the last switch case seems to stop at away How can I make sure switches offline correct.

I have set it up in short time intervals for testing 


PHP Code:
$questions_userinfo $this->question_model->get_user($question_info['question_user_id']);

$whosonlinetime time();

$online '';

switch (
$whosonlinetime) {

case 
$whosonlinetime $questions_userinfo['online'] + 300:

$online '<span class="text-success">[ONLINE]</span>';

break;

case 
$whosonlinetime $questions_userinfo['online'] + 400:

$online '<span class="text-warning">[AWAY]</span>';

break;

case 
$whosonlinetime $questions_userinfo['online'] + 600:

$online '<span class="text-danger">[OFFLINE]</span>';

break; 
}

$data['online'] = $online
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
Switch not going to last case - by wolfgang1983 - 07-07-2017, 05:49 AM
RE: Switch not going to last case - by rtenny - 07-07-2017, 05:53 AM
RE: Switch not going to last case - by skunkbad - 07-07-2017, 08:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB