Preview: phone-cart-list.php
Size: 13.55 KB
/home/godevadmin/www/admin/phone-cart-list.php
<?php
session_start();
include("../include/config.php");
include("../include/functions.php");
validate_admin();
if(SITE_URL==MAINSITE_URL){
$baseurl='https://www.quicklly.com/';
} else if(SITE_URL==UATSITE_URL){
$baseurl='https://www.uat.goquicklly.com/';
}else {
$baseurl='https://www.dev.goquicklly.com/';
}
?>
<!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)
{
//alert(comb);
if(comb=='Delete'){
if(confirm ("Are you sure you want to delete record(s)"))
{
frmobj.action = "phone-cart-del.php";
frmobj.what.value="Delete";
frmobj.submit();
}
else{
return false;
}
}
else if(comb=='Deactivate'){
frmobj.action = "phone-cart-del.php";
frmobj.what.value="Deactivate";
frmobj.submit();
}
else if(comb=='Activate'){
frmobj.action = "phone-cart-del.php";
frmobj.what.value="Activate";
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">
<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 Phone Cart
<span style="float:right; padding-right:10px;">
<input type="button" name="add" value="Add Cart" class="button" onclick="location.href='phone-cart-addf.php'" /></span>
</td>
</tr>
<!------------ 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="phone-cart-list.php">
<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td width="10%" align="right" ><strong>Order ID:</strong></td>
<td width="10%"><input type="text" name="search_order_id" value="<?php echo $_REQUEST['search_order_id']; ?>"/></td>
<td width="10%" align="right" ><strong>Phone:</strong></td>
<td width="10%"><input type="text" name="search_phone" value="<?php echo $_REQUEST['search_phone']; ?>"/></td>
<td width="10%" align="right" ><strong>Payment Status:</strong></td>
<td width="10%"><select name="search_paymentstatus" style="width:150px;" >
<option value="">All</option>
<option value="Payment Success" <?php if ($_REQUEST['search_paymentstatus'] == 'Payment Success') { ?>selected<?php } ?>>Successful</option>
<option value="Payment Failed" <?php if ($_REQUEST['search_paymentstatus'] == 'Payment Failed') { ?>selected<?php } ?>>Unsuccessful</option>
</td>
<td width="10%" align="right" ><strong>User ID:</strong></td>
<td width="10%"><input type="text" name="search_user_id" value="<?php echo $_REQUEST['search_user_id']; ?>"/></td>
<td width="7%" align="right"><input type="submit" name="search" value="Search" style="background:#0099CC; border:5px solid #0099CC; color:#fff" /></td>
<td width="12%" align="center" ><a href="phone-cart-list.php" style="background:#009966; border:6px solid #009966; color:#fff">View All</a></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
<form name="frm" method="post" action="phone-cart-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_order_id'] != '') {
$name = $_REQUEST['search_order_id'];
$where .= " and order_id='" . $name . "'";
}
if ($_REQUEST['search_user_id'] != '') {
$name = $_REQUEST['search_user_id'];
$where .= " and user_id='" . $name . "'";
}
if ($_REQUEST['search_phone'] != '') {
$name = $_REQUEST['search_phone'];
$where .= " and phone like '%$name%' ";
}
if ($_REQUEST['search_paymentstatus'] != '') {
$name = $_REQUEST['search_paymentstatus'];
$where .= " and status='" . $name . "'";
}
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=20;
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 * from tbl_cart_master where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize");
$sql2=$obj->query("select * from tbl_cart_master where 1=1 $where order by $order_by $order_by2",$debug=-1);
$reccnt=$obj->numRows($sql2);
if($reccnt==0)
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="+1">No Record</font></td>
</tr>
</table>
<?php
}
else
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6%" align="left" class="padd5" bgcolor="#f3f4f6"><strong>S No.</strong></td>
<td width="20%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>User Info</strong></td>
<td width="20%" align="center" bgcolor="#f3f4f6" class="padd5"><strong>Cart Info</strong></td>
<td width="20%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Cart Url</strong></td>
<td width="20%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Modified Request</strong></td>
<td width="10%" align="center" bgcolor="#f3f4f6" class="padd5"><strong>Order Info</strong></td>
<td width="7%" align="center" bgcolor="#f3f4f6" class="padd5"><strong>Cart Status</strong></td>
<td width="8%" align="center" class="padd5" bgcolor="#f3f4f6"><strong>Action</strong></td>
<td width="10%" align="center" bgcolor="#f3f4f6" 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 = "#f3f4f6";
$color='';
}
else
{
$bgcolor = "";
$color='';
}
if($line->status=='Cart Modify Request'){
$bgcolor = "#ff005245";
$color='#fff';
}
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> class="padd5"><strong><?php echo $i+$start; ?></strong></td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> class="padd5">
<?php
echo stripslashes($line->phone).'<br>';
?>
<?php
echo stripslashes($line->zipcode);
?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> class="padd5">
<?php
$grocerycountsql=$obj->Query("SELECT COUNT(id) as grocerycount FROM `tbl_cart_master_items` WHERE cart_id='".$line->id."' AND section=1");;
$grocerycountR=$obj->fetchNextObject($grocerycountsql);
$foodcountsql=$obj->Query("SELECT COUNT(id) as foodcount FROM `tbl_cart_master_items` WHERE cart_id='".$line->id."' AND section=3");;
$foodcountR=$obj->fetchNextObject($foodcountsql);
if($grocerycountR->grocerycount>0){
echo '<strong>Total Grocey Items:</strong>'.$grocerycountR->grocerycount.'<br>';
}
if($foodcountR->foodcount>0){
echo '<strong>Total Food Items:</strong>'.$foodcountR->foodcount.'<br>';
}
?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> class="padd5">
<?php
echo "$baseurl".'order-by-phone/'.$line->cart_key;
?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> class="padd5">
<?php
echo $line->modify_msg .'<br>';
?>
<?php
echo $line->modify_on .'<br>';
?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> align="center" valign="middle" class="padd5">
<label><?php if($line->status=='Payment Success'){?>Payment Status:<img src="images/enable.gif" border="0" title="Activated" /> <?php } else if($line->status=='Payment Failed'){ ?>Payment Status:<img src="images/disable.gif" border="0" title="Deactivated" /><?php }?>
</label><br>
<?php if($line->order_id!=''){?>
Order Id: <?php echo $line->order_id;?><br>
<?php } ?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> align="center" valign="middle" class="padd5">
<?php if($line->status=='Cart Enable' || $line->status=='Payment Success'){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> align="center" valign="middle" class="padd5">
<?php if($line->status!='Payment Success'){?>
<a href="phone-cart-addf.php?cartkey=<?php echo $line->cart_key;?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a>
<?php } ?>
</td>
<td <?php if($color!=''){?> style="color:<?php echo $color;?>" <?php } ?> align="center" valign="middle" class="padd5">
<?php if($line->status!='Payment Success'){?>
<input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" />
<?php } ?>
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="8" align="right">
</td> </tr>
<tr>
<td valign="top" colspan="8" align="right" class="dark_red"><?php include("../include/paging.inc.php"); ?>
</td> </tr> <tr><td align="right" style="padding-right:80px;" colspan="6"> <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)" /></td></tr>
</table><?php }?>
</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