qualify_contact.inc.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php //$id: $
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file=array('registration','messages','userInfo','admin');
  4. require_once '../inc/global.inc.php';
  5. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  6. require_once '../inc/lib/social.lib.php';
  7. $user_friend=(int)$_POST['user_friend'];
  8. $list_of_options=array();
  9. $img_user=array();
  10. $img_info_user=array();
  11. $list_of_options=UserFriend::show_list_type_friends();
  12. $path_user=str_replace(array('\\','../','\\0'),array('','',''),$_GET['path_user']);
  13. $img_user =explode('"',$path_user);
  14. $number_list=count($list_of_options);
  15. $user_friend = $user_id = (int)str_replace(array('\\','"'),array('',''),$_GET['id_user']);
  16. $user_info=api_get_user_info($user_friend);
  17. $user_friend_relation=UserFriend::get_relation_between_contacts(api_get_user_id(),$user_friend);
  18. ?>
  19. <input type="hidden" name="user_cod_qualify" id="user_cod_qualify" value="<?php echo $user_friend; ?>"/>
  20. <table width="600" border="0" cellspacing="0" cellpadding="0">
  21. <tr>
  22. <td>
  23. <table width="600" border="0" cellspacing="0" cellpadding="0">
  24. <tr>
  25. <td width="600" align="left">
  26. <td width="50%"><br/>
  27. <img src="<?php echo Security::remove_XSS($img_user[1]); ?>" />
  28. <?php
  29. echo '<br /><br />'.$name_user=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
  30. ?>
  31. </td>
  32. <td width="50%"><div align="left">
  33. <?php
  34. for ($k=0;$k<$number_list;$k++) {
  35. echo '<br />';
  36. if ($list_of_options[$k]['id']==$user_friend_relation) {
  37. $check='checked="checked"';
  38. } else {
  39. $check='';
  40. }
  41. ?>
  42. <input <?php echo $check; ?> style="margin-left:50px" type="radio" class="radio" name="list_type_friend" value="<?php echo api_xml_http_response_encode($list_of_options[$k]['id']); ?>" />
  43. <?php
  44. echo api_xml_http_response_encode(get_lang($list_of_options[$k]['title']));
  45. echo '<br />';
  46. ?>
  47. <?php
  48. }
  49. echo '<br />';
  50. ?>
  51. <button style="margin-left:50px" type="button" class="save" value="<?php echo api_xml_http_response_encode(get_lang('AttachToGroup')); ?>" onclick="set_qualify_friend()"><?php echo api_xml_http_response_encode(get_lang('AttachToGroup')) ?></button>
  52. </div></td>
  53. </td>
  54. </tr>
  55. </table>
  56. </td>
  57. </tr>
  58. </table>