PHP
  Home arrow PHP arrow Page 3 - User Management in a PHP Invoicing System
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

User Management in a PHP Invoicing System
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 5
    2006-09-27


    Table of Contents:
  • User Management in a PHP Invoicing System
  • The Action column
  • Emailing reminders
  • User settings page

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    User Management in a PHP Invoicing System - Emailing reminders
    ( Page 3 of 4 )

    When a invoice remains unpaid for a set amount of time you can send an email as a reminder to the client. This option is available when you view the list of unpaid invoices. So, create a new PHP document and save it as emailInv.php. Then add the following code:

    Code 8 emailInv.php

    <?
    ob_start();
    include "config.php";
    $query="SELECT email FROM client where id='".$u_id."'";
    $result1 = mysql_query($query);
                if (!$result1) {
                   $error = mysql_error();
    }else{
    while ($row = mysql_fetch_array($result1)) {
    $em= $row["email"];
    }
    }
    $query="SELECT * FROM invoices where invno='".$u_id."'";
    $results=mysql_query($query);
    if(!$results){
    exit(mysql_error());
    }
     while ($row = mysql_fetch_array($results)) {
                    $invNo=$row["invno"];
                    $dte=$row["inv_date"];
                  $dte=date("d/m/Y");
                                                         }
    $query_invdetails = "SELECT * FROM clientinv WHERE finv='".$invNo'";
    if(!$result_invdetails= mysql_query($query_invdetails)){
    echo mysql_error();
    }else{
    $num_invdetails = mysql_num_rows($result_invdetails);
    $invdetails=mysql_fetch_assoc($result_invdetails);}
    $emailAd=your@emailaddress;
    $subj="RE: Overdue Invoice Reminder.";
    $mess="Product Description: $invdetails['descr']crn";
    $mess .="Invoice Number: $invNorn";
    $mess .= "Invoice Date: $dtern";
    $mess .="Total (incl. VAT): $invdetails['totwVAT']rn";
    $mess .="If you have any queries or problems please do not hesitate to contactrn";
    $mess .=" your@emailaddress ";
    $from=" your@emailaddress
    $to=$em ;//Client email address
    if (mail($to,$subj,$mess,$from)){
    header("location:Main.php?act=success");
    }else{
    echo "Could not send mail. Please check your mail settings";
    }
    ?>

    A client ID is sent to this script from the unpaid.php page and is then used to retrieve the email address and other information of the client. The script runs three queries; each of them retrieves data related to a particular invoice. The first query interrogates the client table and retrieves the client email address. The second query retrieves the invoice number and the date of the invoice. And finally, the third query retrieves the invoice description and cost.  This information is then used to create an email message, and then sent off.  



     
     
    >>> More PHP Articles          >>> More By Leidago
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek