linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file _ajax_user_autocomplete.php

Documentation is available at _ajax_user_autocomplete.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage workshop
  5.  * @author Simon Georget <simon@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. include_once('../config/define.php');
  12.  
  13. //////////// Check Droits utilisateur ////////////
  14. if (!$l21auth->hasRight('workshop')) ReloadIndex('admin');
  15. ////////////
  16.  
  17. include_once('../workshop/'.SQL.'.inc.php');
  18.  
  19. if(isset($_GET['groupmembers'])) $data=$sql_object->DBSelect(SQL_getWorkgroupUsersList($_GET['groupmembers']));
  20. if($_GET['type']=='O'$data=$sql_object->DBSelect(SQL_getOrganizersList());
  21. if($_GET['type']=='U'$data=$sql_object->DBSelect(SQL_getAllUsersList());
  22.  
  23. $response array();
  24.  
  25. foreach ($data as $i => $user)
  26. {
  27.   $fullname '';
  28.   if(!empty($user['profile_firstname']|| $user['profile_lastname']{
  29.       $fullname ' - '$user['profile_firstname'].' '.$user['profile_lastname'];
  30.   }
  31.   $str_id $user['user_login'];
  32.   $html_str $user['user_login'$fullname ' ('.$user['profile_email'].')';
  33.   $response[array($str_id$html_strnull$html_str);
  34. }
  35.  
  36. header('Content-type: application/json');
  37. echo json_encode($response);

Documentation generated on Thu, 20 Mar 2014 16:49:46 +0100 by phpDocumentor 1.4.1