Drafted By: Nihar Ranjan Roy
DYNAMIC SHOPPING CART
REPORT
ON
SUMMER INTERNSHIP
AT
IBM GURUKOOL
Submitted in partial fulfillment for the award of the degree
of
B.TECH (CSE)
Submitted by
Abhishek Kumar Rai
1101101188
Dhruv Govila
1101101129
Nivi Agrawal
1101101162
Tushar Chowdhury
1101101160
Twesh Srivastava
1101101173
Under the guidance of
Mr. Thirunavukkarasu K.
Assistant Professor
GALGOTIAS UNIVERSITY
SCHOOL OF COMPUTING SCIENCE AND ENGINEERING
17A, YAMUNA EXPRESSWAY, UTTAR PRADESH
SESSION 2014-2015
Page 2
Table Of Contents
Certificate…………………………………………………………………………………………………...…4
Acknowledgement .....................................................................................................................................5
Profile of the Supervisor……………………………………………………………………………………....6
Additional details of the company…………………………………………………………………………....8
Feedback for the internship…………………………………………………………………………………..9
Abstract……………………………………………………………………………………………………...10
Problem Statement…………………………………………………………………………………………..10
Software Requirements Specification…………………………………………………………………..……11
1. Introduction……………………………………………………………………………………..11
1.1 Purpose……………………………………………………………………………………...11
1.2 Scope………………………………………………………………………………………..11
1.3 Definitions……………………………………………………………………………….….12
1.4 References…………………………………………………………………………………..12
1.5 Overview……………………………………………………………………………………12
2. Overall Description……………………………………………………………………………..13
2.1 Product Perspective…………………………………………………………………………13
2.1.1 System Interfaces…………………………………………………………………...13
2.1.2 User Interfaces……………………………………………………………………...13
2.1.3 Hardware Interfaces………………………………………………………………...13
2.1.4 Software Interfaces……………………………………………………………….…13
2.1.5 Communication Interfaces………………………………………………………….14
2.2 Product Function………………………………………………………………………..…..14
2.3 User Classes and Characteristics……………………………………………………………14
2.4 Operating Environment……………………………………………………………………..14
2.5 Design and Implementation Constraints……………………………………………………15
2.5.1 Standard Development tools………………………………………………………..15
2.5.2 Web based Product………………………………………………………………….15
2.6 Assumptions and Dependencies…………………………………………………………….15
3. Specific Requirements………………………………………………………………………….15
3.1 Functional Requirements…………………………………………………………………...15
3.1.1 Use Cases…………………………………………………………………………...17
3.1.2 E-R Diagram………………………………………………………………………..27
3.2 Non-Functional Requirements……………………………………………………………...32
3.2.1 Performance………………………………………………………………………...32
3.2.2 Legal,Copyright and other notices………………………………………………….32
3.2.3 Usability…………………………………………………………………………….33
3.2.3.1 Graphical User Interfaces………………………………………………..…33
3.2.4 Security…………………………………………………………………………..….34
3.2.4.1 Data Transfer……………………………………………………………….34
3.2.4.2 Data Storage………………………………………………………………...34
3.2.5 Scalability……………………………………………………………………………34
3.2.6 Supportability………………………………………………………………………..34
4. Supporting Information…………………………………………………………………………35
4.1 Product Templates……………………………………………………………………….….35
5. Test Cases……………………………………………………………………………………….51
6. Conclusion……………………………………………………………………………………...57
7. Appendix……………………………………………………………………………………….58
7.1 Source Code………………………………………………………………………………..58
Page 3
9. Bibliography……………………………………………………………………………………….....94
Page 4
Certificate
This is to certify that the Group “INNOVISION”comprising of five
members -- Abhishek kr. Rai (1101101188) , Dhruv Govila (1101101129) ,
Nivi Agrawal (1101101162) , Tushar Chowdhury (1101101160) and
Twesh Srivastava (1101101173) has successfully completed the Internship
Project Work on the topic “ DYNAMIC SHOPPING CART “
during the Internship from 19th
June 2014 to 19th
August 2014 at
GALGOTIAS UNIVERSITY , GREATER NOIDA under the guidance of
Mr. Thirunavukkarasu K. , Assistant Professor in the School of Computing
Science and Engineering of Galgotias University .
THE DEAN
SCSE
GALGOTIAS UNIVERSITY
Page 5
ACKNOWLEDGEMENT
We take this opportunity to express our profound gratitude and deep
regards to our guide Mr. Thirunavukkarasu K. , Assistant Professor
and Dr. Ajay Shankar Singh, Program chair of SCSE-IBMfor their
exemplary guidance, monitoring and constant encouragement
throughout the course of this project. The blessing, help and guidance
given by them time-to-time shall carry us a long way in the journey of
life on which we are about to embark on.
We also take this opportunity to express a deep sense of gratitude to Mr.
Arpit Saxena, IBM and Mr. Vikas Saraswat, IBM for their cordial
support, valuable information and guidance, which helped us in
completing this task through various stages.
We are obliged to staff members of GALGOTIAS UNIVERSITY and
IBM, for the valuable information provided by them in their respective
fields.We are grateful for their cooperation during the period of our
project.
Lastly, we thank almighty, our parents, brothers, sisters and friends for
their constant encouragement without which this project would not be
possible.
Team INNOVISION
Page 6
Profile Of The Supervisor
Mr. Thirunavukkarasu K.
Designation: Asst. Professor (Grade-III)
Degree(s): pursuing Ph.D. in Computer Science and Engineering
(Mahatma Gandhi University, Meghalaya, India);
M.E. in Computer Science and Engineering(Anna
University, Tamilnadu, India);
M.C.A(Bharathiar University Campus, Tamilnadu, India)
and B.Sc. in Computer Science(University of Madras,
Tamilnadu, India)
Research Area
Knowledge Engineering, Data Mining, Spatial Database, Database Technology, Information System
Development.
Professional Experience
Total Experience = 16 years (Teaching Experience: 13 years, Industry Experience: 3 years)
Subjects Taught
 M.Tech.: Database Technology, Advanced Algorithmic Analysis, Software Engineering, Object
Oriented SE.
 M.S.: Software Engineering and Supporting Environment, Information System Development.
 B.Tech/MCA.:Database and Web Database Systems, Software Engineering, Project Management,
Management Information System, Internet Technology, System Analysis and Design, Unix/Linux,
Computer Network etc.
Major Publications
 Kamal Upreiti, Shitiz Upreti and Thirunavukkarasu K., “Image Filtering of colored Noise Based on
Kalman Filter”, TECHNIA: International Journal of Computing Science and Communication
Technologies, accepted on 30 Jan 2013, Vol. 5, No. 2, pp. 793-797, 2013
 Thirunavukkarasu K., Nidhi Gupta and Rashmi Upadhay, “STEGANOGRAPHY: Hiding Data from
Human Eye Environment”, International Conference on Facets of Business Excellence for FOBE on
November 29, 2012, organized by IMT India and University of Essex.
 Thirunavukkarasu K., Iffat Khanum and Nudrat Fatima, “Web Data Mining: Emerging Challenges of a
Technique and Its Significance”, International Conference on Facets of Business Excellence for FOBE
2012 on November 29, 2012, organized by IMT India and University of Essex.
 Kamal Upreiti, Nudrat Fatima and Thirunavukkarasu K., “Greedy Approach in Materialized Views
Environment”, 6th International Conference on Advanced Computing and Communication
Technologies (ICACCT-2012) sponsored by IEEE Computer Society Chapter Delhi Section and IETE-
India on November 3, 2012 at Asia Pacific Institute of Information Technology SD India, Panipat
,Haryana, India, volume 2, pp 100-103.
 Thirunavukkarasu K., Iffat Khanum and Nudrat Fatima, “Association Rule using Parallel algorithms”
for ICACCT 2012, 6th International Conference on Advanced Computing and Communication
Technologies sponsored by IEEE Computer Society Chapter Delhi Section and IETE-India on
November 3, 2012 at Asia Pacific Institute of Information Technology SD India, Panipat ,Haryana,
India, volume 2, pp 104-108.
 Kamal Upreiti, Shitiz Upreti and Thirunavukkarasu K. “Image Filtering of colored Noise Based on
Kalman Filter” for ICACCT 2012, 6th International Conference on Advanced Computing and
Page 7
Communication Technologies sponsored by IEEE Computer Society Chapter Delhi Section and IETE-
India on November 3, 2012 at Asia Pacific Institute of Information Technology SD India, Panipat
,Haryana, India, volume 2, pp 109-113.
 Kamal Upreiti, Shitiz Upreti and Thirunavukkarasu K. “Materialized views in Data Warehousing
Environment” for FOBE 2011, International Conference on Facets of Business Excellence on
November 4-7, 2011 at IMT Ghaziabad, India.
 Thirunavukkarasu K., “Knowledge-An Efficient way to Build and Manage”, NCICC-2010-5th
National
Conference on “Innovation in Computer and Computing’ on 5th
March, 2010 at SNS College of
Technology, Coimbatore, Tamilnadu, India.
 Thirunavukkarasu K., “E Simudevice – A Student Companion” for ECLECTIC ’09, Third National
conference on “Future Of Electrical And Instrumentation technology” on 9th
April 2009 at
Vivekananda College of Engineering for Women, Tiruchengode, Tamilnadu, India.
 Thirunavukkarasu K., “Automatic Fuzzy Ontology Generation for Semantic Web” for SITCON,
Second National conference on “ Hi-Tech Trends in Emerging Computation Technologies” during 8 &
9th
May 2008 at Sethu Institute of Engg.and Tech., Madurai, Tamilnadu, India, organized by IEEE and
AICTE.
Awards & Honors
 Invited Talk on “Knowledge Management System” at Jayam College of Engineering & Technology,
Dharmapuri on 09-June-2010.
 Invited Talk on “Software Testing Methodologies” at Vijaya College, Bangalore on 22-June-2009.
 Invited Talk on ““Automotive Software Engineering Methodologies” during 26 & 27 Sept. 2008 at
TIFAC CORE, VIT University, Vellore
 Designed and Developed a course map on Database, supported by the Department of Information
Technology, Government of India held during June 29 – July 24, 2009 at the International Institute of
Information Technology(IIITB), Bangalore, India.
 Organizing Secretary for 4th
ICACCT International Conference at APIIT SD India,
Panipat(Staffordshire University, UK) on 30-Oct-2010.
 Conducted IBM Training - IBM DB2 9 (000-25300419 certificate course) for 4 days on behalf of IBM
Information Certification, IBM and worked as a Trainer for the batch of 150 students from 6-Oct-
2010 to 9-Oct-2010.
 IBM RFT certification holder from IBM Information Certification, IBM, Test Id: PR 1254497, taken
up test on 11-Oct-2010.
 IBM DB2 9 (000-25300419) certification holder from IBM Information Certification, IBM,Test Id: PR
1254497 taken up test on 11-Feb-2010.
 Worked as Asst. Custodian-PG Unit, Reviewers and evaluator for various semester of universities
Examination, Bangalore University from 2002 to Dec.2009.
 MCA, BCA Paper Setter – TCP/IP and DBMS for Jyothi Nivas College (Autonomous) and Christ
University, DBMS, SAD, COBOL, TCP/IP and JAVA for Bangalore University.
 Designed and Developed a value added courses such as Software Testing(Manual & Automated using
WinRunner), Database using IBM DB2 for B.Tech students at Asia Pacific Institute of Information
Technology, Staffordshire University, Panipat, INDIA from Dec.2009 to June 2011 .
 Designed & Developed a value added courses such as Software Testing, Diploma in Database for
Computer students & Diploma in DTP, MS Office for Non-Computer students at Vijaya College,
Bangalore University.
 Scored University Highest Mark in Programming Language - BASIC & FORTRAN for I Semester
MCA, April 1994.
 Scored centum in Network Lab at 2nd
semester M.E.
Page 8
Additional Details Of Company
IBM India Private Ltd,
'G1' Block, Manyata Embassy Business Park.
Outer Ring Road, Nagawara, Bangalore - 560 045
Manayata Tech Park, Thanisandra,
Bengaluru, Karnataka
080 2803 0000
The International Business Machines Corporation (IBM) is anAmerican multinational technology and
consulting corporation, with headquarters in Armonk, New York, United States. IBM manufactures and
markets computer hardware and software, and offers infrastructure, hosting and consulting services in
areas ranging from mainframe computers to nano technology.
IBM is an IT based company that values dedication to every client’s success, innovation that matters
for their company and for the world and trust and personal responsibility in all relationships.
Page 9
Feedback for Internship
Our Internship lasted for 5 days under the IBM GURUKOOL program. . The event was inaugurated
successfully at the CMRIT (CMR Institute of Technology) , Whitefield , Bangalore from 16th
June
2014 to 20th
June ,2014.
The first four days were allotted for the interactive sessions with experieced Industry experts from
various organizations including IBM , Wipro , General Electric , L&T Infotech , Inkoniq , Tech
Mahindra , i2 India , Tricon Infotech ,and Accenture . The last day included the Industrial visit to the
Datacenters of the IBM cloud, Koramanagalam ,Bangalore and Endeavour,Bangalore and Technovate,
Bangalore.
The Interactive sessions included discussions over various topics including the Strength ofworking in a
Team , Benefits of Working in a big Enterprise and a Small/Medium Enterprise , Aspects of
Entrepreneurship , Analog Devices , how software is managed by the Professionals with Emphasis on
the Categorisation of the Risks which arise during the development of the Software By the organization
and the Software Lifecycle Model that is used by the Industry and Importance of User Experience for
the success of an app or Software .
First day, Mr. Dutta Kumar made us to work in teams to show the importance of working in team . Mr.
Vineet Jaiswal also emphasized on the team work which is a necessity for the growth of the
organization and Mr. Vithal Madyalkar took the session giving us the knowledge of Hadoop .
Second day, Mr. Subramani Ramakrishnan shared his views about how the Technical architects should
work and what qualities they should persue. Mr. Rajesh Kumar talked about the importance of User
Experience for the success of the application and Mr. Bala Subramaniam told us about the SMAC
model ( Social , Mobility , Analytics and Cloud ) .
Third day, Mr. C. Sakthivel shared his knowledge about the Integration of IT in business and the
Enterprise Business System layers. Mr. Rajeev Parasar told us the benefits of joining the Small firms.
Ms. Rekha Madakkavil discussed how to prepare a SRS of a project and the Types of Risks involved
in the development of Software Project .
Fourth day, Mr. Vikas Choudhary explained Internet of Things and its importance in future . Mr.
Sridhar Rajgopalan told us about the digital world and Mr. Deepak Jain told us how we can secure our
Finance future.
We gained a lot of knowledge about the new technologies in the IT field that would help us in future.
We learned about the Big Data , Hadoop and Importance of Cloud for the People as a whole .
The Industrial visit to the Datacenter of IBM imparted us with the Knowledge about the Management
of the datacenter , points to be taken into consideration of how an efficient datacenter should be setup
and the different types of servers and the operating systems used by the Servers and how thw air
conditioning works that saves a lot of energy compared to before with the same servers .
The training sessions were highly beneficial and was carried out successfully by the IBM people. They
were supportive in guiding and motivating us throughout the sessions and project work.
The sessions would have been more interesting if we were imparted with the practical knowledge of
how deployment of applications to cloud takes place.
The learning in the training program was high with 8 out of 10 grades.
Page 10
Abstract
A dynamic Loyalty Card is a step over the standard shopping cart. Many companies today have
Loyalty Cards, which are like credit cards except that they contain points instead of rupees. People can
enter the Loyalty Card details in addition to their credit cards when they do transactions. If they have
done transactions of over certain value, they get some special gifts. In addition, for every transaction
they get some points.
A loyalty card is a card used as an incentive plan and which allows a retail business to gather
information about its customers. Generally a loyalty card has a barcode or magnetic stripe that is
scanned at the point of sale (POS). The card identifies the consumer and sends information about what
he or she has bought to a database. Consumers are offered product discounts, coupons, points toward
merchandise or some other reward as exchange for voluntary participation in the program.
This Dynamic Loyalty Card Project is a backend system which can be provided to any organization
wanting to create Loyalty Cards. If a person does a transaction with any of the stores, he gets some
loyalty points. In addition, the card has special capability for users to configure any loyalty/points
based logics based on user transactions.
Problem Statement
Creation of a special type of Customer Loyalty Card which can be used by any Business as
membership card.
Any type of business that provides services to customers directly such as PVR, Convenience store,
Banks etc. can use the card by registering itself with the company Innovision Inc. Once issued, the card
can be used with all the businesses registered with the Innovision Inc. and points will be added to the
card on each transaction. The points can be redeemed either by opting for gift deals or paying for a
transaction through the points available in the card.
The project is capable of handling any no. of customers.
One can browse through the site quickly without any delay.
All the details of Customers, Vendors and Transactions are stored in databases.
The main focus is to provide best User Experience.
Page 11
Software Requirement Specification
1. Introduction
The aim of this document is to gather and analyze and give an in-depth insight of the complete
Dynamic Loyalty Cart by defining the problem statement in detail. Nevertheless, it also concentrates on
the capabilities required by stakeholders and their needs while defining high-level product features. The
detailed requirements of the project are provided in this document.
1.1 Purpose
The purpose of the document is to collect and analyze all assorted ideas that have come up to define the
system, its requirements with respect to consumers. Also, we shall predict and sort out how we hope
this product will be used in order to gain a better understanding of the project, outline concepts that
may be developed later, and document ideas that are being considered, but may be discarded as the
product develops.
In short, the purpose of this SRS document is to provide a detailed overview of our software product,
its parameters and goals. This document describes the project's target audience and its user interface,
hardware and software requirements. It defines how our client, team and audience see the product and
its functionality. Nonetheless, it helps any designer and developer to assist in software delivery
lifecycle (SDLC) processes.
1.2Scope
Primarily, the scope pertains to the InnoCart product features for making Dynamic Shopping Cart
project live. It focuses on the company, the stakeholders and applications, which allow for online sales,
distribution and marketing of products.
This SRS is also aimed at specifying requirements of software to be developed but it can also be
applied to assist in the selection of in-house and commercial software products. The standard can be
used to create software requirements specifications directly or can be used as a model for defining a
organization or project specific standard. It does not identify any specific method, nomenclature or tool
for preparing an SRS.
Page 12
1.3 Definitions
Term Definition
Active Article The document that is tracked by the system; it is a narrative
that is planned to be posted to the public website.
Database Collection of all the information monitored by this system.
Customer Anyone visiting the site to read articles.
Review A written recommendation about the appropriateness of an
article for publication; may include suggestions for
improvement.
Reviewer A person that examines an article and has the ability to
recommend approval of the article for publication or to
request that changes be made in the article.
Software Requirements
Specification
A document that completely describes all of the functions
of a proposed system and the constraints under which it
must operate. For example, this document.
Stakeholder Any person with an interest in the project who is not a
developer.
User Reviewer or Author.
1.4References
IEEE. IEEE Std 830-1998 IEEE Recommended Practice for Software Requirements Specifications.
InnoCart structural model
InnoCart behavioral model
1.5 Overview
The remaining sections of this document provide a general description, including characteristics of the
users of this project, the product's hardware, and the functional and data requirements of the product.
General description of the project is discussed in section 2 of this document. Section 3 gives the
functional requirements, data requirements and constraints and assumptions made while designing the
InnoCart. It also gives the user viewpoint of product. Section 3 also gives the specific requirements of
the product. Section 3 also discusses the external interface requirements and gives detailed description
of functional requirements. Section 4 is for supporting information.
Page 13
2. Overall Description
This document contains the problem statement that the current system is facing which is hampering the
growth opportunities of the company. It further contains a list of the stakeholders and users of the
proposed solution. It also illustrates the needs and wants of the stakeholders that were identified in the
brainstorming exercise as part of the requirements workshop. It further lists and briefly describes the
major features and a brief description of each of the proposed system.
The following SRS contains the detail product perspective from different stakeholders. It provides the
detail product functions of InnoCart with user characteristics permitted constraints, assumptions and
dependencies and requirements subsets.
The proposed system is:
• User friendliness is provided in the application with various controls.
• The system makes the overall project management much easier and flexible.
• There is no risk of data mismanagement at any level while the project development is under
process.
• It provides high level of security with different level of authentication.
• Users from any part of the world can make use of the system.
2.1 Product Perspective
There are many types of interfaces as such supported by the InnoCart software systemnamely; User
Interface, Software Interface and Hardware Interface.
2.1.1 System Interfaces
The protocol used shall be HTTP.
The Port number used will be 3306 .
There shall be logical address of the system in IPv4 format.
2.1.2 User Interfaces
The user interface for the software shall be compatible to any browser such as Internet Explorer,
Mozilla or Google Chrome by which user can access to the system.
The user interface shall be implemented using any tool or software package like PHP IDE, Mysql
Workbench etc.
2.1.3 Hardware Interfaces
Since the application must run over the internet, all the hardware shall require to connect internet will
be hardware interface for the system. As for e.g. Modem, WAN – LAN, Ethernet Cross-Cable.
2.1.4 Software Interfaces
 The InnoCart system shall communicate with the Configurator to identify all the available
components to configure the product.
Page 14
 TheInnoCart shall communicate with the content manager to get the product specifications,
offerings and promotions.
 The InnoCart system shall communicate with billPay system to identify available payment
methods, validate the payments and process payment.
 The InnoCartsystem shall communicate to credit management system for handling financing
