<?php
session_start();

include("../includes/site_config.php");

include('../session_handler.inc');

include('../pop_lists.inc');

include('../error.php');

include_once __INCLUDE_CLASS_PATH."/class.DB.php";

include_once __INCLUDE_CLASS_PATH."/class.Picture.php";

include_once __INCLUDE_CLASS_PATH."/class.Gallery.php";

include_once __INCLUDE_CLASS_PATH."/class.GalleryItem.php";

include_once __INCLUDE_CLASS_PATH."/class.Audio.php";

include_once __INCLUDE_CLASS_PATH."/class.Video.php";

include_once __INCLUDE_CLASS_PATH."/class.ItemManager.php";

$option_manager = new OptionManager();

$db = new DB();

include('../message.php');

 $mode=$_GET['mode'];

 $edit_mem=form_get('edit_mem');
 

# retrieve the template

$area = 'member';

//echo "<PRE>";
//print_r($_REQUEST);


$Sess_UserType = $_SESSION['Sess_UserType'];


if ($Sess_UserType != "A") {

        exit;

}



function getTemplateByName($name,$data,$lang_ID){

    $mailtemplate =& MTemplateManager::getInstance();

    $m_template = $mailtemplate->Get($name);

    return array($m_template->type,$m_template->Parse($data,$lang_ID));

}

function getDefaultLanguage($mem_id){

    $db =& DB::GetInstance();

    $mem_id = $db->escape($mem_id);

    $query="SELECT lang_id FROM members WHERE mem_userid='$mem_id'";

    return $db->get_var($query);

}



function send_mail  ($to_address,  $from_address,  $subject,  $message, $type, $on_switch, $send_type='outside',$charset='ISO 8859-1')  {



GLOBAL $Sess_UserId;

GLOBAL $Sess_UserName;



    if ($send_type == 'inside' || $send_type == 'inside_hidden'){



        $res = mysql_query("SELECT * FROM members WHERE mem_email='$to_address'");

        echo mysql_error();

        if ($receiver = mysql_fetch_assoc($res)){



	        $tempdate=date("Y/m/d");

	        $message = mysql_real_escape_string($message);

	        $title = mysql_real_escape_string($title);



	        mysql_query("INSERT INTO messages SET

	                msg_senderid    = $Sess_UserId,

	                msg_receiverid  = $receiver[mem_userid],

	                msg_senderhandle= '$Sess_UserName',

	                msg_title   = '$subject',

	                msg_text    = '$message',

	                msg_dateadded = '$tempdate',

	                msg_read = 'U'".(($send_type == 'inside_hidden')?", msg_senderdel = 'Y'":""));

        }

    }elseif($send_type == 'outside'){

            if ($type == "html" || $type == "text/html") {

                $headers = "MIME-Version: 1.0\n";

                $headers .= "Content-Type: text/html; charset=$charset\n";

                $headers .= "Content-Transfer-Encoding: 8bit\n";

                $headers .= "From: $from_address\n";

                $headers .= "Reply-To: $from_address\n";

            } else {

                $headers = "MIME-Version: 1.0\n";

                $headers = "Content-Type: text/plain; charset=$charset\n";

                $headers .= "From: $from_address\n";

                $headers .= "Reply-To: $from_address\n";

            }



            if ($on_switch=='ON')

            {

                $message = stripslashes($message);

                ini_set("sendmail_from",$CONST_MAIL);

                mail($to_address,$subject,$message,$headers);

            }

    }

}






# process an authorisation

if ($mode=='next') {

    $txtComment=$_POST['txtComment'];
	  

    $txtMyComment=$_POST['txtMyComment'];
	
    $txtTitle=$_POST['txtTitle'];
	

    $rdoApprove=$_POST['rdoApprove'];
	

 	$hiddenuserid=$_POST['hiddenuserid'];
	//echo $hiddenuserid;

    $hiddenname=$_POST['hiddenname'];
	

    $hiddenemail=$_POST['hiddenemail'];
	

    $offset=$_POST['offset'];
	

    $reason=stripslashes($_POST['reason']);
	

    $txtComment=mysql_real_escape_string($txtComment);

    $txtTitle=mysql_real_escape_string($txtTitle);

    if ($rdoApprove=='Approve') {

            # approved will show up in search

           $query="update adverts set adv_title = '$txtTitle', adv_comment = '$txtComment', adv_approved = 1 where adv_userid=$hiddenuserid";
 			
			$txtMyComment=mysql_escape_string($txtMyComment);

	 			
            if (!mysql_query($query,$link)) { error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}

			$query="REPLACE INTO mymatch (mym_userid, mym_comment)
					VALUES ($hiddenuserid, '$txtMyComment')";
			mysql_query($query,$link) or die(mysql_error());

           // $query="update mymatch set mym_comment = '$txtMyComment' where mym_userid=$hiddenuserid";

           // if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}



            $data['ReceiverName'] = $hiddenname;

            $data['CompanyName'] = $CONST_COMPANY;

            $data['Url'] = $CONST_URL;

            $data['SupportEmail'] = $CONST_SUPPMAIL;

			$CONST_MAIL = $option_manager->GetValue('mail'); 


            list($type,$message) = getTemplateByName("Approve_Mail",$data,getDefaultLanguage($hiddenuserid));

            send_mail ("$hiddenemail", "$CONST_MAIL", "$CONST_COMPANY ".PRGAUTHADS_APR, $message,$type,"ON");

            $admin_action = 'Y';

            //include("$SITE_ROOT/generate_profile.php");
			
	/*	?>
			<script language="javascript">
window.location='index.php';
   // header("Location: prgpicadmin.php");

   // exit;
</script>
<?php */
   

    } 
	
	
elseif ($rdoApprove=='Reject') {

            # rejected will not show up in search or for approval until user amends

            $query="update adverts set adv_title = '$txtTitle', adv_comment = '$txtComment',adv_approved = 2, adv_rejectreason = '".mysql_escape_string($reason)."' where adv_userid=$hiddenuserid";
				
		 //echo $query;

            if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}

            $query="update mymatch set mym_comment = '$txtMyComment' where mym_userid=$hiddenuserid";

            if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}

            $data['ReceiverName'] = $hiddenname;

            $data['CompanyName'] = $CONST_COMPANY;

            $data['Url'] = $CONST_URL;

            $data['Reason'] = $reason;

            $data['SupportEmail'] = $CONST_SUPPMAIL;
			
			$CONST_MAIL = $option_manager->GetValue('mail'); 


            list($type,$message) = getTemplateByName("Reject_Mail",$data,getDefaultLanguage($hiddenuserid));

            send_mail ("$hiddenemail", "$CONST_MAIL", "$CONST_COMPANY ".PRGAUTHADS_UNAPR, $message,$type,"ON");



    } elseif ($rdoApprove=='Skip') {

        $offset++;

    }

}

