Current File : /home/inlingua/public_html/dwarka/icentex/pg/payment_cancle_result.php
<?php
//  Created on: 13-04-2013
session_start();
/*
$loggedUserNo = $_SESSION['loggedUserNo'];
if ($loggedUserNo == "")
{	echo "Please <a href='index.php'>login</a> first.";
	exit(0);
}
*/

// Include header
include "header_in.php";
?>

<aside class="contentbox-head"> <span class="title">Payment Report (<span class="status-row"><a href="<?php echo "reports/payment_report.xlsx" ?>" target="_blank">Download Excel Report</a></span>)
</span>
          </aside>
<div id="contentnew">
<?php if ($_SESSION['dispMesg'][1] != "" && (date("U") - $_SESSION['dispMesg'][0] < 7)) 
{ 	?>
	<span id='mesgSpan'><font color='#da0000'><?php echo $_SESSION['dispMesg'][1];?></font></span>
	<script>
	setTimeout(function() {$('#mesgSpan').fadeOut('slow'); }, 4000); // <-- time in milliseconds 
	</script>
	<br>
	<?php
}
unset($_SESSION['dispMesg']);
?>
<?php
// Include the database connection details
require('../dbConnection.php');

// Include common functions
require('../commonFunc.php');

// Include common functions
require('../globalVars.php');

// Include the table handler class
require('../dbHandler.class.php');

// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();

// Records selection sql
$sqlQuery = "SELECT a. *,a.createDate as Date , a.recNo AS Mainrec, m.bill_details,dt.amount as ItemAmt,dt.remarks, b.location, d.incenter_source,d.mobile,d.preffered_slot,d.preffered_slot_sat, (SELECT name FROM timesheet_user user WHERE user.recNo = d.customer_detailing ) AS customer_detailing, c. * , d.ref_No, dt.course_id, dt.Discount AS Discountdt FROM ingl_invoice_main a inner JOIN timesheet_location b ON a.centre = b.recNo inner JOIN ingl_invoice_payment c ON a.invoice_no = c.rcpt_id inner JOIN ingl_admission d ON a.student_id = d.ref_No INNER JOIN ingl_invoice_detail dt ON a.invoice_no = dt.invoice_no INNER JOIN ingl_billing_main m ON m.recNo = dt.product_id WHERE  ";//c.amount >0

if($_REQUEST['startdate']!="" && $_REQUEST['enddate']!=""){
$sqlQuery.="  ( Date(a.createDate ) >='".$_REQUEST['startdate']."' && Date(a.createDate ) <='".$_REQUEST['enddate']."') ";	
}

if($_REQUEST['location']!=""&&$_REQUEST['location']!="All"){
$sqlQuery.=" && location='".$_REQUEST['location']."' ";
}
if($_REQUEST['Type']=="Refund"){	
$sqlQuery.=" && a.status_delete=2 ";
}
else{	
$sqlQuery.=" && a.status_delete=1 ";
}



/*echo $sqlQuery;
if($_REQUEST['category'][0]!="" && $_REQUEST['category'][0]!="0"){
$sqlQuery.="  && category_id='".$_REQUEST['category'][0]."'";	
}

if($_REQUEST['product'][0]!="" && $_REQUEST['product'][0]!="0"){
$sqlQuery.=" && product_id='".$_REQUEST['product'][0]."'";	
}
*/
$sqlQuery.=" order by rcpt_id ";

//echo $sqlQuery;
// Prepare page navigation
$resultsPerPage = 20; // number of rows to return per page

// Prepare add on URL
$addOnUrl = "";
$offset=$_REQUEST['offset'];
if ($resultsPerPage > 0)
{	//$prev_next_links = $dbObject->prev123Next($sqlQuery, $resultsPerPage,$addOnUrl);
	//$sqlQuery .= " limit " . $offset . "," . $resultsPerPage ;
}

// Print navigation bar
function printArray($element) { echo "$element"; }

if ($resultsPerPage > 0 && $prev_next_links && count($prev_next_links) > 1)
{	//echo "Page: ";
	//array_walk($prev_next_links, 'printArray'); 
}

// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
?>

<table border='0' class='pa-nor pa-table listing-table' width="100%">
<tr valign='top' class='rowH'>
<th>ID</th>
<th>Centre</th>
<th>Product</th>
<th>Receipt No.</th
><th>Date</th>
<th>Reference No.</th>
<th>Registration ID</th>
<th>Name</th>
<th align="right">Amount</th>
<th> Payment Mode </th>
<th>  Cheque No./<br>Transaction Id</th>
<th>  Favour Of/<br>Transaction Details  </th>

</tr>
<?php
// If no records selected, print message
if (!$selectedRecords)
{	?>
	<tr><td colspan='5'>There are no entries</td></tr> 
	<?php
}
	$i=1;
	        	
$tot=0;		
while($objectData=$dbObject->SelectNext())
{
	
	?>
	<tr valign='top' onmouseover="this.className='pa-row-highlight'" onmouseout="this.className='pa-nor'">
	<td><?php echo $i;?></td>
	<td><?php echo $objectData['location'];?></td>
	<td>
	<?php echo $objectData['bill_details'];?>
	</td>
	
	<td>
	<?php echo $objectData['rcpt_id'];?>
	</td>
	
	<td>
	<?php echo date("d-m-Y",strtotime($objectData['Date']));?>
	</td>
	<td>
	<?php echo $objectData['ref_No'];?>
	</td>
	
	<td><?php echo $objectData['course_id'];?></td>
	<td><?php echo $objectData['student_name'];?></td>
	<td align='right'><?php echo $objectData['ItemAmt'];?></td>
	<td><?php echo $objectData['payment_mode'];?></td>
	<td><?php echo $objectData['cheque_no'];?></td>
	<td><?php echo $objectData['favour_of'];?></td>
	</tr>
	<?php
	$i++;
	$tot=$tot+$objectData['ItemAmt'];
}
?>
<tr><td colspan="8">Total</td><td align='right'><?php echo $tot?></td><td colspan="1">&nbsp;</td></tr>
</table>

<?php
// Print navigation bar
if ($resultsPerPage > 0 && $prev_next_links  && count($prev_next_links) > 1)
{	//echo "Page: ";
	//array_walk($prev_next_links, 'printArray'); 
	//echo "<br>";
}
?>
</div>
<script type="text/javascript">
function confDel()
{	var agree = confirm("Click OK to Cancel");
	if (agree)
		return true;
	else
		return false;
}
</script>

<?php

include("05featuredemo1_payment.php");


include("05featuredemo1.inc_payment.php");
$dbObject->CloseConnection();

// Include footer
include "footer_in.php";
?>