options.
 The InnoCart system shall communicate with CRM system to provide support.
 The InnoCart system shall communicate with Sales system for order management.
 The InnoCart system shall communicate with export regulation system to validate export
regulations.
 The system shall be verisign like software which shall allow the users to complete secured
transaction. This usually shall be the third party software system which is widely used for
internet transaction.
2.1.5 Communication Interfaces
The InnoCart system shall use the HTTP protocol for communication over the internet and for the
intranet communication will be through TCP/IP protocol suite.
2.2 Product Function
Each customer is issued a Loyalty Card with a unique number. We have a predefined database with a
list of Merchants who will accept our Loyalty Card. Our system should store the Card along with
Customer Details. Every time a customer uses it with a merchant, we should store the transaction
details and credit the card with appropriate number of points.
2.3 User Classes and Characteristics
This product can be used by the common shopping cart business firms who can integrate this product
to make use of the loyalty card system. It could be used by the people who even don’t have deep
knowledge of the technology. They should only know about the softwares. The product could not be
used in the University system, Tourism and Banking systems etc.
2.4 Operating Environment
The product will work on the Windows Operating System. The softwares required to run the product
are: Mysql Workbench 5.6.19 and the wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-64b .
Page 15
2.5 Design and Implementation Constraints
2.5.1Standard Development Tools
The system shall be built using a standard web page development tool that conforms to either IBM’s
CUA standards or Microsoft’s GUI standards.
2.5.2Web Based Product
There are no memory requirements.
The computers must be equipped with web browsers such as Internet explorer.
The product must be stored in such a way that allows the client easy access to it.
Response time for loading the product should take no longer than five minutes.
A general knowledge of basic computer skills is required to use the product.
2.6Assumption and Dependencies
Platform for Development- WAMP Server 2.5, also executable on XAMPP.
This software has been tested on these Web Browsers-
a. Microsoft Internet Explorer 6.0 and Above
b. Google Chrome 2.0 and above
c. Mozilla Firefox 5.0 and above
This product has been developed and deployed on Microsoft Windows 7 and above.
The DBMS used is the MySQL 5.0
3. Specific Requirements
3.1Functional Requirements:
• Loyalty Card:
The first requirement in our system starts with an Application for creating a New Loyalty Card Request
by filling up a form. The Admin of the system only has a capability to create new Cards. There is a
HTML Form provided where the Admin can enter necessary details as explained below and generate a
new card which he can share with the Customer. Each Loyalty Card entry contains:
i. Card Holder Name which is a string with maximum 200 Characters
ii. Card Holder Phone Number which is a 10 Digit Mobile Number
Page 16
iii. Card Holder Email Id which is a string with maximum 100 Characters
iv. Card Holder Address must be a string with maximum 500 Characters
v. Card Issue Date, which will not be provided by Admin. Instead the code should automatically
take the request receiving timestamp and store it as Card Issue Date.
vi. Card Expiry Date, this should be automatically generated as 1 Year from the Card Issue
Date.
vii. Points Available – At the time of Card creation, this should be integer 0. Every time a
transaction entry is made, this will be incremented appropriately.
viii. A 16 Digit Number which should be Unique Integer like 4564 3834 4504 3849. This
means, every time a New Card request form issubmitted by the admin, there should be a unique
number generated by the code. Please note that the Admin will not provide the card number in his
application, but the code should generate and give it as a response to Admin’s New Card request.
• Merchant:
A Merchant is a vendor who is willing to make an entry for the Loyalty Card everytime a
transaction is done with him. A New Merchant Request Form must be created where the Admin will
fill up with Merchant Details. Upon submitting this form a Merchant entry must be created. The
Merchant Details are:
i. Merchant Name which is a string with maximum 200 Characters
ii. Merchant Address which is a string with maximum 500 Characters
iii. Merchant Identification Number (MIN) which is an Auto Increment Integer
iv. Merchant Type which indicates Merchant’s Nature of Business with options being Cinema
Hall & Restaurant.
• Transaction:
The Admin of the system should be able to make entries of transactions made by various users.
Each transaction contains:
i. Loyalty Card Number
ii. Merchant Identification Number (MIN)
iii. Number of Points Obtained from Transaction
Every time a new transaction entry is made, the code should also pick up the entry of the
Loyalty Card and update the number of points. For example there are 3 points obtained from this
transaction, then the Number of Points available in the Loyalty Card entry table should be
incrementedby 3.
Page 17
• Reports:
In addition to the above mentioned features, the Reports system is the most important module.
There must be a mechanism to search all transactions made along with some search filters. The search
filters should be:
i. Card Number
ii. Transaction Date Range (should be searchable between 2 given dates)
iii. Customer Mobile Number
Please note that the search should work if any of the above the filters is filled. Not all filters are
necessary for the search. The date fields should be made using custom javascript based datepickers. It
should not be just a text entry.
• Optional Addons:
The product can automatically generate Bar Code for the specified product being purchased.
3.1.1USE CASES
Use Case 1: To issue User id to a Customer when the Customer Information does not exist in the
system
Diagram :
Actors: Administrator, Customer
Pre-Condition: Administrator must be logged in
Steps:
1. Customer asks Administrator to issue User Id for Loyalty Card
2. Administrator selects “ CUSTOMERS”
3. Administrator selects “ NEW CUSTOMER “ icon .
4. Administrator enters Name , Phone number , Email id and Address and Account No. of the
customer in the Pop up Box and selects Submit.
5. System assigns the Customer Id & ejects the card of the customer .
6. Administrator takes the card out of the machine.
7. Card is issued to the customer and a pin is assigned to the customer
Post Condition: Card will be issued and handed over to the customer
ADMIN
CUSTOMERS
Page 18
Use Case 2: To update the Customer Information that exists in the system .
Diagram :
Actors: Administrator, Customer
Pre-Condition: Administrator must be logged in
Steps:
1. Customer asks Administrator to update his information in the System
2. Administrator selects “ CUSTOMERS”
3. Administrator selects “ EDIT “ column corresponding to the Customer’s Record .
4. Administrator edits Name , Phone number , Email id and Address and Account No. of the customer
in the Pop up Box and selects Submit.
Post Condition: System updates the customer information.
Use Case 3: To Search the Customer’s Information that exists in the system .
Diagram :
Actors:Administrator, Customer
Pre-Condition: Administrator must be logged in
Steps:
1. Customer asks Administrator to look for his information in the System .
2. Administrator selects “ CUSTOMERS”
3. Administrator enters the Name or Email Id of the Customer in the Search Box .
Post Condition: The System displays Customer’s Information .
Use Case 4: To Delete the Customer Information that exists in the system .
Diagram :
Actors:Administrator, Customer
ADMIN
CUSTOMERS
ADMIN
CUSTOMERS
ADMIN
CUSTOMERS
Page 19
Pre-Condition: Administrator must be logged in.
Steps:
1. Customer asks Administrator to delete his information in the System .
2. Administrator selects “ CUSTOMERS”
3. Administrator ticks the required record & selects “ DELETE “ icon .
Post Condition: The Customer’s information is deleted from the System .
Use Case 5: To enter Item’s Information that does not exist in the system .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in
Steps:
1. Supplier asks Administrator to enter the Item’s information .
2. Administrator selects “ ITEMS ” .
3. Administrator selects “ NEW ITEM “ icon .
4. Administrator enters ISBN , Item name , Category , Supplier , Cost Price , Sales Price , Tax 1 , Tax 2
, Quantity Stock , Reorder level , Description and submits it .
Post Condition: Item’s Information is added to the System .
Use Case 6: To update the Item’s Information that exists in the system .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in .
Steps:
1. Supplier asks Administrator to update item’s information in the System .
2. Administrator selects “ ITEMS ” .
3. Administrator selects the Item’ whose information is to be edited .
4. Administrator selects “BULK EDIT “ icon .
5. Information is edited and then submitted .
Post Condition: Item’s Information is edited in the System .
ITEMS
ADMIN
ITEMS
ITEMS
ADMIN
ITEMS
Page 20
Use Case 7: To Search the Item’s Information that exists in the system .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in
Steps:
1. Administrator look for Item’s information in the System .
2. Administrator selects “ ITEMS” .
3. Administrator enters the Name or ISBN of the Item in the Search Box .
Post Condition: The System displays Item’s Information .
Use Case 8: To Delete the Item Information that exists in the system .
Diagram :
Actors:Administrator
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator deletes Item’s information from the System .
2. Administrator selects “ ITEMS” .
3. Administrator searches the required record . ticks it & selects “ DELETE “ icon .
Post Condition: The Item’s information is deleted from the System .
Use Case 9: To enter Item Kit’s Information that does not exist in the system .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in .
Steps:
1. Supplier asks Administrator to enter the Item kit’s information .
ITEMS
ADMIN
ITEMS
ITEMS
ADMIN
ITEMS
ITEMS
ADMIN
ITEM KITS
Page 21
2. Administrator selects “ ITEM KITS ” .
3. Administrator selects “ NEW ITEM KIT “ icon .
4. Administrator enters Item kit’s name , Item kit’s Description , Add item and submits it .
Post Condition: Item Kit’s Information is added to the System .
Use Case 10: To Search the Item Kit’s Information that exists in the system .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator looks for Item Kit’s information in the System .
2. Administrator selects “ ITEM KITS” .
3. Administrator enters the Item Kit’s Name in the Search Box .
Post Condition: The System displays Item Kit’s Information .
Use Case 11: To Delete the Item Kit’s Information that exists in the system .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator deletes Item Kit’s information from the System .
2. Administrator selects “ ITEM KITS” .
3. Administrator searches the required record . ticks it & selects “ DELETE “ icon .
Post Condition: The Item Kit’s information is deleted from the System .
Use Case 12: To register a Merchant / Vendor/Suppliers in the system .
Diagram :
Actors:Administrator, Merchant
ITEMS
ADMIN
ITEMS
ITEMS
ADMIN
ITEMS
ADMIN
SUPPLIERS
Page 22
Pre-Condition: Administrator must be logged in
Steps:
1. Merchant asks Administrator to Register him .
2. Administrator selects “SUPPLIERS”
3. Administrator enter Name , Phone number , Email id and Address and Account No. of the
Merchant in the Pop up Box and selects Submit .
4. Merchant is registered to the system.
5. System ejects the card of the Merchant .
6. Administrator takes the card out of the machine.
7. Card is issued to the Merchant containing Merchant Identification Number (MIN) and a pin is
assigned to the Merchant .
Post Condition: Card will be issued and handed over to the Merchant .
Use Case 13: To edit a Supplier’s Information from the system .
Diagram :
Actors:Administrator, Merchant
Pre-Condition: Administrator must be logged in
Steps:
1. Supplier asks Administrator/ Administrator updates supplier’s information in the System .
2. Administrator selects “ SUPPLIERS” .
3. Administrator selects “ EDIT “ column corresponding to the Supplier’s Record .
4. Administrator enter Name , Phone number , Email id and Address and Account No. of the
Merchant in the Pop up Box and selects Submit .
Post Condition: System updates the Supplier’s information.
Use Case 14: To Search a Supplier’s Information in the system .
Diagram :
Actors:Administrator, Merchant
Pre-Condition: Administrator must be logged in
Steps:
1. Supplier asks Administrator to look for his information in the System .
2. Administrator selects “ SUPPLIERS” .
3. Administrator enters the Name or Email Id of the Supplier in the search Box .
Post Condition: The System displays Supplier’s Information .
ADMIN
SUPPLIERS
ADMIN
SUPPLIERS
Page 23
Use Case 15: To Delete a Supplier’s Information from the system .
Diagram :
Actors:Administrator, Merchant
Pre-Condition: Administrator must be logged in
Steps:
1. Supplier asks Administrator / administrator deletes Supplier’s information from the System .
2. Administrator selects “ SUPPLIERS” .
3. Administrator ticks the required record & selects “ DELETE “ icon .
Post Condition: The Supplier’s information is deleted from the System .
Use Case 16: To Receive Items from the Supplier .
Diagram :
Actors:Administrator, Supplier
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “ RECEIVINGS” in the main page .
2. Administrator selects Receiving mode as “RECEIVE “ .
3.Administrator scans/finds the item in the System or enters the Item’s data if it is new item .
4.Then enter the quantity being received .
Post Condition: The Items are received in the Inventory .
Use Case 17: To Receive Items from the Supplier .
Diagram :
Actors:Administrator , Suppliers
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “ RECEIVINGS” in the main page .
2. Administrator selects Receiving mode as “RETURN “ .
ADMIN
SUPPLIERS
ITEMS
ADMIN
RECEIVINGS
ITEMS
ADMIN
RECEIVINGS
Page 24
3.Administrator scans/finds the item in the System .
4.Then enter the quantity being returned .
Post Condition: The Items are returned and the Inventory is updated in accordance .
Use Case 18: To Sell Items from the Inventory and generate bill.
Diagram :
Actors: Administrator, Customer
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “ SALES” in the main page .
2. Administrator selects Register mode as “SALE “ .
3. Administrator scans/finds the item in the System .
4. Then enter the quantity being sold .
5. Continues until the cart is empty and presses finish .
Post Condition: It generates the bill .
Use Case 19: To get the sold Item returned and generate refund .
Diagram :
Actors:Administrator, Customer
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “ SALES” in the main page .
2. Administrator selects Register mode as “RETURN “ .
3. Administrator scans/finds the item in the System .
4. Then enter the quantity being returned .
5. Then presses finish .
Post Condition: It generates the refund.
Use Case 20: To issue User id to a Employee when the Employee’s Information does not exist in the
system .
Diagram :
ITEMS
ADMIN
SALES
ITEMS
ADMIN
SALES
Page 25
Actors:Administrator, Employee
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “EMPLOYEES” .
2. Administrator selects “ NEW EMPLOYEE “ icon .
3. Administrator enters Name , Phone number , Email id and Address and assigns User name and
password for accessing the software modules in the Pop up Box and selects Submit.
4. System updates the User Id of the Employee in the System .
Post Condition: Administrator issues the User id and password to the Employee .
Use Case 21: Editing the Employee’s Information in the system .
Diagram :
Actors:Administrator
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “EMPLOYEES” .
2. Administrator selects “ EDIT “ column corresponding to the Employee’s Record .
3. Administrator edits Name , Phone number , Email id and Address and Access privileges in
the Pop up Box and selects Submit.
Post Condition: System edits the Employee’s information.
Use Case 22: Searching the Employee’s Information in the system .
Diagram :
Actors:Administrator
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “EMPLOYEES” .
2. Administrator enters the Name or Email Id of the Customer in the Search Box .
Post Condition: The System displays Employee’s Information .
ITEMS
ADMIN
EMPLOYEES
ITEMS
ADMIN
EMPLOYEES
ITEMS
ADMIN
EMPLOYEES
Page 26
Use Case 23: Deleting the Employee’s Information from the system .
Diagram :
Actors:Administrator
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator deletes Employee’s information in the System .
2. Administrator selects “ EMPLOYEES” .
3. Administrator ticks the required record & selects “ DELETE “ icon .
Post Condition: The Employee’s information is deleted from the System .
Use Case 24: To Issue Gift Card to Customer .
Diagram :
Actors:Administrator
Pre-Condition: Administrator must be logged in .
Steps:
1. Administrator selects “GIFT CARDS” .
2. Administrator selects “ NEW GIFT CARD “ icon .
3. Administrator enters Customer , Gift Card number , Value and submits it .
Post Condition: The Gift card is allotted to the customer who fulfill the required value category .
Use Case 25: To view reports regarding Sales , Categories , Customers , Suppliers , Items , Employees
. Taxes , Discounts and payments
Diagram :
Actors: Administrator
Pre-Condition:Administrator must be logged in .
ITEMS
ADMIN
EMPLOYEES
ITEMS
ADMIN
GIFT CARDS
ITEMS
ADMIN
REPORTS
Page 27
Steps:
1. Administrator selects Reports from the main page .
2. System redirects to the “REPORTS PAGE” .
3. Administrator selects which report to be generated and in which mode for example Graphical ,
Summary , Detailed and Inventory reports .
4. System redirects to the process page .
5. Administrator enters the date range and Sales Type for which report is to be generated .
6. Administrator selects “ Submit” .
7. System generates the report .
Post Condition: Required report is generated .
3.1.2 E-R DIAGRAM –
Page 28
Page 29
Page 30
Page 31
Page 32
3.2 Non-Functional Requirements
3.2.1 Performance:
The user interface for the software should be compatible to any browser such as Internet Explorer,
Mozilla or Netscape Navigator.
The product shall be based on web and has to be run from a web server.
The product shall take initial load time depending on internet connection strength which also depends
on the media from which the product is run.
The performance shall depend upon hardware components of the client/customer.
3.2.2 Legal, Copyright, and Other Notices
Application should display the disclaimers, copyright, word mark, trademark and product
warranties.
Copyright (c) 2013-2014, InnoVision.
All rights reserved.
This license is a legal agreement between you and InnoVision Inc. for the use
of Innovision Software (the "Software"). By obtaining the Software you
agree to comply with the terms and conditions of this license.
PERMITTED USE
You are permitted to use, copy, modify, and distribute the Software and its
documentation, with or without modification, for any purpose, provided that
the following conditions are met:
1. A copy of this license agreement must be included with the distribution.
2. Redistributions of source code must retain the above copyright notice in
all source code files.
3. Redistributions in binary form must reproduce the above copyright notice
in the documentation and/or other materials provided with the distribution.
4. Any files that have been modified must carry notices stating the nature
of the change and the names of those who changed them.
5. Products derived from the Software must include an acknowledgment that
they are derived from Innovision in their documentation and/or other
materials provided with the distribution.
6. Products derived from the Software may not be called "Innovision",
nor may "Innovision" appear in their name, without prior written
Page 33
permission from InnoVision Inc..
INDEMNITY
You agree to indemnify and hold harmless the authors of the Software and
any contributors for any direct, indirect, incidental, or consequential
third-party claims, actions or suits, as well as any related expenses,
liabilities, damages, settlements or fees arising from your use or misuse
of the Software, or a violation of any terms of this license.
DISCLAIMER OF WARRANTY
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED
OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY,
PERFORMANCE,
NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
LIMITATIONS OF LIABILITY
YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE
SOFTWARE.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE
LIABLE
FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN
CONNECTION
WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR
DETERMINING THE
APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE,
INCLUDING
BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT,
LOSS OF
DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF
OPERATIONS.
3.2.3Usability
The system should provide a uniform look and feel between all the pages. And It should also provide a
digital image for each product in the product catalog.
3.2.3.1Graphical User Interface
The system shall provide a uniform look and feel between all the web pages.
The system shall provide a digital image for each product in the product catalog.
The system shall provide use of icons and toolbars.
Page 34
3.2.4Security
3.2.4.1 Data Transfer
The system shall use secure sockets in all transactions that include any confidential customer
information.
The system shall automatically log out all customers after a period of inactivity.
The system shall confirm all transactions with the customer’s web browser.
The system shall not leave any cookies on the customer’s computer containing the user’s password.
The system shall not leave any cookies on the customer’s computer containing any of the user’s
confidential information.
3.2.4.2 Data Storage
The customer’s web browser shall never display a customer’s password. It shall always be echoed with
special characters representing typed characters.
The customer’s web browser shall never display a customer’s credit card number after retrieving from
the database. It shall always be shown with just the last 4 digits of the credit card number.
The system’s back-end servers shall never display a customer’s password. The customer’s password
may be reset but never shown.
The system’s back-end servers shall only be accessible to authenticated administrators.
The system’s back-end databases shall be encrypted
3.2.5 Scability:
The system should have the capability to handle any number of customers and the performance in
terms of browsing should be quick.
3.2.6 Supportability
3.6.1 Configuration Management Tool
The source code developed for this system shall be maintained in configuration management tool.
Page 35
4.Supporting Information
4.1.1 Product Templates
Login Page-
Page 36
Home Page-
Page 37
Customer Page-
Page 38
Page 39
Item Page-
Page 40
Page 41
Barcode Generation-
Page 42
Item Kits-
Page 43
Supplier Page-
Page 44
Page 45
Report Page-
Page 46
Receiving Page-
Page 47
Sales Page-
Page 48
Employee Page-
Page 49
Gift Card Page-
Page 50
Store Configuration Page-
Page 51
5.Test Cases
Test cases in software development refer to the set of conditions or variables under which a tester will
determine whether an application or software system is working correctly or not. Test cases are often
referred to as test scripts, particularly when written. Written test cases are usually collected into test
suites.
A single test case is usually a single step, or occasionally a sequence of steps, to test the correct
behaviour/functionalities, features of an application. An expected result or expected outcome is usually
given.
Information that is included within a test case:
 test case Id
 test case description
 test step or order of execution number
 related requirement(s)
 depth
 test category
 author
 check boxes for whether the test is automatable and has been automated
 Expected result and Actual result