# select advert data

//Time operations

$curr_time = time();

$mod_time = $curr_time - BLOCK_PERIOD_AVAILABLE;

$modified_time = date("Y-m-d H:i:s", $mod_time);

//EOF Time operations



if (!$offset) $offset=0;

$blocking = mysql_query("LOCK TABLES adverts WRITE READ"); // Lock table for Read and Write

//$result = mysql_query("SELECT *, mem_email, mem_confirm

//                       FROM adverts

//                           LEFT JOIN members ON (adv_userid=mem_userid)

//                           WHERE block_time<='$modified_time' AND adv_approved=0 AND mem_confirm = 1 LIMIT $offset,1",$link);




if($mode=='EDIT')
{
 $result = mysql_query("SELECT *, mem_email, mem_confirm

                       FROM adverts

                           LEFT JOIN members ON (adv_userid=mem_userid)

                           WHERE adv_userid=$edit_mem LIMIT $offset,1",$link);

 $TOTAL = mysql_num_rows($result);


}
else{

$result = mysql_query("SELECT *, mem_email, mem_confirm

                       FROM adverts

                           LEFT JOIN members ON (adv_userid=mem_userid)

                           WHERE adv_approved=0 AND mem_confirm = 1 LIMIT $offset,1",$link);


$TOTAL = mysql_num_rows($result);
}
# if nothing is returned then show error otherwise get data

if ($TOTAL < 1) {

 
        //$error_message="<p><a href='$CONST_LINK_ROOT/admin/index.php'>Continue</a></p>";

        //display_page($error_message,PRGAUTHADS_TEXT1);
echo "<script> location.href='$CONST_LINK_ROOT/admin/index.php'</script>";

} else {

        $sql_array = mysql_fetch_object($result);

        $update_blocktime = mysql_query("UPDATE adverts SET block_time = NOW() WHERE adv_userid = '".$sql_array->adv_userid."'");

}

$end_blocking = mysql_query("UNLOCK TABLES"); //Unlock Table

# place advert data into variables for display

$advuser=$sql_array->adv_userid;

$advname=$sql_array->adv_username;

$country=$sql_array->adv_countryid;

$state=$sql_array->adv_stateid;

$city=$sql_array->adv_cityid;

$location=$sql_array->adv_location;

$seeking=$sql_array->adv_seeking;

$bodytype=$sql_array->adv_bodytype;

$marital=$sql_array->adv_marital;

$ethnicity=$sql_array->adv_ethnicity;

$religion=$sql_array->adv_religion;

$children=$sql_array->adv_children;

$smoker=$sql_array->adv_smoker;

$drink=$sql_array->adv_drink;

$eyecolor=$sql_array->adv_eyecolor;

$haircolor=$sql_array->adv_haircolor;

$height=$sql_array->adv_height;

$advtitle=$sql_array->adv_title;

$employment=$sql_array->adv_profession;

$income=$sql_array->adv_income;

$education=$sql_array->adv_education;

$picture=$CONST_LINK_ROOT.$sql_array->adv_picture;

$email=$sql_array->mem_email;

$comment=$sql_array->adv_comment;

$sex=$sql_array->adv_sex;

$comment=stripslashes($comment);

$advtitle=stripslashes($advtitle);

if ($sql_array->adv_seekmen=='Y') {$seekmen='checked';} else {$seekmen='';}

if ($sql_array->adv_seekwmn=='Y') {$seekwmn='checked';} else {$seekwmn='';}

if ($sql_array->adv_seekcpl=='Y') {$seekcpl='checked';} else {$seekcpl='';}

$result=mysql_query("SELECT * FROM mymatch WHERE mym_userid=$advuser") or die(mysql_error());

if (mysql_num_rows($result) > 0) $sql_they=mysql_fetch_object($result);

if ($sql_they->mym_gender=='M') $mygender= PRGSTATS_MALES;

elseif ($sql_they->mym_gender=='F') $mygender= PRGSTATS_FEMALES;

elseif ($sql_they->mym_gender=='C') $mygender= PRGSTATS_COUPLE;




$you_count =$db->get_var("SELECT count(*) FROM youtube WHERE you_userid=$advuser");
?>

<script language=javascript>
function getCookie(name){
   var result = null;
   var myCookie = " " + document.cookie + ";";
   var searchName = " " + name + "=";
   var startOfCookie = myCookie.indexOf(searchName);
   var endOfCookie;

   if (startOfCookie != -1){
      startOfCookie += searchName.length;
      endOfCookie = myCookie.indexOf(";",startOfCookie);
      result = unescape(myCookie.substring(startOfCookie,endOfCookie));
   }
   return result;
}
	country = getCookie('WCountry');
	state = getCookie('WState');
	city = getCookie('WCity');
	
function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}	
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);
  return false;
}
//-->

	
	
