<?php
/**
 * Get Users Login
 */

    if( count( $_REQUEST['datauid'] ) ){
        
        $uid_array = array();
        
        foreach( $_REQUEST['datauid'] as $uid ){
            array_push( $uid_array , "'". intval( $uid ) ."'" );
        }
        
        if( $uid_array ){
            
             $query = db::$i->q("SELECT `id`,`email`,`firstname`,`lastname` FROM `user` WHERE `id` IN(".( join( ',' , $uid_array ) ).")",true);
             //js::$i->setJSON( 'query' , db::$i->query );
             
             if( db::$i->rows ){

                    while( $item = db::$i->f( $query ) ){
                        
                        $parsed_login = ( $item['firstname'] ? ( $item['firstname'] . ( $item['lastname'] ? ( ' ' . $item['lastname'] ) : '' ) ) : $item['email'] );
                        if( $item['status'] == 2 ) $parsed_login = '<span style="color:red !important">'.$parsed_login.'</span>';
                        
                        $login_array[] = array(
                            'uid' => $item['id'],
                            'login' => $parsed_login
                        );
                    }
                    
                    js::$i->setJSON('login_array',$login_array);
                    js::$i->setJSON('status','ok');
                    
             } else {
                
                js::$i->setJSON('status','ok');
                js::$i->setJSON('msg',l(statement::$default_text['mysql']['text']));
                
             }
            
        } else {
            
            js::$i->setJSON('status','err');
            js::$i->setJSON('msg',l(statement::$default_text['empty']['text']));
            
        }
    }



?>