Table 1. Test Case for Processing Sale
Test Case Name: Process Sale - Normal
Use Case Name: Process Sale
Use Case Path to be
[U1, S1, U2.1, S2.1, U3.1, S3.1, U4.1, S4.1]
exercised:
Input Data: 12345
Initial Condition: Cashier (Abhishek) is allowed to process a sale
transaction
No item is in the shopping cart
New sale transaction is already created
Item 12345 is a valid input
Expected Result: New sale transaction is still open for additional
items
Cashier is still authorized to work on the current
transaction.
1 line item is now on the shopping cart
New line item has been established for item
12345.
System is ready to accept for additional item.
Page 52
Figure 1. Flow of Processing Sale Event of a Point of Sale (POS
Page 53
Table 2. Test Case for Processing Sale - Negative
Test Case Name: Process Sale – item is not registered/recognized
Use Case Name: Process Sale
Use Case Path to be
[U1, S1, U2.1, S2.2]
exercised:
Input Data: 54321
Initial Condition: Cashier (Abhishek) is allowed to process a sale
transaction
No item is in the shopping cart
New sale transaction is already created
Item 54321 is not a registered or recognized item
Expected Result: New sale transaction is still open for additional
items
Cashier is still authorized to work on the current
transaction.
Still there are no items added in the shopping cart
No new line has been established.
Displays an error message for unregistered or
unrecognized item
System is ready to accept for additional item.
Table 3. Test Case for Processing Sale - Negative
Test Case Name: Process Sale – quantity exceeds inventory limit
Use Case Name: Process Sale
Use Case Path to be
[U1, S1, U2.2, S3.2]
exercised:
Input Data: 7
Initial Condition: Cashier (Abhishek) is allowed to process a sale
transaction
New sale transaction is already created
1 item is in the shopping cart
Default value of item’s quantity is 1
Inventory limit for the item in the cart is 5
7 is a valid input
Expected Result: New sale transaction is still open for additional
items
Cashier is still authorized to work on the current
transaction.
Still there are no items added in the shopping cart
No new line has been established.
Displays an error message for item that exceeds
inventory limit
System is ready to accept for additional item.
Page 54
Figure 2. Flow of Managing Items Event of a Point of Sale (POS)
Page 55
Table 4. Test Case for Managing Items
Test Case Name: Manage Items - Normal
Use Case Name: Manage Items
Use Case Path to be
[U1, S1, U2.1, S2.1, U3.1, S3.1, U3.1, 3.2]
exercised:
Input Data: 67890-Bear Brand-Nestle-Milk-Lynlyn Poultry
Supply-20.00-22.00-10
Initial Condition: Only the administrator is allowed to manage items
There are existing number of items in the
database
Add New Item transaction is active
No duplicate of item code
Expected Result: Admin is still authorized to work on another new
transaction.
New record has been appended on the database
for item 67890.
The form is ready to receive a new item as
another entry.
Table 5. Test Case for Managing Items - Negative
Test Case Name: Manage Items – insufficient item details
supplied/ duplicate item codes
Use Case Name: Manage Items
Use Case Path to be
[U1, S1, U2.1, S2.1, U3.1, S3.1, U3.1, S3.1]
exercised:
Input Data: 67890-Nido-Nestle-Milk-Lynlyn Poultry Supply-
20.00-22.00-10
Initial Condition: Only the administrator is allowed to manage items
There are existing number of items in the
database
The admin has already selected a type of item to
be added
Add New Item transaction is active
Item code 67890 is already a duplicate of another
item in the database
Expected Result: New sale transaction is still open for additional
items
Admin is still authorized to work on the current
transaction.
No record is appended/updated in the database
System is ready to accept for another item
System is ready to accept additional lacking
details
Page 56
Software’s complexity and accelerated development schedules make avoiding defects difficult. To
assure quality software, the defects found during the testing and implementation phase will be given
solutions or at least minimize the occurrence. The summary of defects must then be summarized and
identify necessary actions to address and correct these defects as shown in Table
Table 1. Summary of Defects
Defects Resolutions
Process Sale – mail is not Displays an error message
Sent to customer
Process Sale – quantity exceeds
inventory limit
Manage Items – insufficient item
details supplied/ duplicate item
codes
Page 57
6.Conclusion
The best way to keep customers loyal is to provide a good product or service that provides good value
for money. Branding alone will not make customers loyal, but back up a good product andcustomer
servicewithbrandingandloyaltywilldevelopquicker.
Offersandloyaltyschemescanincreaseloyalty,buttheyarenosubstitutefor(andwillnotwork without) a good
product, good customer service, and friendly customer relationships. We need to enroll the right
customers. We can recognize the highest value customers torecognize and reward their value to our
organization, we can cultivate high potential customers who currently split their purchases between us
and our competitors or reach out to those mostat risk of churning. Knowing which customer groups are
most important to us allows craftingrecognition and rewarding strategy that piques their interest.
Customers should be involved in the program by constant communication to make themunderstand
what is in for them. Comprehensive surveys should be conducted to find out whatshouldbetheidealwayto
rewardtheloyalcustomersandretainthemforthelifetime.Activitieslike checking point balances online,
responding to targeted offers, using kiosks, bidding onauctionitems,enteringsweepstakesandsoon.Such
participationisasuresignofincreasing value to the customers.
All the above can be achieved through InnoCart, a product of Loyalty InnoVision Inc..With future
improvements it will be able to provide more security by using physical card.More technologies will be
used to study customer behavior in order to profile their purchase pattern by fine tuning.
Page 58
7. Appendix
7.1 Source Code
7.1.1 home.php
<?php $this->load->view("partial/header"); ?>
<br />
<h3><?php echo $this->lang->line('common_welcome_message'); ?></h3>
<div id="home_module_list">
<?php
foreach($allowed_modules->result() as $module)
{
?>
<div class="module_item">
<a href="<?php echo site_url("$module->module_id");?>">
<img src="<?php echo base_url().'images/menubar/'.$module->module_id.'.png';?>"
border="0" alt="Menubar Image" /></a><br />
<a href="<?php echo site_url("$module->module_id");?>"><?php echo $this->lang-
>line("module_".$module->module_id) ?></a>
- <?php echo $this->lang->line('module_'.$module->module_id.'_desc');?>
</div>
<?php
}
?>
</div>
<?php $this->load->view("partial/footer"); ?>
7.1.2 login.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/login.css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>InnoV!sion Loyalty Programme <?php echo $this->lang->line('login_login'); ?></title>
<script src="<?php echo base_url();?>js/jquery-1.2.6.min.js" type="text/javascript"
language="javascript" charset="UTF-8"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#login_form input:first").focus();
});
</script>
</head>
<body>
<h1>InnoV!sion Loyalty Programme <?php echo $this->config->item('application_version'); ?></h1>
Page 59
<?php echo form_open('login') ?>
<div id="container">
<?php echo validation_errors(); ?>
<div id="top">
<?php echo $this->lang->line('login_login'); ?>
</div>
<div id="login_form">
<div id="welcome_message">
<?php echo $this->lang->line('login_welcome_message'); ?>
</div>
<div class="form_field_label"><?php echo $this->lang->line('login_username'); ?>:
</div>
<div class="form_field">
<?php echo form_input(array(
'name'=>'username',
'size'=>'20')); ?>
</div>
<div class="form_field_label"><?php echo $this->lang->line('login_password'); ?>:
</div>
<div class="form_field">
<?php echo form_password(array(
'name'=>'password',
'size'=>'20')); ?>
</div>
<div id="submit_button">
<?php echo form_submit('loginButton','Go'); ?>
</div>
</div>
</div>
<?php echo form_close(); ?>
</body>
</html>
7.1.3 Customer form.php
<?php
echo form_open('customers/save/'.$person_info->person_id,array('id'=>'customer_form'));
?>
<div id="required_fields_message"><?php echo $this->lang-
>line('common_fields_required_message'); ?></div>
<ul id="error_message_box"></ul>
<fieldset id="customer_basic_info">
<legend><?php echo $this->lang->line("customers_basic_information"); ?></legend>
<?php $this->load->view("people/form_basic_info"); ?>
<div class="field_row clearfix">
Page 60
<?php echo form_label($this->lang->line('customers_account_number').':', 'account_number'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'account_number',
'id'=>'account_number',
'value'=>$person_info->account_number)
);?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('customers_taxable').':', 'taxable'); ?>
<div class='form_field'>
<?php echo form_checkbox('taxable', '1', $person_info->taxable == '' ? TRUE :
(boolean)$person_info->taxable);?>
</div>
</div>
<?php
echo form_submit(array(
'name'=>'submit',
'id'=>'submit',
'value'=>$this->lang->line('common_submit'),
'class'=>'submit_button float_right')
);
?>
</fieldset>
<?php
echo form_close();
?>
<script type='text/javascript'>
//validation and submit handling
$(document).ready(function()
{
$('#customer_form').validate({
submitHandler:function(form)
{
$(form).ajaxSubmit({
success:function(response)
{
tb_remove();
post_person_form_submit(response);
},
dataType:'json'
});
},
errorLabelContainer: "#error_message_box",
wrapper: "li",
rules:
{
Page 61
first_name: "required",
last_name: "required",
email: "email"
},
messages:
{
first_name: "<?php echo $this->lang->line('common_first_name_required'); ?>",
last_name: "<?php echo $this->lang->line('common_last_name_required'); ?>",
email: "<?php echo $this->lang->line('common_email_invalid_format'); ?>"
}
});
});
</script>
7.1.4.1Giftcard form.php
<div id="required_fields_message"><?php echo $this->lang-
>line('common_fields_required_message'); ?></div>
<ul id="error_message_box"></ul>
<?php
echo form_open('giftcards/save/'.$giftcard_info->giftcard_id,array('id'=>'giftcard_form'));
?>
<fieldset id="giftcard_basic_info" style="padding: 5px;">
<legend><?php echo $this->lang->line("giftcards_basic_information"); ?></legend>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('giftcards_person_id').':', 'name',array('class'=>'required
wide')); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'person_id',
'id'=>'person_id',
'value'=>$giftcard_info->person_id)
);?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('giftcards_giftcard_number').':',
'name',array('class'=>'required wide')); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'giftcard_number',
'id'=>'giftcard_number',
'value'=>$giftcard_info->giftcard_number)
);?>
</div>
</div>
<div class="field_row clearfix">
Page 62
<?php echo form_label($this->lang->line('giftcards_card_value').':', 'name',array('class'=>'required
wide')); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'value',
'id'=>'value',
'value'=>$giftcard_info->value)
);?>
</div>
</div>
<?php
echo form_submit(array(
'name'=>'submit',
'id'=>'submit',
'value'=>$this->lang->line('common_submit'),
'class'=>'submit_button float_right')
);
?>
</fieldset>
<?php
echo form_close();
?>
<script type='text/javascript'>
//validation and submit handling
$(document).ready(function()
{
$("#person_id").autocomplete("<?php echo
site_url('giftcards/suggest_person');?>",{max:100,minChars:0,delay:10});
$("#person_id").result(function(event, data, formatted){});
$("#person_id").search();
$('#giftcard_form').validate({
submitHandler:function(form)
{
$(form).ajaxSubmit({
success:function(response)
{
tb_remove();
post_giftcard_form_submit(response);
},
dataType:'json'
});
},
errorLabelContainer: "#error_message_box",
wrapper: "li",
rules:
{
giftcard_number:
{
Page 63
required:true,
number:true
},
value:
{
required:true,
number:true
}
},
messages:
{
giftcard_number:
{
required:"<?php echo $this->lang->line('giftcards_number_required');
?>",
number:"<?php echo $this->lang->line('giftcards_number'); ?>"
},
value:
{
required:"<?php echo $this->lang->line('giftcards_value_required'); ?>",
number:"<?php echo $this->lang->line('giftcards_value'); ?>"
}
}
});
});
</script>
7.1.4.2Giftcard manage.php
<?php $this->load->view("partial/header"); ?>
<script type="text/javascript">
$(document).ready(function()
{
init_table_sorting();
enable_select_all();
enable_checkboxes();
enable_row_selection();
enable_search('<?php echo site_url("$controller_name/suggest")?>','<?php echo $this->lang-
>line("common_confirm_search")?>');
enable_delete('<?php echo $this->lang->line($controller_name."_confirm_delete")?>','<?php echo
$this->lang->line($controller_name."_none_selected")?>');
});
function init_table_sorting()
{
//Only init if there is more than one row
if($('.tablesorter tbody tr').length >1)
{
$("#sortable_table").tablesorter(
{
Page 64
sortList: [[1,0]],
headers:
{
0: { sorter: false},
3: { sorter: false}
}
});
}
}
function post_giftcard_form_submit(response)
{
if(!response.success)
{
set_feedback(response.message,'error_message',true);
}
else
{
//This is an update, just update one row
if(jQuery.inArray(response.giftcard_id,get_visible_checkbox_ids()) != -1)
{
update_row(response.giftcard_id,'<?php echo
site_url("$controller_name/get_row")?>');
set_feedback(response.message,'success_message',false);
}
else //refresh entire table
{
do_search(true,function()
{
//highlight new row
hightlight_row(response.giftcard_id);
set_feedback(response.message,'success_message',false);
});
}
}
}
</script>
<div id="title_bar">
<div id="title" class="float_left"><?php echo $this->lang->line('common_list_of').' '.$this-
>lang->line('module_'.$controller_name); ?></div>
<div id="new_button">
<?php echo anchor("$controller_name/view/-1/width:$form_width",
"<div class='big_button' style='float: left;'><span>".$this->lang-
>line($controller_name.'_new')."</span></div>",
array('class'=>'thickbox none','title'=>$this->lang->line($controller_name.'_new')));
?>
</div>
</div>
<?php echo $this->pagination->create_links();?>
Page 65
<div id="table_action_header">
<ul>
<li class="float_left"><span><?php echo anchor("$controller_name/delete",$this->lang-
>line("common_delete"),array('id'=>'delete')); ?></span></li>
<li class="float_right">
<img src='<?php echo base_url()?>images/spinner_small.gif' alt='spinner' id='spinner' />
<?php echo form_open("$controller_name/search",array('id'=>'search_form')); ?>
<input type="text" name ='search' id='search'/>
</form>
</li>
</ul>
</div>
<div id="table_holder">
<?php echo $manage_table; ?>
</div>
<div id="feedback_bar"></div>
<?php $this->load->view("partial/footer"); ?>
7.1.5 People form_basic_info.php
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_first_name').':',
'first_name',array('class'=>'required')); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'first_name',
'id'=>'first_name',
'value'=>$person_info->first_name)
);?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_last_name').':',
'last_name',array('class'=>'required')); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'last_name',
'id'=>'last_name',
'value'=>$person_info->last_name)
);?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_email').':', 'email'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'email',
Page 66
'id'=>'email',
'value'=>$person_info->email)
);?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_phone_number').':', 'phone_number'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'phone_number',
'id'=>'phone_number',
'value'=>$person_info->phone_number));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_address_1').':', 'address_1'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'address_1',
'id'=>'address_1',
'value'=>$person_info->address_1));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_address_2').':', 'address_2'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'address_2',
'id'=>'address_2',
'value'=>$person_info->address_2));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_city').':', 'city'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'city',
'id'=>'city',
'value'=>$person_info->city));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_state').':', 'state'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'state',
'id'=>'state',
Page 67
'value'=>$person_info->state));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_zip').':', 'zip'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'zip',
'id'=>'zip',
'value'=>$person_info->zip));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_country').':', 'country'); ?>
<div class='form_field'>
<?php echo form_input(array(
'name'=>'country',
'id'=>'country',
'value'=>$person_info->country));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('common_comments').':', 'comments'); ?>
<div class='form_field'>
<?php echo form_textarea(array(
'name'=>'comments',
'id'=>'comments',
'value'=>$person_info->comments,
'rows'=>'5',
'cols'=>'17')
);?>
</div>
</div>
7.1.6.1 Report_data_input.php
<?php $this->load->view("partial/header"); ?>
<div id="page_title" style="margin-bottom:8px;"><?php echo $this->lang-
>line('reports_report_input'); ?></div>
<?php
if(isset($error))
{
echo "<div class='error_message'>".$error."</div>";
}
?>
<?php echo form_label($this->lang->line('reports_date_range'), 'report_date_range_label',
array('class'=>'required')); ?>
<div id='report_date_range_simple'>
Page 68
<input type="radio" name="report_type" id="simple_radio" value='simple'
checked='checked'/>
<?php echo form_dropdown('report_date_range_simple',$report_date_range_simple, '',
'id="report_date_range_simple"'); ?>
</div>
<div id='report_date_range_complex'>
<input type="radio" name="report_type" id="complex_radio" value='complex' />
<span>
<?php echo form_dropdown('start_month',$months, $selected_month,
'id="start_month"'); ?>
<?php echo form_dropdown('start_day',$days, $selected_day, 'id="start_day"'); ?>
<?php echo form_dropdown('start_year',$years, $selected_year, 'id="start_year"'); ?>
-
<?php echo form_dropdown('end_month',$months, $selected_month,
'id="end_month"'); ?>
<?php echo form_dropdown('end_day',$days, $selected_day, 'id="end_day"'); ?>
<?php echo form_dropdown('end_year',$years, $selected_year, 'id="end_year"'); ?>
</span>
<?php
if (isset($discount_input)) {
?>
<div>
<span>
<?php echo $this->lang->line('reports_discount_prefix') .'&nbsp;'
.form_input(array(
'name'=>'selected_discount',
'id'=>'selected_discount',
'value'=>'0')). '&nbsp;'. $this->lang-
>line('reports_discount_suffix')
?>
</span>
</div>
<?php
}
?>
</div>
<?php
if($mode == 'sale')
{
?>
<?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label',
array('class'=>'required')); ?>
<div id='report_sale_type'>
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'),
'sales' => $this->lang->line('reports_sales'),
'returns' => $this->lang->line('reports_returns')), 'all', 'id="input_type"'); ?>
</div>
<?php
}
elseif($mode == 'receiving')
Page 69
{
?>
<?php echo form_label($this->lang->line('reports_receiving_type'), 'reports_receiving_type_label',
array('class'=>'required')); ?>
<div id='report_receiving_type'>
<?php echo form_dropdown('receiving_type',array('all' => $this->lang->line('reports_all'),
'receiving' => $this->lang->line('reports_receivings'),
'returns' => $this->lang->line('reports_returns'),
'requisitions' => $this->lang->line('reports_requisitions')), 'all', 'id="input_type"'); ?>
</div>
<?php
}
elseif($mode == 'requisition')
{
//Do nothing
}
?>
<?php
echo form_button(array(
'name'=>'generate_report',
'id'=>'generate_report',
'content'=>$this->lang->line('common_submit'),
'class'=>'submit_button')
);
?>
<?php $this->load->view("partial/footer"); ?>
<script type="text/javascript" language="javascript">
$(document).ready(function()
{
$("#generate_report").click(function()
{
var input_type = $("#input_type").val();
if ($("#simple_radio").attr('checked'))
{
window.location = window.location+'/'+$("#report_date_range_simple
option:selected").val() + '/' + input_type;
}
else
{
var start_date = $("#start_year").val()+'-'+$("#start_month").val()+'-
'+$('#start_day').val();
var end_date = $("#end_year").val()+'-'+$("#end_month").val()+'-
'+$('#end_day').val();
if(input_type == null)
{
window.location = window.location+'/'+start_date + '/'+ end_date;
}
else
{
Page 70
window.location = window.location+'/'+start_date + '/'+ end_date+ '/' +
input_type;
}
}
});
$("#start_month, #start_day, #start_year, #end_month, #end_day, #end_year").click(function()
{
$("#complex_radio").attr('checked', 'checked');
});
$("#report_date_range_simple").click(function()
{
$("#simple_radio").attr('checked', 'checked');
});
});
</script>
7.1.6.2 Reports_excel_import
<?php $this->load->view("partial/header"); ?>
<div id="page_title" style="margin-bottom:8px;"><?php echo $this->lang-
>line('reports_report_input'); ?></div>
<?php
if(isset($error))
{
echo "<div class='error_message'>".$error."</div>";
}
?>
<div>
Export to Excel: <input type="radio" name="export_excel" id="export_excel_yes"
value='1' /> Yes
<input type="radio" name="export_excel" id="export_excel_no" value='0'
checked='checked' /> No
</div>
<?php
echo form_button(array(
'name'=>'generate_report',
'id'=>'generate_report',
'content'=>$this->lang->line('common_submit'),
'class'=>'submit_button')
);
?>
<?php $this->load->view("partial/footer"); ?>
<script type="text/javascript" language="javascript">
Page 71
$(document).ready(function()
{
$("#generate_report").click(function()
{
var export_excel = 0;
if ($("#export_excel_yes").attr('checked'))
{
export_excel = 1;
}
window.location = window.location+'/' + export_excel;
});
});
</script>
7.1.7 Sales_form.php
<div id="edit_sale_wrapper">
<div id="required_fields_message"><?php echo $this->lang-
>line('common_fields_required_message'); ?></div>
<ul id="error_message_box"></ul>
<fieldset id="sale_basic_info">
<?php echo form_open("sales/save/".$sale_info['sale_id'],array('id'=>'sales_edit_form')); ?>
<legend><?php echo $this->lang->line("sales_basic_information"); ?></legend>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('sales_receipt').':', 'customer'); ?>
<div class='form_field'>
<?php echo anchor('sales/receipt/'.$sale_info['sale_id'], $this->lang-
>line('sales_receipt_number') .$sale_info['sale_id'], array('target' => '_blank'));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('sales_date').':', 'date', array('class'=>'required')); ?>
<div class='form_field'>
<?php echo form_input(array('name'=>'date','value'=>date('m/d/Y',
strtotime($sale_info['sale_time'])), 'id'=>'date'));?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('sales_customer').':', 'customer'); ?>
<div class='form_field'>
<?php echo form_input(array('name' => 'customer_id', 'value' =>
$selected_customer, 'id' => 'customer_id'));?>
Page 72
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('sales_employee').':', 'employee'); ?>
<div class='form_field'>
<?php echo form_dropdown('employee_id', $employees,
$sale_info['employee_id'], 'id="employee_id"');?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('sales_comment').':', 'comment'); ?>
<div class='form_field'>
<?php echo
form_textarea(array('name'=>'comment','value'=>$sale_info['comment'],'rows'=>'4','cols'=>'23',
'id'=>'comment'));?>
</div>
</div>
<?php
echo form_submit(array(
'name'=>'submit',
'value'=>$this->lang->line('common_submit'),
'class'=> 'submit_button float_right')
);
?>
</form>
<?php echo form_open("sales/delete/".$sale_info['sale_id'],array('id'=>'sales_delete_form')); ?>
<?php echo form_hidden('sale_id', $sale_info['sale_id']);?>
<?php
echo form_submit(array(
'name'=>'submit',
'value'=>$this->lang->line('sales_delete_entire_sale'),
'class'=>'delete_button float_right')
);
?>
</form>
</fieldset>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function()
{
$('#date').datePicker({startDate: '01/01/1970'});
$("#sales_delete_form").submit(function()
{
if (!confirm('<?php echo $this->lang->line("sales_delete_confirmation"); ?>'))
{
return false;
Page 73
}
});
var format_item = function(row) {
var result = [row[0], "|", row[1]].join("");
// if more than one occurence
if (row[2] > 1 && row[3] && row[3].toString().trim()) {
// display zip code
result += ' - ' + row[3];
}
return result;
};
var autocompleter = $("#customer_id").autocomplete('<?php echo
site_url("sales/customer_search"); ?>', {
minChars:0,
delay:15,
max:100,
cacheLength: 1,
formatItem: format_item,
formatResult : format_item
});
// declare submitHandler as an object.. will be reused
var submit_form = function(selected_customer) {
$(this).ajaxSubmit({
success:function(response)
{
tb_remove();
post_form_submit(response);
},
error: function(jqXHR, textStatus, errorThrown) {
selected_customer && autocompleter.val(selected_customer);
post_form_submit({message: errorThrown});
},
dataType:'json'
});
};
$('#sales_edit_form').validate({
submitHandler : function(form)
{
var selected_customer = autocompleter.val();
var selected_customer_id = selected_customer.replace(/(w)|.*/, "$1");
selected_customer_id && autocompleter.val(selected_customer_id);
submit_form.call(form, selected_customer);
},
errorLabelContainer: "#error_message_box",
wrapper: "li",
rules:
{
date: {
required:true,
date:true
Page 74
}
},
messages:
{
date: {
required: "<?= $this->lang->line('sales_date_required'); ?>",
date: "<?= $this->lang->line('sales_date_type'); ?>"
}
}
});
$('#sales_delete_form').submit(function() {
var id = $("input[name='sale_id']").val();
$(this).ajaxSubmit({
success:function(response)
{
tb_remove();
set_feedback(response.message,'success_message',false);
var $element = get_table_row(id).parent().parent();
$element.find("td").animate({backgroundColor:"green"},1200,"linear")
.end().animate({opacity:0},1200,"linear",function()
{
$element.next().remove();
$(this).remove();
//Re-init sortable table as we removed a row
update_sortable_table();
});
},
error: function(jqXHR, textStatus, errorThrown) {
set_feedback(textStatus,'error_message',true);
},
dataType:'json'
});
return false;
});
});
</script>
7.1.8Giftcard.php
<?php
class Giftcard extends CI_Model
{
/*
Determines if a given giftcard_id is an giftcard
*/
function exists( $giftcard_id )
{
$this->db->from('giftcards');
$this->db->where('giftcard_id',$giftcard_id);
Page 75
$this->db->where('deleted',0);
$query = $this->db->get();
return ($query->num_rows()==1);
}
/*
Returns all the giftcards
*/
function get_all($limit=10000, $offset=0)
{
$this->db->from('giftcards');
$this->db->join('people','people.person_id=giftcards.person_id');
$this->db->where('deleted',0);
$this->db->order_by("giftcard_number", "asc");
$this->db->limit($limit);
$this->db->offset($offset);
return $this->db->get();
}
function count_all()
{
$this->db->from('giftcards');
$this->db->where('deleted',0);
return $this->db->count_all_results();
}
/*
Gets information about a particular giftcard
*/
function get_info($giftcard_id)
{
$this->db->from('giftcards');
$this->db->where('giftcard_id',$giftcard_id);
$this->db->where('deleted',0);
$query = $this->db->get();
if($query->num_rows()==1)
{
return $query->row();
}
else
{
//Get empty base parent object, as $giftcard_id is NOT an giftcard
$giftcard_obj=new stdClass();
//Get all the fields from giftcards table
$fields = $this->db->list_fields('giftcards');
foreach ($fields as $field)
{
Page 76
$giftcard_obj->$field='';
}
return $giftcard_obj;
}
}
/*
Get an giftcard id given an giftcard number
*/
function get_giftcard_id($giftcard_number)
{
$this->db->from('giftcards');
$this->db->where('giftcard_number',$giftcard_number);
$this->db->where('deleted',0);
$query = $this->db->get();
if($query->num_rows()==1)
{
return $query->row()->giftcard_id;
}
return false;
}
/*
Gets information about multiple giftcards
*/
function get_multiple_info($giftcard_ids)
{
$this->db->from('giftcards');
$this->db->where_in('giftcard_id',$giftcard_ids);
$this->db->where('deleted',0);
$this->db->order_by("giftcard_number", "asc");
return $this->db->get();
}
/*
Inserts or updates a giftcard
*/
function save(&$giftcard_data,$giftcard_id=false)
{
if (!$giftcard_id or !$this->exists($giftcard_id))
{
if($this->db->insert('giftcards',$giftcard_data))
{
$giftcard_data['giftcard_id']=$this->db->insert_id();
return true;
}
return false;
}
Page 77
$this->db->where('giftcard_id', $giftcard_id);
return $this->db->update('giftcards',$giftcard_data);
}
/*
Updates multiple giftcards at once
*/
function update_multiple($giftcard_data,$giftcard_ids)
{
$this->db->where_in('giftcard_id',$giftcard_ids);
return $this->db->update('giftcards',$giftcard_data);
}
/*
Deletes one giftcard
*/
function delete($giftcard_id)
{
$this->db->where('giftcard_id', $giftcard_id);
return $this->db->update('giftcards', array('deleted' => 1));
}
/*
Deletes a list of giftcards
*/
function delete_list($giftcard_ids)
{
$this->db->where_in('giftcard_id',$giftcard_ids);
return $this->db->update('giftcards', array('deleted' => 1));
}
/*
Get search suggestions to find giftcards
*/
function get_search_suggestions($search,$limit=25)
{
$suggestions = array();
$this->db->from('giftcards');
$this->db->like('giftcard_number', $search);
$this->db->where('deleted',0);
$this->db->order_by("giftcard_number", "asc");
$by_number = $this->db->get();
foreach($by_number->result() as $row)
{
$suggestions[]=$row->giftcard_number;
}
$this->db->from('customers');
Page 78
$this->db->join('people','customers.person_id=people.person_id');
$this->db->like("first_name",$this->db->escape_like_str($search));
$this->db->or_like("last_name",$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db-
>escape_like_str($search));
$this->db->where("deleted","0");
$this->db->order_by("last_name", "asc");
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[]=$row->first_name.' '.$row->last_name;
}
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
}
return $suggestions;
}
/*
Get search suggestions to find customers
*/
function get_person_search_suggestions($search,$limit=25)
{
$suggestions = array();
$this->db->select('person_id');
$this->db->from('people');
$this->db->like('person_id',$this->db->escape_like_str($search));
$this->db->or_like('first_name',$this->db->escape_like_str($search));
$this->db->or_like('last_name',$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db-
>escape_like_str($search));
$this->db->or_like('email',$this->db->escape_like_str($search));
$this->db->or_like('phone_number',$this->db->escape_like_str($search));
$this->db->order_by('person_id', 'asc');
$by_person_id = $this->db->get();
foreach($by_person_id->result() as $row)
{
$suggestions[]=$row->person_id;
}
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
}
Page 79
return $suggestions;
}
/*
Preform a search on giftcards
*/
function search($search)
{
$this->db->from('giftcards');
$this->db->join('people','giftcards.person_id=people.person_id');
$this->db->like("first_name",$this->db->escape_like_str($search));
$this->db->or_like("last_name",$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db-
>escape_like_str($search));
$this->db->or_like("giftcard_number",$this->db->escape_like_str($search));
$this->db->or_like("giftcards.person_id",$this->db->escape_like_str($search));
$this->db->where('deleted',$this->db->escape('0'));
$this->db->order_by("giftcard_number", "asc");
return $this->db->get();
}
public function get_giftcard_value( $giftcard_number )
{
if ( !$this->exists( $this->get_giftcard_id($giftcard_number)))
return 0;
$this->db->from('giftcards');
$this->db->where('giftcard_number',$giftcard_number);
return $this->db->get()->row()->value;
}
function update_giftcard_value( $giftcard_number, $value )
{
$this->db->where('giftcard_number', $giftcard_number);
$this->db->update('giftcards', array('value' => $value));
}
}
?>
7.1.9sha1.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* InnoCart
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package InnoCart
* @author Team InnoVision
* @copyright Copyright (c) 2013 - 2014, InnoVision Inc.
* @license http://innovision.com/user_guide/license.html
Page 80
* @link http://innovision.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* SHA1 Encoding Class
*
* Purpose: Provides 160 bit hashing using The Secure Hash Algorithm
* developed at the National Institute of Standards and Technology. The 40
* character SHA1 message hash is computationally infeasible to crack.
*
* This class is a fallback for servers that are not running PHP greater than
* 4.3, or do not have the MHASH library.
*
* This class is based on two scripts:
*
* Marcus Campbell's PHP implementation (GNU license)
* http://www.tecknik.net/sha-1/
*
* ...which is based on Paul Johnston's JavaScript version
* (BSD license). http://pajhome.org.uk/
*
* I encapsulated the functions and wrote one additional method to fix
* a hex conversion bug. - Rick Ellis
*
* @package InnoCart
* @subpackage Libraries
* @category Encryption
* @author Team InnoVision
* @link http://innovision.com/user_guide/general/encryption.html
*/
class CI_SHA1 {
public function __construct()
{
log_message('debug', "SHA1 Class Initialized");
}
/**
* Generate the Hash
*
* @access public
* @param string
* @return string
*/
function generate($str)
{
$n = ((strlen($str) + 8) >> 6) + 1;
Page 81
for ($i = 0; $i < $n * 16; $i++)
{
$x[$i] = 0;
}
for ($i = 0; $i < strlen($str); $i++)
{
$x[$i >> 2] |= ord(substr($str, $i, 1)) << (24 - ($i % 4) * 8);
}
$x[$i >> 2] |= 0x80 << (24 - ($i % 4) * 8);
$x[$n * 16 - 1] = strlen($str) * 8;
$a = 1732584193;
$b = -271733879;
$c = -1732584194;
$d = 271733878;
$e = -1009589776;
for ($i = 0; $i < count($x); $i += 16)
{
$olda = $a;
$oldb = $b;
$oldc = $c;
$oldd = $d;
$olde = $e;
for ($j = 0; $j < 80; $j++)
{
if ($j < 16)
{
$w[$j] = $x[$i + $j];
}
else
{
$w[$j] = $this->_rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j
- 16], 1);
}
$t = $this->_safe_add($this->_safe_add($this->_rol($a, 5), $this->_ft($j,
$b, $c, $d)), $this->_safe_add($this->_safe_add($e, $w[$j]), $this->_kt($j)));
$e = $d;
$d = $c;
$c = $this->_rol($b, 30);
$b = $a;
$a = $t;
}
$a = $this->_safe_add($a, $olda);
$b = $this->_safe_add($b, $oldb);
Page 82
$c = $this->_safe_add($c, $oldc);
$d = $this->_safe_add($d, $oldd);
$e = $this->_safe_add($e, $olde);
}
return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this-
>_hex($e);
}
// --------------------------------------------------------------------
/**
* Convert a decimal to hex
*
* @access private
* @param string
* @return string
*/
function _hex($str)
{
$str = dechex($str);
if (strlen($str) == 7)
{
$str = '0'.$str;
}
return $str;
}
// --------------------------------------------------------------------
/**
* Return result based on iteration
*
* @access private
* @return string
*/
function _ft($t, $b, $c, $d)
{
if ($t < 20)
return ($b & $c) | ((~$b) & $d);
if ($t < 40)
return $b ^ $c ^ $d;
if ($t < 60)
return ($b & $c) | ($b & $d) | ($c & $d);
return $b ^ $c ^ $d;
}
// --------------------------------------------------------------------
Page 83
/**
* Determine the additive constant
*
* @access private
* @return string
*/
function _kt($t)
{
if ($t < 20)
{
return 1518500249;
}
else if ($t < 40)
{
return 1859775393;
}
else if ($t < 60)
{
return -1894007588;
}
else
{
return -899497514;
}
}
// --------------------------------------------------------------------
/**
* Add integers, wrapping at 2^32
*
* @access private
* @return string
*/
function _safe_add($x, $y)
{
$lsw = ($x & 0xFFFF) + ($y & 0xFFFF);
$msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16);
return ($msw << 16) | ($lsw & 0xFFFF);
}
// --------------------------------------------------------------------
/**
* Bitwise rotate a 32-bit number
*
* @access private
* @return integer
*/
function _rol($num, $cnt)
{
Page 84
return ($num << $cnt) | $this->_zero_fill($num, 32 - $cnt);
}
// --------------------------------------------------------------------
/**
* Pad string with zero
*
* @access private
* @return string
*/
function _zero_fill($a, $b)
{
$bin = decbin($a);
if (strlen($bin) < $b)
{
$bin = 0;
}
else
{
$bin = substr($bin, 0, strlen($bin) - $b);
}
for ($i=0; $i < $b; $i++)
{
$bin = "0".$bin;
}
return bindec($bin);
}
}
// END CI_SHA
/* End of file Sha1.php */
/* Location: ./system/libraries/Sha1.php */
7.1.10 Encrypt.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* InnoCart
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package InnoCart
* @author Team InnoVision
* @copyright Copyright (c) 2013 - 2014, InnoVision Inc.
Page 85
* @license http://innovision.com/user_guide/license.html
* @link http://innovision.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* InnoCart Encryption Class
*
* Provides two-way keyed encoding using Mcrypt
*
* @package InnoCart
* @subpackage Libraries
* @category Libraries
* @author Team InnoVision
* @link http://innovision.com/user_guide/libraries/encryption.html
*/
class CI_Encrypt {
var $CI;
var $encryption_key = '';
var $_hash_type = 'sha1';
var $_mcrypt_exists = FALSE;
var $_mcrypt_cipher;
var $_mcrypt_mode;
/**
* Constructor
*
* Simply determines whether the mcrypt library exists.
*
*/
public function __construct()
{
$this->CI =& get_instance();
$this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
if ($this->_mcrypt_exists === FALSE)
{
show_error('The Encrypt library requires the Mcrypt extension.');
}
log_message('debug', "Encrypt Class Initialized");
}
// --------------------------------------------------------------------
/**
* Fetch the encryption key
*
Page 86
* Returns it as MD5 in order to have an exact-length 128 bit key.
* Mcrypt is sensitive to keys that are not the correct length
*
* @access public
* @param string
* @return string
*/
function get_key($key = '')
{
if ($key == '')
{
if ($this->encryption_key != '')
{
return $this->encryption_key;
}
$CI =& get_instance();
$key = $CI->config->item('encryption_key');
if ($key == FALSE)
{
show_error('In order to use the encryption class requires that you set an
encryption key in your config file.');
}
}
return md5($key);
}
// --------------------------------------------------------------------
/**
* Set the encryption key
*
* @access public
* @param string
* @return void
*/
function set_key($key = '')
{
$this->encryption_key = $key;
}
// --------------------------------------------------------------------
/**
* Encode
*
* Encodes the message string using bitwise XOR encoding.
* The key is combined with a random hash, and then it
* too gets converted using XOR. The whole thing is then run
* through mcrypt using the randomized key. The end result
Page 87
* is a double-encrypted message string that is randomized
* with each call to this function, even if the supplied
* message and key are the same.
*
* @access public
* @param string the string to encode
* @param string the key
* @return string
*/
function encode($string, $key = '')
{
$key = $this->get_key($key);
$enc = $this->mcrypt_encode($string, $key);
return base64_encode($enc);
}
// --------------------------------------------------------------------
/**
* Decode
*
* Reverses the above process
*
* @access public
* @param string
* @param string
* @return string
*/
function decode($string, $key = '')
{
$key = $this->get_key($key);
if (preg_match('/[^a-zA-Z0-9/+=]/', $string))
{
return FALSE;
}
$dec = base64_decode($string);
if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE)
{
return FALSE;
}
return $dec;
}
// --------------------------------------------------------------------
/**
* Encode from Legacy
Page 88
function encode_from_legacy($string, $legacy_mode = MCRYPT_MODE_ECB, $key = '')
{
// decode it first
// set mode temporarily to what it was when string was encoded with the legacy
// algorithm - typically MCRYPT_MODE_ECB
$current_mode = $this->_get_mode();
$this->set_mode($legacy_mode);
$key = $this->get_key($key);
if (preg_match('/[^a-zA-Z0-9/+=]/', $string))
{
return FALSE;
}
$dec = base64_decode($string);
if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE)
{
return FALSE;
}
$dec = $this->_xor_decode($dec, $key);
// set the mcrypt mode back to what it should be, typically MCRYPT_MODE_CBC
$this->set_mode($current_mode);
// and re-encode
return base64_encode($this->mcrypt_encode($dec, $key));
}
// --------------------------------------------------------------------
/**
* XOR Decode
*
* Takes an encoded string and key as input and generates the
* plain-text original message
*
* @access private
* @param string
* @param string
* @return string
*/
function _xor_decode($string, $key)
{
$string = $this->_xor_merge($string, $key);
$dec = '';
for ($i = 0; $i < strlen($string); $i++)
{
Page 89
$dec .= (substr($string, $i++, 1) ^ substr($string, $i, 1));
}
return $dec;
}
// --------------------------------------------------------------------
/**
* XOR key + string Combiner
*
* Takes a string and key as input and computes the difference using XOR
*
* @access private
* @param string
* @param string
* @return string
*/
function _xor_merge($string, $key)
{
$hash = $this->hash($key);
$str = '';
for ($i = 0; $i < strlen($string); $i++)
{
$str .= substr($string, $i, 1) ^ substr($hash, ($i % strlen($hash)), 1);
}
return $str;
}
// --------------------------------------------------------------------
function mcrypt_encode($data, $key)
{
$init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode());
$init_vect = mcrypt_create_iv($init_size, MCRYPT_RAND);
return $this->_add_cipher_noise($init_vect.mcrypt_encrypt($this->_get_cipher(), $key,
$data, $this->_get_mode(), $init_vect), $key);
}
// --------------------------------------------------------------------
/**
* Decrypt using Mcrypt
*
* @access public
* @param string
* @param string
* @return string
*/
function mcrypt_decode($data, $key)
Page 90
{
$data = $this->_remove_cipher_noise($data, $key);
$init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode());
if ($init_size > strlen($data))
{
return FALSE;
}
$init_vect = substr($data, 0, $init_size);
$data = substr($data, $init_size);
return rtrim(mcrypt_decrypt($this->_get_cipher(), $key, $data, $this->_get_mode(),
$init_vect), "0");
}
// --------------------------------------------------------------------
/**
* Adds permuted noise to the IV + encrypted data to protect
* against Man-in-the-middle attacks on CBC mode ciphers
* http://www.ciphersbyritter.com/GLOSSARY.HTM#IV
*
* Function description
*
* @access private
* @param string
* @param string
* @return string
*/
function _add_cipher_noise($data, $key)
{
$keyhash = $this->hash($key);
$keylen = strlen($keyhash);
$str = '';
for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j)
{
if ($j >= $keylen)
{
$j = 0;
}
$str .= chr((ord($data[$i]) + ord($keyhash[$j])) % 256);
}
return $str;
}
// --------------------------------------------------------------------
/**
* Removes permuted noise from the IV + encrypted data, reversing
Page 91
* _add_cipher_noise()
*
* Function description
*
* @access public
* @param type
* @return type
*/
function _remove_cipher_noise($data, $key)
{
$keyhash = $this->hash($key);
$keylen = strlen($keyhash);
$str = '';
for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j)
{
if ($j >= $keylen)
{
$j = 0;
}
$temp = ord($data[$i]) - ord($keyhash[$j]);
if ($temp < 0)
{
$temp = $temp + 256;
}
$str .= chr($temp);
}
return $str;
}
// --------------------------------------------------------------------
/**
* Set the Mcrypt Cipher
*
* @access public
* @param constant
* @return string
*/
function set_cipher($cipher)
{
$this->_mcrypt_cipher = $cipher;
}
// --------------------------------------------------------------------
/**
* Set the Mcrypt Mode
Page 92
*
* @access public
* @param constant
* @return string
*/
function set_mode($mode)
{
$this->_mcrypt_mode = $mode;
}
// --------------------------------------------------------------------
/**
* Get Mcrypt cipher Value
*
* @access private
* @return string
*/
function _get_cipher()
{
if ($this->_mcrypt_cipher == '')
{
$this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256;
}
return $this->_mcrypt_cipher;
}
// --------------------------------------------------------------------
/**
* Get Mcrypt Mode Value
*
* @access private
* @return string
*/
function _get_mode()
{
if ($this->_mcrypt_mode == '')
{
$this->_mcrypt_mode = MCRYPT_MODE_CBC;
}
return $this->_mcrypt_mode;
}
// --------------------------------------------------------------------
function set_hash($type = 'sha1')
{
$this->_hash_type = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type;
Page 93
}
// --------------------------------------------------------------------
/**
* Hash encode a string
*
* @access public
* @param string
* @return string
*/
function hash($str)
{
return ($this->_hash_type == 'sha1') ? $this->sha1($str) : md5($str);
}
// --------------------------------------------------------------------
/**
* Generate an SHA1 Hash
*
* @access public
* @param string
* @return string
*/
function sha1($str)
{
if ( ! function_exists('sha1'))
{
if ( ! function_exists('mhash'))
{
require_once(BASEPATH.'libraries/Sha1.php');
$SH = new CI_SHA;
return $SH->generate($str);
}
else
{
return bin2hex(mhash(MHASH_SHA1, $str));
}
}
else
{
return sha1($str);
}
}
}
// END CI_Encrypt class
/* End of file Encrypt.php */
/* Location: ./system/libraries/Encrypt.php */
Page 94
Bibliography
1. http://www.w3schools.com/html/default.asp for html reference
2. http://www.w3schools.com/css/default.asp for css functions reference
3. http://www.w3schools.com/js/default.asp for javascript reference
4. http://www.w3schools.com/jquery/default.asp for jquery reference
5. http://www.w3schools.com/php/default.asp for php reference
6. http://www.w3schools.com/sql/default.asp for sql reference
7. SRS IEEE FORMAT for writing SRS

