Location: PHPKode > scripts > PHP Online Invoice System > php-online-invoice-system/recv_payment.php
<?php
/*
 * Exemplar Web hosting
 * http://www.exemplar.biz
 *
 * Title: PHP Online Invoice System
 * Version: 2.0
 * Author: Exemplar
 * Date: 01-01-2006
 *
*/

include('header.php');
$year = date (Y);
$mon = date (m);
$day = date (d);
$today = $year."-". $mon."-". $day;

$result = mysql_query("SELECT invoices.*,clients.* FROM invoices,clients WHERE invoices.clientid=clients.clientid && invoices.id = '$id'",$db);

while ($row = mysql_fetch_array($result))
{
	$invoiceid = $row["id"];
	$clientid = $row["clientid"];
	$clientname = $row["name"];
	$clientcompany = $row["company"];
	$clientemail = $row["email"];
	$client_title = $row["company"];
	$date = $row["date"];
	$bill_date = $row["bill_date"];
	$due_date = $row["due_date"];
	$paid_date = $row["paid_date"];
	$dateshow = fixDate($date);
	$dateshow1 = fixDate($bill_date);
	$dateshow2 = fixDate($due_date);
	$dateshow3 = fixDate($paid_date);
	$dateshow4 = fixdate($today);
	$shipping = $row["shipping"];
	$salestax = $row["salestax"];
	$subtotal = $row["subtotal"];
	$total = $row["total"];
	$misc = $row["misc"];
	$note = $row["note"];
	$status = $row["status"];
	$taxid = $row["taxid"];
	$first_name = $row["first_name"];
    $last_name = $row["last_name"];
    $company = $row["company"];
    $address = $row["address"];
    $city = $row["city"];
    $state = $row["state"];
    $zip = $row["zip"];
    $shiptoname = $row["shiptoname"];
    $shiptoaddr = $row["shiptoaddr"];
    $shiptocity = $row["shiptocity"];
    $shiptostate = $row["shiptostate"];
    $shiptozip = $row["shiptozip"];

}



if($submit){


	$sql = "INSERT INTO acctrecv (clientid,invoiceid,amt_recv,recv_date,comments)
	 VALUES ('$clientid','$invoiceid','$amt_recv','$recv_date','$comments')";
$result = mysql_query($sql);




 echo "<center><BR><h2>Thank you! Information entered.</h2><BR><H4><A HREF=menu.php>Return to Invoices</A></H4></center> \n";
	}
else
	{
?>
	<center><form action="recv_payment.php" method="post">
<table border="1" align="center" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" id="box" width="50%" cellspacing="0">

	<TR><br><font class="lrgBoldred"><?php if (isset($_GET['message'])) { echo ' - '.$_GET['message']; } ?></font><BR>
		<td WIDTH="100%" align="left">
	<table border="0" align="left" style="border-collapse: collapse; background-image:url(''); background-repeat:repeat" bordercolor="#111111" id="createbox" width="100%"
cellspacing="1" BACKGROUND="images/bgimage.jpg">

      <tr>
         <td class="topHeadrow5" width="100%" colspan="4">
        <p align="left"><B>Register Payment for Invoice # <?=$id?>. </b>
        </td>
      </tr>
      <td width="151" align="right"><B>
        User ID:</B>
        </td>
        <td width="243"><B>

	<input type="text" NAME="clientid" value="<?=$clientid?>"  SIZE="21" MAXLENGTH="35"></B>
	     </td>
      </tr>

      <td width="151" align="right"><B>
        Company:</B>
        </td>
        <td width="243"><B>

	<input type="text" name="company" value="<?=$company?>" SIZE="21" MAXLENGTH="35"></B>
	     </td>
      </tr>
      <td width="151" align="right"><B>
        Amount Received:</B>
        </td>
        <td width="243"><B>

	<input type="text" name="amt_recv"  SIZE="20"  value="<?=$total?>" SIZE="21" MAXLENGTH="35"></B>
	     </td>
      </tr>
      <td width="151" align="right" VALIGN="top"><B>
        Received Date:</B>
        </td>
        <td width="243"><B>

	<input type="text" name="recv_date"  SIZE="20"  value="<?=$today?>" SIZE="21" MAXLENGTH="35"></B>
        <p align="left" style="margin-top: 1px"><FONT SIZE="1">Y-M-D&nbsp;&nbsp;0000-00-00</p></font></td>
      </tr>


      <td width="151" align="right"><B>
        Comments:</B>
        </td>
        <td width="243"><B>

	<textarea cols="" rows="" name="comments"></textarea></B>
	     </td>
      </tr>
      <tr>


        <td width="100%" COLSPAN="2">&nbsp;<P align="center" style="margin-top: 2px; margin-bottom: 5px"><b>
        <input type="hidden" name="invoiceid" value="<?=$id?>">
	<INPUT class="sub_bttn" TYPE="SUBMIT" NAME="submit" VALUE="Register Payment"></b></td>
      </tr>

    </table>
    </td>
    </tr>
    </table>

	</FORM></center>
<?
	}
?>
Return current item: PHP Online Invoice System