You are on page 1of 64

On

Restaurant Management System

Submitted To : Submitted By :
Mr.Priyank Jain Faiz Khan
Arif Khan
Yawar Hussain

Signature of Teacher Signature of Student


INDEX

B.C.A.

Contents Page No.

1. Introduction of Project

2. S/W.,H//W. Requirement

3. Objective.

4. Project Planning

5. Coding

6. Conclusion

7. Bibliography
Contents of Project File

1. Front Page

2. Certificate

3. Acknowledgement

4. Preface

5. Index

Instructions :

1. Do not use Photocopy

2. Every student should submit three copy of document file(one

printout and two photocopy)

3. Every Page must have Page No.

4. print out copy should be hard Binding & Color of front page

Should be Dark Blue & Font is Black


Certificate

This is to certify that Faiz Khan,Arif Khan ,Yawar Hussain who is

student of B.C.A. of this Institution has Successfully completed her Project

on “Restaurant Management System” during academic session 2010-

2011

This Project report is submitted in partial fulfillment for award of the

degree of B.C.A. of Barkatullah University Bhopal .

Lecture in charge

Mr.Priyank Jain
Acknowledgement

We are grateful to Mr.Priyank Jain entrusting the work of


developing a Report on Restaurant Management System
sincerely thank him for extending his full cooperation and
guidance to us during the making of this project.

We are thankful to all to all faculty members of computer


department for there cooperation and providing us with the
basic amenities and an environment which helped us
successfully achieve the completion of our project.

We have put a sincere effort and hope that the project


fulfills their expectations.

Thanking you,

Group Name

Faiz
Khan
Arif Khan
Yawar Hussain
Project Description
Introduction about Restaurant Management System

Hotel Management is developed to fulfill the complete requirement of any


Library for its

 Display record according to the customer

 Customer Entry

 New Customer Information

 Update all Customer’s records.

 Delete Customer’s records.

 Display records.

This Project provides facility to manage any department and to


have all the information within a few mouse clicks for the purpose of better
decision making which provide the organization a competitive edge.
This Project is a complete Graphical User Interface which uses C for storing
and maintaining the database and provide a user friendly environment to the
user. This is a Menu driven system which provides extremely interactive
interface to the user for easy and quick operations.
SOFTWARE USED
ABOUT OPERATING SYSTEM

WINDOWS 98

In order to understand the application development process, it is


helpful to understand some of the key concepts upon which Visual Basic is
build because Visual Basic is a windows development language, so some
familiarity with the Windows environment is necessary.

A complete description of the inner working of Windows would require an


entire book. A simplified working of the Windows involves three key concepts:-
1 Windows
2 Events
3 Messages

Windows can be thought of simply as a rectangular region with


its own boundaries. There are several different types of Windows:
1 An explorer window in Windows 98
2 A document window within our word processing program OR
3 A dialog box that pops up of remind us of an appointment Icons, Text
boxes, Option buttons and menu bar all Windows.

The Microsoft Windows O .S manages all of these many


windows by assigning each one a unique ID no. the system continually
monitors each of these windows for sign of activity or events. Events can
occur through user action such as a mouse click or a key press, through
programmatic control, or events as a result of another window action.

As can be imagined dealing with all of the possible


combinations of windows, events and messages could be mind-boggling.
Fortunately Visual Basic insulates us from having to deal with all of the low
level messages handling. Many of the messages are handled automatically
by Visual Basic. This allows us to create powerful application.
Language Used & Why:

We are using the Clanguage because of the following advantages.

C: It is convenient for hardware programming.

C: C is an Object Oriented Programming Language (named initially C


with classes), was developed by Bjarne Stroustrup at AT&T Bell
Laboratories in Murray Hall, New Jersy USA, in the early 80’s.

 C has best of two languages, i.e. Simula 67 & C.


 C is superset of C.
 The three most important facilities that C adds on to C are Classes,
Function Overloading, &Operator Overloading. These features enable
us to create abstract data type, inherit properties from existing data
type and support polymorphism, thus making C truly Object Oriented.
 It offers benefits to Program Designer & User. OOPs promises greater
programmer productivity, better quality of software & less
maintenance cost.
 We can build programs from the standard working modules that
communicate with one another rather than having to start from
scratch. This leads to saving of Development time and Higher
Productivity.

PLATFORM: MS DOS. / Windows98.

OPERATIONAL REQUIREMENTS

In this section we will discuss about the functions


used & there respective header files.
E-R DIAGRAM
E-R Modeling is a technique for analysis and logical modeling
of a system’s data requirements. The relationship between the collection of
data in a system may be graphically represented using E-R Diagrams. E-R
Diagrams provides a simplified approach to the structured design of a
system. It helps to determine the data objects in the system, the composition
of each, and the relationship that exists between them.
It uses three basic concepts, entities, their attributes and the
relationship that exist between entities.

1 Entities: - An entity is any object, place, person, concept etc about


which data is recorded. It is an object which has an instance or
occurrence and each instance should be capable of being uniquely
identified.

2 Attributes: - Attributes are data elements that describe an entity.

3 Relationship: - This is the association between the entities.


SYSTEM REQUIREMENT
In order to install the software your system must the following
specification

1 Hardware Requirement:-

Processor : Celorn processor 2.4 or Pentium III or


higher

RAM : 128 MB RAM

HD Capacity : 2 G B HD or more

Scanner : Should be of good quality

Printer : Inkjet B/W or color


2 Software Requirement: -

Operating System: Windows 98 or higher version


INTRODUCTION OF “C”Languge

C (pronounced /siː/, like the letter C) is a general-purpose computer


programming language developed between 1969 and 1973 by Dennis
Ritchie at the Bell Telephone Laboratories for use with the Unix operating
system.[2]

Although C was designed for implementing system software,[5] it is also


widely used for developing portable application software.

C is one of the most popular programming languages of all time[6][7] and


there are very few computer architectures for which a C compiler does not
exist. C has greatly influenced many other popular programming languages,
most notably C++, which began as an extension to C.

Design

C is an imperative (procedural) systems implementation language. It was


designed to be compiled using a relatively straightforward compiler, to
provide low-level access to memory, to provide language constructs that
map efficiently to machine instructions, and to require minimal run-time
support. C was therefore useful for many applications that had formerly been
coded in assembly language.

Despite its low-level capabilities, the language was designed to encourage


cross-platform programming. A standards-compliant and portably written C
program can be compiled for a very wide variety of computer platforms and
operating systems with few changes to its source code. The language has
become available on a very wide range of platforms, from embedded
microcontrollers to supercomputers.
Characteristics

Like most imperative languages in the ALGOL tradition, C has facilities for
structured programming and allows lexical variable scope and recursion,
while a static type system prevents many unintended operations. In C, all
executable code is contained within functions. Function parameters are
always passed by value. Pass-by-reference is simulated in C by explicitly
passing pointer values. Heterogeneous aggregate data types (struct) allow
related data elements to be combined and manipulated as a unit. C program
source text is free-format, using the semicolon as a statement terminator.