Loyalty_Card Report

  • 1.
    Drafted By: NiharRanjan Roy DYNAMIC SHOPPING CART REPORT ON SUMMER INTERNSHIP AT IBM GURUKOOL Submitted in partial fulfillment for the award of the degree of B.TECH (CSE) Submitted by Abhishek Kumar Rai 1101101188 Dhruv Govila 1101101129 Nivi Agrawal 1101101162 Tushar Chowdhury 1101101160 Twesh Srivastava 1101101173 Under the guidance of Mr. Thirunavukkarasu K. Assistant Professor GALGOTIAS UNIVERSITY SCHOOL OF COMPUTING SCIENCE AND ENGINEERING 17A, YAMUNA EXPRESSWAY, UTTAR PRADESH SESSION 2014-2015
  • 2.
    Page 2 Table OfContents Certificate…………………………………………………………………………………………………...…4 Acknowledgement .....................................................................................................................................5 Profile of the Supervisor……………………………………………………………………………………....6 Additional details of the company…………………………………………………………………………....8 Feedback for the internship…………………………………………………………………………………..9 Abstract……………………………………………………………………………………………………...10 Problem Statement…………………………………………………………………………………………..10 Software Requirements Specification…………………………………………………………………..……11 1. Introduction……………………………………………………………………………………..11 1.1 Purpose……………………………………………………………………………………...11 1.2 Scope………………………………………………………………………………………..11 1.3 Definitions……………………………………………………………………………….….12 1.4 References…………………………………………………………………………………..12 1.5 Overview……………………………………………………………………………………12 2. Overall Description……………………………………………………………………………..13 2.1 Product Perspective…………………………………………………………………………13 2.1.1 System Interfaces…………………………………………………………………...13 2.1.2 User Interfaces……………………………………………………………………...13 2.1.3 Hardware Interfaces………………………………………………………………...13 2.1.4 Software Interfaces……………………………………………………………….…13 2.1.5 Communication Interfaces………………………………………………………….14 2.2 Product Function………………………………………………………………………..…..14 2.3 User Classes and Characteristics……………………………………………………………14 2.4 Operating Environment……………………………………………………………………..14 2.5 Design and Implementation Constraints……………………………………………………15 2.5.1 Standard Development tools………………………………………………………..15 2.5.2 Web based Product………………………………………………………………….15 2.6 Assumptions and Dependencies…………………………………………………………….15 3. Specific Requirements………………………………………………………………………….15 3.1 Functional Requirements…………………………………………………………………...15 3.1.1 Use Cases…………………………………………………………………………...17 3.1.2 E-R Diagram………………………………………………………………………..27 3.2 Non-Functional Requirements……………………………………………………………...32 3.2.1 Performance………………………………………………………………………...32 3.2.2 Legal,Copyright and other notices………………………………………………….32 3.2.3 Usability…………………………………………………………………………….33 3.2.3.1 Graphical User Interfaces………………………………………………..…33 3.2.4 Security…………………………………………………………………………..….34 3.2.4.1 Data Transfer……………………………………………………………….34 3.2.4.2 Data Storage………………………………………………………………...34 3.2.5 Scalability……………………………………………………………………………34 3.2.6 Supportability………………………………………………………………………..34 4. Supporting Information…………………………………………………………………………35 4.1 Product Templates……………………………………………………………………….….35 5. Test Cases……………………………………………………………………………………….51 6. Conclusion……………………………………………………………………………………...57 7. Appendix……………………………………………………………………………………….58 7.1 Source Code………………………………………………………………………………..58
  • 3.
  • 4.
    Page 4 Certificate This isto certify that the Group “INNOVISION”comprising of five members -- Abhishek kr. Rai (1101101188) , Dhruv Govila (1101101129) , Nivi Agrawal (1101101162) , Tushar Chowdhury (1101101160) and Twesh Srivastava (1101101173) has successfully completed the Internship Project Work on the topic “ DYNAMIC SHOPPING CART “ during the Internship from 19th June 2014 to 19th August 2014 at GALGOTIAS UNIVERSITY , GREATER NOIDA under the guidance of Mr. Thirunavukkarasu K. , Assistant Professor in the School of Computing Science and Engineering of Galgotias University . THE DEAN SCSE GALGOTIAS UNIVERSITY
  • 5.
    Page 5 ACKNOWLEDGEMENT We takethis opportunity to express our profound gratitude and deep regards to our guide Mr. Thirunavukkarasu K. , Assistant Professor and Dr. Ajay Shankar Singh, Program chair of SCSE-IBMfor their exemplary guidance, monitoring and constant encouragement throughout the course of this project. The blessing, help and guidance given by them time-to-time shall carry us a long way in the journey of life on which we are about to embark on. We also take this opportunity to express a deep sense of gratitude to Mr. Arpit Saxena, IBM and Mr. Vikas Saraswat, IBM for their cordial support, valuable information and guidance, which helped us in completing this task through various stages. We are obliged to staff members of GALGOTIAS UNIVERSITY and IBM, for the valuable information provided by them in their respective fields.We are grateful for their cooperation during the period of our project. Lastly, we thank almighty, our parents, brothers, sisters and friends for their constant encouragement without which this project would not be possible. Team INNOVISION
  • 6.
    Page 6 Profile OfThe Supervisor Mr. Thirunavukkarasu K. Designation: Asst. Professor (Grade-III) Degree(s): pursuing Ph.D. in Computer Science and Engineering (Mahatma Gandhi University, Meghalaya, India); M.E. in Computer Science and Engineering(Anna University, Tamilnadu, India); M.C.A(Bharathiar University Campus, Tamilnadu, India) and B.Sc. in Computer Science(University of Madras, Tamilnadu, India) Research Area Knowledge Engineering, Data Mining, Spatial Database, Database Technology, Information System Development. Professional Experience Total Experience = 16 years (Teaching Experience: 13 years, Industry Experience: 3 years) Subjects Taught  M.Tech.: Database Technology, Advanced Algorithmic Analysis, Software Engineering, Object Oriented SE.  M.S.: Software Engineering and Supporting Environment, Information System Development.  B.Tech/MCA.:Database and Web Database Systems, Software Engineering, Project Management, Management Information System, Internet Technology, System Analysis and Design, Unix/Linux, Computer Network etc. Major Publications  Kamal Upreiti, Shitiz Upreti and Thirunavukkarasu K., “Image Filtering of colored Noise Based on Kalman Filter”, TECHNIA: International Journal of Computing Science and Communication Technologies, accepted on 30 Jan 2013, Vol. 5, No. 2, pp. 793-797, 2013  Thirunavukkarasu K., Nidhi Gupta and Rashmi Upadhay, “STEGANOGRAPHY: Hiding Data from Human Eye Environment”, International Conference on Facets of Business Excellence for FOBE on November 29, 2012, organized by IMT India and University of Essex.  Thirunavukkarasu K., Iffat Khanum and Nudrat Fatima, “Web Data Mining: Emerging Challenges of a Technique and Its Significance”, International Conference on Facets of Business Excellence for FOBE 2012 on November 29, 2012, organized by IMT India and University of Essex.  Kamal Upreiti, Nudrat Fatima and Thirunavukkarasu K., “Greedy Approach in Materialized Views Environment”, 6th International Conference on Advanced Computing and Communication Technologies (ICACCT-2012) sponsored by IEEE Computer Society Chapter Delhi Section and IETE- India on November 3, 2012 at Asia Pacific Institute of Information Technology SD India, Panipat ,Haryana, India, volume 2, pp 100-103.  Thirunavukkarasu K., Iffat Khanum and Nudrat Fatima, “Association Rule using Parallel algorithms” for ICACCT 2012, 6th International Conference on Advanced Computing and Communication Technologies sponsored by IEEE Computer Society Chapter Delhi Section and IETE-India on November 3, 2012 at Asia Pacific Institute of Information Technology SD India, Panipat ,Haryana, India, volume 2, pp 104-108.  Kamal Upreiti, Shitiz Upreti and Thirunavukkarasu K. “Image Filtering of colored Noise Based on Kalman Filter” for ICACCT 2012, 6th International Conference on Advanced Computing and
  • 7.
    Page 7 Communication Technologiessponsored by IEEE Computer Society Chapter Delhi Section and IETE- India on November 3, 2012 at Asia Pacific Institute of Information Technology SD India, Panipat ,Haryana, India, volume 2, pp 109-113.  Kamal Upreiti, Shitiz Upreti and Thirunavukkarasu K. “Materialized views in Data Warehousing Environment” for FOBE 2011, International Conference on Facets of Business Excellence on November 4-7, 2011 at IMT Ghaziabad, India.  Thirunavukkarasu K., “Knowledge-An Efficient way to Build and Manage”, NCICC-2010-5th National Conference on “Innovation in Computer and Computing’ on 5th March, 2010 at SNS College of Technology, Coimbatore, Tamilnadu, India.  Thirunavukkarasu K., “E Simudevice – A Student Companion” for ECLECTIC ’09, Third National conference on “Future Of Electrical And Instrumentation technology” on 9th April 2009 at Vivekananda College of Engineering for Women, Tiruchengode, Tamilnadu, India.  Thirunavukkarasu K., “Automatic Fuzzy Ontology Generation for Semantic Web” for SITCON, Second National conference on “ Hi-Tech Trends in Emerging Computation Technologies” during 8 & 9th May 2008 at Sethu Institute of Engg.and Tech., Madurai, Tamilnadu, India, organized by IEEE and AICTE. Awards & Honors  Invited Talk on “Knowledge Management System” at Jayam College of Engineering & Technology, Dharmapuri on 09-June-2010.  Invited Talk on “Software Testing Methodologies” at Vijaya College, Bangalore on 22-June-2009.  Invited Talk on ““Automotive Software Engineering Methodologies” during 26 & 27 Sept. 2008 at TIFAC CORE, VIT University, Vellore  Designed and Developed a course map on Database, supported by the Department of Information Technology, Government of India held during June 29 – July 24, 2009 at the International Institute of Information Technology(IIITB), Bangalore, India.  Organizing Secretary for 4th ICACCT International Conference at APIIT SD India, Panipat(Staffordshire University, UK) on 30-Oct-2010.  Conducted IBM Training - IBM DB2 9 (000-25300419 certificate course) for 4 days on behalf of IBM Information Certification, IBM and worked as a Trainer for the batch of 150 students from 6-Oct- 2010 to 9-Oct-2010.  IBM RFT certification holder from IBM Information Certification, IBM, Test Id: PR 1254497, taken up test on 11-Oct-2010.  IBM DB2 9 (000-25300419) certification holder from IBM Information Certification, IBM,Test Id: PR 1254497 taken up test on 11-Feb-2010.  Worked as Asst. Custodian-PG Unit, Reviewers and evaluator for various semester of universities Examination, Bangalore University from 2002 to Dec.2009.  MCA, BCA Paper Setter – TCP/IP and DBMS for Jyothi Nivas College (Autonomous) and Christ University, DBMS, SAD, COBOL, TCP/IP and JAVA for Bangalore University.  Designed and Developed a value added courses such as Software Testing(Manual & Automated using WinRunner), Database using IBM DB2 for B.Tech students at Asia Pacific Institute of Information Technology, Staffordshire University, Panipat, INDIA from Dec.2009 to June 2011 .  Designed & Developed a value added courses such as Software Testing, Diploma in Database for Computer students & Diploma in DTP, MS Office for Non-Computer students at Vijaya College, Bangalore University.  Scored University Highest Mark in Programming Language - BASIC & FORTRAN for I Semester MCA, April 1994.  Scored centum in Network Lab at 2nd semester M.E.
  • 8.
    Page 8 Additional DetailsOf Company IBM India Private Ltd, 'G1' Block, Manyata Embassy Business Park. Outer Ring Road, Nagawara, Bangalore - 560 045 Manayata Tech Park, Thanisandra, Bengaluru, Karnataka 080 2803 0000 The International Business Machines Corporation (IBM) is anAmerican multinational technology and consulting corporation, with headquarters in Armonk, New York, United States. IBM manufactures and markets computer hardware and software, and offers infrastructure, hosting and consulting services in areas ranging from mainframe computers to nano technology. IBM is an IT based company that values dedication to every client’s success, innovation that matters for their company and for the world and trust and personal responsibility in all relationships.
  • 9.
    Page 9 Feedback forInternship Our Internship lasted for 5 days under the IBM GURUKOOL program. . The event was inaugurated successfully at the CMRIT (CMR Institute of Technology) , Whitefield , Bangalore from 16th June 2014 to 20th June ,2014. The first four days were allotted for the interactive sessions with experieced Industry experts from various organizations including IBM , Wipro , General Electric , L&T Infotech , Inkoniq , Tech Mahindra , i2 India , Tricon Infotech ,and Accenture . The last day included the Industrial visit to the Datacenters of the IBM cloud, Koramanagalam ,Bangalore and Endeavour,Bangalore and Technovate, Bangalore. The Interactive sessions included discussions over various topics including the Strength ofworking in a Team , Benefits of Working in a big Enterprise and a Small/Medium Enterprise , Aspects of Entrepreneurship , Analog Devices , how software is managed by the Professionals with Emphasis on the Categorisation of the Risks which arise during the development of the Software By the organization and the Software Lifecycle Model that is used by the Industry and Importance of User Experience for the success of an app or Software . First day, Mr. Dutta Kumar made us to work in teams to show the importance of working in team . Mr. Vineet Jaiswal also emphasized on the team work which is a necessity for the growth of the organization and Mr. Vithal Madyalkar took the session giving us the knowledge of Hadoop . Second day, Mr. Subramani Ramakrishnan shared his views about how the Technical architects should work and what qualities they should persue. Mr. Rajesh Kumar talked about the importance of User Experience for the success of the application and Mr. Bala Subramaniam told us about the SMAC model ( Social , Mobility , Analytics and Cloud ) . Third day, Mr. C. Sakthivel shared his knowledge about the Integration of IT in business and the Enterprise Business System layers. Mr. Rajeev Parasar told us the benefits of joining the Small firms. Ms. Rekha Madakkavil discussed how to prepare a SRS of a project and the Types of Risks involved in the development of Software Project . Fourth day, Mr. Vikas Choudhary explained Internet of Things and its importance in future . Mr. Sridhar Rajgopalan told us about the digital world and Mr. Deepak Jain told us how we can secure our Finance future. We gained a lot of knowledge about the new technologies in the IT field that would help us in future. We learned about the Big Data , Hadoop and Importance of Cloud for the People as a whole . The Industrial visit to the Datacenter of IBM imparted us with the Knowledge about the Management of the datacenter , points to be taken into consideration of how an efficient datacenter should be setup and the different types of servers and the operating systems used by the Servers and how thw air conditioning works that saves a lot of energy compared to before with the same servers . The training sessions were highly beneficial and was carried out successfully by the IBM people. They were supportive in guiding and motivating us throughout the sessions and project work. The sessions would have been more interesting if we were imparted with the practical knowledge of how deployment of applications to cloud takes place. The learning in the training program was high with 8 out of 10 grades.
  • 10.
    Page 10 Abstract A dynamicLoyalty Card is a step over the standard shopping cart. Many companies today have Loyalty Cards, which are like credit cards except that they contain points instead of rupees. People can enter the Loyalty Card details in addition to their credit cards when they do transactions. If they have done transactions of over certain value, they get some special gifts. In addition, for every transaction they get some points. A loyalty card is a card used as an incentive plan and which allows a retail business to gather information about its customers. Generally a loyalty card has a barcode or magnetic stripe that is scanned at the point of sale (POS). The card identifies the consumer and sends information about what he or she has bought to a database. Consumers are offered product discounts, coupons, points toward merchandise or some other reward as exchange for voluntary participation in the program. This Dynamic Loyalty Card Project is a backend system which can be provided to any organization wanting to create Loyalty Cards. If a person does a transaction with any of the stores, he gets some loyalty points. In addition, the card has special capability for users to configure any loyalty/points based logics based on user transactions. Problem Statement Creation of a special type of Customer Loyalty Card which can be used by any Business as membership card. Any type of business that provides services to customers directly such as PVR, Convenience store, Banks etc. can use the card by registering itself with the company Innovision Inc. Once issued, the card can be used with all the businesses registered with the Innovision Inc. and points will be added to the card on each transaction. The points can be redeemed either by opting for gift deals or paying for a transaction through the points available in the card. The project is capable of handling any no. of customers. One can browse through the site quickly without any delay. All the details of Customers, Vendors and Transactions are stored in databases. The main focus is to provide best User Experience.
  • 11.
    Page 11 Software RequirementSpecification 1. Introduction The aim of this document is to gather and analyze and give an in-depth insight of the complete Dynamic Loyalty Cart by defining the problem statement in detail. Nevertheless, it also concentrates on the capabilities required by stakeholders and their needs while defining high-level product features. The detailed requirements of the project are provided in this document. 1.1 Purpose The purpose of the document is to collect and analyze all assorted ideas that have come up to define the system, its requirements with respect to consumers. Also, we shall predict and sort out how we hope this product will be used in order to gain a better understanding of the project, outline concepts that may be developed later, and document ideas that are being considered, but may be discarded as the product develops. In short, the purpose of this SRS document is to provide a detailed overview of our software product, its parameters and goals. This document describes the project's target audience and its user interface, hardware and software requirements. It defines how our client, team and audience see the product and its functionality. Nonetheless, it helps any designer and developer to assist in software delivery lifecycle (SDLC) processes. 1.2Scope Primarily, the scope pertains to the InnoCart product features for making Dynamic Shopping Cart project live. It focuses on the company, the stakeholders and applications, which allow for online sales, distribution and marketing of products. This SRS is also aimed at specifying requirements of software to be developed but it can also be applied to assist in the selection of in-house and commercial software products. The standard can be used to create software requirements specifications directly or can be used as a model for defining a organization or project specific standard. It does not identify any specific method, nomenclature or tool for preparing an SRS.
  • 12.
    Page 12 1.3 Definitions TermDefinition Active Article The document that is tracked by the system; it is a narrative that is planned to be posted to the public website. Database Collection of all the information monitored by this system. Customer Anyone visiting the site to read articles. Review A written recommendation about the appropriateness of an article for publication; may include suggestions for improvement. Reviewer A person that examines an article and has the ability to recommend approval of the article for publication or to request that changes be made in the article. Software Requirements Specification A document that completely describes all of the functions of a proposed system and the constraints under which it must operate. For example, this document. Stakeholder Any person with an interest in the project who is not a developer. User Reviewer or Author. 1.4References IEEE. IEEE Std 830-1998 IEEE Recommended Practice for Software Requirements Specifications. InnoCart structural model InnoCart behavioral model 1.5 Overview The remaining sections of this document provide a general description, including characteristics of the users of this project, the product's hardware, and the functional and data requirements of the product. General description of the project is discussed in section 2 of this document. Section 3 gives the functional requirements, data requirements and constraints and assumptions made while designing the InnoCart. It also gives the user viewpoint of product. Section 3 also gives the specific requirements of the product. Section 3 also discusses the external interface requirements and gives detailed description of functional requirements. Section 4 is for supporting information.
  • 13.
    Page 13 2. OverallDescription This document contains the problem statement that the current system is facing which is hampering the growth opportunities of the company. It further contains a list of the stakeholders and users of the proposed solution. It also illustrates the needs and wants of the stakeholders that were identified in the brainstorming exercise as part of the requirements workshop. It further lists and briefly describes the major features and a brief description of each of the proposed system. The following SRS contains the detail product perspective from different stakeholders. It provides the detail product functions of InnoCart with user characteristics permitted constraints, assumptions and dependencies and requirements subsets. The proposed system is: • User friendliness is provided in the application with various controls. • The system makes the overall project management much easier and flexible. • There is no risk of data mismanagement at any level while the project development is under process. • It provides high level of security with different level of authentication. • Users from any part of the world can make use of the system. 2.1 Product Perspective There are many types of interfaces as such supported by the InnoCart software systemnamely; User Interface, Software Interface and Hardware Interface. 2.1.1 System Interfaces The protocol used shall be HTTP. The Port number used will be 3306 . There shall be logical address of the system in IPv4 format. 2.1.2 User Interfaces The user interface for the software shall be compatible to any browser such as Internet Explorer, Mozilla or Google Chrome by which user can access to the system. The user interface shall be implemented using any tool or software package like PHP IDE, Mysql Workbench etc. 2.1.3 Hardware Interfaces Since the application must run over the internet, all the hardware shall require to connect internet will be hardware interface for the system. As for e.g. Modem, WAN – LAN, Ethernet Cross-Cable. 2.1.4 Software Interfaces  The InnoCart system shall communicate with the Configurator to identify all the available components to configure the product.
  • 14.
    Page 14  TheInnoCartshall communicate with the content manager to get the product specifications, offerings and promotions.  The InnoCart system shall communicate with billPay system to identify available payment methods, validate the payments and process payment.  The InnoCartsystem shall communicate to credit management system for handling financing options.  The InnoCart system shall communicate with CRM system to provide support.  The InnoCart system shall communicate with Sales system for order management.  The InnoCart system shall communicate with export regulation system to validate export regulations.  The system shall be verisign like software which shall allow the users to complete secured transaction. This usually shall be the third party software system which is widely used for internet transaction. 2.1.5 Communication Interfaces The InnoCart system shall use the HTTP protocol for communication over the internet and for the intranet communication will be through TCP/IP protocol suite. 2.2 Product Function Each customer is issued a Loyalty Card with a unique number. We have a predefined database with a list of Merchants who will accept our Loyalty Card. Our system should store the Card along with Customer Details. Every time a customer uses it with a merchant, we should store the transaction details and credit the card with appropriate number of points. 2.3 User Classes and Characteristics This product can be used by the common shopping cart business firms who can integrate this product to make use of the loyalty card system. It could be used by the people who even don’t have deep knowledge of the technology. They should only know about the softwares. The product could not be used in the University system, Tourism and Banking systems etc. 2.4 Operating Environment The product will work on the Windows Operating System. The softwares required to run the product are: Mysql Workbench 5.6.19 and the wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-64b .
  • 15.
    Page 15 2.5 Designand Implementation Constraints 2.5.1Standard Development Tools The system shall be built using a standard web page development tool that conforms to either IBM’s CUA standards or Microsoft’s GUI standards. 2.5.2Web Based Product There are no memory requirements. The computers must be equipped with web browsers such as Internet explorer. The product must be stored in such a way that allows the client easy access to it. Response time for loading the product should take no longer than five minutes. A general knowledge of basic computer skills is required to use the product. 2.6Assumption and Dependencies Platform for Development- WAMP Server 2.5, also executable on XAMPP. This software has been tested on these Web Browsers- a. Microsoft Internet Explorer 6.0 and Above b. Google Chrome 2.0 and above c. Mozilla Firefox 5.0 and above This product has been developed and deployed on Microsoft Windows 7 and above. The DBMS used is the MySQL 5.0 3. Specific Requirements 3.1Functional Requirements: • Loyalty Card: The first requirement in our system starts with an Application for creating a New Loyalty Card Request by filling up a form. The Admin of the system only has a capability to create new Cards. There is a HTML Form provided where the Admin can enter necessary details as explained below and generate a new card which he can share with the Customer. Each Loyalty Card entry contains: i. Card Holder Name which is a string with maximum 200 Characters ii. Card Holder Phone Number which is a 10 Digit Mobile Number
  • 16.
    Page 16 iii. CardHolder Email Id which is a string with maximum 100 Characters iv. Card Holder Address must be a string with maximum 500 Characters v. Card Issue Date, which will not be provided by Admin. Instead the code should automatically take the request receiving timestamp and store it as Card Issue Date. vi. Card Expiry Date, this should be automatically generated as 1 Year from the Card Issue Date. vii. Points Available – At the time of Card creation, this should be integer 0. Every time a transaction entry is made, this will be incremented appropriately. viii. A 16 Digit Number which should be Unique Integer like 4564 3834 4504 3849. This means, every time a New Card request form issubmitted by the admin, there should be a unique number generated by the code. Please note that the Admin will not provide the card number in his application, but the code should generate and give it as a response to Admin’s New Card request. • Merchant: A Merchant is a vendor who is willing to make an entry for the Loyalty Card everytime a transaction is done with him. A New Merchant Request Form must be created where the Admin will fill up with Merchant Details. Upon submitting this form a Merchant entry must be created. The Merchant Details are: i. Merchant Name which is a string with maximum 200 Characters ii. Merchant Address which is a string with maximum 500 Characters iii. Merchant Identification Number (MIN) which is an Auto Increment Integer iv. Merchant Type which indicates Merchant’s Nature of Business with options being Cinema Hall & Restaurant. • Transaction: The Admin of the system should be able to make entries of transactions made by various users. Each transaction contains: i. Loyalty Card Number ii. Merchant Identification Number (MIN) iii. Number of Points Obtained from Transaction Every time a new transaction entry is made, the code should also pick up the entry of the Loyalty Card and update the number of points. For example there are 3 points obtained from this transaction, then the Number of Points available in the Loyalty Card entry table should be incrementedby 3.
  • 17.
    Page 17 • Reports: Inaddition to the above mentioned features, the Reports system is the most important module. There must be a mechanism to search all transactions made along with some search filters. The search filters should be: i. Card Number ii. Transaction Date Range (should be searchable between 2 given dates) iii. Customer Mobile Number Please note that the search should work if any of the above the filters is filled. Not all filters are necessary for the search. The date fields should be made using custom javascript based datepickers. It should not be just a text entry. • Optional Addons: The product can automatically generate Bar Code for the specified product being purchased. 3.1.1USE CASES Use Case 1: To issue User id to a Customer when the Customer Information does not exist in the system Diagram : Actors: Administrator, Customer Pre-Condition: Administrator must be logged in Steps: 1. Customer asks Administrator to issue User Id for Loyalty Card 2. Administrator selects “ CUSTOMERS” 3. Administrator selects “ NEW CUSTOMER “ icon . 4. Administrator enters Name , Phone number , Email id and Address and Account No. of the customer in the Pop up Box and selects Submit. 5. System assigns the Customer Id & ejects the card of the customer . 6. Administrator takes the card out of the machine. 7. Card is issued to the customer and a pin is assigned to the customer Post Condition: Card will be issued and handed over to the customer ADMIN CUSTOMERS
  • 18.
    Page 18 Use Case2: To update the Customer Information that exists in the system . Diagram : Actors: Administrator, Customer Pre-Condition: Administrator must be logged in Steps: 1. Customer asks Administrator to update his information in the System 2. Administrator selects “ CUSTOMERS” 3. Administrator selects “ EDIT “ column corresponding to the Customer’s Record . 4. Administrator edits Name , Phone number , Email id and Address and Account No. of the customer in the Pop up Box and selects Submit. Post Condition: System updates the customer information. Use Case 3: To Search the Customer’s Information that exists in the system . Diagram : Actors:Administrator, Customer Pre-Condition: Administrator must be logged in Steps: 1. Customer asks Administrator to look for his information in the System . 2. Administrator selects “ CUSTOMERS” 3. Administrator enters the Name or Email Id of the Customer in the Search Box . Post Condition: The System displays Customer’s Information . Use Case 4: To Delete the Customer Information that exists in the system . Diagram : Actors:Administrator, Customer ADMIN CUSTOMERS ADMIN CUSTOMERS ADMIN CUSTOMERS
  • 19.
    Page 19 Pre-Condition: Administratormust be logged in. Steps: 1. Customer asks Administrator to delete his information in the System . 2. Administrator selects “ CUSTOMERS” 3. Administrator ticks the required record & selects “ DELETE “ icon . Post Condition: The Customer’s information is deleted from the System . Use Case 5: To enter Item’s Information that does not exist in the system . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in Steps: 1. Supplier asks Administrator to enter the Item’s information . 2. Administrator selects “ ITEMS ” . 3. Administrator selects “ NEW ITEM “ icon . 4. Administrator enters ISBN , Item name , Category , Supplier , Cost Price , Sales Price , Tax 1 , Tax 2 , Quantity Stock , Reorder level , Description and submits it . Post Condition: Item’s Information is added to the System . Use Case 6: To update the Item’s Information that exists in the system . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in . Steps: 1. Supplier asks Administrator to update item’s information in the System . 2. Administrator selects “ ITEMS ” . 3. Administrator selects the Item’ whose information is to be edited . 4. Administrator selects “BULK EDIT “ icon . 5. Information is edited and then submitted . Post Condition: Item’s Information is edited in the System . ITEMS ADMIN ITEMS ITEMS ADMIN ITEMS
  • 20.
    Page 20 Use Case7: To Search the Item’s Information that exists in the system . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in Steps: 1. Administrator look for Item’s information in the System . 2. Administrator selects “ ITEMS” . 3. Administrator enters the Name or ISBN of the Item in the Search Box . Post Condition: The System displays Item’s Information . Use Case 8: To Delete the Item Information that exists in the system . Diagram : Actors:Administrator Pre-Condition: Administrator must be logged in . Steps: 1. Administrator deletes Item’s information from the System . 2. Administrator selects “ ITEMS” . 3. Administrator searches the required record . ticks it & selects “ DELETE “ icon . Post Condition: The Item’s information is deleted from the System . Use Case 9: To enter Item Kit’s Information that does not exist in the system . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in . Steps: 1. Supplier asks Administrator to enter the Item kit’s information . ITEMS ADMIN ITEMS ITEMS ADMIN ITEMS ITEMS ADMIN ITEM KITS
  • 21.
    Page 21 2. Administratorselects “ ITEM KITS ” . 3. Administrator selects “ NEW ITEM KIT “ icon . 4. Administrator enters Item kit’s name , Item kit’s Description , Add item and submits it . Post Condition: Item Kit’s Information is added to the System . Use Case 10: To Search the Item Kit’s Information that exists in the system . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in . Steps: 1. Administrator looks for Item Kit’s information in the System . 2. Administrator selects “ ITEM KITS” . 3. Administrator enters the Item Kit’s Name in the Search Box . Post Condition: The System displays Item Kit’s Information . Use Case 11: To Delete the Item Kit’s Information that exists in the system . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in . Steps: 1. Administrator deletes Item Kit’s information from the System . 2. Administrator selects “ ITEM KITS” . 3. Administrator searches the required record . ticks it & selects “ DELETE “ icon . Post Condition: The Item Kit’s information is deleted from the System . Use Case 12: To register a Merchant / Vendor/Suppliers in the system . Diagram : Actors:Administrator, Merchant ITEMS ADMIN ITEMS ITEMS ADMIN ITEMS ADMIN SUPPLIERS
  • 22.
    Page 22 Pre-Condition: Administratormust be logged in Steps: 1. Merchant asks Administrator to Register him . 2. Administrator selects “SUPPLIERS” 3. Administrator enter Name , Phone number , Email id and Address and Account No. of the Merchant in the Pop up Box and selects Submit . 4. Merchant is registered to the system. 5. System ejects the card of the Merchant . 6. Administrator takes the card out of the machine. 7. Card is issued to the Merchant containing Merchant Identification Number (MIN) and a pin is assigned to the Merchant . Post Condition: Card will be issued and handed over to the Merchant . Use Case 13: To edit a Supplier’s Information from the system . Diagram : Actors:Administrator, Merchant Pre-Condition: Administrator must be logged in Steps: 1. Supplier asks Administrator/ Administrator updates supplier’s information in the System . 2. Administrator selects “ SUPPLIERS” . 3. Administrator selects “ EDIT “ column corresponding to the Supplier’s Record . 4. Administrator enter Name , Phone number , Email id and Address and Account No. of the Merchant in the Pop up Box and selects Submit . Post Condition: System updates the Supplier’s information. Use Case 14: To Search a Supplier’s Information in the system . Diagram : Actors:Administrator, Merchant Pre-Condition: Administrator must be logged in Steps: 1. Supplier asks Administrator to look for his information in the System . 2. Administrator selects “ SUPPLIERS” . 3. Administrator enters the Name or Email Id of the Supplier in the search Box . Post Condition: The System displays Supplier’s Information . ADMIN SUPPLIERS ADMIN SUPPLIERS
  • 23.
    Page 23 Use Case15: To Delete a Supplier’s Information from the system . Diagram : Actors:Administrator, Merchant Pre-Condition: Administrator must be logged in Steps: 1. Supplier asks Administrator / administrator deletes Supplier’s information from the System . 2. Administrator selects “ SUPPLIERS” . 3. Administrator ticks the required record & selects “ DELETE “ icon . Post Condition: The Supplier’s information is deleted from the System . Use Case 16: To Receive Items from the Supplier . Diagram : Actors:Administrator, Supplier Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “ RECEIVINGS” in the main page . 2. Administrator selects Receiving mode as “RECEIVE “ . 3.Administrator scans/finds the item in the System or enters the Item’s data if it is new item . 4.Then enter the quantity being received . Post Condition: The Items are received in the Inventory . Use Case 17: To Receive Items from the Supplier . Diagram : Actors:Administrator , Suppliers Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “ RECEIVINGS” in the main page . 2. Administrator selects Receiving mode as “RETURN “ . ADMIN SUPPLIERS ITEMS ADMIN RECEIVINGS ITEMS ADMIN RECEIVINGS
  • 24.
    Page 24 3.Administrator scans/findsthe item in the System . 4.Then enter the quantity being returned . Post Condition: The Items are returned and the Inventory is updated in accordance . Use Case 18: To Sell Items from the Inventory and generate bill. Diagram : Actors: Administrator, Customer Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “ SALES” in the main page . 2. Administrator selects Register mode as “SALE “ . 3. Administrator scans/finds the item in the System . 4. Then enter the quantity being sold . 5. Continues until the cart is empty and presses finish . Post Condition: It generates the bill . Use Case 19: To get the sold Item returned and generate refund . Diagram : Actors:Administrator, Customer Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “ SALES” in the main page . 2. Administrator selects Register mode as “RETURN “ . 3. Administrator scans/finds the item in the System . 4. Then enter the quantity being returned . 5. Then presses finish . Post Condition: It generates the refund. Use Case 20: To issue User id to a Employee when the Employee’s Information does not exist in the system . Diagram : ITEMS ADMIN SALES ITEMS ADMIN SALES
  • 25.
    Page 25 Actors:Administrator, Employee Pre-Condition:Administrator must be logged in . Steps: 1. Administrator selects “EMPLOYEES” . 2. Administrator selects “ NEW EMPLOYEE “ icon . 3. Administrator enters Name , Phone number , Email id and Address and assigns User name and password for accessing the software modules in the Pop up Box and selects Submit. 4. System updates the User Id of the Employee in the System . Post Condition: Administrator issues the User id and password to the Employee . Use Case 21: Editing the Employee’s Information in the system . Diagram : Actors:Administrator Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “EMPLOYEES” . 2. Administrator selects “ EDIT “ column corresponding to the Employee’s Record . 3. Administrator edits Name , Phone number , Email id and Address and Access privileges in the Pop up Box and selects Submit. Post Condition: System edits the Employee’s information. Use Case 22: Searching the Employee’s Information in the system . Diagram : Actors:Administrator Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “EMPLOYEES” . 2. Administrator enters the Name or Email Id of the Customer in the Search Box . Post Condition: The System displays Employee’s Information . ITEMS ADMIN EMPLOYEES ITEMS ADMIN EMPLOYEES ITEMS ADMIN EMPLOYEES
  • 26.
    Page 26 Use Case23: Deleting the Employee’s Information from the system . Diagram : Actors:Administrator Pre-Condition: Administrator must be logged in . Steps: 1. Administrator deletes Employee’s information in the System . 2. Administrator selects “ EMPLOYEES” . 3. Administrator ticks the required record & selects “ DELETE “ icon . Post Condition: The Employee’s information is deleted from the System . Use Case 24: To Issue Gift Card to Customer . Diagram : Actors:Administrator Pre-Condition: Administrator must be logged in . Steps: 1. Administrator selects “GIFT CARDS” . 2. Administrator selects “ NEW GIFT CARD “ icon . 3. Administrator enters Customer , Gift Card number , Value and submits it . Post Condition: The Gift card is allotted to the customer who fulfill the required value category . Use Case 25: To view reports regarding Sales , Categories , Customers , Suppliers , Items , Employees . Taxes , Discounts and payments Diagram : Actors: Administrator Pre-Condition:Administrator must be logged in . ITEMS ADMIN EMPLOYEES ITEMS ADMIN GIFT CARDS ITEMS ADMIN REPORTS
  • 27.
    Page 27 Steps: 1. Administratorselects Reports from the main page . 2. System redirects to the “REPORTS PAGE” . 3. Administrator selects which report to be generated and in which mode for example Graphical , Summary , Detailed and Inventory reports . 4. System redirects to the process page . 5. Administrator enters the date range and Sales Type for which report is to be generated . 6. Administrator selects “ Submit” . 7. System generates the report . Post Condition: Required report is generated . 3.1.2 E-R DIAGRAM –
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
    Page 32 3.2 Non-FunctionalRequirements 3.2.1 Performance: The user interface for the software should be compatible to any browser such as Internet Explorer, Mozilla or Netscape Navigator. The product shall be based on web and has to be run from a web server. The product shall take initial load time depending on internet connection strength which also depends on the media from which the product is run. The performance shall depend upon hardware components of the client/customer. 3.2.2 Legal, Copyright, and Other Notices Application should display the disclaimers, copyright, word mark, trademark and product warranties. Copyright (c) 2013-2014, InnoVision. All rights reserved. This license is a legal agreement between you and InnoVision Inc. for the use of Innovision Software (the "Software"). By obtaining the Software you agree to comply with the terms and conditions of this license. PERMITTED USE You are permitted to use, copy, modify, and distribute the Software and its documentation, with or without modification, for any purpose, provided that the following conditions are met: 1. A copy of this license agreement must be included with the distribution. 2. Redistributions of source code must retain the above copyright notice in all source code files. 3. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution. 4. Any files that have been modified must carry notices stating the nature of the change and the names of those who changed them. 5. Products derived from the Software must include an acknowledgment that they are derived from Innovision in their documentation and/or other materials provided with the distribution. 6. Products derived from the Software may not be called "Innovision", nor may "Innovision" appear in their name, without prior written
  • 33.
    Page 33 permission fromInnoVision Inc.. INDEMNITY You agree to indemnify and hold harmless the authors of the Software and any contributors for any direct, indirect, incidental, or consequential third-party claims, actions or suits, as well as any related expenses, liabilities, damages, settlements or fees arising from your use or misuse of the Software, or a violation of any terms of this license. DISCLAIMER OF WARRANTY THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. LIMITATIONS OF LIABILITY YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. 3.2.3Usability The system should provide a uniform look and feel between all the pages. And It should also provide a digital image for each product in the product catalog. 3.2.3.1Graphical User Interface The system shall provide a uniform look and feel between all the web pages. The system shall provide a digital image for each product in the product catalog. The system shall provide use of icons and toolbars.
  • 34.
    Page 34 3.2.4Security 3.2.4.1 DataTransfer The system shall use secure sockets in all transactions that include any confidential customer information. The system shall automatically log out all customers after a period of inactivity. The system shall confirm all transactions with the customer’s web browser. The system shall not leave any cookies on the customer’s computer containing the user’s password. The system shall not leave any cookies on the customer’s computer containing any of the user’s confidential information. 3.2.4.2 Data Storage The customer’s web browser shall never display a customer’s password. It shall always be echoed with special characters representing typed characters. The customer’s web browser shall never display a customer’s credit card number after retrieving from the database. It shall always be shown with just the last 4 digits of the credit card number. The system’s back-end servers shall never display a customer’s password. The customer’s password may be reset but never shown. The system’s back-end servers shall only be accessible to authenticated administrators. The system’s back-end databases shall be encrypted 3.2.5 Scability: The system should have the capability to handle any number of customers and the performance in terms of browsing should be quick. 3.2.6 Supportability 3.6.1 Configuration Management Tool The source code developed for this system shall be maintained in configuration management tool.
  • 35.
    Page 35 4.Supporting Information 4.1.1Product Templates Login Page-
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
    Page 51 5.Test Cases Testcases in software development refer to the set of conditions or variables under which a tester will determine whether an application or software system is working correctly or not. Test cases are often referred to as test scripts, particularly when written. Written test cases are usually collected into test suites. A single test case is usually a single step, or occasionally a sequence of steps, to test the correct behaviour/functionalities, features of an application. An expected result or expected outcome is usually given. Information that is included within a test case:  test case Id  test case description  test step or order of execution number  related requirement(s)  depth  test category  author  check boxes for whether the test is automatable and has been automated  Expected result and Actual result Table 1. Test Case for Processing Sale Test Case Name: Process Sale - Normal Use Case Name: Process Sale Use Case Path to be [U1, S1, U2.1, S2.1, U3.1, S3.1, U4.1, S4.1] exercised: Input Data: 12345 Initial Condition: Cashier (Abhishek) is allowed to process a sale transaction No item is in the shopping cart New sale transaction is already created Item 12345 is a valid input Expected Result: New sale transaction is still open for additional items Cashier is still authorized to work on the current transaction. 1 line item is now on the shopping cart New line item has been established for item 12345. System is ready to accept for additional item.
  • 52.
    Page 52 Figure 1.Flow of Processing Sale Event of a Point of Sale (POS
  • 53.
    Page 53 Table 2.Test Case for Processing Sale - Negative Test Case Name: Process Sale – item is not registered/recognized Use Case Name: Process Sale Use Case Path to be [U1, S1, U2.1, S2.2] exercised: Input Data: 54321 Initial Condition: Cashier (Abhishek) is allowed to process a sale transaction No item is in the shopping cart New sale transaction is already created Item 54321 is not a registered or recognized item Expected Result: New sale transaction is still open for additional items Cashier is still authorized to work on the current transaction. Still there are no items added in the shopping cart No new line has been established. Displays an error message for unregistered or unrecognized item System is ready to accept for additional item. Table 3. Test Case for Processing Sale - Negative Test Case Name: Process Sale – quantity exceeds inventory limit Use Case Name: Process Sale Use Case Path to be [U1, S1, U2.2, S3.2] exercised: Input Data: 7 Initial Condition: Cashier (Abhishek) is allowed to process a sale transaction New sale transaction is already created 1 item is in the shopping cart Default value of item’s quantity is 1 Inventory limit for the item in the cart is 5 7 is a valid input Expected Result: New sale transaction is still open for additional items Cashier is still authorized to work on the current transaction. Still there are no items added in the shopping cart No new line has been established. Displays an error message for item that exceeds inventory limit System is ready to accept for additional item.
  • 54.
    Page 54 Figure 2.Flow of Managing Items Event of a Point of Sale (POS)
  • 55.
    Page 55 Table 4.Test Case for Managing Items Test Case Name: Manage Items - Normal Use Case Name: Manage Items Use Case Path to be [U1, S1, U2.1, S2.1, U3.1, S3.1, U3.1, 3.2] exercised: Input Data: 67890-Bear Brand-Nestle-Milk-Lynlyn Poultry Supply-20.00-22.00-10 Initial Condition: Only the administrator is allowed to manage items There are existing number of items in the database Add New Item transaction is active No duplicate of item code Expected Result: Admin is still authorized to work on another new transaction. New record has been appended on the database for item 67890. The form is ready to receive a new item as another entry. Table 5. Test Case for Managing Items - Negative Test Case Name: Manage Items – insufficient item details supplied/ duplicate item codes Use Case Name: Manage Items Use Case Path to be [U1, S1, U2.1, S2.1, U3.1, S3.1, U3.1, S3.1] exercised: Input Data: 67890-Nido-Nestle-Milk-Lynlyn Poultry Supply- 20.00-22.00-10 Initial Condition: Only the administrator is allowed to manage items There are existing number of items in the database The admin has already selected a type of item to be added Add New Item transaction is active Item code 67890 is already a duplicate of another item in the database Expected Result: New sale transaction is still open for additional items Admin is still authorized to work on the current transaction. No record is appended/updated in the database System is ready to accept for another item System is ready to accept additional lacking details
  • 56.
    Page 56 Software’s complexityand accelerated development schedules make avoiding defects difficult. To assure quality software, the defects found during the testing and implementation phase will be given solutions or at least minimize the occurrence. The summary of defects must then be summarized and identify necessary actions to address and correct these defects as shown in Table Table 1. Summary of Defects Defects Resolutions Process Sale – mail is not Displays an error message Sent to customer Process Sale – quantity exceeds inventory limit Manage Items – insufficient item details supplied/ duplicate item codes
  • 57.
    Page 57 6.Conclusion The bestway to keep customers loyal is to provide a good product or service that provides good value for money. Branding alone will not make customers loyal, but back up a good product andcustomer servicewithbrandingandloyaltywilldevelopquicker. Offersandloyaltyschemescanincreaseloyalty,buttheyarenosubstitutefor(andwillnotwork without) a good product, good customer service, and friendly customer relationships. We need to enroll the right customers. We can recognize the highest value customers torecognize and reward their value to our organization, we can cultivate high potential customers who currently split their purchases between us and our competitors or reach out to those mostat risk of churning. Knowing which customer groups are most important to us allows craftingrecognition and rewarding strategy that piques their interest. Customers should be involved in the program by constant communication to make themunderstand what is in for them. Comprehensive surveys should be conducted to find out whatshouldbetheidealwayto rewardtheloyalcustomersandretainthemforthelifetime.Activitieslike checking point balances online, responding to targeted offers, using kiosks, bidding onauctionitems,enteringsweepstakesandsoon.Such participationisasuresignofincreasing value to the customers. All the above can be achieved through InnoCart, a product of Loyalty InnoVision Inc..With future improvements it will be able to provide more security by using physical card.More technologies will be used to study customer behavior in order to profile their purchase pattern by fine tuning.
  • 58.
    Page 58 7. Appendix 7.1Source Code 7.1.1 home.php <?php $this->load->view("partial/header"); ?> <br /> <h3><?php echo $this->lang->line('common_welcome_message'); ?></h3> <div id="home_module_list"> <?php foreach($allowed_modules->result() as $module) { ?> <div class="module_item"> <a href="<?php echo site_url("$module->module_id");?>"> <img src="<?php echo base_url().'images/menubar/'.$module->module_id.'.png';?>" border="0" alt="Menubar Image" /></a><br /> <a href="<?php echo site_url("$module->module_id");?>"><?php echo $this->lang- >line("module_".$module->module_id) ?></a> - <?php echo $this->lang->line('module_'.$module->module_id.'_desc');?> </div> <?php } ?> </div> <?php $this->load->view("partial/footer"); ?> 7.1.2 login.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/login.css" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>InnoV!sion Loyalty Programme <?php echo $this->lang->line('login_login'); ?></title> <script src="<?php echo base_url();?>js/jquery-1.2.6.min.js" type="text/javascript" language="javascript" charset="UTF-8"></script> <script type="text/javascript"> $(document).ready(function() { $("#login_form input:first").focus(); }); </script> </head> <body> <h1>InnoV!sion Loyalty Programme <?php echo $this->config->item('application_version'); ?></h1>
  • 59.
    Page 59 <?php echoform_open('login') ?> <div id="container"> <?php echo validation_errors(); ?> <div id="top"> <?php echo $this->lang->line('login_login'); ?> </div> <div id="login_form"> <div id="welcome_message"> <?php echo $this->lang->line('login_welcome_message'); ?> </div> <div class="form_field_label"><?php echo $this->lang->line('login_username'); ?>: </div> <div class="form_field"> <?php echo form_input(array( 'name'=>'username', 'size'=>'20')); ?> </div> <div class="form_field_label"><?php echo $this->lang->line('login_password'); ?>: </div> <div class="form_field"> <?php echo form_password(array( 'name'=>'password', 'size'=>'20')); ?> </div> <div id="submit_button"> <?php echo form_submit('loginButton','Go'); ?> </div> </div> </div> <?php echo form_close(); ?> </body> </html> 7.1.3 Customer form.php <?php echo form_open('customers/save/'.$person_info->person_id,array('id'=>'customer_form')); ?> <div id="required_fields_message"><?php echo $this->lang- >line('common_fields_required_message'); ?></div> <ul id="error_message_box"></ul> <fieldset id="customer_basic_info"> <legend><?php echo $this->lang->line("customers_basic_information"); ?></legend> <?php $this->load->view("people/form_basic_info"); ?> <div class="field_row clearfix">
  • 60.
    Page 60 <?php echoform_label($this->lang->line('customers_account_number').':', 'account_number'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'account_number', 'id'=>'account_number', 'value'=>$person_info->account_number) );?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('customers_taxable').':', 'taxable'); ?> <div class='form_field'> <?php echo form_checkbox('taxable', '1', $person_info->taxable == '' ? TRUE : (boolean)$person_info->taxable);?> </div> </div> <?php echo form_submit(array( 'name'=>'submit', 'id'=>'submit', 'value'=>$this->lang->line('common_submit'), 'class'=>'submit_button float_right') ); ?> </fieldset> <?php echo form_close(); ?> <script type='text/javascript'> //validation and submit handling $(document).ready(function() { $('#customer_form').validate({ submitHandler:function(form) { $(form).ajaxSubmit({ success:function(response) { tb_remove(); post_person_form_submit(response); }, dataType:'json' }); }, errorLabelContainer: "#error_message_box", wrapper: "li", rules: {
  • 61.
    Page 61 first_name: "required", last_name:"required", email: "email" }, messages: { first_name: "<?php echo $this->lang->line('common_first_name_required'); ?>", last_name: "<?php echo $this->lang->line('common_last_name_required'); ?>", email: "<?php echo $this->lang->line('common_email_invalid_format'); ?>" } }); }); </script> 7.1.4.1Giftcard form.php <div id="required_fields_message"><?php echo $this->lang- >line('common_fields_required_message'); ?></div> <ul id="error_message_box"></ul> <?php echo form_open('giftcards/save/'.$giftcard_info->giftcard_id,array('id'=>'giftcard_form')); ?> <fieldset id="giftcard_basic_info" style="padding: 5px;"> <legend><?php echo $this->lang->line("giftcards_basic_information"); ?></legend> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('giftcards_person_id').':', 'name',array('class'=>'required wide')); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'person_id', 'id'=>'person_id', 'value'=>$giftcard_info->person_id) );?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('giftcards_giftcard_number').':', 'name',array('class'=>'required wide')); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'giftcard_number', 'id'=>'giftcard_number', 'value'=>$giftcard_info->giftcard_number) );?> </div> </div> <div class="field_row clearfix">
  • 62.
    Page 62 <?php echoform_label($this->lang->line('giftcards_card_value').':', 'name',array('class'=>'required wide')); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'value', 'id'=>'value', 'value'=>$giftcard_info->value) );?> </div> </div> <?php echo form_submit(array( 'name'=>'submit', 'id'=>'submit', 'value'=>$this->lang->line('common_submit'), 'class'=>'submit_button float_right') ); ?> </fieldset> <?php echo form_close(); ?> <script type='text/javascript'> //validation and submit handling $(document).ready(function() { $("#person_id").autocomplete("<?php echo site_url('giftcards/suggest_person');?>",{max:100,minChars:0,delay:10}); $("#person_id").result(function(event, data, formatted){}); $("#person_id").search(); $('#giftcard_form').validate({ submitHandler:function(form) { $(form).ajaxSubmit({ success:function(response) { tb_remove(); post_giftcard_form_submit(response); }, dataType:'json' }); }, errorLabelContainer: "#error_message_box", wrapper: "li", rules: { giftcard_number: {
  • 63.
    Page 63 required:true, number:true }, value: { required:true, number:true } }, messages: { giftcard_number: { required:"<?php echo$this->lang->line('giftcards_number_required'); ?>", number:"<?php echo $this->lang->line('giftcards_number'); ?>" }, value: { required:"<?php echo $this->lang->line('giftcards_value_required'); ?>", number:"<?php echo $this->lang->line('giftcards_value'); ?>" } } }); }); </script> 7.1.4.2Giftcard manage.php <?php $this->load->view("partial/header"); ?> <script type="text/javascript"> $(document).ready(function() { init_table_sorting(); enable_select_all(); enable_checkboxes(); enable_row_selection(); enable_search('<?php echo site_url("$controller_name/suggest")?>','<?php echo $this->lang- >line("common_confirm_search")?>'); enable_delete('<?php echo $this->lang->line($controller_name."_confirm_delete")?>','<?php echo $this->lang->line($controller_name."_none_selected")?>'); }); function init_table_sorting() { //Only init if there is more than one row if($('.tablesorter tbody tr').length >1) { $("#sortable_table").tablesorter( {
  • 64.
    Page 64 sortList: [[1,0]], headers: { 0:{ sorter: false}, 3: { sorter: false} } }); } } function post_giftcard_form_submit(response) { if(!response.success) { set_feedback(response.message,'error_message',true); } else { //This is an update, just update one row if(jQuery.inArray(response.giftcard_id,get_visible_checkbox_ids()) != -1) { update_row(response.giftcard_id,'<?php echo site_url("$controller_name/get_row")?>'); set_feedback(response.message,'success_message',false); } else //refresh entire table { do_search(true,function() { //highlight new row hightlight_row(response.giftcard_id); set_feedback(response.message,'success_message',false); }); } } } </script> <div id="title_bar"> <div id="title" class="float_left"><?php echo $this->lang->line('common_list_of').' '.$this- >lang->line('module_'.$controller_name); ?></div> <div id="new_button"> <?php echo anchor("$controller_name/view/-1/width:$form_width", "<div class='big_button' style='float: left;'><span>".$this->lang- >line($controller_name.'_new')."</span></div>", array('class'=>'thickbox none','title'=>$this->lang->line($controller_name.'_new'))); ?> </div> </div> <?php echo $this->pagination->create_links();?>
  • 65.
    Page 65 <div id="table_action_header"> <ul> <liclass="float_left"><span><?php echo anchor("$controller_name/delete",$this->lang- >line("common_delete"),array('id'=>'delete')); ?></span></li> <li class="float_right"> <img src='<?php echo base_url()?>images/spinner_small.gif' alt='spinner' id='spinner' /> <?php echo form_open("$controller_name/search",array('id'=>'search_form')); ?> <input type="text" name ='search' id='search'/> </form> </li> </ul> </div> <div id="table_holder"> <?php echo $manage_table; ?> </div> <div id="feedback_bar"></div> <?php $this->load->view("partial/footer"); ?> 7.1.5 People form_basic_info.php <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_first_name').':', 'first_name',array('class'=>'required')); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'first_name', 'id'=>'first_name', 'value'=>$person_info->first_name) );?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_last_name').':', 'last_name',array('class'=>'required')); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'last_name', 'id'=>'last_name', 'value'=>$person_info->last_name) );?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_email').':', 'email'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'email',
  • 66.
    Page 66 'id'=>'email', 'value'=>$person_info->email) );?> </div> </div> <div class="field_rowclearfix"> <?php echo form_label($this->lang->line('common_phone_number').':', 'phone_number'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'phone_number', 'id'=>'phone_number', 'value'=>$person_info->phone_number));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_address_1').':', 'address_1'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'address_1', 'id'=>'address_1', 'value'=>$person_info->address_1));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_address_2').':', 'address_2'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'address_2', 'id'=>'address_2', 'value'=>$person_info->address_2));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_city').':', 'city'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'city', 'id'=>'city', 'value'=>$person_info->city));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_state').':', 'state'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'state', 'id'=>'state',
  • 67.
    Page 67 'value'=>$person_info->state));?> </div> </div> <div class="field_rowclearfix"> <?php echo form_label($this->lang->line('common_zip').':', 'zip'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'zip', 'id'=>'zip', 'value'=>$person_info->zip));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_country').':', 'country'); ?> <div class='form_field'> <?php echo form_input(array( 'name'=>'country', 'id'=>'country', 'value'=>$person_info->country));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('common_comments').':', 'comments'); ?> <div class='form_field'> <?php echo form_textarea(array( 'name'=>'comments', 'id'=>'comments', 'value'=>$person_info->comments, 'rows'=>'5', 'cols'=>'17') );?> </div> </div> 7.1.6.1 Report_data_input.php <?php $this->load->view("partial/header"); ?> <div id="page_title" style="margin-bottom:8px;"><?php echo $this->lang- >line('reports_report_input'); ?></div> <?php if(isset($error)) { echo "<div class='error_message'>".$error."</div>"; } ?> <?php echo form_label($this->lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'required')); ?> <div id='report_date_range_simple'>
  • 68.
    Page 68 <input type="radio"name="report_type" id="simple_radio" value='simple' checked='checked'/> <?php echo form_dropdown('report_date_range_simple',$report_date_range_simple, '', 'id="report_date_range_simple"'); ?> </div> <div id='report_date_range_complex'> <input type="radio" name="report_type" id="complex_radio" value='complex' /> <span> <?php echo form_dropdown('start_month',$months, $selected_month, 'id="start_month"'); ?> <?php echo form_dropdown('start_day',$days, $selected_day, 'id="start_day"'); ?> <?php echo form_dropdown('start_year',$years, $selected_year, 'id="start_year"'); ?> - <?php echo form_dropdown('end_month',$months, $selected_month, 'id="end_month"'); ?> <?php echo form_dropdown('end_day',$days, $selected_day, 'id="end_day"'); ?> <?php echo form_dropdown('end_year',$years, $selected_year, 'id="end_year"'); ?> </span> <?php if (isset($discount_input)) { ?> <div> <span> <?php echo $this->lang->line('reports_discount_prefix') .'&nbsp;' .form_input(array( 'name'=>'selected_discount', 'id'=>'selected_discount', 'value'=>'0')). '&nbsp;'. $this->lang- >line('reports_discount_suffix') ?> </span> </div> <?php } ?> </div> <?php if($mode == 'sale') { ?> <?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?> <div id='report_sale_type'> <?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'), 'sales' => $this->lang->line('reports_sales'), 'returns' => $this->lang->line('reports_returns')), 'all', 'id="input_type"'); ?> </div> <?php } elseif($mode == 'receiving')
  • 69.
    Page 69 { ?> <?php echoform_label($this->lang->line('reports_receiving_type'), 'reports_receiving_type_label', array('class'=>'required')); ?> <div id='report_receiving_type'> <?php echo form_dropdown('receiving_type',array('all' => $this->lang->line('reports_all'), 'receiving' => $this->lang->line('reports_receivings'), 'returns' => $this->lang->line('reports_returns'), 'requisitions' => $this->lang->line('reports_requisitions')), 'all', 'id="input_type"'); ?> </div> <?php } elseif($mode == 'requisition') { //Do nothing } ?> <?php echo form_button(array( 'name'=>'generate_report', 'id'=>'generate_report', 'content'=>$this->lang->line('common_submit'), 'class'=>'submit_button') ); ?> <?php $this->load->view("partial/footer"); ?> <script type="text/javascript" language="javascript"> $(document).ready(function() { $("#generate_report").click(function() { var input_type = $("#input_type").val(); if ($("#simple_radio").attr('checked')) { window.location = window.location+'/'+$("#report_date_range_simple option:selected").val() + '/' + input_type; } else { var start_date = $("#start_year").val()+'-'+$("#start_month").val()+'- '+$('#start_day').val(); var end_date = $("#end_year").val()+'-'+$("#end_month").val()+'- '+$('#end_day').val(); if(input_type == null) { window.location = window.location+'/'+start_date + '/'+ end_date; } else {
  • 70.
    Page 70 window.location =window.location+'/'+start_date + '/'+ end_date+ '/' + input_type; } } }); $("#start_month, #start_day, #start_year, #end_month, #end_day, #end_year").click(function() { $("#complex_radio").attr('checked', 'checked'); }); $("#report_date_range_simple").click(function() { $("#simple_radio").attr('checked', 'checked'); }); }); </script> 7.1.6.2 Reports_excel_import <?php $this->load->view("partial/header"); ?> <div id="page_title" style="margin-bottom:8px;"><?php echo $this->lang- >line('reports_report_input'); ?></div> <?php if(isset($error)) { echo "<div class='error_message'>".$error."</div>"; } ?> <div> Export to Excel: <input type="radio" name="export_excel" id="export_excel_yes" value='1' /> Yes <input type="radio" name="export_excel" id="export_excel_no" value='0' checked='checked' /> No </div> <?php echo form_button(array( 'name'=>'generate_report', 'id'=>'generate_report', 'content'=>$this->lang->line('common_submit'), 'class'=>'submit_button') ); ?> <?php $this->load->view("partial/footer"); ?> <script type="text/javascript" language="javascript">
  • 71.
    Page 71 $(document).ready(function() { $("#generate_report").click(function() { var export_excel= 0; if ($("#export_excel_yes").attr('checked')) { export_excel = 1; } window.location = window.location+'/' + export_excel; }); }); </script> 7.1.7 Sales_form.php <div id="edit_sale_wrapper"> <div id="required_fields_message"><?php echo $this->lang- >line('common_fields_required_message'); ?></div> <ul id="error_message_box"></ul> <fieldset id="sale_basic_info"> <?php echo form_open("sales/save/".$sale_info['sale_id'],array('id'=>'sales_edit_form')); ?> <legend><?php echo $this->lang->line("sales_basic_information"); ?></legend> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('sales_receipt').':', 'customer'); ?> <div class='form_field'> <?php echo anchor('sales/receipt/'.$sale_info['sale_id'], $this->lang- >line('sales_receipt_number') .$sale_info['sale_id'], array('target' => '_blank'));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('sales_date').':', 'date', array('class'=>'required')); ?> <div class='form_field'> <?php echo form_input(array('name'=>'date','value'=>date('m/d/Y', strtotime($sale_info['sale_time'])), 'id'=>'date'));?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('sales_customer').':', 'customer'); ?> <div class='form_field'> <?php echo form_input(array('name' => 'customer_id', 'value' => $selected_customer, 'id' => 'customer_id'));?>
  • 72.
    Page 72 </div> </div> <div class="field_rowclearfix"> <?php echo form_label($this->lang->line('sales_employee').':', 'employee'); ?> <div class='form_field'> <?php echo form_dropdown('employee_id', $employees, $sale_info['employee_id'], 'id="employee_id"');?> </div> </div> <div class="field_row clearfix"> <?php echo form_label($this->lang->line('sales_comment').':', 'comment'); ?> <div class='form_field'> <?php echo form_textarea(array('name'=>'comment','value'=>$sale_info['comment'],'rows'=>'4','cols'=>'23', 'id'=>'comment'));?> </div> </div> <?php echo form_submit(array( 'name'=>'submit', 'value'=>$this->lang->line('common_submit'), 'class'=> 'submit_button float_right') ); ?> </form> <?php echo form_open("sales/delete/".$sale_info['sale_id'],array('id'=>'sales_delete_form')); ?> <?php echo form_hidden('sale_id', $sale_info['sale_id']);?> <?php echo form_submit(array( 'name'=>'submit', 'value'=>$this->lang->line('sales_delete_entire_sale'), 'class'=>'delete_button float_right') ); ?> </form> </fieldset> </div> <script type="text/javascript" language="javascript"> $(document).ready(function() { $('#date').datePicker({startDate: '01/01/1970'}); $("#sales_delete_form").submit(function() { if (!confirm('<?php echo $this->lang->line("sales_delete_confirmation"); ?>')) { return false;
  • 73.
    Page 73 } }); var format_item= function(row) { var result = [row[0], "|", row[1]].join(""); // if more than one occurence if (row[2] > 1 && row[3] && row[3].toString().trim()) { // display zip code result += ' - ' + row[3]; } return result; }; var autocompleter = $("#customer_id").autocomplete('<?php echo site_url("sales/customer_search"); ?>', { minChars:0, delay:15, max:100, cacheLength: 1, formatItem: format_item, formatResult : format_item }); // declare submitHandler as an object.. will be reused var submit_form = function(selected_customer) { $(this).ajaxSubmit({ success:function(response) { tb_remove(); post_form_submit(response); }, error: function(jqXHR, textStatus, errorThrown) { selected_customer && autocompleter.val(selected_customer); post_form_submit({message: errorThrown}); }, dataType:'json' }); }; $('#sales_edit_form').validate({ submitHandler : function(form) { var selected_customer = autocompleter.val(); var selected_customer_id = selected_customer.replace(/(w)|.*/, "$1"); selected_customer_id && autocompleter.val(selected_customer_id); submit_form.call(form, selected_customer); }, errorLabelContainer: "#error_message_box", wrapper: "li", rules: { date: { required:true, date:true
  • 74.
    Page 74 } }, messages: { date: { required:"<?= $this->lang->line('sales_date_required'); ?>", date: "<?= $this->lang->line('sales_date_type'); ?>" } } }); $('#sales_delete_form').submit(function() { var id = $("input[name='sale_id']").val(); $(this).ajaxSubmit({ success:function(response) { tb_remove(); set_feedback(response.message,'success_message',false); var $element = get_table_row(id).parent().parent(); $element.find("td").animate({backgroundColor:"green"},1200,"linear") .end().animate({opacity:0},1200,"linear",function() { $element.next().remove(); $(this).remove(); //Re-init sortable table as we removed a row update_sortable_table(); }); }, error: function(jqXHR, textStatus, errorThrown) { set_feedback(textStatus,'error_message',true); }, dataType:'json' }); return false; }); }); </script> 7.1.8Giftcard.php <?php class Giftcard extends CI_Model { /* Determines if a given giftcard_id is an giftcard */ function exists( $giftcard_id ) { $this->db->from('giftcards'); $this->db->where('giftcard_id',$giftcard_id);
  • 75.
    Page 75 $this->db->where('deleted',0); $query =$this->db->get(); return ($query->num_rows()==1); } /* Returns all the giftcards */ function get_all($limit=10000, $offset=0) { $this->db->from('giftcards'); $this->db->join('people','people.person_id=giftcards.person_id'); $this->db->where('deleted',0); $this->db->order_by("giftcard_number", "asc"); $this->db->limit($limit); $this->db->offset($offset); return $this->db->get(); } function count_all() { $this->db->from('giftcards'); $this->db->where('deleted',0); return $this->db->count_all_results(); } /* Gets information about a particular giftcard */ function get_info($giftcard_id) { $this->db->from('giftcards'); $this->db->where('giftcard_id',$giftcard_id); $this->db->where('deleted',0); $query = $this->db->get(); if($query->num_rows()==1) { return $query->row(); } else { //Get empty base parent object, as $giftcard_id is NOT an giftcard $giftcard_obj=new stdClass(); //Get all the fields from giftcards table $fields = $this->db->list_fields('giftcards'); foreach ($fields as $field) {
  • 76.
    Page 76 $giftcard_obj->$field=''; } return $giftcard_obj; } } /* Getan giftcard id given an giftcard number */ function get_giftcard_id($giftcard_number) { $this->db->from('giftcards'); $this->db->where('giftcard_number',$giftcard_number); $this->db->where('deleted',0); $query = $this->db->get(); if($query->num_rows()==1) { return $query->row()->giftcard_id; } return false; } /* Gets information about multiple giftcards */ function get_multiple_info($giftcard_ids) { $this->db->from('giftcards'); $this->db->where_in('giftcard_id',$giftcard_ids); $this->db->where('deleted',0); $this->db->order_by("giftcard_number", "asc"); return $this->db->get(); } /* Inserts or updates a giftcard */ function save(&$giftcard_data,$giftcard_id=false) { if (!$giftcard_id or !$this->exists($giftcard_id)) { if($this->db->insert('giftcards',$giftcard_data)) { $giftcard_data['giftcard_id']=$this->db->insert_id(); return true; } return false; }
  • 77.
    Page 77 $this->db->where('giftcard_id', $giftcard_id); return$this->db->update('giftcards',$giftcard_data); } /* Updates multiple giftcards at once */ function update_multiple($giftcard_data,$giftcard_ids) { $this->db->where_in('giftcard_id',$giftcard_ids); return $this->db->update('giftcards',$giftcard_data); } /* Deletes one giftcard */ function delete($giftcard_id) { $this->db->where('giftcard_id', $giftcard_id); return $this->db->update('giftcards', array('deleted' => 1)); } /* Deletes a list of giftcards */ function delete_list($giftcard_ids) { $this->db->where_in('giftcard_id',$giftcard_ids); return $this->db->update('giftcards', array('deleted' => 1)); } /* Get search suggestions to find giftcards */ function get_search_suggestions($search,$limit=25) { $suggestions = array(); $this->db->from('giftcards'); $this->db->like('giftcard_number', $search); $this->db->where('deleted',0); $this->db->order_by("giftcard_number", "asc"); $by_number = $this->db->get(); foreach($by_number->result() as $row) { $suggestions[]=$row->giftcard_number; } $this->db->from('customers');
  • 78.
    Page 78 $this->db->join('people','customers.person_id=people.person_id'); $this->db->like("first_name",$this->db->escape_like_str($search)); $this->db->or_like("last_name",$this->db->escape_like_str($search)); $this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db- >escape_like_str($search)); $this->db->where("deleted","0"); $this->db->order_by("last_name","asc"); $by_name = $this->db->get(); foreach($by_name->result() as $row) { $suggestions[]=$row->first_name.' '.$row->last_name; } //only return $limit suggestions if(count($suggestions > $limit)) { $suggestions = array_slice($suggestions, 0,$limit); } return $suggestions; } /* Get search suggestions to find customers */ function get_person_search_suggestions($search,$limit=25) { $suggestions = array(); $this->db->select('person_id'); $this->db->from('people'); $this->db->like('person_id',$this->db->escape_like_str($search)); $this->db->or_like('first_name',$this->db->escape_like_str($search)); $this->db->or_like('last_name',$this->db->escape_like_str($search)); $this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db- >escape_like_str($search)); $this->db->or_like('email',$this->db->escape_like_str($search)); $this->db->or_like('phone_number',$this->db->escape_like_str($search)); $this->db->order_by('person_id', 'asc'); $by_person_id = $this->db->get(); foreach($by_person_id->result() as $row) { $suggestions[]=$row->person_id; } //only return $limit suggestions if(count($suggestions > $limit)) { $suggestions = array_slice($suggestions, 0,$limit); }
  • 79.
    Page 79 return $suggestions; } /* Preforma search on giftcards */ function search($search) { $this->db->from('giftcards'); $this->db->join('people','giftcards.person_id=people.person_id'); $this->db->like("first_name",$this->db->escape_like_str($search)); $this->db->or_like("last_name",$this->db->escape_like_str($search)); $this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db- >escape_like_str($search)); $this->db->or_like("giftcard_number",$this->db->escape_like_str($search)); $this->db->or_like("giftcards.person_id",$this->db->escape_like_str($search)); $this->db->where('deleted',$this->db->escape('0')); $this->db->order_by("giftcard_number", "asc"); return $this->db->get(); } public function get_giftcard_value( $giftcard_number ) { if ( !$this->exists( $this->get_giftcard_id($giftcard_number))) return 0; $this->db->from('giftcards'); $this->db->where('giftcard_number',$giftcard_number); return $this->db->get()->row()->value; } function update_giftcard_value( $giftcard_number, $value ) { $this->db->where('giftcard_number', $giftcard_number); $this->db->update('giftcards', array('value' => $value)); } } ?> 7.1.9sha1.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * InnoCart * * An open source application development framework for PHP 5.1.6 or newer * * @package InnoCart * @author Team InnoVision * @copyright Copyright (c) 2013 - 2014, InnoVision Inc. * @license http://innovision.com/user_guide/license.html
  • 80.
    Page 80 * @linkhttp://innovision.com * @since Version 1.0 * @filesource */ // ------------------------------------------------------------------------ /** * SHA1 Encoding Class * * Purpose: Provides 160 bit hashing using The Secure Hash Algorithm * developed at the National Institute of Standards and Technology. The 40 * character SHA1 message hash is computationally infeasible to crack. * * This class is a fallback for servers that are not running PHP greater than * 4.3, or do not have the MHASH library. * * This class is based on two scripts: * * Marcus Campbell's PHP implementation (GNU license) * http://www.tecknik.net/sha-1/ * * ...which is based on Paul Johnston's JavaScript version * (BSD license). http://pajhome.org.uk/ * * I encapsulated the functions and wrote one additional method to fix * a hex conversion bug. - Rick Ellis * * @package InnoCart * @subpackage Libraries * @category Encryption * @author Team InnoVision * @link http://innovision.com/user_guide/general/encryption.html */ class CI_SHA1 { public function __construct() { log_message('debug', "SHA1 Class Initialized"); } /** * Generate the Hash * * @access public * @param string * @return string */ function generate($str) { $n = ((strlen($str) + 8) >> 6) + 1;
  • 81.
    Page 81 for ($i= 0; $i < $n * 16; $i++) { $x[$i] = 0; } for ($i = 0; $i < strlen($str); $i++) { $x[$i >> 2] |= ord(substr($str, $i, 1)) << (24 - ($i % 4) * 8); } $x[$i >> 2] |= 0x80 << (24 - ($i % 4) * 8); $x[$n * 16 - 1] = strlen($str) * 8; $a = 1732584193; $b = -271733879; $c = -1732584194; $d = 271733878; $e = -1009589776; for ($i = 0; $i < count($x); $i += 16) { $olda = $a; $oldb = $b; $oldc = $c; $oldd = $d; $olde = $e; for ($j = 0; $j < 80; $j++) { if ($j < 16) { $w[$j] = $x[$i + $j]; } else { $w[$j] = $this->_rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j - 16], 1); } $t = $this->_safe_add($this->_safe_add($this->_rol($a, 5), $this->_ft($j, $b, $c, $d)), $this->_safe_add($this->_safe_add($e, $w[$j]), $this->_kt($j))); $e = $d; $d = $c; $c = $this->_rol($b, 30); $b = $a; $a = $t; } $a = $this->_safe_add($a, $olda); $b = $this->_safe_add($b, $oldb);
  • 82.
    Page 82 $c =$this->_safe_add($c, $oldc); $d = $this->_safe_add($d, $oldd); $e = $this->_safe_add($e, $olde); } return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this- >_hex($e); } // -------------------------------------------------------------------- /** * Convert a decimal to hex * * @access private * @param string * @return string */ function _hex($str) { $str = dechex($str); if (strlen($str) == 7) { $str = '0'.$str; } return $str; } // -------------------------------------------------------------------- /** * Return result based on iteration * * @access private * @return string */ function _ft($t, $b, $c, $d) { if ($t < 20) return ($b & $c) | ((~$b) & $d); if ($t < 40) return $b ^ $c ^ $d; if ($t < 60) return ($b & $c) | ($b & $d) | ($c & $d); return $b ^ $c ^ $d; } // --------------------------------------------------------------------
  • 83.
    Page 83 /** * Determinethe additive constant * * @access private * @return string */ function _kt($t) { if ($t < 20) { return 1518500249; } else if ($t < 40) { return 1859775393; } else if ($t < 60) { return -1894007588; } else { return -899497514; } } // -------------------------------------------------------------------- /** * Add integers, wrapping at 2^32 * * @access private * @return string */ function _safe_add($x, $y) { $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); return ($msw << 16) | ($lsw & 0xFFFF); } // -------------------------------------------------------------------- /** * Bitwise rotate a 32-bit number * * @access private * @return integer */ function _rol($num, $cnt) {
  • 84.
    Page 84 return ($num<< $cnt) | $this->_zero_fill($num, 32 - $cnt); } // -------------------------------------------------------------------- /** * Pad string with zero * * @access private * @return string */ function _zero_fill($a, $b) { $bin = decbin($a); if (strlen($bin) < $b) { $bin = 0; } else { $bin = substr($bin, 0, strlen($bin) - $b); } for ($i=0; $i < $b; $i++) { $bin = "0".$bin; } return bindec($bin); } } // END CI_SHA /* End of file Sha1.php */ /* Location: ./system/libraries/Sha1.php */ 7.1.10 Encrypt.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * InnoCart * * An open source application development framework for PHP 5.1.6 or newer * * @package InnoCart * @author Team InnoVision * @copyright Copyright (c) 2013 - 2014, InnoVision Inc.
  • 85.
    Page 85 * @licensehttp://innovision.com/user_guide/license.html * @link http://innovision.com * @since Version 1.0 * @filesource */ // ------------------------------------------------------------------------ /** * InnoCart Encryption Class * * Provides two-way keyed encoding using Mcrypt * * @package InnoCart * @subpackage Libraries * @category Libraries * @author Team InnoVision * @link http://innovision.com/user_guide/libraries/encryption.html */ class CI_Encrypt { var $CI; var $encryption_key = ''; var $_hash_type = 'sha1'; var $_mcrypt_exists = FALSE; var $_mcrypt_cipher; var $_mcrypt_mode; /** * Constructor * * Simply determines whether the mcrypt library exists. * */ public function __construct() { $this->CI =& get_instance(); $this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE; if ($this->_mcrypt_exists === FALSE) { show_error('The Encrypt library requires the Mcrypt extension.'); } log_message('debug', "Encrypt Class Initialized"); } // -------------------------------------------------------------------- /** * Fetch the encryption key *
  • 86.
    Page 86 * Returnsit as MD5 in order to have an exact-length 128 bit key. * Mcrypt is sensitive to keys that are not the correct length * * @access public * @param string * @return string */ function get_key($key = '') { if ($key == '') { if ($this->encryption_key != '') { return $this->encryption_key; } $CI =& get_instance(); $key = $CI->config->item('encryption_key'); if ($key == FALSE) { show_error('In order to use the encryption class requires that you set an encryption key in your config file.'); } } return md5($key); } // -------------------------------------------------------------------- /** * Set the encryption key * * @access public * @param string * @return void */ function set_key($key = '') { $this->encryption_key = $key; } // -------------------------------------------------------------------- /** * Encode * * Encodes the message string using bitwise XOR encoding. * The key is combined with a random hash, and then it * too gets converted using XOR. The whole thing is then run * through mcrypt using the randomized key. The end result
  • 87.
    Page 87 * isa double-encrypted message string that is randomized * with each call to this function, even if the supplied * message and key are the same. * * @access public * @param string the string to encode * @param string the key * @return string */ function encode($string, $key = '') { $key = $this->get_key($key); $enc = $this->mcrypt_encode($string, $key); return base64_encode($enc); } // -------------------------------------------------------------------- /** * Decode * * Reverses the above process * * @access public * @param string * @param string * @return string */ function decode($string, $key = '') { $key = $this->get_key($key); if (preg_match('/[^a-zA-Z0-9/+=]/', $string)) { return FALSE; } $dec = base64_decode($string); if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE) { return FALSE; } return $dec; } // -------------------------------------------------------------------- /** * Encode from Legacy
  • 88.
    Page 88 function encode_from_legacy($string,$legacy_mode = MCRYPT_MODE_ECB, $key = '') { // decode it first // set mode temporarily to what it was when string was encoded with the legacy // algorithm - typically MCRYPT_MODE_ECB $current_mode = $this->_get_mode(); $this->set_mode($legacy_mode); $key = $this->get_key($key); if (preg_match('/[^a-zA-Z0-9/+=]/', $string)) { return FALSE; } $dec = base64_decode($string); if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE) { return FALSE; } $dec = $this->_xor_decode($dec, $key); // set the mcrypt mode back to what it should be, typically MCRYPT_MODE_CBC $this->set_mode($current_mode); // and re-encode return base64_encode($this->mcrypt_encode($dec, $key)); } // -------------------------------------------------------------------- /** * XOR Decode * * Takes an encoded string and key as input and generates the * plain-text original message * * @access private * @param string * @param string * @return string */ function _xor_decode($string, $key) { $string = $this->_xor_merge($string, $key); $dec = ''; for ($i = 0; $i < strlen($string); $i++) {
  • 89.
    Page 89 $dec .=(substr($string, $i++, 1) ^ substr($string, $i, 1)); } return $dec; } // -------------------------------------------------------------------- /** * XOR key + string Combiner * * Takes a string and key as input and computes the difference using XOR * * @access private * @param string * @param string * @return string */ function _xor_merge($string, $key) { $hash = $this->hash($key); $str = ''; for ($i = 0; $i < strlen($string); $i++) { $str .= substr($string, $i, 1) ^ substr($hash, ($i % strlen($hash)), 1); } return $str; } // -------------------------------------------------------------------- function mcrypt_encode($data, $key) { $init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode()); $init_vect = mcrypt_create_iv($init_size, MCRYPT_RAND); return $this->_add_cipher_noise($init_vect.mcrypt_encrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), $key); } // -------------------------------------------------------------------- /** * Decrypt using Mcrypt * * @access public * @param string * @param string * @return string */ function mcrypt_decode($data, $key)
  • 90.
    Page 90 { $data =$this->_remove_cipher_noise($data, $key); $init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode()); if ($init_size > strlen($data)) { return FALSE; } $init_vect = substr($data, 0, $init_size); $data = substr($data, $init_size); return rtrim(mcrypt_decrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), "0"); } // -------------------------------------------------------------------- /** * Adds permuted noise to the IV + encrypted data to protect * against Man-in-the-middle attacks on CBC mode ciphers * http://www.ciphersbyritter.com/GLOSSARY.HTM#IV * * Function description * * @access private * @param string * @param string * @return string */ function _add_cipher_noise($data, $key) { $keyhash = $this->hash($key); $keylen = strlen($keyhash); $str = ''; for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j) { if ($j >= $keylen) { $j = 0; } $str .= chr((ord($data[$i]) + ord($keyhash[$j])) % 256); } return $str; } // -------------------------------------------------------------------- /** * Removes permuted noise from the IV + encrypted data, reversing
  • 91.
    Page 91 * _add_cipher_noise() * *Function description * * @access public * @param type * @return type */ function _remove_cipher_noise($data, $key) { $keyhash = $this->hash($key); $keylen = strlen($keyhash); $str = ''; for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j) { if ($j >= $keylen) { $j = 0; } $temp = ord($data[$i]) - ord($keyhash[$j]); if ($temp < 0) { $temp = $temp + 256; } $str .= chr($temp); } return $str; } // -------------------------------------------------------------------- /** * Set the Mcrypt Cipher * * @access public * @param constant * @return string */ function set_cipher($cipher) { $this->_mcrypt_cipher = $cipher; } // -------------------------------------------------------------------- /** * Set the Mcrypt Mode
  • 92.
    Page 92 * * @accesspublic * @param constant * @return string */ function set_mode($mode) { $this->_mcrypt_mode = $mode; } // -------------------------------------------------------------------- /** * Get Mcrypt cipher Value * * @access private * @return string */ function _get_cipher() { if ($this->_mcrypt_cipher == '') { $this->_mcrypt_cipher = MCRYPT_RIJNDAEL_256; } return $this->_mcrypt_cipher; } // -------------------------------------------------------------------- /** * Get Mcrypt Mode Value * * @access private * @return string */ function _get_mode() { if ($this->_mcrypt_mode == '') { $this->_mcrypt_mode = MCRYPT_MODE_CBC; } return $this->_mcrypt_mode; } // -------------------------------------------------------------------- function set_hash($type = 'sha1') { $this->_hash_type = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type;
  • 93.
    Page 93 } // -------------------------------------------------------------------- /** *Hash encode a string * * @access public * @param string * @return string */ function hash($str) { return ($this->_hash_type == 'sha1') ? $this->sha1($str) : md5($str); } // -------------------------------------------------------------------- /** * Generate an SHA1 Hash * * @access public * @param string * @return string */ function sha1($str) { if ( ! function_exists('sha1')) { if ( ! function_exists('mhash')) { require_once(BASEPATH.'libraries/Sha1.php'); $SH = new CI_SHA; return $SH->generate($str); } else { return bin2hex(mhash(MHASH_SHA1, $str)); } } else { return sha1($str); } } } // END CI_Encrypt class /* End of file Encrypt.php */ /* Location: ./system/libraries/Encrypt.php */
  • 94.
    Page 94 Bibliography 1. http://www.w3schools.com/html/default.aspfor html reference 2. http://www.w3schools.com/css/default.asp for css functions reference 3. http://www.w3schools.com/js/default.asp for javascript reference 4. http://www.w3schools.com/jquery/default.asp for jquery reference 5. http://www.w3schools.com/php/default.asp for php reference 6. http://www.w3schools.com/sql/default.asp for sql reference 7. SRS IEEE FORMAT for writing SRS