<?php
include("includes/site_info.php");
include("session_handler.inc");
include("includes/functions.php");
include('lib/lib.Functions.php');
include_once __INCLUDE_CLASS_PATH."/class.Picture.php";
$picture = new Picture();

$WUserID = $_SESSION['Sess_UserId'];
$WUserType = $_SESSION['Sess_UserType'];

################

$friend=mysql_query("SELECT uid, friend_uid, mem_profileid, mem_username, mem_userid, mem_nickname FROM my_friends LEFT JOIN members ON (uid=mem_userid) WHERE friend_uid ='$WUserID' AND approved='0' AND status='P'");

?>
<link rel="stylesheet" type="text/css" href="selectlist.css" />
<script type="text/javascript" src="js/jquery.selectlist.js"></script>
<script type="text/javascript">  
jQuery.noConflict();
jQuery(document).ready(function () { 
	jQuery('select').selectList();
}); 

</script> 
<div class="p5 width_600">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><div id="sub_content">
              <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" class="white_back_t_xb p10">
                <?php 
	 while ($ret_pic = mysql_fetch_object($friend)) {
$photo_query=mysql_query("SELECT * FROM pictures WHERE pic_userid = '$ret_pic->mem_userid' and pic_default='Y' and pic_private='N'") or die(mysql_error());
$pics_count = mysql_num_rows($photo_query);
$aPicture = mysql_fetch_object($photo_query);
if ($pics_count > 0) {
	$medium = $aPicture->pic_picture."_ps.".$aPicture->ext;
	$male1_picture1 = "members/$ret_pic->mem_username/picture/$medium";
             }else{
$male1_picture1=$picture->GetProfilePicture($ret_pic->mem_userid);
}

if ($ret_pic->mem_profileid != null) { $male1_name1= $ret_pic->mem_profileid; }
else { $male1_name1= $ret_pic->mem_username; }

?>
                <tr class='solid_line_separator'>
                  <td width='50px' align='left' valign="top"><a href="<?=$CONST_LINK_ROOT?>/<?=$male1_name1?>"><img src="<?=$CONST_LINK_ROOT?>/<?=$male1_picture1?>" width="50" height="50" class="image_border" title="Name:&nbsp;<?=ucwords($male1_name1)?>"/></a></td>
                  <td align='left' width='100%'>
                   <div id="formlayer_<?=$ret_pic->uid?>"><form action="javascript:void(null);" name="form_<?=$ret_pic->uid?>" id="form_<?=$ret_pic->uid?>"> Accept <?=ucwords($male1_name1)?> as your:- 
                    <input type="hidden" name="friend_uid" value="<?=$ret_pic->friend_uid?>" />
                    <input type="hidden" name="uid" value="<?=$ret_pic->uid?>" />
  <select multiple="multiple" id="sfolder" title="Label Me" name="sfolder[]">
					<?php 
	$folder_query=mysql_query("SELECT * FROM my_friend_folder where (user_id=0 or user_id='$WUserID')order by name ASC ") or die(mysql_error());
	while($folder=mysql_fetch_array($folder_query)){?>
        <option value="<?=$folder['folder_id']; ?>"><?=$folder['name']; ?></option>
      <?php }?>
					</select>
                      <div class="style_left"><input name="Approve" type="button" class="button" id="Approve" onclick="javascript:getInvitation(this.parentNode.parentNode, this.id, 'formlayer_<?=$ret_pic->uid?>');" value="Approve" />
                    <input id="Reject" type="button" class="button" onclick="javascript:getInvitation(this.parentNode.parentNode,this.id, 'formlayer_<?=$ret_pic->uid?>');" value="Ignore" />
                      </div>
                    </form> </div>
                  </td>
                </tr>
                <? 
				$i++;
				} ?>
              </table>
            </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</div>