C also exhibits the following more specific characteristics:

 Partially weak typing; for instance, characters can be used as integers


 Low-level access to computer memory by converting machine
addresses to typed pointers
 Function and data pointers supporting ad hoc run-time polymorphism
 array indexing as a secondary notion, defined in terms of pointer
arithmetic
 A preprocessor for macro definition, source code file inclusion, and
conditional compilation
 Complex functionality such as I/O, string manipulation, and
mathematical functions consistently delegated to library routines
 A large number of compound operators, such as +=, -=, *=, ++, etc.

K&R C

In 1978, Brian Kernighan and Dennis Ritchie published the first edition of
The C Programming Language.[8] This book, known to C programmers as
"K&R", served for many years as an informal specification of the language.
The version of C that it describes is commonly referred to as K&R C. The
second edition of the book[1] covers the later ANSI C standard.

K&R introduced several language features:

 standard I/O library


 long int data type
 unsigned int data type
 compound assignment operators of the form =op (such as =-) were
changed to the form op= to remove the semantic ambiguity created by
such constructs as i=-10, which had been interpreted as i =- 10
instead of the possibly intended i = -10

Even after the publication of the 1989 C standard, for many years K&R C
was still considered the "lowest common denominator" to which C
programmers restricted themselves when maximum portability was desired,
since many older compilers were still in use, and because carefully written
K&R C code can be legal Standard C as well.

In early versions of C, only functions that returned a non-int value needed


to be declared if used before the function definition; a function used without
any previous declaration was assumed to return type int, if its value was
used.

For example:

long some_function();
/* int */ other_function();

/* int */ calling_function()
{
long test1;
register /* int */ test2;

test1 = some_function();
if (test1 > 0)
test2 = 0;
else
test2 = other_function();
return test2;
}

All the above commented-out int declarations could be omitted in K&R C.

Since K&R function declarations did not include any information about
function arguments, function parameter type checks were not performed,
although some compilers would issue a warning message if a local function
was called with the wrong number of arguments, or if multiple calls to an
external function used different numbers or types of arguments. Separate
tools such as Unix's lint utility were developed that (among other things)
could check for consistency of function use across multiple source files.

In the years following the publication of K&R C, several unofficial features


were added to the language, supported by compilers from AT&T and some
other vendors. These included:

 void functions (i.e. functions with no return value)


 functions returning struct or union types (rather than pointers)
 assignment for struct data types
 enumerated types
The large number of extensions and lack of agreement on a standard library,
together with the language popularity and the fact that not even the Unix
compilers precisely implemented the K&R specification, led to the necessity
of standardization.

ANSI C and ISO C

During the late 1970s and 1980s, versions of C were implemented for a wide
variety of mainframe computers, minicomputers, and microcomputers,
including the IBM PC, as its popularity began to increase significantly.

In 1983, the American National Standards Institute (ANSI) formed a


committee, X3J11, to establish a standard specification of C. In 1989, the
standard was ratified as ANSI X3.159-1989 "Programming Language C".
This version of the language is often referred to as ANSI C, Standard C, or
sometimes C89.

In 1990, the ANSI C standard (with formatting changes) was adopted by the
International Organization for Standardization (ISO) as ISO/IEC 9899:1990,
which is sometimes called C90. Therefore, the terms "C89" and "C90" refer
to the same programming language.

ANSI, like other national standards bodies, no longer develops the C


standard independently, but defers to the ISO C standard. National adoption
of updates to the international standard typically occurs within a year of ISO
publication.

One of the aims of the C standardization process was to produce a superset


of K&R C, incorporating many of the unofficial features subsequently
introduced. The standards committee also included several additional
features such as function prototypes (borrowed from C++), void pointers,
support for international character sets and locales, and preprocessor
enhancements. The syntax for parameter declarations was also augmented to
include the style used in C++, although the K&R interface continued to be
permitted, for compatibility with existing source code.

C89 is supported by current C compilers, and most C code being written


today is based on it. Any program written only in Standard C and without
any hardware-dependent assumptions will run correctly on any platform
with a conforming C implementation, within its resource limits. Without
such precautions, programs may compile only on a certain platform or with a
particular compiler, due, for example, to the use of non-standard libraries,
such as GUI libraries, or to a reliance on compiler- or platform-specific
attributes such as the exact size of data types and byte endianness.

In cases where code must be compilable by either standard-conforming or


K&R C-based compilers, the __STDC__ macro can be used to split the
code into Standard and K&R sections to prevent using on a K&R C-based
compiler features available only in Standard C.

C99

After the ANSI/ISO standardization process, the C language specification


remained relatively static for some time. In 1995 Normative Amendment 1
to the 1990 C standard was published, to correct some details and to add
more extensive support for international character sets. The C standard was
further revised in the late 1990s, leading to the publication of ISO/IEC
9899:1999 in 1999, which is commonly referred to as "C99". It has since
been amended three times by Technical Corrigenda. The international C
standard is maintained by the working group ISO/IEC JTC1/SC22/WG14.
C99 introduced several new features, including inline functions, several new
data types (including long long int and a complex type to represent
complex numbers), variable-length arrays, support for variadic macros
(macros of variable arity) and support for one-line comments beginning with
//, as in BCPL or C++. Many of these had already been implemented as
extensions in several C compilers.

C99 is for the most part backward compatible with C90, but is stricter in
some ways; in particular, a declaration that lacks a type specifier no longer
has int implicitly assumed. A standard macro __STDC_VERSION__ is
defined with value 199901L to indicate that C99 support is available. GCC,
Sun Studio and other C compilers now support many or all of the new
features of C99.

C1X

In 2007, work began in anticipation of another revision of the C standard,


informally called "C1X". The C standards committee has adopted guidelines
to limit the adoption of new features that have not been tested by existing
implementations.

Uses

C is often used for "system programming", including implementing


operating systems and embedded system applications, due to a combination
of desirable characteristics such as code portability and efficiency, ability to
access specific hardware addresses, ability to pun types to match externally
imposed data access requirements, and low run-time demand on system
resources. C can also be used for website programming using CGI as a
"gateway" for information between the Web application, the server, and the
browser.[9] Some reasons for choosing C over interpreted languages are its
speed, stability, and near-universal availability.[10]

One consequence of C's wide acceptance and efficiency is that compilers,


libraries, and interpreters of other programming languages are often
implemented in C. The primary implementations of Python (CPython), Perl
5, and PHP are all written in C.

Due to its thin layer of abstraction and low overhead, C allows efficient
implementations of algorithms and data structures, which is useful for
programs that perform a lot of computations. For example, the GNU Multi-
Precision Library, the GNU Scientific Library, Mathematica and MATLAB
are completely or partially written in C.

C is sometimes used as an intermediate language by implementations of


