CREDIT CARD APPROVAL SYSTEM
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
project report helper
Active In SP
**

Posts: 2,270
Joined: Sep 2010
#1
19-10-2010, 12:26 PM



.doc   final report 5.doc (Size: 718 KB / Downloads: 214)
CREDIT CARD APPROVAL SYSTEM

Introduction

A credit card is part of a system of payments named after the small plastic card issued to users of the system. It is a card entitling its holder to buy goods and services based on the holder's promise to pay for these goods and services.[1] The issuer of the card grants a line of credit to the consumer (or the user) from which the user can borrow money for payment to a merchant or as a cash advance to the user. A credit card is different from a charge card, where a charge card requires the balance to be paid in full each month. In contrast, credit cards allow the consumers to 'revolve' their balance, at the cost of having interest charged. Most credit cards are issued by local banks or credit unions, and are the shape and size specified by the ISO/IEC 7810 standard as ID-1. This is defined as 85.60 × 53.98 mm in size.
Reply
computer science crazy
Super Moderator
******

Posts: 3,048
Joined: Dec 2008
#2
06-11-2010, 12:38 PM

1 Introduction
A credit card is part of a system of payments named after the small plastic card issued to users of the system. It is a card entitling its holder to buy goods and services based on the holder's promise to pay for these goods and services.[1] The issuer of the card grants a line of credit to the consumer (or the user) from which the user can borrow money for payment to a merchant or as a cash advance to the user. A credit card is different from a charge card, where a charge card requires the balance to be paid in full each month. In contrast, credit cards allow the consumers to 'revolve' their balance, at the cost of having interest charged. Most credit cards are issued by local banks or credit unions, and are the shape and size specified by the ISO/IEC 7810 standard as ID-1. This is defined as 85.60 × 53.98 mm in size.

1.1 History

The modern credit card was the successor of a variety of merchant credit schemes. It was first used in the 1920s, in the United States, specifically to sell fuel to a growing number of automobile owners. In 1938 several companies started to accept each other's cards. Western Union had begun issuing charge cards to its frequent customers in 1921. Some charge cards were printed on paper card stock, but were easily counterfeited.
The Charge-Plate was an early predecessor to the credit card and used during the 1930s and late 1940s. It was a 2 1/2" x 1 1/4" rectangle of sheet metal, similar to a military tag, that was embossed with the customer's name, city and state (no address). It held a small paper card for a signature. It was laid in the imprinter first, and then a charge slips on top of it, onto which an inked ribbon was pressed.[26] Charga-Plate was a trademark of Farrington Manufacturing Co. Charga-Plates was issued by large-scale merchants to their regular customers, much like department store credit cards of today. In some cases, the plates were kept in the issuing store rather than held by customers. When an authorized user made a purchase, a clerk retrieved the plate from the store's files and then processed the purchase. Charga-Plates speeded back-office bookkeeping that was done manually in paper ledgers in each store, before computers. The concept of customers paying different merchants using the same card was invented in 1950 by Ralph Schneider and Frank X. McNamara, founders of Diners Club, to consolidate multiple cards. The Diners Club, which was created partially through a merger with Dine and Sign, produced the first "general purpose" charge card, and required the entire bill to be paid with each statement. That was followed by Carte Blanche and in 1958 by American Express which created a worldwide credit card network (although these were initially charge cards that acquired credit card features after BankAmerica demonstrated the feasibility of the concept).
However, until 1958, no one had been able to create a working revolving credit financial instrument issued by a third-party bank that was generally accepted by a large number of merchants (as opposed to merchant-issued revolving cards accepted by only a few merchants). A dozen experiments by small American banks had been attempted (and had failed). In an odd coincidence, both of the products that finally succeeded were born in the U.S. state of California. In September 1958, Bank of America launched the BankAmerica in Fresno, California. BankAmerica became the first successful recognizably modern credit card (although it underwent a troubled gestation during which its creator resigned), and with its overseas affiliates, eventually evolved into the Visa system. In 1966, the ancestor of MasterCard was born when a group of California banks established Master Charge to compete with BankAmerica; it received a significant boost when Citibank merged its proprietary Everything Card (launched in 1967) into Master Charge in 1969.
Early credit cards in the U.S., of which BankAmerica was the most prominent example, were mass produced and mass mailed to bank customers who were thought to be good credit risks; that is, they were unsolicited. These mass mailings were known as "drops" in banking terminology, and were outlawed in 1970 due to the financial chaos that they caused, but not before 100 million credit cards had been dropped into the U.S. population. After 1970, only credit card applications could be sent unsolicited in mass mailings. The fractured nature of the U.S. banking system under the Glass-Steagall Act meant that credit cards became an effective way for those who were traveling around the country to move their credit to places where they could not directly use their banking facilities. In 1966 Barclaycard in the UK launched the first credit card outside of the U.S. There are now countless variations on the basic concept of revolving credit for individuals (as issued by banks and honored by a network of financial institutions), including organization-branded credit cards, corporate-user credit cards, store cards and so on.
In contrast, although having reached very high adoption levels in the US, Canada and the UK, it is important to note that many cultures were much more cash-oriented in the latter half of the twentieth century, or had developed alternative forms of cash-less payments, such as Carte blues or the Euro card (Germany, France, Switzerland, and others). In these places, the take-up of credit cards was initially much slower. It took until the 1990s to reach anything like the percentage market-penetration levels achieved in the US, Canada, or the UK. In many countries acceptance still remains poor as the use of a credit card system depends on the banking system being perceived as reliable. Of particular note is Japan, which remains a very cash oriented society, with credit card adoption being limited to only the largest of merchants, although an alternative system based on RFIDs inside cell phones has seen some acceptance.
In contrast, because of the legislative framework surrounding banking system overdrafts, some countries, France in particular, were much faster to develop and adopt chip-based credit cards which are now seen as major anti-fraud credit devices.
The design of the credit card itself has become a major selling point in recent years. The value of the card to the issuer is often related to the customer's usage of the card, or to the customer's financial worth. This has led to the rise of Co-Brand and Affinity cards - where the card design is related to the "affinity" (a university, for example) leading to higher card usage. In most cases a percentage of the value of the card is returned to the affinity group.
2 How credit cars works