</script>

<?php include("include/header.php"); ?>
<table width="654" border="0" cellpadding="0" cellspacing="0">


  <!--DWLayoutTable-->
  <tr>
    <td width="654" height="31" valign="top"><a href="approve_profiles.php">&nbsp;&nbsp;&nbsp;Profiles</a> - <a href="approve_pictures.php">Photos</a> - <a href="approve_videos.php">Videos</a> - <a href="approve_audio.php">Audio</a> - <a href="approve_bio.php">Bio</a> - <a href="approve_comments.php">Comments</a> - <a href="approve_media.php">Galleries</a> - <a href="approve_blogs.php">Blogs</a></td>
  </tr>
</table>
<div class="mainwidth">
<div class="admin-page-header"><div class="admin-page-heading">&nbsp;&nbsp;<?php echo APPROVE_ADS_SECTION_NAME ?></div></div>
<div class="clear"></div>
<div class="admin-page">
  <table width="<?php print("$CONST_TABLE_WIDTH"); ?>" align="<?php print("$CONST_TABLE_ALIGN"); ?>" border="0" cellspacing="<?php print("$CONST_TABLE_CELLSPACING"); ?>" cellpadding="<?php print("$CONST_TABLE_CELLPADDING"); ?>">
			<tr>
				<td valign="top">
					<table width="100%"  border="0" cellpadding="<?php print("$CONST_SUBTABLE_CELLPADDING"); ?>" cellspacing="<?php print("$CONST_SUBTABLE_CELLSPACING"); ?>">
					<tr>
					<td class="titlehead">Edit Profile</td>
					</tr>
			<tr>
				<td valign="top">
					<table width="100%"  border="0" cellpadding="<?php print("$CONST_SUBTABLE_CELLPADDING"); ?>" cellspacing="<?php print("$CONST_SUBTABLE_CELLSPACING"); ?>">
						<form enctype='multipart/form-data' method='post' action='<?php echo $CONST_LINK_ROOT?>/admin/approve_profiles.php<?php print("?PHPSESSID=".session_id()); ?>&mode=next' name="FrmAuthorise">

						<input type="hidden" name="offset" value="<?=$offset?>" />

						<tr>

						<td valign="top" class="admin-head2" colspan="4"><?php print("$advname"); ?></td>
						</tr>

						<input type='hidden' name="hiddenuserid" value="<?php print("$advuser"); ?>">

						<input type='hidden' name="hiddenemail" value="<?php print("$email"); ?>">

						<input type='hidden' name="hiddenname" value="<?php print("$advname"); ?>">
			

 <? //if($GEOGRAPHY_JAVASCRIPT)
		  //{
		  ?>
          <script language="javascript" src="../geography.js"></script>
          <tr class="tdodd" > 
            <td height="24"  align="left"><span class=mandatory>*</span> <?php echo GENERAL_COUNTRY?></td>
            <td width="112" > <select class="input" name="WCountry" id="WCountry" size="1" tabindex="1" onChange="onCountryListChange('FrmAuthorise', 'WCountry', 'WState', 'WCity');">
                <option value="0" selected></option>
              </select> </td>
            <td  align="left"><span class=mandatory>*</span> <?php echo GENERAL_STATE?></td>
            <td > <select class="input" name="WState" id="WState" size="1"  tabindex='14' onChange="onStateListChange('FrmAuthorise', 'WCountry', 'WState', 'WCity');">
                <option value="0" selected></option>
              </select> </td>
          </tr>
          <tr class="tdeven" > 
            <td height="24"  align="left"><span class=mandatory>*</span> <?php echo GENERAL_CITY?></td>
            <td colspan="3" > <select class="input" name="WCity" id="WCity" size="1"   tabindex='15' onChange="onCityListChange('FrmAuthorise', 'WCity');">
                <option value="0" selected></option>
              </select> </td>
          </tr>
          <script language="javascript"> 
                        initialize('FrmAuthorise', 'WCountry', 'WState', 'WCity', new Array('<?=$country?>'), new Array('<?=$state?>'), new Array('<?=$city?>'));
          </script>
		<? 
		$sql="SELECT DISTINCT lst_type,name from vlistbox";
		$resultvalue=mysql_query($sql) or die(mysql_error());
		$countrow=mysql_num_rows($resultvalue);
		$j=0;
		 $i=0;
		while($rowvalue=mysql_fetch_array($resultvalue))
		{
			if(($i%2)==0)
		    {
		print "<tr class=tdeven>";
			}
			$j < $countrow;
		?>
	    <td align="left"><?=$rowvalue['name'];?></td>
		<td><select class="input" name="dropoptions[]" size="1" id="dropoptions<?=$j;?>" tabindex="23">
          <? 
				 $sql_SKG="SELECT * FROM vlistbox WHERE lst_type = '".$rowvalue['lst_type']."' order by lst_order";
				   $result=mysql_query($sql_SKG) or die(mysql_error());
				   while($row=mysql_fetch_array($result))
					{
						$lowelcase = strtolower($row['name']);
						$newphrase9 = str_replace(" ","", $lowelcase);
						$tablefield = "adv_$newphrase9";
						$sql_Query = mysql_fetch_object(mysql_query("SELECT * FROM adverts_dropdown WHERE $tablefield = '".$row['lst_value']."' AND adv_userid = $advuser"));
					if($sql_Query->$tablefield == stripslashes($row['lst_value']))
					{ ?>
					<option value="<?=stripslashes($row['lst_value'])?>" selected="selected"><?=stripslashes($row['lst_value'])?></option>
				 <?	} else { ?>
          			<option value="<?=stripslashes($row['lst_value'])?>" ><?=stripslashes($row['lst_value'])?></option>
         		 <? }

				  }

				?>
        </select>     </td>
		<? 
		 $i++;
		 $j++;
		 }
		 ?>
		</tr>

          <tr class="tdeven">
            <td  align="left"><?php echo SEX?></td>
            <td ><span class="tdhead">
              <select name="select" size="1" class="input" >
                <option <?php if ($sex == "M") { print("selected");} ?> value="M"><?php echo SEX_MALE?></option>
                <option <?php if ($sex == "F") { print("selected");} ?> value="F"><?php echo SEX_FEMALE?></option>
              </select>
            </span></td>
            <td  align="left">&nbsp;</td>
            <td >&nbsp;</td>
          </tr>

       

          <tr class="tdeven">

            <td  align="left"><?php echo PRGAMENDAD_TITLE?></td>

            <td colspan="3" > <input type="text" class="input" name="txtTitle" size="30" maxlength='30' tabindex="15" value="<?=stripslashes($advtitle)?>"></td>
          </tr>

          <tr class="tdodd">

            <td  align="left" ><b><?php echo ADMINMAIL_MESS?></b></td>

            <td colspan="3" > <textarea  class="inputl"rows="10" name="txtComment" cols="59" tabindex="15"><?=stripslashes($comment)?></textarea></td>
          </tr>

          <!--<tr class="tdeven">

            <td colspan="4"  align="left" ><?php print("$personality"); ?></td>

          </tr>-->

          <tr>

            <td colspan="4"  align="left" class="tdfoot"><b><?php //echo PRGRETUSER_MYMATCH?></b></td>
          </tr>

         
          <tr class="tdodd">

           
          </tr>

          <tr class="tdeven">

            <td  align="left" ><span class="tdhead"><b><?=MY_MATCH?></b></span></td>

            <td colspan="3" class="tdeven" > <textarea  class="inputl"rows="10" name="txtMyComment" cols="59" tabindex="15"><?=stripslashes($sql_they->mym_comment)?></textarea></td>
          </tr>

          <tr align="center" class="tdodd">

            <td colspan="4" > <input type="radio" name="rdoApprove" value="Approve">

              <?php echo AFF_AUTHORISE_APPROVE?>&nbsp; <input type="radio" name="rdoApprove" value="Reject" >

              <?php echo AFF_AUTHORISE_REJECT?> &nbsp; <input type="radio" name="rdoApprove" value="Skip" checked>

              <?php echo AFF_AUTHORISE_SKIP?><br> <?php echo AFF_AUTHORISE_REASON?>

              <input name='reason' type='text' class="inputl" size='30'></td>
          </tr>

          <tr align="center">

            <td colspan="4" class="tdfoot"> <input type="submit" name="Submit" value="<?php echo BUTTON_SUBMIT ?>" class="normal">            </td>
          </tr>
        </form>
      </table></td>

    </tr>
  </table></td>
  <td valign="top">
  		<table width="100%"  border="0" cellpadding="<?php print("$CONST_SUBTABLE_CELLPADDING"); ?>" cellspacing="<?php print("$CONST_SUBTABLE_CELLSPACING"); ?>">
		<tr><td class="titlehead" valign="top">Edit Media</td></tr>
		<tr><td class="admin-head2">Photo</td></tr>
