select_friend_response.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file = array('registration','messages','userInfo','admin');
  4. require '../inc/global.inc.php';
  5. require_once api_get_path(LIBRARY_PATH).'image.lib.php';
  6. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  7. require_once api_get_path(LIBRARY_PATH).'social.lib.php';
  8. $this_section = SECTION_MYPROFILE;
  9. $_SESSION['this_section']=$this_section;
  10. api_block_anonymous_users();
  11. $request=api_is_xml_http_request();
  12. $language_variable=api_xml_http_response_encode(get_lang('PendingInvitations'));
  13. $language_comment=api_xml_http_response_encode(get_lang('SocialInvitesComment'));
  14. //api_display_tool_title($language_variable);
  15. ?>
  16. <div id="id_response" align="center"></div>
  17. <?php
  18. $list_get_invitation=array();
  19. $list_get_path_web=array();
  20. $user_id=api_get_user_id();
  21. $list_get_invitation=SocialManager::get_list_invitation_of_friends_by_user_id($user_id);
  22. $list_get_path_web=SocialManager::get_list_web_path_user_invitation_by_user_id($user_id);
  23. $number_loop=count($list_get_invitation);
  24. if ($number_loop==0) {
  25. Display::display_normal_message(api_xml_http_response_encode(get_lang('YouDontHaveInvites')));
  26. }
  27. for ($i=0;$i<$number_loop;$i++) {
  28. ?>
  29. <div id="<?php echo 'id_'.$list_get_invitation[$i]['user_sender_id'] ?>" align="center">
  30. <table width="600" border="0" cellpadding="0" cellspacing="0">
  31. <tr>
  32. <td width="600" height="20" valign="top"><table width="100%" border="0"
  33. cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
  34. <tr>
  35. <td width="600" height="20" valign="top" style="padding:4px;"><div align="left"><b><?php echo api_xml_http_response_encode(get_lang('RequestContact')); ?></b></div></td>
  36. </tr>
  37. </table></td>
  38. </tr>
  39. <tr>
  40. <td height="135" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  41. <tr>
  42. <td width="600" height="135" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  43. <tr>
  44. <td width="600" height="110" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  45. <tr>
  46. <td width="100" height="110" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C8D5E4">
  47. <tr>
  48. <td width="100" height="110" style="padding:4px;" >
  49. <?php $friends_profile = SocialManager::get_picture_user($list_get_invitation[$i]['user_sender_id'], $list_get_path_web[$i]['file'], 92); ?>
  50. <center><img src="<?php echo $friends_profile['file']; ?>" <?php echo $friends_profile['style']; ?> /></center></td>
  51. </tr>
  52. </table></td>
  53. <td width="500" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  54. <tr>
  55. <td width="500" height="22" valign="top">
  56. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  57. <tr>
  58. <td width="500" height="22" valign="top" style="padding:2px;">
  59. <?php
  60. $user_id=$list_get_invitation[$i]['user_sender_id'];
  61. $user_info=api_get_user_info($user_id);
  62. echo api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
  63. ?></td>
  64. </tr>
  65. </table></td>
  66. </tr>
  67. <tr>
  68. <td height="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  69. <tr>
  70. <td width="500" height="5"></td>
  71. </tr>
  72. </table></td>
  73. </tr>
  74. <tr>
  75. <td height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  76. <tr>
  77. <td width="500" height="22" valign="top" style="padding:2px;"><?php
  78. $title=get_lang($list_get_invitation[$i]['title']);
  79. $content=get_lang($list_get_invitation[$i]['content']);
  80. echo api_xml_http_response_encode($title.' : '.$content);
  81. ?> </td>
  82. </tr>
  83. </table></td>
  84. </tr>
  85. <tr>
  86. <td height="61" valign="top" style="padding:2px;"><?php
  87. $date=$list_get_invitation[$i]['send_date'];
  88. echo api_xml_http_response_encode(get_lang('DateSend').' : '.$date);
  89. ?></td>
  90. </tr>
  91. </table></td>
  92. </tr>
  93. </table></td>
  94. </tr>
  95. <tr>
  96. <td height="25" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
  97. <tr>
  98. <td width="600" height="25" valign="top" style="padding:4px;"><div align="right">
  99. <button class="save" name="btn_accepted" type="submit" id="<?php echo "btn_accepted_".$user_id ?>" value="<?php echo api_xml_http_response_encode(get_lang('Accept'));?>"onclick="javascript:register_friend(this)"><?php echo api_xml_http_response_encode(get_lang('Accept')) ?></button>
  100. <button class="cancel" name="btn_denied" type="submit" id="<?php echo "btn_deniedst_".$user_id ?>" value="<?php echo api_xml_http_response_encode(get_lang('Deny')); ?>" onclick="javascript:denied_friend(this)" ><?php echo api_xml_http_response_encode(get_lang('Deny'))?></button>
  101. </div></td>
  102. </tr>
  103. </table></td>
  104. </tr>
  105. </table></td>
  106. </tr>
  107. </table></td>
  108. </tr>
  109. </table>
  110. </div>
  111. <br/>
  112. <?php
  113. }