Credit cards are issued after an account has been approved by the credit provider, after which cardholders can use it to make purchases at merchants accepting that card. When a purchase is made, the credit card user agrees to pay the card issuer. The cardholder indicates consent to pay by signing a receipt with a record of the card details and indicating the amount to be paid or by entering a personal identification number (PIN). Also, many merchants now accept verbal authorizations via telephone and electronic authorization using the Internet, known as a 'Card/Cardholder Not Present' (CNP) transaction.
Electronic verification systems allow merchants to verify that the card is valid and the credit card customer has sufficient credit to cover the purchase in a few seconds, allowing the verification to happen at time of purchase. The verification is performed using a credit card payment terminal or Point of Sale (POS) system with a communications link to the merchant's acquiring bank. Data from the card is obtained from a magnetic stripe or chip on the card; the latter system is in the United Kingdom and Ireland commonly known as Chip and PIN, but is more technically an EMV card.
Other variations of verification systems are used by ecommerce merchants to determine if the user's account is valid and able to accept the charge. These will typically involve the cardholder providing additional information, such as the security code printed on the back of the card, or the address of the cardholder.
Each month, the credit card user is sent a statement indicating the purchases undertaken with the card, any outstanding fees, and the total amount owed. After receiving the statement, the cardholder may dispute any charges that he or she thinks are incorrect (see Fair Credit Billing Act for details of the US regulations). Otherwise, the cardholder must pay a defined minimum proportion of the bill by a due date, or may choose to pay a higher amount up to the entire amount owed. The credit issuer charges interest on the amount owed if the balance is not paid in full (typically at a much higher rate than most other forms of debt). Some financial institutions can arrange for automatic payments to be deducted from the user's bank accounts, thus avoiding late payment altogether as long as the cardholder has sufficient fund.
1.3 Credit Card Numbering

The numbers found on credit cards have a certain amount of internal structure, and share a common numbering scheme. The card number's prefix, called the Bank Identification Number, is the sequence of digits at the beginning of the number that determine the bank to which a credit card number belongs. This is the first six digits for MasterCard and Visa cards. The next nine digits are the individual account number, and the final digit is a validity check code.
In addition to the main credit card number, credit cards also carry issue and expiration dates (given to the nearest month), as well as extra codes such as issue numbers and security codes. Not all credit cards have the same sets of extra codes nor do they use the same number of digits.
1.4 Features of credit card

Some of the features of credit cards are:
• Logos: The card carries logos of the card association (Visa, MasterCard) as well as that of the issuing bank (ICICI, HDFC and so on) in the front.

• Number: The card number is embossed in the front. This is usually a 16-digit number. The first digit symbolizes the major industry. Banking industry cards usually start with 4, 5 or 6. The first six digits identify the issuing organization. The next nine digits denote the individual’s account number. The last digit is a check digit.

• Name: Also embossed on the front of the card is the name of the cardholder.

• Expiry date: The date till which the card is valid is embossed on the front of the card.

• Magnetic stripe: There is a magnetic stripe (called magnetic strip) running through the length of the card on its reverse. This contains the identification information of the card which is transmitted during a transaction.

• CVV No.: This is a three-digit number that appears on the reverse of the card after the 16-digit card number. This is used as an additional security check, mostly in online transactions.

• Signature: There is a space below the magnetic stripe where the cardholder is supposed to sign. While processing a transaction, the merchant has to verify this signature.

• Contact Nos.: On the reverse of the card, the issuing bank’s contact numbers are printed. The cardholder can call these numbers for any card-related queries.

1.5 Transaction Steps