other languages. This approach may be used for portability or convenience;
by using C as an intermediate language, it is not necessary to develop
machine-specific code generators. Some languages and compilers which
have used C this way are BitC, C++, COBOL, Eiffel, Gambit, GHC,
Squeak, and Vala. However, C was designed as a programming language,
not as a compiler target language, and is thus less than ideal for use as an
intermediate language. This has led to development of C-based intermediate
languages such as C--.

C has also been widely used to implement end-user applications, but much
of that development has shifted to newer languages.

Syntax

C has a formal grammar specified by the C standard.[11] Unlike languages


such as FORTRAN 77, C source code is free-form which allows arbitrary
use of whitespace to format code, rather than column-based or text-line-
based restrictions. Comments may appear either between the delimiters /*
and */, or (in C99) following // until the end of the line.

C source files contain declarations and function definitions. Function


definitions, in turn, contain declarations and statements. Declarations either
define new types using keywords such as struct, union, and enum, or
assign types to and perhaps reserve storage for new variables, usually by
writing the type followed by the variable name. Keywords such as char
and int specify built-in types. Sections of code are enclosed in braces
({ and }, sometimes called "curly brackets") to limit the scope of
declarations and to act as a single statement for control structures.

As an imperative language, C uses statements to specify actions. The most


common statement is an expression statement, consisting of an expression to
be evaluated, followed by a semicolon; as a side effect of the evaluation,
functions may be called and variables may be assigned new values. To
modify the normal sequential execution of statements, C provides several
control-flow statements identified by reserved keywords. Structured
programming is supported by if(-else) conditional execution and by do-
while, while, and for iterative execution (looping). The for statement
has separate initialization, testing, and reinitialization expressions, any or all
of which can be omitted. break and continue can be used to leave the
innermost enclosing loop statement or skip to its reinitialization. There is
also a non-structured goto statement which branches directly to the
designated label within the function. switch selects a case to be executed
based on the value of an integer expression.

Expressions can use a variety of built-in operators (see below) and may
contain function calls. The order in which arguments to functions and
operands to most operators are evaluated is unspecified. The evaluations
may even be interleaved. However, all side effects (including storage to
variables) will occur before the next "sequence point"; sequence points
include the end of each expression statement, and the entry to and return
from each function call. Sequence points also occur during evaluation of
expressions containing certain operators (&&, ||, ?: and the comma
operator). This permits a high degree of object code optimization by the
compiler, but requires C programmers to take more care to obtain reliable
results than is needed for other programming languages.

Although mimicked by many languages because of its widespread


familiarity, C's syntax has often been criticized. For example, Kernighan and
Ritchie say in the Introduction of The C Programming Language, "C, like
any other language, has its blemishes. Some of the operators have the wrong
precedence; some parts of the syntax could be better."

Some specific problems worth noting are:

 Not checking number and types of arguments prior to C99 when the
function declaration has an empty parameter list. (This provides
backward compatibility with K&R C, which lacked prototypes.)
 Some questionable choices of operator precedence, as mentioned by
Kernighan and Ritchie above, such as == binding more tightly than &
and | in expressions like x & 1 == 0, which would need to be
written (x & 1) == 0 to be properly evaluated.
 The use of the = operator, used in mathematics for equality, to
indicate assignment, following the precedent of Fortran and PL/I, but
unlike ALGOL and its derivatives. Ritchie made this syntax design
decision consciously, based primarily on the argument that
assignment occurs more often than comparison.
 Similarity of the assignment and equality operators (= and ==),
making it easy to accidentally substitute one for the other. In many
cases, each may be used in the context of the other without a
compilation error (although some compilers produce warnings). For
example, the conditional expression in if (a=b) is true if a is not
zero after the assignment.[12]
 A lack of infix operators for complex objects, particularly for string
operations, making programs which rely heavily on these operations
(implemented as functions instead) somewhat difficult to read.
 A declaration syntax that some find unintuitive, particularly for
function pointers. (Ritchie's idea was to declare identifiers in contexts
resembling their use: "declaration reflects use".)

Keywords

C89 has 32 keywords (reserved words with special meaning): auto,


break, case, char, const, continue, default, do, double,
else, enum, extern, float, for, goto, if, int, long, register,
return, short, signed, sizeof, static, struct, switch,
typedef, union, unsigned, void, volatile, and while.

C99 adds five more keywords: inline, restrict, _Bool, _Complex,


and _Imaginary.

Operators

supports a rich set of operators, which are symbols used within an


expression to specify the manipulations to be performed while evaluating
that expression. C has operators for:

 arithmetic: +, -, *, /, %
 assignment: =
o augmented assignment: +=, -=, *=, /=, %=, &=, |=, ^=, <<=,
>>=
 bitwise logic: ~, &, |, ^
 bitwise shifts: <<, >>
 boolean logic: !, &&, ||
 conditional evaluation: ? :
 equality testing: ==, !=
 calling functions: ( )
 increment and decrement: ++ and --
 member selection: ., ->
 object size: sizeof
 order relations: <, <=, >, >=
 reference and dereference: &, *, [ ]
 sequencing: ,
 subexpression grouping: ( )
 type conversion: (typename)

Data types

C has a static weak typing type system that shares some similarities with that
of other ALGOL descendants such as Pascal. There are built-in types for
integers of various sizes, both signed and unsigned, floating-point numbers,
characters, and enumerated types (enum). C99 added a boolean datatype.
There are also derived types including arrays, pointers, records (struct),
and untagged unions (union).
C is often used in low-level systems programming where escapes from the
type system may be necessary. The compiler attempts to ensure type
correctness of most expressions, but the programmer can override the checks
in various ways, either by using a type cast to explicitly convert a value from
one type to another, or by using pointers or unions to reinterpret the
underlying bits of a value in some other way.

Pointers

C supports the use of pointers, a very simple type of reference that records,
in effect, the address or location of an object or function in memory. Pointers
can be dereferenced to access data stored at the address pointed to, or to
invoke a pointed-to function. Pointers can be manipulated using assignment
and also pointer arithmetic. The run-time representation of a pointer value is
typically a raw memory address (perhaps augmented by an offset-within-
word field), but since a pointer's type includes the type of the thing pointed
to, expressions including pointers can be type-checked at compile time.
Pointer arithmetic is automatically scaled by the size of the pointed-to data
type. (See Array-pointer interchangeability below.) Pointers are used for
many different purposes in C. Text strings are commonly manipulated using
pointers into arrays of characters. Dynamic memory allocation, which is
described below, is performed using pointers. Many data types, such as
trees, are commonly implemented as dynamically allocated struct objects
linked together using pointers. Pointers to functions are useful for callbacks
from event handlers.

A null pointer is a pointer that explicitly points to no valid location. Even


though it is created by setting a pointer to literal zero '0', it is not necessarily
zero.[14] Dereferencing a null pointer is therefore undefined, typically
resulting in a run-time error. Null pointers are useful for indicating special
cases such as no next pointer in the final node of a linked list, or as an error
indication from functions returning pointers. In code, null pointers are
usually represented by 0 or NULL, and logically evaluate to false.

