Current File : /home/inlingua/www/icentex/in-centre/payment_details.php |
<?php
// Created on: 10-05-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";
?>
<h3 class='pa-nor-navbar'>Payment Details</h3>
<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();
$user=$_REQUEST['user'];
$date1=$_REQUEST['date1'];
$date2=$_REQUEST['date2'];
// Records selection sql
$sqlQuery = "select a.*,b.invoice_no,b.student_name,b.final_amount from ingl_invoice_payment a left join ingl_invoice_main b on a.invice_no=b.recNo where a.created_by='".$user."' && date(a.createDate)>='".$date1."' && date(a.createDate)<='".$date2."'";
//$sqlQuery .= " && invice_no='".$_REQUEST['kV']."' ";
// Prepare page navigation
$resultsPerPage = 20; // number of rows to return per page
// Prepare add on URL
$addOnUrl = "";
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' width="100%">
<tr valign='top' class='rowH'>
<td>Id</td>
<td>Receipt No</td>
<td>Invoice No</td>
<td>Name</td>
<td>Amount</td>
<td>Payment Mode</td>
<td>Date</td>
<td>Action</td>
</tr>
<?php
// If no records selected, print message
if (!$selectedRecords)
{ ?>
<tr><td colspan='5'>There are no entries</td></tr>
<?php
}
$i=1;
$received=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><a href='rcpt_pdf.php?kV=<?php echo $objectData['recNo'] ;?>' target='_blank'><?php echo $objectData['rcpt_id'];?></a></td>
<td><?php echo $objectData['invoice_no'];?></td>
<td><?php echo $objectData['student_name'];?></td>
<td><?php echo $objectData['amount'];?></td>
<td><?php echo $objectData['payment_mode'];?></td>
<td><?php echo $objectData['createDate'];?></td>
<td>
<a href='ingl_invoice_payment.main.php?aC=sM&kV=<?php echo $objectData['recNo'] ;?>&invice_no=<?php echo $objectData['invice_no']; ?>' title='Modify entry'><img src='images/edit.png' border='0' hspace='2'></a> |
<a href='ingl_invoice_payment.main.php?aC=sV&kV=<?php echo $objectData['recNo'] ;?>&invice_no=<?php echo $objectData['invice_no']; ?>' title='View entry'><img src='images/view.png' border='0' hspace='2'></a> |
<a onclick='return confDel();' href='ingl_invoice_payment.main.php?aC=Delete&kV=<?php echo $objectData['recNo'] ;?>&invice_no=<?php echo $objectData['invice_no']; ?>' title='Delete entry'><img src='images/delete.png' border='0' hspace='2'></a>
</td>
</tr>
<?php
$i++;
//$payment=$objectData['final_amount'];
$received=$received+$objectData['amount'];
}
?>
<tr style="background-color:#cccccc;"><td colspan="4"><b>Total Received</b></td><td><?php echo $received; ?></td><td colspan="3"></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 delete permanently or cancel");
if (agree)
return true;
else
return false;
}
</script>
<?php
$dbObject->CloseConnection();
// Include footer
include "footer_in.php";
?>