• Authorization: The cardholder pays for the purchase and the merchant submits the transaction to the acquirer (acquiring bank). The acquirer verifies the credit card number, the transaction type and the amount with the issuer (Card-issuing bank) and reserves that amount of the cardholder's credit limit for the merchant. An authorization will generate an approval code, which the merchant stores with the transaction.
• Batching: Authorized transactions are stored in "batches", which are sent to the acquirer. Batches are typically submitted once per day at the end of the business day. If a transaction is not submitted in the batch, the authorization will stay valid for a period determined by the issuer, after which the held amount will be returned back to the cardholder's available credit (see authorization hold). Some transactions may be submitted in the batch without prior authorizations; these are either transactions falling under the merchant's floor limit or ones where the authorization was unsuccessful but the merchant still attempts to force the transaction through. (Such may be the case when the cardholder is not present but owes the merchant additional money, such as extending a hotel stay or car rental.)
• Clearing and Settlement: The acquirer sends the batch transactions through the credit card association, which debits the issuers for payment and credits the acquirer. Essentially, the issuer pays the acquirer for the transaction.
• Funding: Once the acquirer has been paid, the acquirer pays the merchant. The merchant receives the amount totaling the funds in the batch minus either the "discount rate," "mid-qualified rate", or "non-qualified rate" which are tiers of fees the merchant pays the acquirer for processing the transactions.
• Charge backs: A chargeback is an event in which money in a merchant account is held due to a dispute relating to the transaction. Charge backs are typically initiated by the cardholder. In the event of a chargeback, the issuer returns the transaction to the acquirer for resolution. The acquirer then forwards the chargeback to the merchant, who must either accept the chargeback or contest it.
1.6 Advantage

The major benefit of a credit card is that the individual using it dose not require ready cash to make payments for various purchase
• No immediate cash
• Free credit
• World wide usage
• Tracking expense
• E-buying Cash
• withdrawal
1.7 Disadvantage

There is various feature of a credit card that seem to be a gift for the this person using the card but a little bit of carelessness can change the entire position the same factor can end up being a course for user.
• Interest cost 14%-15%person
• Charge
• Credit trap
• Multiple card

2 Security Problems and Solutions

Credit card security relies on the physical security of the plastic card as well as the privacy of the credit card number. Therefore, whenever a person other than the card owner has access to the card or its number, security is potentially compromised. Once, merchants would often accept credit card numbers without additional verification for mail order purchases. It's now common practice to only ship to confirmed addresses as a security measure to minimize fraudulent purchases. Some merchants will accept a credit card number for in-store purchases, whereupon access to the number allows easy fraud, but many require the card itself to be present, and require a signature. A lost or stolen card can be cancelled, and if this is done quickly, will greatly limit the fraud that can take place in this way. For internet purchases, there is sometimes the same level of security as for mail order (number only) hence requiring only that the fraudster take care about collecting the goods, but often there are additional measures. European banks can require a cardholder's security PIN be entered for in-person purchases with the card.
The PCI DSS is the security standard issued by The PCI SSC (Payment Card Industry Security Standards Council). This data security standard is used by acquiring banks to impose cardholder data security measures upon their merchants.
A smart card, combining credit card and debit card properties. The 3 by 5 mm security chip embedded in the card is shown enlarged in the inset. The contact pads on the card enable electronic access to the chip.
The low security of the credit card system presents countless opportunities for fraud. This opportunity has created a huge black market in stolen credit card numbers, which are generally used quickly before the cards are reported stolen.
The goal of the credit card companies is not to eliminate fraud, but to "reduce it to manageable levels". This implies that high-cost low-return fraud prevention measures will not be used if their cost exceeds the potential gains from fraud reduction - as would be expected from organizations whose goal is profit maximization.
Most internet fraud is friendly fraud. The rest is done through the use of stolen credit card information which is obtained in many ways, the simplest being copying information from retailers, either online or offline. Despite efforts to improve security for remote purchases using credit cards, systems with security holes are usually the result of poor implementations of card acquisition by merchants. For example, a website that uses SSL to encrypt card numbers from a client may simply email the number from the web server to someone who manually processes the card details at a card terminal. Naturally, anywhere card details become human-readable before being processed at the acquiring bank, a security risk is created. However, many banks offer systems where encrypted card details captured on a merchant's web server can be sent directly to the payment processor.
Controlled Payment Numbers which are used by various banks such as Citibank (Virtual Account Numbers), Discover (Secure Online Account Numbers, Bank of America (Shop Safe), 5 banks using eCarte Blue and CMB's Virtual is in France, and Swanbank of Sweden's eKort product are another option for protecting one's credit card number. These are generally one-time use numbers that front one's actual account (debit/credit) number, and are generated as one shops on-line. They can be valid for a relatively short time, for the actual amount of the purchase, or for a price limit set by the user. Their use can be limited to one merchant if one chooses. The effect of this is the users’ real account details are not exposed to the merchant and its employees. If the number the merchant has on their database is compromised, it would be useless to a thief after the first transaction and will be rejected if an attempt is made to use it again.
The same system of controls can be used on standard real plastic as well. For example if a consumer has a chip and pin (EMV) enabled card they can limit that card so that it be used only at point of sale locations restricted from being used on-line) and only in a given territory only for use in Canada). This technology provides the option for banks to support many other controls too that can be turned on and off and varied by the credit card owner in real time as circumstances change they can change temporal, numerical, geographical and many other parameters on their primary and subsidiary cards). Apart from the obvious benefits of such controls: from a security perspective this means that a customer can have a chip and pin card secured for the real world, and limited for use in the home country assuming it is totally chip and pin. In this eventuality a thief stealing the details will be prevented from using these overseas in non chip and pin (EMV) countries. Similarly the real card can be restricted from use on-line so that stolen details will be declined if this tried. Then when card users shop online they can use virtual account numbers. In both circumstances an alert system can be built in notifying a user that a fraudulent attempt has been made which breaches their parameters, and can provide data on this in real time. This is the optimal method of security for credit cards, as it provides very high levels of security, control and awareness in the real and virtual world. Furthermore it requires no changes for merchants at all and is attractive to users, merchants and banks, as it not only detects fraud but prevents it.
The Federal Bureau of Investigation and U.S. Postal Inspection Service are responsible for prosecuting criminals who engage in credit card fraud in the United States, but they do not have the resources to pursue all criminals. In general, federal officials only prosecute cases exceeding US $5,000 in value. Three improvements to card security have been introduced to the more common credit card networks but none has proven to help reduce credit card fraud so far. First, the on-line verification system used by merchants is being enhanced to require a 4 digit Personal Identification Number (PIN) known only to the card holder. Second, the cards themselves are being replaced with similar-looking tamper-resistant smart cards which are intended to make forgery more difficult. The majority of smart card (IC card) based credit cards comply with the EMV (Euro pay MasterCard Visa) standard. Third, an additional 3 or 4 digit Card Security Code (CSC) is now present on the back of most cards, for use in "card not present" transactions.
2.1 Over limit charges

