Filter:   InfoImg
download invoices.php
Language: PHP
LOC: 117
Project Info
Total ISP(total-isp)
Server: SourceForge
Type: cvs
...orge\t\total‑isp\total‑isp\
   abn.php
   addnew.php
   addnote.php
   addpay.php
   addsub.php
   addtime.php
   aliasadd.php
   answer.php
   approvelink.php
   ask.php
   autobill.php
   autobillpost.php
   backuplink.php
   batchtax.php
   Blocks-check.php
   Blocks-oldmail.php
   buildmenu.php
   business-check.php
   buytime.php
   cachemgr.php
   callanalysis.php
   calls.php
   callweekall.php
   ccemail.php
   changes.php
   checkmail.php
   cli.php
   clicheck.php
   config.php
   createwebdir.php
   credit.php
   creditpost.php
   cvimage.php
   dbspec.sql
   dealer.php
   dealeredit.php
   dealereditsave.php
   dealermenu.php
   dealerspecial-check.php
   dealerspecial.php
   dealersummary.php
   dig.php
   dnstest.php
   domainadd.php
   dschurn.php
   dsused.php
   edit.php
   editadd.php
   emailip.php
   expire.php
   extraadd.php
   faq.php
   firstpayments.php
   fixedip.dat
   fixedip.ph
   fixedip.php
   frames.php
   frconten.php
   frmain.php
   getcall.php
   gstinc.inc.php
   gsttest.php
   hms.inc.php
   index.php
   invoicepost.php
   invoices.php
   IPAD-check.php
   ipadmail.dat
   jump.php
   kick.php
   kickall.php
   killed.php
   lastaccess.php
   lastcall.php
   lastpasswords.php
   list.php
   listpay.php
   listpurchase-cash.php
   listpurchase-cheque.php
   listpurchase-code.php
   listpurchase-dupes.php
   listpurchase-exact.php
   listpurchase-group.php
   listpurchase-summary.php
   listpurchase-supplier.php
   ...purchase-unapproved.php
   listpurchase.php
   lm.inc.php
   loginfail.php
   mail.php
   mailadd.php
   mailusr.php
   monthpurch.php
   mysql.inc.php
   names.php
   newcustomer.php
   nextcall.php
   nosubs.php
   orphans.php
   password.php
   payimage.php
   payment.php
   payreport.php
   payview.php
   pdf-daily-sum.php
   pdfprint.inc.php
   permanent-check.php
   phpinfo.php
   phptest.php
   ping.php
   purchase-delete.php
   purchaseedit.php
   purchaseindex.php
   purchasing.php
   qchar.php
   radiususers.php
   radtest.php
   reallysure.php
   recall.php
   redir.php
   report.php
   reseller-check.php
   resellview.php
   sampledata.sql
   searchfaq.php
   searchfaqres.php
   sendmail.php
   staff.php
   subedit.php
   subeditadd.php
   submituser.php
   subnames.php
   taxpdf.php
   testbatch.php
   testpdf-day.php
   testpost.php
   testtaxpdf.php
   testuser.php
   testwho.php
   thundermail.php
   tigris.php
   time1.inc.php
   timetest.php
   top.php
   unanswered.php
   unlimited-3mth-check.php
   unlimited-check.php
   unlimited-stats.php
   unlimitedpartition.php
   uploadmailhdr.php
   user.php
   viewnotes.php
   visp.inc.php
   webadd.php
   weblinks.php
   WebSite-check.php
   weeknotes.php
   weekuser.php
   who.php
   whoip.php
   whoverify.php

<?

#GST-approved.


function CCshow($cc){
	$cc=trim($cc);
	if ($cc=="")
		$cr="???? ???? ???? ????";
	else{
		if (!ereg(" ",$cc)){
			$cr=substr($cc,0,4)." ";
			$cr=$cr.substr($cc,4,4)." ";
			$cr=$cr.substr($cc,8,4)." ";
			$cr=$cr.substr($cc,12);
		}else{
			$cr=$cc;
		}
	}
return $cr;
}


#if (!$CustomerID){
#	header ("Location: frmain.php");
#	exit;
#}

