Preview: user-list.php
Size: 11.78 KB
/home/godevadmin/public_html/admin/user-list.php
<?php
session_start();
include("../include/config.php");
include("../include/functions.php");
validate_admin();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo SITE_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<script>
function checkall(objForm)
{
len = objForm.elements.length;
var i=0;
for( i=0 ; i<len ; i++){
if (objForm.elements[i].type=='checkbox')
objForm.elements[i].checked=objForm.check_all.checked;
}
}
function del_prompt(frmobj,comb)
{
if(comb=='Delete'){
if(confirm ("Are you sure you want to delete record(s)"))
{
frmobj.action = "user-del.php";
frmobj.what.value="Delete";
frmobj.submit();
}
else{
return false;
}
}
else if(comb=='Deactivate'){
frmobj.action = "user-del.php";
frmobj.what.value="Deactivate";
frmobj.submit();
}
else if(comb=='Activate'){
frmobj.action = "user-del.php";
frmobj.what.value="Activate";
frmobj.submit();
}
else if(comb=='MarkQrSeller'){
frmobj.action = "user-del.php";
frmobj.what.value="MarkQrSeller";
frmobj.submit();
}
else if(comb=='UnMarkQrSeller'){
frmobj.action = "user-del.php";
frmobj.what.value="UnMarkQrSeller";
frmobj.submit();
}
}
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php include("header.php") ?>
<tr>
<td align="right" class="paddRtLt70" valign="top">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!------------ Search Section ----------------->
<tr>
<td align="left" valign="middle" class="bodr" style="padding-bottom:20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="headingbg bodr text14" style="padding-left:20px;">Search<span style="float:right; padding-right:10px;"></span></td>
</tr>
<tr><td height="10"></td></tr>
<tr>
<td>
<form name="searchForm" method="post" action="user-list.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="72%"><table width="89%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" align="right" ><strong>User ID:</strong></td>
<td width="15%"><input type="text" name="search_uid" value="<?php echo $_REQUEST['search_uid']; ?>"/></td>
<td width="10%" align="right" ><strong>Name:</strong></td>
<td width="15%"><input type="text" name="search_uname" value="<?php echo $_REQUEST['search_uname']; ?>"/></td>
<td width="10%" align="right" ><strong>Email:</strong></td>
<td width="15%"><input type="text" name="search_email" value="<?php echo $_REQUEST['search_email']; ?>"/></td>
<td width="10%" align="right" ><strong>User type:</strong></td>
<td width="15%">
<select name="company_name" class="clsSelSec">
<option value="">All</option>
<option value="company" <?php if ($_REQUEST['company_name'] == 'company') { ?>selected<?php } ?>>Desktop</option>
</select>
</td>
</tr>
</table>
</td>
<td width="28%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%"><input type="submit" class="button" name="search" value="Search" /></td>
<td width="78%"><a href="user-list.php">View All</a></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr><td height="10"></td></tr>
<!----- Search End --------->
<tr>
<td align="left" valign="middle" class="headingbg bodr text14">
<em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: View Customers
<span style="float:right; padding-right:10px;">
<a href="registeruser_csv.php"> <input type="button" name="add" value="Download Excell" class="button" /></a></span>
</td>
</tr>
<form name="frm" method="post" action="user-del.php" enctype="multipart/form-data">
<tr>
<td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr">
<table width="100%" cellpadding="0" cellspacing="0">
<?php if($_SESSION['sess_msg']){ ?>
<tr><td align="center"><font color="#FF0000"><strong><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td></tr>
<?php }?>
<tr>
<td align="left">
<?php
$where='';
if($_REQUEST['search_uid']!=''){
$where.=" and id='".$_REQUEST['search_uid']."' ";
}
if($_REQUEST['search_uname']!=''){
$where.=" and ( fname like '".$_REQUEST['search_uname']."%' or lname like '".$_REQUEST['search_uname']."%' ) ";
}
if($_REQUEST['search_email']!=''){
$where.=" and email like '%".$_REQUEST['search_email']."%' ";
}
if($_REQUEST['company_name']!=''){
$where.=" and company_name!='' ";
}
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=15;
if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize'];
$order_by='id';
if(isset($_GET['order_by'])) $order_by=$_GET['order_by'];
$order_by2='desc';
if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2'];
$sql=$obj->Query("select id,fname,lname,email,user_type,house_no,street,complex,landmark,city_id,pincode,area,state,mobile,full_address,reward_points,register_date,status,mark_seller from tbl_user where 1=1 $where order by id desc limit $start, $pagesize");
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td>
<td width="6%" align="left" bgcolor="#e7efef" class="padd5"><strong> User ID / User Type</strong> <?php echo sort_arrows('id') ?></td>
<td width="6%" align="left" bgcolor="#e7efef" class="padd5"><strong> Name</strong> <?php echo sort_arrows('fname') ?></td>
<td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong> Email</strong> <?php echo sort_arrows('email') ?></td>
<td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>Mobile/ Phone</strong> </td>
<td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong> Address</strong> </td>
<td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong> Area</strong> </td>
<td width="5%" align="left" bgcolor="#e7efef" class="padd5"><strong> Pincode</strong> </td> <td width="10%" align="left" bgcolor="#e7efef" class="padd5"><strong> Reward Points</strong> </td>
<td width="10%" align="left" bgcolor="#e7efef" class="padd5"><strong> Wallet Balance</strong> </td>
<td width="10%" align="left" bgcolor="#e7efef" class="padd5"><strong> Wallet Refund</strong> </td>
<td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>No. of Orders</strong> </td>
<td width="12%" align="left" bgcolor="#e7efef" class="padd5"><strong>Last Order</strong> </td>
<td width="13%" align="left" bgcolor="#e7efef" class="padd5"><strong> Register Date</strong> </td>
<td width="7%" align="center" bgcolor="#e7efef" class="padd5"><strong>Is QR Seller</strong></td>
<td width="7%" align="center" bgcolor="#e7efef" class="padd5"><strong>Status</strong></td>
<!--<td width="5%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td> -->
<td width="2%" align="center" bgcolor="#e7efef" class="padd5" > <input name="check_all" type="checkbox" id="check_all" onclick="checkall(this.form)" value="check_all" /></td>
</tr>
<?php
$i=0;
while($line=$obj->fetchNextObject($sql))
{
$i++;
if($i%2==0)
{
$bgcolor = "#f6f6f6";
}
else
{
$bgcolor = "";
}
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td>
<td class="padd5"><?php echo stripslashes($line->id);?><br><?php if($line->user_type==0){ echo "Registered"; }else{ echo "Guest"; } ?></td>
<td class="padd5"><?php echo stripslashes($line->fname)." ".stripslashes($line->lname);?></td>
<td class="padd5"><?php echo stripslashes($line->email);?></td>
<td class="padd5"><?php echo stripslashes($line->mobile);?></td>
<td class="padd5"><?php if($line->full_address){ echo $line->full_address; }else{ echo stripslashes($line->house_no);?> <?php echo stripslashes($line->street);?> <?php echo stripslashes($line->complex); ?> <?php echo stripslashes($line->landmark).', '.$line->city_id.', '.$line->state; } ?></td>
<td class="padd5"><?php echo stripslashes($line->state);?></td>
<td class="padd5"><?php echo stripslashes($line->pincode);?></td>
<td align="center" class="padd5"><a href="rewardhistory-list.php?user_id=<?php echo $line->id; ?>" target="_blank"><?php echo getRewardPoints($line->id);?></a></td>
<td align="center" class="padd5"><a href="wallethistory-list.php?user_id=<?php echo $line->id; ?>" target="_blank"><?php echo $website_currency_symbol.getwallet($line->id);?></a></td>
<td align="center" class="padd5"><a href="wallet_rfnd.php?rfduid=<?php echo $line->id; ?>" target="_blank">Refund</a></td>
<td class="padd5"><?php $orderdetail=$obj->query("select order_date, count(id) as ordercount from tbl_order where user_id='$line->id' order by order_date desc");
$orderes=$obj->fetchNextObject($orderdetail);
echo $orderes->ordercount; ?>
</td>
<td class="padd5"><?php
if($orderes->ordercount>1){
echo CalculateOrderTime($orderes->order_date)." <strong style=color'#000'>(".$orderes->order_date.")</strong>"; }else{ echo $orderes->order_date; } ?></td>
<td class="padd5"><?php echo date('d M Y H:i',strtotime($line->register_date));?></td>
<td align="center" valign="middle" class="padd5">
<?php if($line->mark_seller==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?> </td>
<td align="center" valign="middle" class="padd5">
<?php if($line->status==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?> </td>
<td align="center" valign="middle" class="padd5">
<input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" /> </td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="13" align="right"> </td> </tr>
<tr>
<td valign="top" colspan="13" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td> </tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="13"> </td>
</tr>
<tr>
<td align="right" style="padding-right:80px;" colspan="13"> </td>
</tr>
<tr><td align="right" style="padding-right:80px;" colspan="13"> <input type="hidden" name="what" value="what" />
<input type="submit" name="Submit" value="Activate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Deactivate" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="Delete" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="MarkQrSeller" class="button" onclick="return del_prompt(this.form,this.value)" />
<input type="submit" name="Submit" value="UnMarkQrSeller" class="button" onclick="return del_prompt(this.form,this.value)" />
</td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr><td height="100"></td></tr>
<?php include('footer.php'); ?>
</table>
</body>
</html>
Directory Contents
Dirs: 10 × Files: 414