Consumers who keep their account in good order by always staying within their credit limit, and always making at least the minimum monthly payment will see interest as the biggest expense from their card provider. Those who are not so careful and regularly surpass their credit limit or are late in making payments are exposed to multiple charges that were typically as high as £25 - £35 [17] until a ruling from the Office of Fair Trading[18] that they would presume charges over £12 to be unfair which led the majority of card providers to reduce their fees to exactly that level.
2.2 Credit Card Fraud
The credit card industry is keenly seeking ways to control and minimize the billions of dollars lost every year due to credit card fraud. If credit card issuers could accomplish that goal, they could reap big benefits not merely by reducing losses and thus increasing revenues, but by lowering their business risks and raising both customer confidence and satisfaction. Predictive analytics is a powerful tool to help achieve that goal. 1So far the trend has been to bring in customer analytics to analyze historical data after an event has occurred. This limits its value as far as effective decision making is concerned. For example, credit card issuers use customer analytics to sift through past transaction data to detect fraudulent transaction patterns. However, since the losses have already arisen, the value of that insight remains limited. Predictive analysis, on the other hand, provides intelligence in real time before the event. It can, therefore, be invaluable in the detection and prevention of credit card fraud, by allowing issuers to catch suspicious transactions before they go through, thus actually helping prevent fraud. So far, predictive analytics in fraud detection has been constrained by issues of high costs and response times. Therefore, it has not been used in a widespread manner. Now, however, powerful computing hardware and network bandwidth are both widely available and much more affordable. Simultaneously, over the last few years, credit card fraud has been on the rise worldwide and is itself evolving, which makes detecting and preventing frauds an urgent imperative. This confluence of events implies that the time is ripe for credit card issuers to begin implementing fraud detection and prevention (FD&P) systems.

2.2.1 Overview of Real-time Fraud Detection and Prevention

So how does a FD&P system work? It intercepts all relevant transactions before they are approved by the card issuer’s existing authorization system and passes them through algorithms that calculate a Fraud Potential Index (FPI), which is a measure of how likely the transaction is to be fraudulent. The card issuer assigns a certain weightage for each algorithm in the set, which can differ based on a broad range of parameters. Both the number of algorithms to be used and their relative weightages can be configured to suit individual card issuers’ policies. Using the FPIs returned by individual algorithms, the FD&P system computes a ‘composite FPI’ across all applicable algorithms, based on which it derives an action code that it sends to the existing authorization system.
The card issuer can specify different actions depending on the parameters of the transaction. For example, certain transactions can be approved, others declined and still others can be passed but marked for future declines or interventions. Such marking can be performed by amount, or incidence, or by other parameters decided by the issuer. A card issuer could choose to use proprietary or industry standard algorithms. A good FD&P solution should come with a rich set of industry standard algorithms along with the ability to be augmented with issuer specific, proprietary and customized ones.

