select_friend_response.php 5.9 KB

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