include "mysql.inc.php";
$sql="SELECT FirstName, LastName, Invoices.CustomerID AS ID, CreditCardNumbor,Reseller,
DATE_FORMAT(CreditCardExp,'%m/%y') AS exp, credit,identifier,
PaymentID, DATE_FORMAT(PaymentDate,'%e/%c/%Y %T') AS PDate, PaymentAmount,GST,
PaymentType,ResellerPayment,Purchase, to_days(now())-to_days(PaymentDate) as cdays 
FROM Invoices,MasterAccounts WHERE
Invoices.CustomerID=MasterAccounts.CustomerID
AND Credit >0 
ORDER BY PaymentDate DESC"; 
$result=mysql_query($sql);

if (mysql_error())
	print mysql_error();

#$usql="SELECT FirstName, LastName FROM MasterAccounts WHERE
#CustomerID=$CustomerID";
#echo $usql;
#$ures=mysql_query($usql);
#$uname=mysql_fetch_row($ures);
?><HTML>
<HEAD>
<TITLE>View Payments</TITLE>
</HEAD>
<BODY>
<center>
<FORM action="invoicepost.php" METHOD=POST>
<TABLE WIDTH=95% border=1>
<TR><TH>Name</TH><TH>Get</TH><TH>Date</TH><TH>Amount</TH><TH>Payment
Type</TH><TH>Purchase</TH><TH>Reseller</TH><th>Identifier</TH><TH>Status</TH></TR>
<?
while ($row=mysql_fetch_array($result)){
	$i++;

	if ($row[cdays]>6)
		$f="<FONT COLOR=RED>";
	else
		$f="";

	$cost = number_format($row[PaymentAmount]+$row[GST],2);
	print "<TR><TD><A HREF=\"user.php?ID=$row[ID]\">$f$row[FirstName] $row[LastName]</A></TD>";

	print "<TD><A HREF=\"taxpdf.php?PaymentID=$row[PaymentID]&PayTable=Invoices&print=1&CustomerID=$row[ID]\">Print</A> ";
	print "<A HREF=\"taxpdf.php?PaymentID=$row[PaymentID]&PayTable=Invoices&download=1&CustomerID=$row[ID]\">Download</A> ";

	print "<TD NOWRAP>$f$row[PDate]</TD><TD>$f$cost</TD><TD>";
	
	if (ereg("Credit Card",$row[PaymentType])||ereg("AutoBill",$row[PaymentType])){
		print "<B>";
		print CCshow($row[CreditCardNumbor]);
		print "</B> ";
		if ($row[CreditCardNumbor])
			print "Exp: <B>$row[exp]</B>";
	}else{
		print $row[PaymentType];
	}
	print "</TD>";
	print "<TD>$row[Purchase]</TD><TD>";
	$rsql="SELECT DealerName FROM Dealer WHERE DealerID=$row[Reseller]";
	$rres=0;
	$rres=mysql_query($rsql);
	#print $rres;
	if ($rres){
		$rr=mysql_fetch_row($rres);
		print $rr[0];
	}
	else
		print "&nbsp";
	print "</TD><TD>$row[identifier]";
	#print "</TD><TD><INPUT TYPE=checkbox NAME=\"keep[$i]\" checked></TD></TR>";

	print "</TD><TD>";
	?>
	<SELECT Name="Status[<? echo $i ?>]">
	<OPTION value="1"<? if ($row[credit]==1) print " selected";
?>>Pending</OPTION>
	<OPTION value="2"<? if ($row[credit]==2) print " selected";?>>Declined</OPTION>
	<OPTION value="-1">Cancel</OPTION>
	<OPTION value="10">Paid</OPTION>
	</SELECT>
<?
	print "<INPUT TYPE=HIDDEN NAME=\"PaymentID[$i]\" VALUE=\"$row[PaymentID]\">";
	$pt=$pt+$row[PaymentAmount];
}
?></TABLE>
<INPUT TYPE=SUBMIT VALUE="Save">
</FORM>
</CENTER>

<H3>Brief Explanation of Terms:</H3>

A Number in the payment type is a credit card number waiting to be
processed. 
<BR>If you make any changes to the Status, remember to save before
going anywhere else!
<BR><BR>
<LI><B>Pending</B> is a payment waiting to be processed.</LI>
<LI><B>Declined</B> is a payment that has been processed but did not go
through. If it is a cheque we may also need to charge a dishonour
fee.</LI>
<LI><B>Paid</B> is what we want. A successful transaction.</LI>
<LI><B>Cancel</B> is when a user has no intention of paying, or the
transaction is repeatedly declined. You must manually remove the hours
added.</LI>
 </BODY>
</HTML>