,
Use Search at http://topicideas.net/search.php wisely To Get Information About Project Topic and Seminar ideas with report/source code along pdf and ppt presenaion
Reply
smart paper boy
Active In SP
**

Posts: 2,053
Joined: Jun 2011
#3
30-08-2011, 02:59 PM


.zip   Credit_Card_Approval_System.zip (Size: 1.76 MB / Downloads: 66)
Code:
/**
*Credit Card Apporval System
*
*@author Joseph John Paul Baba
*@author Jeshurun Ray Flores
*@author Lemuel Kit Rapanot
*@version 1(BETA)
*@since JDK 1.4 &copy 2006
*/

import java.awt.*;
import java.util.*;
import java.text.*;
import java.sql.Time;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.io.*;
import javax.swing.table.*;

public class CCApproval extends ViewElements{
    
    /**************/
    /*    main    */
    /**************/
    
    public static Splash mySplash = new Splash(5000,false);
    public static void main(String[] args) {
        mySplash = new Splash(5000,false);
         mySplash.setVisible(true);
         mySplash.setStatus("Loading User Interface");
         mySplash.sleep(1000);
         try {
            javax.swing.UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
        } catch (Exception e) {}//*/
        
        lbBlank.setText("Loading...");
        JFrame screen = new JFrame();
        Dimension disp = Toolkit.getDefaultToolkit().getScreenSize();        
       int width = disp.width;
       int height = disp.height;
       int x = (disp.width - width) / 2;
       int y = (disp.height - height) / 2;
        
        CCApproval iframe = new CCApproval("Credit Card Approval and Monitoring System V1 (BETA)");
        JDesktopPane desktop = new JDesktopPane();
        
        Dimension disp2 = Toolkit.getDefaultToolkit().getScreenSize();        
       int x2 = (disp2.width - 620) / 2;
       int y2 = (disp2.height - 430) / 2;
        
       iframe.setBounds(x2,y2,620,430);
        iframe.setSize(620,430);         
        iframe.setVisible(true);
        iframe.setResizable(false);        
        iframe.setMaximizable(false);        
        iframe.setClosable(false);
        
        int bx = (disp.width - 1024)/2;
        int by = (disp.height - 768)/2;
        
        ImageIcon icon = new ImageIcon("backclip.jpg");
        JLabel back = new JLabel(icon);
        back.setBounds(x,y,1024,768);
        desktop.add(back, new Integer(Integer.MIN_VALUE));
        
    
        desktop.add(iframe);
        screen.getContentPane().add(desktop, BorderLayout.CENTER);
        screen.getContentPane().setVisible(true);             
        screen.setSize(width,height);
        screen.setUndecorated(true);
        screen.setVisible(true);            
        screen.setResizable(false);
        
        
        screen.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        screen.addWindowListener(new windowListener());
        
        okId = (long)customers.size()+1;
        if(customers.containsKey(""+okId))
            while(!customers.containsKey(""+okId))
                okId++;
        mySplash.setStatus("Load completed..");
        mySplash.sleep(1000);
        mySplash.setVisible(false);
        lbBlank.setText("WELCOME!");
        updateClock();
        
    }    
    
    public CCApproval(String title){
        super(title);
        readFiles();
        mySplash.setStatus("Loading files..");
        mySplash.sleep(1000);
        reloadData();
        setListeners();
        clearFields(0);
        setVisible(true);
    }
    /**************/
    /*misc methods*/
    /**************/
    public void setListeners(){
        btrst1.addActionListener(new ButtonListener());
        btok1.addActionListener(new ButtonListener());
        rbcash.addActionListener(new RadioButtonListener());
        rbcard.addActionListener(new RadioButtonListener());
        btper.addActionListener(new ButtonListener());
        btselcard.addActionListener(new ButtonListener());
        btselcust.addActionListener(new ButtonListener());
        
        bttrans2.addActionListener(new ButtonListener());
        btedit.addActionListener(new ButtonListener());
        
        btview.addActionListener(new ButtonListener());
        tfsearch[0].addKeyListener(new nameSearch());
        tfsearch[1].addKeyListener(new cardSearch());        
        
        
        custsort.addMouseListenerToHeaderInTable(tbcust);
        cardsort.addMouseListenerToHeaderInTable(tbcard);
        
        miabout.addActionListener(new MenuListener());
        miexit.addActionListener(new MenuListener());
    }
    public void clearFields(int where){
        switch(where){
            case 0:
                dltype.setSelectedIndex(0);
                tacust.setText("");
              tffn.setText("");    tfln.setText("");    tfmn.setText("");
              tfmfn.setText("");    tfmln.setText(""); tfmmn.setText("");
              taad.setText("");
              spbday.setModel(new SpinnerDateModel());
                
                break;
            case 1:
                tfccnum2.setText("");    tfcust.setText("");
                tfcost.setText("");    tfstore.setText("");
                
                rbcash.setSelected(true);
                enableDisable();
                break;
                
        }
        cust = null;
        card = null;
    }
    
