<?php require_once('../Connections/oprmConn.php'); include('check-admin-session.php');
mysql_select_db($database_oprmConn, $oprmConn);
$query_MembersList = "select * FROM weby_otherdoc ORDER BY user_id ASC";
$MembersList = mysql_query($query_MembersList, $oprmConn) or die(mysql_error());
$row_MembersList = mysql_fetch_assoc($MembersList);
$totalRows_MembersList = mysql_num_rows($MembersList);

Header("Content-Disposition: attachment; filename=otherdocs.csv");
?>User #,Name,Document Name,Uploaded Date,Status<?php do { ?>

<?php echo $row_MembersList['user_id']; ?>,<?php mysql_select_db($database_oprmConn, $oprmConn);
$query_getUsree = "select weby_profiles.full_name FROM weby_profiles where weby_profiles.user_id = '$row_MembersList[user_id]' and weby_profiles.status = 'A'";
$getUsree = mysql_query($query_getUsree, $oprmConn) or die(mysql_error());
$row_getUsree = mysql_fetch_assoc($getUsree);
$totalRows_getUsree = mysql_num_rows($getUsree);
echo $row_getUsree['full_name']; ?>,<?php echo $row_MembersList['other_docs']; ?>,<?php echo date("d-m-Y",strtotime($row_MembersList['created_date'])); ?>,<?php	
if($row_MembersList['status'] == 'A'){echo'Active'; } if($row_MembersList['status'] == 'P'){ echo'Pending';} if($row_MembersList['status'] == 'D'){ echo'Deleted';} ?>
		<?php } while ($row_MembersList = mysql_fetch_assoc($MembersList)); ?>

<?php
mysql_free_result($MembersList);
?>
