<?
/*
* Exemplar Web hosting
* http://www.exemplar.biz
*
* Title: PHP Online Invoice System
* Version: 2.0
* Author: Exemplar
* Date: 01-01-2006
*
*/
include "header.php";
$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"];
$clientemailfind = mysql_query("SELECT email FROM clients WHERE clientid = '$clientid'",$db);
$clientemail = mysql_result($clientemailfind,0);
$date = $row["date"];
$dateshow = fixdate($date);
$name = $row["name"];
$first_name = $row["first_name"];
$last_name = $row["last_name"];
$passw = $row["password"];
$total = $row["total"];
$status = $row["status"];
}
?>
<h1>Notify client</h1>
<?
if ($submit) {
include "sendnotification.php";
echo "Client email notification has been sent";
}
else {
?>
<form name="form1" method="post" action="<? echo $PHP_SELF ?>">
Message: <br>
<textarea name="message" cols="60" rows="12">
Hello <? echo $first_name ?>
this message is a friendly reminder that you have an invoice due from <? echo $yourcompany ?>.
Date of invoice: <? echo $dateshow ?>.
You can login to your account at: <? echo $site ?>.
Below is your username and password, please email us <? echo $youremail ?> if you have any problems.
User Name: <? echo $name ?>
Password: <? echo $passw ?>
</textarea>
<input type="hidden" name="clientemail" value="<? echo $clientemail ?>">
<input type="hidden" name="date" value="<? echo $dateshow ?>">
<br>
<input type="submit" name="submit" value="Send notification">
</form></blockquote>
<?
}
include "footer.php";
?>