    /**************/
    /*   model    */
    /**************/
    public static ChainedMap customers = new ChainedMap(29);
    public static ChainedMap cards = new ChainedMap(29);
    public static Customer cust = new Customer();
    public static CreditCard card = new CreditCard();
    public static Transaction trans = new Transaction(null,null,0.0);
    public static long okId;    
    public static long transCount;
    public static final String[] month = {"January","Febuary","March","April",
                                          "May","June","July","August","September",
                                          "October","November","December"};
    
    /**************/
    /*    view    */
    /**************/
    /**all view objects coded in ViewElements.java**/
    
    
    /**************/
    /* controller */
    /**************/
    
    private class RadioButtonListener implements ActionListener{
        public void actionPerformed(ActionEvent e){
            enableDisable();
        }
    }
    private class ButtonListener implements ActionListener{
        public void actionPerformed(ActionEvent e){
            Object src = e.getSource();
            if(src == btok1){
                cust = new Customer(tffn.getText(),tfln.getText());
                
                Date bday = (Date)spbday.getValue();
                cust.setMiddleName(tfmn.getText().trim().toUpperCase());
                cust.setMother(new Person(tfmfn.getText().trim().toUpperCase(),
                                          tfmln.getText().trim().toUpperCase(),
                                          tfmmn.getText().trim().toUpperCase()));
                cust.setBirthday(bday);
                cust.setAddress(taad.getText());
                cust.setId(okId++);
                
                if(dltype.getSelectedIndex()!=0){
                    card = new CreditCard(cust,dltype.getSelectedIndex());
                    cards.insert(card.getNumber(),card);
                    cust.addCreditCard((CreditCard)cards.get(card.getNumber()));
                    Object[] row = {card,card.getHolder(), card.getType(),card.getStatus()};
                    tbcardmodel.addRow(row);
                }
                customers.insert(""+cust.getId(),cust);
                Object[] row = {cust,""+cust.cardCount()};
                tbcustmodel.addRow(row);
                clearFields(0);
                
                cust = null;
                card = null;
                lbBlank.setText("["+new Date()+"] Customer: "+row[0]+" added to database.");
            }
            else if(src == btrst1){
                clearFields(0);
                cust = null;
                card = null;
            }
            else if(src == btselcust){
                tabFrame.setSelectedIndex(2);
                tab3tabs.setSelectedIndex(0);
            }
            else if(src == btselcard){
                CustomerCreditCardsDialog dlgcard = new CustomerCreditCardsDialog(new JFrame(),tfccnum2);
            }
            else if(src == btper){
                lbBlank.setText("["+new Date()+"] Processing Transaction...");
                try{
                    if(rbcard.isSelected())
                        trans = new Transaction(cust,(CreditCard)cards.get(card.getNumber()),Integer.parseInt(tfcost.getText()));
                    else
                        trans = new Transaction(cust,null,Long.parseLong(tfcost.getText()));
                    trans.setTransNumber(transCount++);
                    trans.setMerchant(tfstore.getText());
                    cust.addTransaction(trans);
                    customers.remove(""+cust.getId());
                    customers.insert(""+cust.getId(),cust);
                    if(rbcard.isSelected()){
                        card.addTransaction(trans);
                        cards.remove(card.getNumber());
                        cards.insert(card.getNumber(),card);
                    }
                    reloadData();
                    String theOut = "";
                    theOut += "Store: " + trans.getMerchant().toUpperCase() + "\n"
                        + "=======================\n" + trans.getTransDate().toString() + "\n\n"
                        + "Customer: "+trans.getCustomer().toString()+"\n"
                        + "Paid in ";                
    
                      if(trans.getCardUsed() == null)
                          theOut += "CASH :: Php "+trans.getAmount();
                      else
                          theOut += "CREDIT CARD :: "+trans.getCardUsed().toString();
                    trans.setApprovalNum();
                  theOut+="\n\nApproval Number: "+trans.getApprovalNumber();
                    JOptionPane.showMessageDialog(null, theOut);                
                }
                catch(Exception err){
                    JOptionPane.showMessageDialog(null, "There was an invalid value in the input,\nPlease enter appropriate input in the fields!","Error", JOptionPane.ERROR_MESSAGE);
                    lbBlank.setText("Some fields are incomplete.");

                    return;
                }            
                clearFields(1);
                cust = null;
                card = null;
                enableDisable();
                lbBlank.setText("["+new Date()+"] Transaction Processed...");
            }
            
            else if(src == bttrans2){
                try{

                    int sel = tbcust.getSelectedRow();
                    cust = (Customer)tbcust.getModel().getValueAt(sel,0);
                    
                    tabFrame.setSelectedIndex(1);
                    tfcust.setText(cust.toString());
                    enableDisable();
                }
                catch(Exception ex){
                    lbBlank.setText("No customer has been selected.");
                }
            }
            else if(src == btedit){
                try{
                    int sel = tbcust.getSelectedRow();
                    cust = (Customer)tbcust.getModel().getValueAt(sel,0);
                    Customer old = cust;
                    ViewModifyCustomerDialog dlg = new ViewModifyCustomerDialog(new JFrame());
                    customers.remove(old);
                    enableDisable();
                }
                catch(Exception ex){}
            }
            else if(src == btview){
                try{
                    int sel = tbcard.getSelectedRow();
                    card = (CreditCard)tbcard.getModel().getValueAt(sel,0);
                    ViewCreditCardDialog dlg = new ViewCreditCardDialog(new JFrame());
                    reloadData();
                }
                catch(Exception ex){}
            }
        }
    }
    