<script type="text/javascript" src="lightbox/js/prototype.js"></script>
<script type="text/javascript" src="lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="lightbox/js/lightbox.js"></script>
<link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen" />

		<tr><td>
		<?
		$picture = new Picture();
		$aPictures = $picture->GetListByMember($advuser);
		$result = count($aPictures);
		if($result>0)
		{
			$i=0;
			foreach ($aPictures as $sql_array) 
			{
				$pic_private = ($sql_array->pic_private=='Y') ? "checked" : "";
			
				$pic_default = ($sql_array->pic_default=='Y') ? "checked" : "";
				$pic_info = $sql_array->getInfo('small');
		
				if($sql_array->approved=='0'){$approval="Pending";}
				if($sql_array->approved=='1'){$approval="Approved";}	
				if(($i%2)==0)
				{
				print "<tr><td>&nbsp;</td></tr>
				<tr>";
				}
				print(" 
		<td align='center' width='180px'>
			<a href='$CONST_LINK_ROOT/includes$pic_info->Path' rel='lightbox' title='$sql_array->caption'><img border='0' src='$CONST_LINK_ROOT/includes$pic_info->Path' height='100' width='100s'></a>
	<br><a href='$CONST_LINK_ROOT/admin/approve_profile_update.php?chkRemoveid=$sql_array->pic_id&type=p&edit_mem=$advuser'");?> onclick="javascript:return confirm('Are you sure want to delete')"><div class=admin-head2>Delete</div></a>&nbsp;
		<?
$i++;}
		}
		?>
		</td></tr>
		<tr><td class="admin-head2" colspan="2"><hr /></td></tr>
		<tr><td class="admin-head2">Audio</td></tr>
		<tr><td>
		<? 
		$audio = new Audio(); 
		$aAudios = $audio->GetListByMember($advuser);
		$resultaud = count($aAudios);
		if($resultaud>0)
		{
		 $i=0;
		 foreach ($aAudios as $Audios_row)
		 {
			if(($i%2)==0)
				{
				print "<tr><td>&nbsp;</td></tr>
				<tr>";
				}
				$image="$CONST_IMAGE_ROOT/audio_latest.jpg";
				?>
				<td align='center' width='180px'><a href="javascript:;"
onclick="MM_openBrWindow('admin_play.php?edit_mem=<?=$advuser?>&aid=<?=$Audios_row->aud_id?>','','width=300,height=100, scrollbars=yes');"><img border='0' src='<?=$image?>' height='100' width='100s'></a>
	 <? print(" <br><a href='$CONST_LINK_ROOT/admin/approve_profile_update.php?chkRemoveid=$Audios_row->aud_id&type=a&edit_mem=$advuser'");?>onclick="javascript:return confirm('Are you sure want to delete')"><div class=admin-head2>Delete</div></a>&nbsp;
	<?	
$i++;}
		}
		?></td></tr>
		<tr><td class="admin-head2" colspan="2"><hr /></td></tr>
		<tr><td class="admin-head2">Video</td></tr>
		<tr><td>
		<? 
		$query=mysql_query("SELECT * FROM youtube WHERE you_userid ='$advuser'");
		 
		 $i=0;
		 while($result=mysql_fetch_object($query))
		 {
			if(($i%2)==0)
				{
				print "<tr><td>&nbsp;</td></tr>
				<tr>";
				} 
				$image="$CONST_IMAGE_ROOT/you.png";
				?>
			<td align='center' width='180px'><a href="javascript:;"
onclick="MM_openBrWindow('admin_play.php?edit_mem=<?=$advuser?>&you=<?=$result->you_id?>','','width=450,height=375');"><img border='0' src="<?=$image ?>" height='100' width='100s'></a>
	<? print("<br><a href='$CONST_LINK_ROOT/admin/approve_profile_update.php?chkRemoveid=$result->you_id&type=v&edit_mem=$advuser'");?>onclick="javascript:return confirm('Are you sure want to delete')"><div class=admin-head2>Delete</div></a>&nbsp;
		<?
$i++;}
		
		?>
		</td></tr>
		<tr><td class="admin-head2" colspan="2"><hr /></td></tr>
		<tr><td class="admin-head2">Gallery</td></tr>
		<tr>
		<td>
		<?
		$gallery = new Gallery();
		$aGallery = $gallery->GetListByMember($advuser);
		$count=count($aGallery);
		if($count>0)
		{
		 $i=0;
		 foreach ($aGallery as $gallery_row)
		 {
			if(($i%2)==0)
				{
				print "<tr><td>&nbsp;</td></tr>
				<tr>";
			}
				?>
			<td align='center' width='180px'>
			<a href="javascript:;"onclick="MM_openBrWindow('admin_play.php?edit_mem=<?=$advuser?>&Gallery_Id=<?=$gallery_row->Gallery_ID?>','','width=450,height=375');"  ><img border='0' src='<?="$CONST_LINK_ROOT/includes/members/gallery/gallery_$gallery_row->Gallery_ID.jpg" ?>' height='100' width='100s'></a>
	<? print ("<br><a href='$CONST_LINK_ROOT/admin/approve_profile_update.php?chkRemoveid=$gallery_row->Gallery_ID&type=g&edit_mem=$advuser'");?> onclick="javascript:return confirm('Are you sure want to delete')"><div class=admin-head2>Delete</div></a>&nbsp;
		<?
$i++;}
		}
		?>
		</td></tr>
		</table>
  
  </td>
  </tr></table></div><div class="admin-page-bottom"></div></div>
<?php include("include/footer.php"); ?>