Void pointers (void *) point to objects of unknown type, and can


therefore be used as "generic" data pointers. Since the size and type of the
pointed-to object is not known, void pointers cannot be dereferenced, nor is
pointer arithmetic on them allowed, although they can easily be (and in
many contexts implicitly are) converted to and from any other object pointer
type.

Careless use of pointers is potentially dangerous. Because they are typically


unchecked, a pointer variable can be made to point to any arbitrary location,
which can cause undesirable effects. Although properly-used pointers point
to safe places, they can be made to point to unsafe places by using invalid
pointer arithmetic; the objects they point to may be deallocated and reused
(dangling pointers); they may be used without having been initialized (wild
pointers); or they may be directly assigned an unsafe value using a cast,
union, or through another corrupt pointer. In general, C is permissive in
allowing manipulation of and conversion between pointer types, although
compilers typically provide options for various levels of checking. Some
other programming languages address these problems by using more
restrictive reference types.

Arrays

Array types in C are traditionally of a fixed, static size specified at compile


time. (The more recent C99 standard also allows a form of variable-length
arrays.) However, it is also possible to allocate a block of memory (of
arbitrary size) at run-time, using the standard library's malloc function,
and treat it as an array. C's unification of arrays and pointers (see below)
means that true arrays and these dynamically-allocated, simulated arrays are
virtually interchangeable. Since arrays are always accessed (in effect) via
pointers, array accesses are typically not checked against the underlying
array size, although the compiler may provide bounds checking as an option.
Array bounds violations are therefore possible and rather common in
carelessly written code, and can lead to various repercussions, including
illegal memory accesses, corruption of data, buffer overruns, and run-time
exceptions.

C does not have a special provision for declaring multidimensional arrays,


but rather relies on recursion within the type system to declare arrays of
arrays, which effectively accomplishes the same thing. The index values of
the resulting "multidimensional array" can be thought of as increasing in
row-major order.

Multidimensional arrays are commonly used in numerical algorithms


(mainly from applied linear algebra) to store matrices. The structure of the C
array is well suited to this particular task. However, since arrays are passed
merely as pointers, the bounds of the array must be known fixed values or
else explicitly passed to any subroutine that requires them, and dynamically
sized arrays of arrays cannot be accessed using double indexing. (A
workaround for this is to allocate the array with an additional "row vector"
of pointers to the columns.)

C99 introduced "variable-length arrays" which address some, but not all, of
the issues with ordinary C arrays.

See also: C string


Array-pointer interchangeability

A distinctive (but potentially confusing) feature of C is its treatment of


arrays and pointers. The array-subscript notation x[i] can also be used
when x is a pointer; the interpretation (using pointer arithmetic) is to access
the (i + 1)th object of several adjacent data objects pointed to by x,
counting the object that x points to (which is x[0]) as the first element of
the array.

Formally, x[i] is equivalent to *(x + i). Since the type of the pointer
involved is known to the compiler at compile time, the address that x + i
points to is not the address pointed to by x incremented by i bytes, but
rather incremented by i multiplied by the size of an element that x points to.
The size of these elements can be determined with the operator sizeof by
applying it to any dereferenced element of x, as in n = sizeof *x or n
= sizeof x[0].

Furthermore, in most expression contexts (a notable exception is as operand


of sizeof), the name of an array is automatically converted to a pointer to
the array's first element; this implies that an array is never copied as a whole
when named as an argument to a function, but rather only the address of its
first element is passed. Therefore, although function calls in C use pass-by-
value semantics, arrays are in effect passed by reference.
Screen
Shot
PROJECT
CODE
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* RESTAURENT MANAGEMENT SYSTEM */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/

#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
#include<graphics.h>
#define PATH ". gi"
#define TBG textbackground(WHITE);textcolor(BLUE)

typedef struct customer


{
long id;
char name[20];
char pn[12];
char BILLress[40];
char category;
int doj[3];
}cust;

typedef struct FOOD


{
long id;
char title[25];
int copy;
int cponshelf;
int issue;
char sid[20];
int loc;
}mov;

typedef struct transaction


{
long invoice;
int doi[3];
int dor[3];
char title[25];
int fine;
long cid;
char cname[20];
int copies;
int rent;
int tam;
}transaction;

cust ctr;
mov mv;
transaction tran;
FILE *fc,*fm,*ft,*tmp;
long int size;
int days,k=0;
struct date d;