    static String profileSearchText = "";
    static String cardSearchText = "";
    
    private class nameSearch extends KeyAdapter
    {
          public void keyReleased(KeyEvent e)
        {
               profileSearchText = tfsearch[0].getText();
               updateProfileTable();
           
          }
    }
    private class cardSearch extends KeyAdapter
    {
          public void keyReleased(KeyEvent e)
        {
               cardSearchText = tfsearch[1].getText();               
               updateCardTable();
           
          }
    }
    private void updateProfileTable() {

          while(srchTableModel.getRowCount() > 0)
              srchTableModel.removeRow(0);          
      
          if(profileSearchText.equals(""))
              tbcust.setModel(custsort);
          
          else{          
              ListIterator iter = CCApproval.customers.dataIterator();
          
              while(iter.hasNext()){
                  Customer toProcess = (Customer)iter.next();
                  if(toProcess.toString().startsWith(profileSearchText.toUpperCase()))
                      srchTableModel.addRow(new Object[]{toProcess, ""+toProcess.cardCount()});                  
              }
              tbcust.setModel(srchsort);
        }            
    }
    private void updateCardTable() {

          while(srchCardModel.getRowCount() > 0)
              srchCardModel.removeRow(0);          
      
          if(cardSearchText.equals(""))
              tbcard.setModel(cardsort);
          
          else{          
              ListIterator iter = CCApproval.cards.dataIterator();
                  int tempX = dlsearch.getSelectedIndex();
              while(iter.hasNext()){
                  CreditCard toProcess = (CreditCard)iter.next();
                  String comparable = "";
                  switch(tempX){
                      case 0 : comparable = toProcess.getHolder().toString(); break;
                      case 1 : comparable = "" + toProcess.getNumber(); break;
                      case 2 : comparable = toProcess.getType();break;
                  }
                  if(comparable.startsWith(cardSearchText.toUpperCase()))
                      srchCardModel.addRow(new Object[]{toProcess, ""+toProcess.getHolder(), toProcess.getType(), toProcess.getStatus()});                  
              }
              tbcard.setModel(crdsort);
        }            
    }
    
    
    private class MenuListener implements ActionListener{
        public void actionPerformed(ActionEvent e){
            Object src = e.getSource();
            if(src == miabout){
                JDialog theAbout = new About(null);
            }
            else if(src == miexit){
                Object[] options = { "YES", "NO" };
                int option = JOptionPane.showOptionDialog(null, "Are you sure you want to exit?","EXIT",
                    JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,
                    null, options, options[0]);
                if (option == JOptionPane.OK_OPTION){
                    writeFiles();
                    lbBlank.setText("Thank You For Using Me.. :D");
                    System.exit(0);
                }
            }
            
        }
    }
    private static class windowListener extends WindowAdapter {
        public void windowClosing(WindowEvent we) {
            Object[] options = { "YES", "NO" };
            int option = JOptionPane.showOptionDialog(null, "Are you sure you want to exit?","EXIT",
                JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,
                null, options, options[0]);
            if (option == JOptionPane.OK_OPTION){
                lbBlank.setText("Thank You For Using Me.. :D");
                System.exit(0);
            }
        }
    }
    
    
    public static void updateClock(){        
        while(true){            
               Date now = new Date();
               DateFormat df1 = DateFormat.getDateInstance(DateFormat.LONG);
            long startDate = now.getTime();
  
            Time distime = new Time(startDate);
                    boolean amPM = false;
                    int tempH = distime.getHours();
                    int tempMin = distime.getMinutes();
                    int tempSec = distime.getSeconds();
                    
                    if(tempH > 12){            
                        tempH -= 12;
                        amPM = true;
                    }
            
            
                    NumberFormat nf = NumberFormat.getInstance();
                    nf.setMinimumIntegerDigits(2);
                    nf.setMaximumIntegerDigits(2);            
                    String theOut = "" + nf.format(tempH) + ":" + nf.format(tempMin) + ":" + nf.format(tempSec);
                    if(amPM)
                        theOut += " PM";
                    else
                theOut += " AM";                
                    
              DateFormat df2 = DateFormat.getDateInstance(DateFormat.FULL);
            String s4 = df2.format(now);
            theOut += "  " + s4;    
            
            lbClock.setText(theOut);        
        
            if(Integer.parseInt(nf.format(tempMin))%10==0 &&
            Integer.parseInt(nf.format(tempSec)) == 0){
                lbBlank.setText("Auto-saving data...");
                writeFiles();
                lbBlank.setText("System is Idle..");
            }
        
        try{Thread.sleep(200);} catch(InterruptedException e){}
        }      
    }
    
