Preview: order-events-report.php
Size: 27.40 KB
/home/godevadmin/public_html/admin/order-events-report.php
<?php
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)
{
//alert(comb);
if(comb=='Delete'){
if(confirm ("Are you sure you want to delete record(s)"))
{
frmobj.action = "order-del.php";
frmobj.what.value="Delete";
frmobj.submit();
}
else{
return false;
}
}
else if(comb=='Deactivate'){
frmobj.action = "order-del.php";
frmobj.what.value="Deactivate";
frmobj.submit();
}
else if(comb=='Activate'){
frmobj.action = "order-del.php";
frmobj.what.value="Activate";
frmobj.submit();
}
}
</script>
<style>
td.padd5 p span {
font-weight: 600;
}
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php include("header.php") ?>
<link rel="stylesheet" href="../colorbox/colorbox.css" />
<script src="../colorbox/jquery.colorbox.js"></script>
<link rel="stylesheet" href="calender/css/jquery-ui.css">
<script src="calender/js/jquery-ui.js"></script>
<script>
$(function() {
$( "#search_from_date" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat:'yy-mm-dd' ,
yearRange:'2014:<?php echo date('Y'); ?>',
onClose: function( selectedDate ) {
$( "#search_to_date" ).val(selectedDate);
$( "#search_to_date" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#search_to_date" ).datepicker({
changeMonth: true,
changeYear: true,
numberOfMonths: 2,
dateFormat:'yy-mm-dd' ,
yearRange:'2014:<?php echo date('Y'); ?>',
})
$( "#search_from_date" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat:'yy-mm-dd' ,
yearRange:'2014:<?php echo date('Y'); ?>',
onClose: function( selectedDate ) {
$( "#visit_date_to" ).val(selectedDate);
$( "#visit_date_to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#search_to_date" ).datepicker({
changeMonth: true,
changeYear: true,
numberOfMonths: 2,
dateFormat:'yy-mm-dd' ,
yearRange:'2014:<?php echo date('Y'); ?>',
})
});
</script>
<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="order-events-report.php">
<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td width="11%" align="right" ><strong>Order ID:</strong></td>
<td width="18%"><input type="text" name="search_order_id" value="<?php echo $_REQUEST['search_order_id']; ?>"/></td>
<td width="12%" align="right" ><strong>Email:</strong></td>
<td width="15%"><input type="text" name="search_email" value="<?php echo $_REQUEST['search_email']; ?>"/></td>
<td width="6%" rowspan="2"><input type="submit" name="search" value="Search" /></td>
<td width="16%" rowspan="2"><a href="order-events-report.php">View All</a></td>
</tr>
<tr>
<td width="11%" align="right" ><strong>User ID:</strong></td>
<td width="18%"><input type="text" name="search_user_id" value="<?php echo $_REQUEST['search_user_id']; ?>"/></td>
<td width="8%" align="right" ><strong>Store:</strong></td>
<td width="14%"><select name="storename" style="width:150px;">
<option value="">-Select-</option>
<?php $storeArr=$obj->query("SELECT storeid,storename FROM `stores` where status=1 and sectionid=25");
while($resultStore=$obj->fetchNextObject($storeArr)){?>
<option value="<?php echo stripslashes($resultStore->storeid); ?>" <?php if($_REQUEST['storename']==$resultStore->storeid){?>selected<?php } ?> ><?php echo stripslashes($resultStore->storename); ?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td width="12%" align="right" ><strong>From Date:</strong></td>
<td width="15%"><input type="text" name="search_from_date" id="search_from_date" value="<?php echo $_REQUEST['search_from_date']; ?>"/></td>
<td width="8%" align="right" ><strong>To Date:</strong></td>
<td width="14%"><input type="text" name="search_to_date" id="search_to_date" value="<?php echo $_REQUEST['search_to_date']; ?>"/></td>
</tr>
<tr>
<td width="8%" align="right" ><strong>Event Status:</strong></td>
<td width="14%"><select name="event_status" style="width:150px;">
<option value="" <?php if($_REQUEST['event_status']==''){?>selected<?php } ?>>-Select-</option>
<option value="0" <?php if($_REQUEST['event_status']=='0'){?>selected<?php } ?> >Canceled</option>
<option value="1" <?php if($_REQUEST['event_status']==1){?>selected<?php } ?> >Active</option>
</select></td>
</tr>
<td width="8%" align="right" ><strong>Payment Status:</strong></td>
<td width="14%">
<select style="width:150px;" class="form-control form-control-user custominput" aria-label=".form-select-lg example" name="search_payment_status">
<option value="" <?php if($_REQUEST['search_payment_status']==''){?>selected<?php } ?>>-Select-</option>
<option value="1" <?php if($_REQUEST['search_payment_status']=='1'){?>selected<?php } ?>>Successful</option>
<option value="0" <?php if($_REQUEST['search_payment_status']=='0'){?>selected<?php } ?>>Unsuccessful</option>
</select>
</td>
<td width="8%" align="right" ><strong>Event:</strong></td>
<td width="14%">
<select name="search_pid" class="form-control form-control-user custominput">
<option value="">Select Event</option>
<?php
$wherep="";
$catArr=$obj->query("SELECT p.id,p.product_name
FROM tbl_product p
INNER JOIN tbl_maincategory c ON c.id = p.cat_id
WHERE $wherep c.parent_id = (SELECT id FROM tbl_maincategory WHERE slug = 'events')");
while($resultCat=$obj->fetchNextObject($catArr)){
?>
<option value="<?php echo $resultCat->id; ?>"<?php if($resultCat->id==$_REQUEST['search_pid']){?>selected<?php } ?>><?php echo stripslashes($resultCat->product_name); ?></option>
<?php } ?>
</select>
</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 Events Order Report
<span style="float:right;">
<form name="exportfrm" action="export-events-orders.php">
<input type="hidden" name="exportExcel" value="yes" />
<input type="hidden" name="search_order_id" value="<?php echo $_REQUEST['search_order_id'];?>" />
<input type="hidden" name="search_pid" value="<?php echo $_REQUEST['search_pid'];?>" />
<input type="hidden" name="search_email" value="<?php echo $_REQUEST['search_email'];?>" />
<input type="hidden" name="search_user_id" value="<?php echo $_REQUEST['search_user_id'];?>" />
<input type="hidden" name="event_status" value="<?php echo $_REQUEST['event_status'];?>" />
<input type="hidden" name="storename" value="<?php echo $_REQUEST['storename'];?>" />
<input type="hidden" name="search_from_date" value="<?php echo $_REQUEST['search_from_date'];?>" />
<input type="hidden" name="search_to_date" value="<?php echo $_REQUEST['search_to_date'];?>" />
<input type="hidden" name="search_payment_status" value="<?php echo $_REQUEST['search_payment_status'];?>" />
<input type="submit" name="export" class="button" value="Export To Excel" />
</form>
</span>
</td>
</tr>
<form name="frm" method="post" action="order-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 o.id='".$name."'";
}
if($_REQUEST['search_user_id']!=''){
$name=$_REQUEST['search_user_id'];
$where.=" and e.user_id='".$name."'";
}
if($_REQUEST['storename']!=''){
$name=$_REQUEST['storename'];
$where.=" and e.event_store_id='".$name."'";
}
if($_REQUEST['search_email']!=''){
$name=$_REQUEST['search_email'] ;
$where.=" and o.ship_email like '%$name%' ";
}
if($_REQUEST['search_from_date']!='' && $_REQUEST['search_to_date']!=''){
$where.=" and Date(o.order_date)>='".$_REQUEST['search_from_date']."' and Date(o.order_date)<='".$_REQUEST['search_to_date']."' ";
}
if($_REQUEST['search_payment_status'] || $_REQUEST['search_payment_status']=='0'){
$name=$_REQUEST['search_payment_status'] ;
$where.=" and o.payment_status ='".$name."'";
}
if($_REQUEST['event_status'] || $_REQUEST['event_status']=='0'){
if($_REQUEST['event_status']=='0'){
$where.=" and e.event_cancel_reason!='' ";
} else {
$where.=" and e.event_cancel_reason='' ";
}
}
if($_REQUEST['search_pid']!=''){
$name=$_REQUEST['search_pid'] ;
$where.=" and p.id='".$name."'";
}
$start=0;
if(isset($_GET['start'])) $start=$_GET['start'];
$pagesize=50;
if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize'];
$order_by='o.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 e.id, e.event_product_id, e.order_id, e.user_name,e.user_id,e.event_store_id, e.event_name, e.total_qty, e.total_amount, e.event_time,
e.event_from_date, e.event_to_date, e.event_address, e.latitude, e.longitude, e.event_qr_code_image,
e.event_cancel_date, e.event_cancel_reason,e.event_remarks,e.event_status,o.payment_status, o.order_date,o.ship_fname,o.ship_lname,o.ship_email,o.ship_mobile, p.photo_wide, m.last_event_cancel_date,
m.cancel_duduction_type, m.cancel_duduction_amount,event_visit_status,event_visit_date_time,e.service_fee_amount, i.tax_value,e.convenience_fee_amount
FROM tbl_order_event e
INNER JOIN tbl_order o ON e.order_id = o.id
INNER JOIN tbl_order_itmes i ON i.order_id = e.order_id AND i.product_id = e.event_product_id
INNER JOIN tbl_product p ON p.id = e.event_product_id
INNER JOIN tbl_event_meta m ON m.id = e.event_id where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize");
$sql2=$obj->query("SELECT e.id, e.event_product_id, e.order_id, e.user_name, e.event_name, e.total_qty, e.total_amount, e.event_time,
e.event_from_date, e.event_to_date, e.event_address, e.latitude, e.longitude, e.event_qr_code_image,
e.event_cancel_date, e.event_cancel_reason,e.event_remarks,e.event_status,o.payment_status, o.order_date,o.ship_fname,o.ship_lname,o.ship_email,o.ship_mobile, p.photo_wide, m.last_event_cancel_date,
m.cancel_duduction_type, m.cancel_duduction_amount,e.service_fee_amount, i.tax_value,e.convenience_fee_amount
FROM tbl_order_event e
INNER JOIN tbl_order o ON e.order_id = o.id
INNER JOIN tbl_order_itmes i ON i.order_id = e.order_id AND i.product_id = e.event_product_id
INNER JOIN tbl_product p ON p.id = e.event_product_id
INNER JOIN tbl_event_meta m ON m.id = e.event_id 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 align="center" valign="middle"><strong><?php echo $reccnt; ?> Records Found.</strong></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%" align="left" class="padd5" bgcolor="#f3f4f6"><strong>S No.</strong></td>
<td width="6%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Order Date</strong></td>
<td width="5%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Order ID</strong></td>
<td width="6%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Customer Details</strong></td>
<td width="13%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Events Details</strong></td>
<td width="6%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Store Name</strong></td>
<td width="13%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Reason For Cancel</strong></td>
<td width="5%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Payment Status</strong></td>
<td width="5%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Ticket Status</strong></td>
<td width="5%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Visit Status</strong></td>
<td width="8%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Action</strong></td>
<!--<td width="11%" 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++;
$currDate = new DateTime();
$fromDate = strtotime($line->event_from_date);
$toDate = strtotime($line->event_to_date);
$datecanel='';
if($line->event_cancel_date=='0000-00-00 00:00:00'){
$datecanel='';
} else {
$datecanel = $line->event_cancel_date;
}
if($fromDate == $toDate)
$fromDate = date('d M Y', $fromDate);
else
$fromDate = date('d M Y', $fromDate) . ' - ' . date('d M Y', $toDate);
$isUpcoming = false;
if($line->event_to_date > $currDate->format("Y-m-d"))
$isUpcoming = true;
$allowCancel = true;
if($currDate->format("Y-m-d") > $line->last_event_cancel_date)
$allowCancel = false;
$isCancelled = false;
if($line->event_cancel_reason != null && $line->event_cancel_reason != ''){
$isCancelled = true;
$allowCancel = false;
}
$photoWide = 'https://www.dev.goquicklly.com/upload_images/product/wide/' . $line->photo_wide;
$qr = 'https://www.dev.goquicklly.com/upload_images/events/qrcode/' . $line->event_qr_code_image;
$cancelCharge = 0;
$total = $line->total_amount + $line->tax_value + $line->service_fee_amount+$line->convenience_fee_amount;
$cancelCharge = number_format((float)$line->service_fee_amount,2);
$refundAmt = number_format((float)$total - (float)$cancelCharge,2);
$m=0;
?>
<tr>
<td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td>
<td class="padd5">
<?php
echo date('d M Y H:i',strtotime($line->order_date));
?>
</td>
<td class="padd5">
<?php
echo stripslashes($line->order_id);
?>
</td>
<td class="padd5">
<p><span>Name:</span><?php echo stripslashes($line->ship_fname );?> <?php echo stripslashes($line->ship_lname );?> (<?php echo stripslashes($line->user_id);?>)</p>
<p><span>Email:</span><?php echo $line->ship_email;?></p>
<p><span>Mobile:</span><?php echo $line->ship_mobile;?></p>
</td>
<td class="padd5">
<?php if($isUpcoming==true){?>
<p id="upcomingevents" style="background: green;color: #fff;text-align: center;font-weight: 600;">Upcoming Events</p>
<?php } else {?>
<p id="upcomingevents" style="background: #000;color: #fff;text-align: center;font-weight: 600;">Past Events</p>
<?php } ?>
<p><span>Product Name:</span><?php echo stripslashes($line->event_name);?>
<p><span>Event Date Time:</span><?php echo stripslashes($fromDate);?> I <?php echo stripslashes($line->event_time);?></p>
<p><span>Last Allowed cancel Date:</span><?php echo stripslashes($line->last_event_cancel_date);?></p>
<p><span>Qty:</span><?php echo stripslashes($line->total_qty);?> Tickets(<?php echo stripslashes($line->event_remarks);?>)</p>
<p><span>Total Amount:</span>$<?php echo stripslashes($total);?></p>
<p><span>Refundable Amount:</span>$<?php echo stripslashes($refundAmt);?></p>
<p><span>Cancel Charge:</span>$<?php echo stripslashes($cancelCharge);?></p>
</td>
<td class="padd5">
<?php
echo $rstorename=getFieldWhere('storename', 'stores', 'storeid', $line->event_store_id);?>
</td>
<td class="padd5">
<?php echo stripslashes($line->event_cancel_reason);?>
</td>
<td class="padd5">
<?php
if($line->payment_status==1){
echo '<img src="images/green.gif" title="Successfull" /> Success';
} else {
echo '<img src="images/red.gif" title="Declined" /> Declined';
}
?>
</td>
<td class="padd5">
<?php
if($isCancelled==false){
echo '<img src="images/green.gif" title="Successfull" /> Active';
} else {
echo '<img src="images/red.gif" title="Successfull" /> Canceled';
}
?>
</td>
<td>
<?php
if($line->event_visit_status==1){ ?>
<span> <img src="images/green.gif" title="Active" /> Visited</span><br>
<p>Event Visit Date <?php $event_visit_date_time = strtotime($line->event_visit_date_time); echo date('d M Y', $event_visit_date_time);?></p>
<?php } else{?>
<span> <img src="images/red.gif" title="Cancel" /> Not Visited</span>
<?php }?>
</td>
<td class="padd5">
<?php
if($allowCancel==true && $line->payment_status==1 && $line->event_visit_status==0){?>
<script>
$(document).ready(function () {
$(".iframeadres<?php echo $line->id; ?>").colorbox({iframe: true, width: "700px;", height: "500px;", frameborder: "0", scrolling: true});
});
</script>
<a href="changeeventstatus.php?cancelkey=<?php echo $line->order_id . '-' . $line->id . '-' . $line->event_product_id?>&event_order_id=<?php echo $line->id;?>&user_id=<?php echo $line->user_id;?>&order_id=<?php echo $line->order_id;?>" class="iframeadres<?php echo $line->id; ?>" style="color:#0066CC; font-weight:bold">Cancel Subscription</a>
<?php } ?>
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top" colspan="14" align="right">
</td> </tr>
<tr>
<td valign="top" colspan="14" align="right" class="dark_red" style="padding-right:150px;"> </td>
</tr>
<tr>
<td valign="top" colspan="14" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?>
</td> </tr>
<tr>
<td valign="top" colspan="14" align="right" class="dark_red" style="padding-right:150px;"> </td>
</tr>
<tr><td align="right" style="padding-right:80px;" colspan="14"> <input type="hidden" name="what" value="what" />
<!-- <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