void main_menu()
{
char *menu[]={"CUSTOMER SECTION",
"FOOD SECTION",
"TRANSACTION SECTION",
"EXIT"};

char ch;
int gd=DETECT,gm,i,choice=0;
initgraph(&gd,&gm,PATH);
setfillstyle(SOLID_FILL,RED);
bar(0,0,640,480);
title("MAIN MENU",180);
status();
box(0,menu[0]);
box(1,menu[1]);
box(2,menu[2]);
box(3,menu[3]);
selectbox(choice,menu[choice]);

while((ch=getch())!=13)
{
switch(ch)
{
case 80:
case 81:
choice++;
if(choice==4)
choice=0;
selectbox(choice,menu[choice]);
for(i=0;i<=3;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
break;
case 72:
case 73:
choice--;
if(choice==-1)
choice=3;
selectbox(choice,menu[choice]);
for(i=0;i<=3;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
}
}

pressbutton(choice,menu[choice]);

switch(choice)
{
case 0:
size=sizeof(ctr);
customer();
break;
case 1:
FOOD();
break;
case 2:
transactions();
break;
case 3:
closegraph();
restorecrtmode();
exit(0);
}
}

customer()
{
char *menu[]={
"BILL CUSTOMER",
"SERVE TO CUSTOMER",
"DELETE CUSTOMER",
"LIST CUSTOMER",
"BACK TO MAIN MENU",
"EXIT"
};
char ch;
int gd=DETECT,gm;
int i,choice=0;
initgraph(&gd,&gm,PATH);
setfillstyle(SOLID_FILL,RED);
bar(0,0,640,480);
title("CUSTOMER MENU",130);
status();
box(0,menu[0]);
box(1,menu[1]);
box(2,menu[2]);
box(3,menu[3]);
box(4,menu[4]);
box(5,menu[5]);
selectbox(choice,menu[choice]);

while((ch=getch())!=13)
{
switch(ch)
{
case 80:
case 81:
choice++;
if(choice==6)
choice=0;
selectbox(choice,menu[choice]);
for(i=0;i<=5;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
break;
case 72:
case 73:
choice--;
if(choice==-1)
choice=5;
selectbox(choice,menu[choice]);
for(i=0;i<=5;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
}
}

pressbutton(choice,menu[choice]);
closegraph();
restorecrtmode();
clrscr();
if((fc=fopen("c:customer.txt","rb+"))==NULL)
fc=fopen("c:customer.txt","wb+");

switch(choice)
{
case 0:
BILLcus();
break;
case 1:
rewind(fc);
modify();
break;
case 2:
delete();
break;
case 3:
listcust();
break;
case 4:
fclose(fc);
main_menu();
break;
case 5:
fclose(fc);
exit(1);
}
}

FOOD()
{
char *menu[]={
"BILL FOOD",
"LIST FOOD",
"SEARCH FOOD",
"BACK TO MAIN MENU",
"EXIT"
};

char ch;
int gd=DETECT,gm;
int i,choice=0;
initgraph(&gd,&gm,PATH);
setfillstyle(SOLID_FILL,RED);
bar(0,0,640,480);
title("FOOD MENU",165);
status();
box(0,menu[0]);
box(1,menu[1]);
box(2,menu[2]);
box(3,menu[3]);
box(4,menu[4]);
selectbox(choice,menu[choice]);

while((ch=getch())!=13)
{
switch(ch)
{
case 80:
case 81:
choice++;
if(choice==5)
choice=0;
selectbox(choice,menu[choice]);
for(i=0;i<=4;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
break;
case 72:
case 73:
choice--;
if(choice==-1)
choice=4;
selectbox(choice,menu[choice]);
for(i=0;i<=4;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
}
}

pressbutton(choice,menu[choice]);
closegraph();
restorecrtmode();

clrscr();
/*textcolor(4);*/
fm=fopen("c:FOOD.txt","rb+");
if(fm==NULL)
fm=fopen("c:FOOD.txt","wb+");
switch(choice)
{
case 0:
BILLmov();
break;
case 1:
listmov();
break;
case 2:
searchmov();
break;
case 3:
main_menu();
break;
case 4:
fclose(fm);
exit(1);
}
}

transactions()
{
char *menu[]={
"NEW TRANSACTION",
"CLOSE TRANSACTION",
"LIST TRANSACTIONS",
"SEARCH FOOD",
"BACK TO MAIN MENU",
"EXIT"
};

char ch;
int gd=DETECT,gm,i,choice=0;
initgraph(&gd,&gm,PATH);
setfillstyle(SOLID_FILL,RED);
bar(0,0,640,480);
title("TRANSACTION MENU",100);
status();
box(0,menu[0]);
box(1,menu[1]);
box(2,menu[2]);
box(3,menu[3]);
box(4,menu[4]);
box(5,menu[5]);
selectbox(choice,menu[choice]);

while((ch=getch())!=13)
{
switch(ch)
{
case 80:
case 81:
choice++;
if(choice==6)
choice=0;
selectbox(choice,menu[choice]);
for(i=0;i<=5;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
break;
case 72:
case 73:
choice--;
if(choice==-1)
choice=5;
selectbox(choice,menu[choice]);
for(i=0;i<=5;i++)
{
if(i==choice) continue;
box(i,menu[i]);
}
}
}

pressbutton(choice,menu[choice]);
closegraph();
restorecrtmode();

clrscr();
ft=fopen("c: ransact.txt","rb+");
if(ft==NULL)
ft=fopen("c: ransact.txt","wb+");
switch(choice)
{
case 0:
BILLtran();
break;
case 1:
closetran();
break;
case 2:
listtran();
break;
case 3:
fm=fopen("c:FOOD.txt","rb+");
if(fm==NULL)
fm=fopen("c:FOOD.txt","wb+");
searchmov();
break;
case 4:
main_menu();
break;
case 5:
exit(0);
}
}

BILLcus()
{
char another='y';
fseek(fc,0,SEEK_END);

TBG;
while(another=='y'||another=='Y')
{
clrscr();

gotorc(2,24);
customid();
gotorc(4,24);
fflush(stdin);
gets(ctr.name);
gotorc(6,24);
fflush(stdin);
gets(ctr.pn);
gotorc(8,24);
fflush(stdin);
gets(ctr.BILLress);
gotorc(10,24);
fflush(stdin);
getdate(&d);
ctr.doj[0]=d.da_day;ctr.doj[1]=d.da_mon;ctr.doj[2]=d.da_year;
printf("%d/%d/%d",d.da_day,d.da_mon,d.da_year);
gotorc(12,24);
fflush(stdin);
ctr.category=getche();
gotorc(16,3);
printf("DO YOU WANT TO SUBMIT THIS FORM (Y/N)");
fflush(stdin);
another=getch();
if(another=='y'||another=='Y')
fwrite(&ctr,size,1,fc);
gotorc(18,3);
printf("DO YOU WANT TO BILL ANOTHER CUTOMER(Y/N)");
fflush(stdin);
another=getch();
}
fclose(fc);
customer();
}

customid()
{
rewind(fc);
if(fread(&ctr,sizeof(ctr),1,fc)!=1)
ctr.id=1;
else
{
while(fread(&ctr,sizeof(ctr),1,fc)==1);
ctr.id++;
}
printf("%ld",ctr.id);
}

modify()
{
char another='y',choice,name[20],flag='n';
long id;

TBG;
while(another=='y'||another=='Y')
{
clrscr();
rewind(fc);

printf(" SEARCH BY NAME : PRESS 1 SEARCH BY ID : PRESS


2 ");

fflush(stdin);
choice=getchar();
if(choice=='2')
{
printf("ENTER CUSTOMER ID : ");
scanf("%ld",&id);
while(fread(&ctr,size,1,fc)==1)
{
if(ctr.id==id)
{
new();
flag='y';
break;
}
}
}
if(choice=='1')
{
printf("ENTER CUSTOMER NAME : ");
fflush(stdin);
gets(name);
while(fread(&ctr,size,1,fc)==1)
{
if(strcmpi(ctr.name,name)==0)
{
new();
flag='y';
break;
}
}
}
if(flag=='n')
{
gotorc(15,3);
printf("CUSTOMER NOT FOUND............ !");
}
gotorc(18,3);
printf("DO YOU WANT TO SERVE TO ANOTHER CUTOMER(Y/N)");
fflush(stdin);
another=getch();
}
fclose(fc);
customer();
}

new()
{
char another='y';
clrscr();
TBG;
fseek(fc,-size,SEEK_CUR);
printf("CUSTOMER'S NEW NAME :");
printf("CUSTOMER'S NEW PHONE NO :");
printf("CUSTOMER'S NEW BILLRESS :");
printf("NEW DATE OF JOINING (DD<-|MM<-|YYYY<-|) :");
printf("NEW CATEGORY(H/A/C/R/S/T) :");
gotorc(1,43);
fflush(stdin);
gets(ctr.name);
gotorc(3,43);
fflush(stdin);
gets(ctr.pn);
gotorc(5,43);
fflush(stdin);
gets(ctr.BILLress);
gotorc(7,43);
fflush(stdin);
scanf("%d",&ctr.doj[0]);
gotorc(7,45);
printf("%c",'/');
scanf("%d",&ctr.doj[1]);
gotorc(7,48);
printf("%c",'/');
scanf("%d",&ctr.doj[2]);
gotorc(9,43);
fflush(stdin);
ctr.category=getche();
gotorc(16,3);
printf("UPDATE THE CUSTOMER RECORD (Y/N)");
fflush(stdin);
another=getch();
if(another=='y'||another=='Y')
fwrite(&ctr,size,1,fc);
rewind(fc);
}

listcust()
{
int i=1,p=4;
clrscr();

TBG;
rewind(fc);
printf("******************** CUSTOMERS LIST ************");
gotorc(2,3);
printf("ID");
gotorc(2,8);
printf("NAME");
gotorc(2,22);
printf("PHONE NO");
gotorc(2,35);
printf("BILLRESS");
gotorc(2,55);
printf("D.O.J");
gotorc(2,68);
printf("CATEGORY");
while(fread(&ctr,size,1,fc)==1)
{
gotorc(p,3);
printf("%ld",ctr.id);
gotorc(p,8);
printf("%s",strupr(ctr.name));
gotorc(p,22);
printf("%s",ctr.pn);
gotorc(p,35);
printf("%s",strupr(ctr.BILLress));
gotorc(p,55);
printf("%d/%d/%d",ctr.doj[0],ctr.doj[1],ctr.doj[2]);
gotorc(p,70);
printf("%c",toupper(ctr.category));
if(i%15==0)
{
gotorc(40,3);
printf("PRESS ANY KEY TO CONTINUE.....");
getch();
clrscr();
p=4;
}
p+=2;
i++;

}
printf(" PRESS ANY KEY TO BACK TO CUSTOMER MENU");
getch();
customer();
}

delete()
{
char another='y',choice,name[20],flag='n';
long id;
tmp=fopen("c: emp.txt","wb");
rewind(fc);

TBG;
while(another=='y'||another=='Y')
{
clrscr();
printf(" DELETE BY NAME : 1 DELETE BY ID : 2 ");
fflush(stdin);
choice=getchar();
if(choice=='2')
{
printf("ENTER CUSTOMER ID : ");
scanf("%ld",&id);
clrscr();
while(fread(&ctr,size,1,fc)==1)
{
if(ctr.id!=id)
fwrite(&ctr,size,1,tmp);
else
flag='y';
}
}
if(choice=='1')
{
fflush(stdin);
gets(name);
clrscr();
while(fread(&ctr,size,1,fc)==1)
{
if(strcmpi(ctr.name,name)!=0)
fwrite(&ctr,size,1,tmp);
else
flag='y';
}
}
fclose(fc);
fclose(tmp);
remove("c:customer.txt");
rename("c: emp.txt","c:customer.txt");
if(flag=='n')
printf("CUSTOMER NOT FOUND.... !");
printf("DO YOU WANT TO DELETE ANOTHER CUTOMER(Y/N)");
fflush(stdin);
another=getch();
}
fclose(fc);
customer();
}

BILLmov()
{
char another='y';

TBG;
fseek(fm,0,SEEK_END);
while(another=='y'||another=='Y')
{
clrscr();
printf("*****************BILL FOOD FORM*****************");
printf("FOOD ID(NUMERIC) :");
printf("FOOD NAME :");
printf("NO OF COPIES :");
printf("SUPPLIER ID :");
printf("LOCATION :");
gotorc(1,24);
movid();
gotorc(2,24);
fflush(stdin);
gets(mv.title);
gotorc(3,24);
fflush(stdin);
scanf("%d",&mv.copy);
mv.cponshelf=mv.copy;
mv.issue=0;
gotorc(4,24);
fflush(stdin);
gets(mv.sid);
gotorc(5,24);
fflush(stdin);
scanf("%d",&mv.loc);
fwrite(&mv,sizeof(mv),1,fm);
printf("DO YOU WANT TO BILL ANOTHER FOOD(Y/N)");
fflush(stdin);
another=getch();
}
fclose(fm);
printf("PRESS ANY KEY TO BACK TO FOOD MENU");
FOOD();
}

movid()
{
rewind(fm);
if(fread(&mv,sizeof(mv),1,fm)!=1)
mv.id=1;
else
{
while(fread(&mv,sizeof(mv),1,fm)==1);
mv.id++;
}
printf("%ld",mv.id);
}

listmov()
{
int i=1,p=4;
textbackground(WHITE);
textcolor(BLUE);
clrscr();
rewind(fm);
printf("******************** FOOD LIST *****************");
gotorc(2,1);
printf("ID");
gotorc(2,5);
printf("TITLE");
gotorc(2,25);
printf("TOT_CP");
gotorc(2,35);
printf("CP_O_SHELF");
gotorc(2,48);
printf("TOT_ISSUES");
gotorc(2,59);
printf("SUPPLIER ID");
gotorc(2,71);
printf("LOCATION");
while(fread(&mv,sizeof(mv),1,fm)==1)
{
gotorc(p,1);
printf("%ld",mv.id);
gotorc(p,5);
printf("%s",strupr(mv.title));
gotorc(p,28);
printf("%d",mv.copy);
gotorc(p,40);
printf("%d",mv.cponshelf);
gotorc(p,52);
printf("%d",mv.issue);
gotorc(p,59);
printf("%s",mv.sid);
gotorc(p,74);
printf("%d",mv.loc);
if(i%10==0)
{
printf("PRESS ANY KEY TO CONTINUE.....");
fflush(stdin);
getch();
clrscr();
p=4;
}
i++;
p+=2;

}
printf("PRESS ANY KEY TO BACK TO FOOD MENU");
getch();
fclose(fm);
FOOD();
}

searchmov()
{
char mname[20],another;

TBG;
clrscr();
rewind(fm);
gotorc(5,5);
printf("ENTER FOOD TITLE : ");
fflush(stdin);
gets(mname);
while(fread(&mv,sizeof(mv),1,fm)==1)
{
if(strcmpi(mv.title,mname)==0)
{
gotorc(7,12);
textcolor(0);
cprintf("FOOD FOUND..");
textcolor(4);
gotorc(9,5);
printf("FOOD TITLE : %s",mv.title);
gotorc(11,5);
printf("TOTAL NO OF COPIES : %d",mv.copy);
gotorc(13,5);
printf("NO OF COPIES AVAILABLE : %d",mv.cponshelf);
gotorc(15,5);
printf("SUPPLIER ID : %s",mv.sid);
gotorc(17,5);
printf("LOCATION : %d",mv.loc);
gotorc(20,5);
printf("DO YOU WANT TO SEARCH MORE FOOD(Y/N)");
fflush(stdin);
another=getchar();
if(another=='y'||another=='Y')
searchmov();
fclose(fm);
FOOD();
}
}

gotorc(7,5);
textcolor(4);
cprintf("FOOD NOT FOUND.....!");
textcolor(4);
gotorc(12,5);
printf("DO YOU WANT TO SEARCH MORE FOOD(Y/N)");
fflush(stdin);
another=getchar();
if(another=='y'||another=='Y')
searchmov();
fclose(fm);
FOOD();

BILLtran()
{
char another='y',rec;

TBG;
fseek(ft,0,SEEK_END);
while(another=='y'||another=='Y')
{
clrscr();
printf("***************** TRANSACTION****************");
printf("INVOICE NO(NUMERIC) :");
printf("FOOD TITLE :");
printf("COPIES AVAILABLE :");
printf("CUSTOMER ID :");
printf("CUSTOMER NAME :");
printf("NO. OF COPIES :");
printf("DATE OF ISSUE :");
gotorc(2,24);
invoice();
gotorc(4,24);
fflush(stdin);
gets(tran.title);
gotorc(6,24);
avail();
gotorc(8,24);
fflush(stdin);
scanf("%ld",&tran.cid);
custcheck();
gotorc(12,24);
fflush(stdin);
scanf("%d",&tran.copies);
if(tran.copies>mv.cponshelf)
{
gotorc(18,3);
printf("TRANSACTION NOT POSSIBLE : REQUIRED NO OF
COPIES NOT AVAILABLE");
printf("PRESS ANY KEY TO BACK TO TRANSACTION MENU");
getch();
transactions();
}
gotorc(14,24);
fflush(stdin);
getdate(&d);
tran.doi[0]=d.da_day;tran.doi[1]=d.da_mon;tran.doi[2]=d.da_year;
printf("%d/%d/%d",d.da_day,d.da_mon,d.da_year);
tran.dor[0]=0;
tran.rent=0;
gotorc(18,4);
printf("DO YOU WANT TO RECORD THIS TRANSACTION(Y/N)");
rec=getchar();
if(rec=='y'||rec=='Y')
{
update();
fwrite(&tran,sizeof(tran),1,ft);
}
printf("DO YOU WANT TO BILL ANOTHER TRANSACTION(Y/N)");
fflush(stdin);
another=getch();
}
fclose(ft);
printf("PRESS ANY KEY TO BACK TO TRANSACTION MENU");
transactions();
}

custcheck()
{

if((fc=fopen("c:customer.txt","rb"))==NULL)
fc=fopen("c:customer.txt","wb+");
rewind(fc);
while(fread(&ctr,sizeof(ctr),1,fc)==1)
{
if(ctr.id==tran.cid)
{
gotorc(10,24);
printf("%s",ctr.name);
strcpy(tran.cname,ctr.name);
fclose(fc);
return;
}
}
fclose(fc);
gotorc(18,4);
printf("INVALID CUSTOMER ............!");
gotorc(21,4);
printf("PRESS ANY KEY TO BACK TO TRANSACTION MENU");
getch();
transactions();

invoice()
{
rewind(ft);
if(fread(&tran,sizeof(tran),1,ft)!=1)
tran.invoice=1;
else
{
while(fread(&tran,sizeof(tran),1,ft)==1);
tran.invoice++;
}
printf("%ld",tran.invoice);
}
avail()
{
fm=fopen("c:FOOD.txt","rb+");
if(fm==NULL)
fm=fopen("c:FOOD.txt","wb+");
while(fread(&mv,sizeof(mv),1,fm)==1)
{
if(strcmpi(tran.title,mv.title)==0)
{
printf("%d",mv.cponshelf);
fclose(fm);
return;
}
}
gotorc(18,3);
printf("%s","FOOD NOT FOUND...!");
gotorc(21,3);
printf("PRESS ANY KEY TO RETURN");
getch();
fclose(fm);
transactions();
}

update()
{
long msize;
msize=sizeof(mv);
fm=fopen("c:FOOD.txt","rb+");
if(fm==NULL)
fm=fopen("c:FOOD.txt","wb+");
while(fread(&mv,sizeof(mv),1,fm)==1)
{
if(strcmpi(tran.title,mv.title)==0)
{
mv.cponshelf=mv.cponshelf-tran.copies;
mv.issue=mv.issue+tran.copies;
fseek(fm,-msize,SEEK_CUR);
fwrite(&mv,sizeof(mv),1,fm);
break;
}
}
fclose(fm);
return;
}
listtran()
{
int i=1;

TBG;
clrscr();
rewind(ft);
while(fread(&tran,sizeof(tran),1,ft)==1)
{
printf(" INVOICE NO(NUMERIC) : %ld ",tran.invoice);
printf("CUSTOMER ID : %ld ",tran.cid);
printf("CUSTOMER NAME : %s ",tran.cname);
printf("FOOD TITLE : %s ",tran.title);
printf("NO. OF COPIES : %d ",tran.copies);
printf("DATE OF ISSUE : %d/%d/%d
",tran.doi[0],tran.doi[1],tran.doi[2]);
if(tran.dor[0]!=0)
{
printf("DATE OF RETURN : %d/%d/%d
",tran.dor[0],tran.dor[1],tran.dor[2]);
printf("RENT : %d ",tran.rent);
printf("FINE : %d ",tran.fine);
printf("TOTAL AMOUNT : %d",tran.tam);
}

printf("........................................");

if(i%2==0)
{
printf("PRESS ANY KEY TO CONTINUE.....");
getch();
clrscr();
}
i++;

}
fclose(ft);
printf("PRESS ANY KEY TO BACK TO TRANSACTION MENU");
getch();
transactions();
}

closetran()
{
long id,sz;
TBG;
clrscr();
sz=sizeof(tran);
printf("ENTER INVOICE NO: ");
scanf("%ld",&id);
clrscr();
while(fread(&tran,sz,1,ft)==1)
{
if(tran.invoice==id)
{
if(tran.dor[0]!=0)
{
gotorc(4,4);
printf("THIS TRANSACTION IS ALL READY CLOSED...!");
gotorc(7,4);
printf("PRESS ANY KEY TO BACK TO TRANSACTION
MENU......");
getch();
transactions();
}
fseek(ft,-sz,1);
getdate(&d);
tran.dor[0]=d.da_day;tran.dor[1]=d.da_mon;tran.dor[2]=d.da_year;
difference();
tran.rent=tran.copies*25;
if(k==0)
tran.fine=0;
else
tran.fine=tran.copies*(k-1)*5;
tran.tam=tran.rent+tran.fine;
printf("INVOICE NO(NUMERIC) : %ld ",tran.invoice);
printf("CUSTOMER ID : %ld ",tran.cid);
printf("CUSTOMER NAME : %s ",tran.cname);
printf("FOOD TITLE : %s ",tran.title);
printf("NO. OF COPIES : %d ",tran.copies);
printf("DATE OF ISSUE : %d/%d/%d
",tran.doi[0],tran.doi[1],tran.doi[2]);
printf("DATE OF RETURN : %d/%d/%d
",tran.dor[0],tran.dor[1],tran.dor[2]);
printf("RENT : %d ",tran.rent);
printf("FINE : %d ",tran.fine);
printf("TOTAL AMOUNT : %d",tran.tam);
updateclose();
fwrite(&tran,sz,1,ft);
fclose(ft);
}
}
printf("PRESS ANY KEY TO BACK TO TRANSACTION MENU");
getch();
transactions();
}

difference()
{
int t,m1,m2,y1,y2,d1,d2;
d1=tran.doi[0];
d2=tran.dor[0];
m1=tran.doi[1];
m2=tran.dor[1];
y1=tran.doi[2];
y2=tran.dor[2];
t=m1;
if(y2>y1)
{
while(y2>y1)
{
while(m1<=12)
{
check(m1,y1);
if(m1==t)
k=days-d1;
else
k=k+days;
m1=m1+1;
}
m1=1;y1++;
}
while(m1<m2)
{
check(m1,y1);
k=k+days;
m1++;
}
k=k+d2;
}
else
{
if(m1!=m2)
{
while(m1<m2)
{
check(m1,y1);
if(m1==t)
k=days-d1;
else
k=k+days;
m1=m1+1;
}
k=k+d2;
}
else
k=d2-d1;
}

check(int m1,int y1)


{
if(m1==1||m1==3||m1==5||m1==7||m1==8||m1==10||m1==12)
days=31;
else
{
if(m1!=2)
days=30;
else
{
if(y1%4==0)
days=29;
else
days=28;
}
}
}

updateclose()
{
long msize;
msize=sizeof(mv);
fm=fopen("c:FOOD.txt","rb+");
if(fm==NULL)
fm=fopen("c:FOOD.txt","wb+");
while(fread(&mv,sizeof(mv),1,fm)==1)
{
if(strcmpi(tran.title,mv.title)==0)
{
mv.cponshelf=mv.cponshelf+tran.copies;
fseek(fm,-msize,SEEK_CUR);
fwrite(&mv,msize,1,fm);
break;
}
}
fclose(fm);
return;
}

gotorc(int r,int c)
{
union REGS i,o;
i.h.ah=2;
i.h.bh=0;
i.h.dh=r;
i.h.dl=c;
int86(16,&i,&o);
}

screen1()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,PATH);
setfillstyle(SOLID_FILL,RED);
bar(0,0,640,480);
setfillstyle(SOLID_FILL,WHITE);
bar(15,15,625,465);
setfillstyle(SOLID_FILL,RED);
bar(30,30,610,450);
settextstyle(1,0,8);
setcolor(WHITE);
outtextxy(190,35,"Hotel");
setfillstyle(SOLID_FILL,LIGHTGRAY);
bar3d(180,140,385,130,20,20);
outtextxy(160,150,"Managment");
bar3d(140,255,440,245,20,20);
outtextxy(165,270,"SYSTEM");
bar3d(145,375,440,365,20,20);
/* sleep(4); */
getch();
closegraph();
restorecrtmode();
}

screen2()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,PATH);
setfillstyle(SOLID_FILL,RED);
bar(0,0,640,480);
setfillstyle(SOLID_FILL,WHITE);
bar(15,15,625,465);
setfillstyle(SOLID_FILL,RED);
bar(30,30,610,450);
setfillstyle(SOLID_FILL,LIGHTGRAY);
bar3d(180,100,420,300,25,25); /*members bar*/
settextstyle(1,1,10);
setcolor(WHITE);
outtextxy(10,55,"IIMS");
setfillstyle(SOLID_FILL,LIGHTGRAY);
bar3d(180,50,420,70,20,20); /*project members bar*/
bar3d(50,350,570,420,25,25); /*project guide bar*/
setcolor(BLUE);
settextstyle(1,0,2);
outtextxy(193,48,"PROJECT MEMBERS");

outtextxy(193,130,"Ashish Gupta");
outtextxy(193,170,"Yasar Khan");

outtextxy(235,351,"PROJECT GUIDE:");
settextstyle(1,0,5);
outtextxy(140,373,"Miss Monika ");
/* sleep(4); */
getch();
closegraph();
restorecrtmode();
}

box(int i,char *p)


{
setfillstyle(SOLID_FILL,WHITE);
bar(179,108+55*i,409,138+55*i);
setfillstyle(SOLID_FILL,LIGHTGRAY);
bar(180,110+55*i,410,140+55*i);
setcolor(BLUE);
settextstyle(1,0,2);
outtextxy(184,110+55*i,p);
/* getch();
setfillstyle(SOLID_FILL,WHITE);
bar(180,60,390,90);
setfillstyle(SOLID_FILL,RED);
bar(179,59,389,89); */

/* bar3d(180,100,420,300,-25,25);*/ /*members bar*/


/* closegraph();
restorecrtmode(); */
}

selectbox(int i,char *p)


{
setfillstyle(SOLID_FILL,WHITE);
bar(179,108+55*i,409,138+55*i);
setfillstyle(SOLID_FILL,9);
bar(180,110+55*i,410,140+55*i);
setcolor(WHITE);

settextstyle(1,0,2);
outtextxy(184,110+55*i,p);
/* getch();
setfillstyle(SOLID_FILL,WHITE);
bar(180,60,390,90);
setfillstyle(SOLID_FILL,RED);
bar(179,59,389,89); */

/* bar3d(180,100,420,300,-25,25);*/ /*members bar*/


/* closegraph();
restorecrtmode(); */
}

pressbutton(int i,char *p)


{

setfillstyle(SOLID_FILL,WHITE);
bar(180,110+55*i,410,140+55*i);
setfillstyle(SOLID_FILL,9);
bar(179,108+55*i,409,138+55*i);
setcolor(CYAN);
settextstyle(1,0,2);
outtextxy(184,110+55*i,p);
delay(350);
}
title(char *title,int x)
{
setfillstyle(SOLID_FILL,9);
bar(0,0,640,50);
setcolor(BLACK);
settextstyle(1,0,5);
outtextxy(x,0,title);
}

status()
{
setfillstyle(SOLID_FILL,9);
bar(0,450,640,480);
setcolor(BLACK);
settextstyle(1,0,3);
outtextxy(30,450,"USE UP & DOWN ARROW KEYS TO SELECT AN
OPTION");
}

void main()
{
screen1();
screen2();
main_menu();
}
Conclusion

Now ,as the user /reader has under gone through the listing AND other
accessories details of the project work ,so we feel that the user must have
become well acquainted with the aim AND feed back of this work. We wish
that the acquaintance of the user with this work revals a positive response
AND he/she finds this effort of ours in their good thoughts.
Of course, at the beginning ,project appeared very small,but when we
actually started the work , we encounterd its depth. This project work
coverd every aspect of the customer management. The experience of our
guide helped us a lot in this regard. This project gives us complete
satisfaction.
Thanks a million for going through our work ,because your viewing AND
satisfaction is the reward for our work in developing this project to its
present shape.

Hope you rewind this….

Thanks!
BIBLIOGRAPHY

 Let Us C By: Yashwant Kanetkar.


 Turbo C By: Robert Lafore.
 Complete Reference C By: Herbert Shild.
 Teach Yourself C By: Akanksha Sharma .

You might also like