    static void writeFiles(){
        try{
            FileOutputStream outStream = new FileOutputStream("Customers.dat");
            ObjectOutputStream ooStream = new ObjectOutputStream(outStream);
            
            ooStream.writeObject(customers);
            ooStream.flush();
            outStream.close();
            
            
            outStream = new FileOutputStream("CreditCards.dat");
            ooStream = new ObjectOutputStream(outStream);

            ooStream.writeObject(cards);
            ooStream.flush();
            outStream.close();

            FileWriter misc = new FileWriter("misc.inf");
            misc.write(""+transCount);
            misc.close();
    }
    catch (IOException exc){System.err.println("Encountered error while writing files!");}
  }
  static void readFiles(){
        lbBlank.setText("Loading...");
    try{
            FileInputStream inStream;
            ObjectInputStream oiStream;
      
            inStream = new FileInputStream("CreditCards.dat");
            oiStream = new ObjectInputStream(inStream);
      
      
            cards = (ChainedMap)oiStream.readObject();
            
            inStream.close();
            
            inStream = new FileInputStream("Customers.dat");
            oiStream = new ObjectInputStream(inStream);
      
            customers = (ChainedMap)oiStream.readObject();
      
            inStream.close();
    }
    catch (FileNotFoundException exc){
            System.err.println("Some required file/s is/are missing or might be corrupt!");
    }
    catch (IOException exc){}
    catch(ClassNotFoundException exc){
            System.err.println("Required files not found.");
    }
    try{
            BufferedReader br = new BufferedReader(new FileReader("misc.inf"));
            transCount = Long.parseLong(br.readLine());
        }
        catch(FileNotFoundException ex){
            transCount = 1;
        }
    catch (IOException exc){}
  }
    public static void reloadData(){
        ListIterator iter = customers.dataIterator();
        int a =0;
        while(iter.hasNext()){
            Customer tmp = (Customer)iter.next();
            Object[] row = {tmp,""+tmp.cardCount()};
            try{
                tbcustmodel.setValueAt(row[0],a,0);
                tbcustmodel.setValueAt(row[1],a,1);
            }
            catch(Exception e){
                tbcustmodel.addRow(row);
            }
            a++;
        }
        iter = cards.dataIterator();
        a = 0;
        while(iter.hasNext()){
            CreditCard tmp = (CreditCard)iter.next();
            Object[] row2 = {tmp,tmp.getHolder(), tmp.getType(),tmp.getStatus()};
            try{
                for(int b=0;b<row2.length;b++)
                    tbcardmodel.setValueAt(row2[b],a,b);
            }
            catch(Exception e){
                tbcardmodel.addRow(row2);
            }
            a++;
        }
    }
    public static String dateString(Date thisDate){
        String date = "";
        date+=month[thisDate.getMonth()]+" ";
        date+=thisDate.getDate()+", ";
        date+=(thisDate.getYear()+1900);
        
        return date;
    }
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page

Quick Reply
Message
Type your reply to this message here.


Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Authendication for Visa Card System PPT study tips 0 337 30-08-2013, 04:17 PM
Last Post: study tips
  Student Report Card Project Report study tips 4 770 06-08-2013, 09:31 AM
Last Post: study tips
  STUDENT REPORT CARD seminar ideas 1 843 05-08-2013, 03:31 PM
Last Post: Musa_Jutt
  Citizen card system project topics 17 10,623 14-06-2013, 09:38 AM
Last Post: study tips
  CREDIT CARD PROCESSING study tips 0 251 17-05-2013, 12:33 PM
Last Post: study tips
  FPGA based Auto toll gate with Smart Card and GSM Interface using VERILOG Report study tips 0 812 09-05-2013, 03:39 PM
Last Post: study tips
  Report on Development of a Budget Approval System study tips 0 497 16-04-2013, 03:28 PM
Last Post: study tips
  Report on Credit Management System project girl 0 335 02-02-2013, 03:57 PM
Last Post: project girl
  DEVELOPMENT OF A WORKFLOW BASED PURCHASE REQUEST APPROVAL SYSTEM ABSTRACT project girl 0 249 28-01-2013, 09:31 AM
Last Post: project girl
  DEVELOPMENT OF A BUDGET APPROVAL SYSTEM ABSTRACT project girl 0 361 28-01-2013, 09:08 AM
Last Post: project girl