├── DATA.txt
├── confirm.wav
├── welcome.wav
├── atention.wav
├── thankyou.wav
├── .gitignore
├── LICENSE
├── README.md
├── jlogin.h
└── super market management.cpp
/DATA.txt:
--------------------------------------------------------------------------------
1 | jay jay1 isha kp jay3 naimish abhi
--------------------------------------------------------------------------------
/confirm.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jayskhatri/Super-Market-Management/HEAD/confirm.wav
--------------------------------------------------------------------------------
/welcome.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jayskhatri/Super-Market-Management/HEAD/welcome.wav
--------------------------------------------------------------------------------
/atention.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jayskhatri/Super-Market-Management/HEAD/atention.wav
--------------------------------------------------------------------------------
/thankyou.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jayskhatri/Super-Market-Management/HEAD/thankyou.wav
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Jay Khatri
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Welcome to Super Market Management 👋
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | > It's my 2nd sem project on super market management which is in c++. Simple billing and market management project in c++. It has admin panel where admin can manage stock of items and customer can buy the items. Bill is auto generated. Just clone the Repository and run the main cpp file with gcc
15 |
16 | ### 🏠 [Homepage](https://github.com/jayskhatri/Super-Market-Management)
17 |
18 | ## Prerequisites
19 |
20 | - Code is optimized to be compile with gcc only.
21 |
22 | ## Author
23 |
24 | 👤 **Jay Khatri**
25 |
26 | * Twitter: [@jayskhatri](https://twitter.com/jayskhatri)
27 | * Github: [@jayskhatri](https://github.com/jayskhatri)
28 |
29 | 👤 **Isha Khimsurya**
30 |
31 | * Github: [@ishakhimsurya](https://github.com/ishakhimsurya)
32 |
33 | 👤 **Naimish Ghevariya**
34 |
35 | * Github: [@NaimishGhevariya](https://github.com/NaimishGhevariya)
36 |
37 | ## 🤝 Contributing
38 |
39 | Contributions, issues and feature requests are welcome !
Feel free to check [issues page](https://github.com/jayskhatri/Super-Market-Management/issues).
40 |
41 | ## Show your support
42 |
43 | Give a ⭐️ if this project helped you !
44 |
45 | ## 📝 License
46 |
47 | Copyright © 2019 [Jay Khatri](https://github.com/jayskhatri).
48 | This project is [MIT](https://github.com/jayskhatri/Super-Market-Management/blob/master/LICENSE) licensed.
49 |
50 | ***
51 | _This README was generated with ❤️ by [readme-md-generator](https://github.com/jayskhatri/readme-md-generator)_
52 |
--------------------------------------------------------------------------------
/jlogin.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | using namespace std;
7 | COORD coord={0,0};
8 | void gotoxy(int x,int y)
9 | {
10 | coord.X=x;
11 | coord.Y=y;
12 | SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
13 | }
14 |
15 |
16 |
17 |
18 | int login()
19 | {
20 | {
21 | int c=0,i=0,j=0,c1=0,c2=0;
22 | long int v;
23 | char jk[31],s1[10],s2[31],s3[10],e,l;
24 | FILE *f1,*f2,*f3;
25 | f1=fopen("DATA.txt","r");
26 | f2=fopen("pass.txt","r");
27 |
28 |
29 | //*********************************************************************
30 | // FOR ENTERING A NEW USERNAME
31 | //*********************************************************************
32 | lbl:
33 | do
34 | {
35 | printf("\n\tEnter user name:");
36 | scanf("%s",s1);
37 | fseek(f1,0L,0);
38 | fscanf(f1,"%c",&s3[0]);
39 |
40 |
41 | while(s3[j]!=EOF)
42 | {
43 | j++;
44 | fscanf(f1,"%c",&s3[j]);
45 | if(s3[j]==32)
46 | {
47 | s3[j]='\0';
48 | if(!strcmp(s3,s1))
49 | {
50 |
51 | break;
52 | }
53 | c2++;
54 | j=0;
55 |
56 | fscanf(f1,"%c",&s3[j]);
57 | }
58 | }
59 | if(strcmp(s3,s1))
60 | {
61 | printf("\n\tuser name does not exists");
62 | c2=0;
63 | }
64 | j=0;
65 | }while(strcmp(s1,s3)!=0);
66 |
67 |
68 | //*********************************************************************
69 | // FOR ENTERING PASSWORD
70 | //*********************************************************************
71 | string pass="";
72 | char ch;
73 | int ng=0;
74 |
75 | do
76 | {
77 | restart:
78 | printf("\n\tenter password:");
79 | a:
80 | pass="";
81 | ch=_getch();
82 | while(ch!=13)
83 | {
84 | if(ch!=8)
85 | {
86 | pass.push_back(ch);
87 | cout<<"*";
88 | //cout<10)
213 | {
214 | printf("\n\tPassword should be equals to 10 characters.");
215 | }
216 | }while(strlen(s)<8 || strlen(s)>10);
217 |
218 | for(i=0;s[i]!='\0';i++)
219 | {
220 | if(s[i]=='@')
221 | c1=1;
222 | }
223 | i=0;
224 | if(c1!=1)
225 | printf("\n\tPlease use atleast one time @ in password..");
226 | }while(c1==0);
227 |
228 | do
229 | {
230 | printf("\n\tConfirm your password:");
231 |
232 | a:
233 | ch=_getch();
234 | pass="";
235 | while(ch!=13)
236 | {
237 | if(ch!=8)
238 | {
239 | pass.push_back(ch);
240 | cout<<"*";
241 | ch=_getch();
242 | }
243 | else{
244 | // fseek(f2,-1,1);
245 | goto a;
246 | }
247 | }
248 | strcpy(s2, pass.c_str());
249 |
250 | if(strcmp(s,s2)!=0)
251 | {
252 | printf("\n\tPassword don't match.");
253 | }
254 |
255 | }while(strcmp(s,s2));
256 |
257 | for(i=strlen(s);i<10;i++)
258 | {
259 | s[i]=' ';
260 | }
261 | //printf("%s",s);cout<
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include"jlogin.h"
11 | #include
12 | #include
13 | #include
14 | #include
15 | using namespace std;
16 | void admin_menu();
17 | void r_admin_menu();
18 | void main_menu();
19 | void gotoxy(int ,int);
20 | int mini_main();
21 | //***************************************************************
22 | // CLASS USED IN PROJECT
23 | //***************************************************************
24 |
25 | class item
26 | {
27 | int ino;
28 | char name[100];
29 | float price,qty,tax,dis;
30 | public:
31 | void create_item()
32 | {
33 | cout<<"\n\nPlease Enter The No. of The Item : ";
34 | cin>>ino;
35 | cout<<"\nPlease Enter The Name of The Item : ";
36 | fflush(stdin);
37 | cin.getline(name,100);
38 | cout<<"\nPlease Enter The price of The Item : ";
39 | cin>>price;
40 | cout<<"\nPlease Enter The Discount (%) : ";
41 | cin>>dis;
42 | }
43 |
44 | void show_item()
45 | {
46 | cout<<"\nThe Item No. of The Item : "<>a;
94 | }while(a=='y' || a=='Y');
95 |
96 | fp.close();
97 | cout<<"\n\nThe item Has Been Created : ";
98 | gotoxy(175,49);
99 | //system("pause");
100 | r_admin_menu();
101 |
102 | }
103 |
104 |
105 |
106 |
107 | //***************************************************************
108 | // function to read all records from file
109 | //****************************************************************
110 |
111 |
112 | void display_all()
113 | {
114 | system("cls");
115 |
116 | cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
117 | fp.open("Shop.dat",ios::in);
118 | while(fp.read((char*)&itm,sizeof(item)))
119 | {
120 | itm.show_item();
121 | cout<<"\n"<>no;
170 | fp.open("Shop.dat",ios::in|ios::out);
171 | while(fp.read((char*)&itm,sizeof(item)) && found==0)
172 | {
173 | if(itm.retino()==no)
174 | {
175 | itm.show_item();
176 | cout<<"\n\nPlease Enter The New Details of Item"<>no;
208 |
209 | cout<<"\nAre you sure ? (y/n) : ";
210 | char a;
211 | PlaySound("confirm.wav", NULL, SND_ASYNC);
212 | cin>>a;
213 | if(a=='y' || a=='Y'){
214 | fp.open("Shop.dat",ios::in|ios::out);
215 | fstream fp2;
216 | fp2.open("Temp.dat",ios::out);
217 | fp.seekg(0,ios::beg);
218 | while(fp.read((char*)&itm,sizeof(item)))
219 | {
220 | if(itm.retino()!=no)
221 | {
222 | fp2.write((char*)&itm,sizeof(item));
223 | }
224 | }
225 | fp2.close();
226 | fp.close();
227 | remove("Shop.dat");
228 | rename("Temp.dat","Shop.dat");
229 | cout<<"\n\n\tRecord Deleted ..";
230 | gotoxy(175,49);
231 | system("pause");
232 | r_admin_menu();
233 | }
234 | else
235 | r_admin_menu();
236 | gotoxy(175,49);system("pause");
237 | }
238 |
239 |
240 | //***************************************************************
241 | // function to display all Items price list
242 | //****************************************************************
243 |
244 | void menu()
245 | {
246 | system("cls");
247 |
248 | fp.open("Shop.dat",ios::in);
249 | if(!fp)
250 | {
251 | cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To Admin Menu to create File";
252 | cout<<"\n\n\n program is closing ....";
253 | gotoxy(175,49);system("pause");
254 | admin_menu();
255 | exit(0);
256 | }
257 |
258 | cout<<"\n\t\tITEM MENU\n\n";
259 | for(int i=0;i<71;i++)
260 | cout<<"=";
261 | cout<<"\n";
262 | gotoxy(0,4);
263 | cout<<"P.NO."<<"\t\t\t\t";
264 | //gotoxy(14,4);
265 | cout<<"NAME"<<"\t\t\t\t";
266 | //gotoxy(28,4);
267 | cout<<"PRICE";
268 | cout<<"\n";
269 | for(int i=0;i<71;i++)
270 | cout<<"=";
271 | cout<<"\n";
272 | while(fp.read((char*)&itm,sizeof(item)))
273 | {
274 | int i=0;
275 | //gotoxy(0,8+i);
276 | cout<<"\n"<>order_arr[c];
313 | cout<<"\nQuantity in number : ";
314 | cin>>quan[c];
315 | c++;
316 | cout<<"\nDo You Want To Order Another Item ? (y/n) : ";
317 | PlaySound("confirm.wav", NULL, SND_ASYNC);
318 | cin>>ch;
319 |
320 | }while(ch=='y' ||ch=='Y');
321 | cout<<"\n\nThank You For Placing The Order";gotoxy(175,49);system("pause");system("cls");
322 | system("color 70");
323 | cout<<"\n\n";
324 | for(int i=0;i<125;i++)
325 | cout<<"-";
326 | cout<<"\n";
327 | for(int i=0;i<53;i++)
328 | cout<<"*";
329 | cout<<" INVOICE ";
330 | for(int i=0;i<53;i++)
331 | cout<<"*";
332 | cout<<"\n";
333 | for(int i=0;i<125;i++)
334 | cout<<"-";
335 | cout<<"\n";
336 | gotoxy(2,5);
337 | cout<<"Item No.";//<<"\t\t";
338 | gotoxy(22,5);
339 | cout<<"Item Name";//<<"\t\t";
340 | gotoxy(42,5);
341 | cout<<"Quantity";//<<"\t\t";
342 | gotoxy(62,5);
343 | cout<<"Price";//<<"\t\t";
344 | gotoxy(82,5);
345 | cout<<"Amount";//<<"\t\t";
346 | gotoxy(102,5);
347 | cout<<"Amount after discount\n";
348 | for(int i=0;i<125;i++)
349 | cout<<"=";
350 | int X=2,Y,J=0;
351 | for(int x=0;x<=c;x++)
352 | {
353 | fp.open("Shop.dat",ios::in);
354 | fp.read((char*)&itm,sizeof(item));
355 | while(!fp.eof())
356 | {
357 | if(itm.retino()==order_arr[x])
358 | {
359 |
360 |
361 | Y=7+J;
362 | amt=itm.retprice()*quan[x];
363 | damt=amt-(amt*itm.retdis()/100);
364 | gotoxy(X,Y);
365 | cout<>num;
521 | display_sp(num);
522 | break;
523 | case '4':
524 | Beep(500,500);
525 | modify_item();break;
526 | case '5':
527 | Beep(500,500);
528 | delete_item();break;
529 | case '6':
530 | Beep(500,500);
531 | menu();
532 | r_admin_menu();
533 | break;
534 | case '7': break;
535 | default:
536 | PlaySound("atention.wav", NULL, SND_ASYNC);
537 | cout<<"\a";
538 | }
539 | }
540 |
541 | void main_menu()
542 | {
543 | system("cls");
544 | system("color 07");
545 | cout<<"\n\n\n\tMAIN MENU";
546 | cout<<"\n ===========";
547 | cout<<"\n\n\t01. CUSTOMER";
548 | cout<<"\n\n\t02. ADMINISTRATOR";
549 | cout<<"\n\n\t03. ABOUT THE PROJECT";
550 | cout<<"\n\n\t04. EXIT";
551 | cout<<"\n\n\tPlease Select Your Option (1-4) ";
552 | }
553 |
554 |
555 | //***************************************************************
556 | // THE MAIN FUNCTION OF program
557 | //****************************************************************
558 | int mini_main()
559 | {
560 | char ch;
561 | do
562 | {
563 | system("color 07");
564 |
565 | x: system("cls");
566 | main_menu();
567 | fflush(stdin);
568 | p:ch=cin.get();
569 | switch(ch)
570 | {
571 | case '1': system("cls");
572 | Beep(500,500);
573 | place_order();
574 | // gotoxy(175,49);system("pause");
575 | break;
576 | case '2':
577 | Beep(500,500);
578 |
579 | admin_menu();
580 | break;
581 | case '4':
582 | Beep(500,500);
583 | exit(0);
584 | case '3':
585 | system("cls");
586 | Beep(500,500);
587 | gotoxy(90,15);
588 | cout<<"MADE BY : ";
589 | gotoxy(99,20);
590 | cout<<"Jay Khatri";
591 | gotoxy(99,22);
592 | cout<<"Isha Khimsurya\n\n\n";
593 | gotoxy(99,24);
594 | cout<<"Naimish Ghevariya\n\n\n";
595 |
596 | gotoxy(90,30);
597 | cout<<"MENTORED BY: ";
598 | gotoxy(99,35);
599 | cout<<"Prof. Mayuri Popat\n\n\n";
600 | gotoxy(99,37);
601 | cout<<"Prof. Aniruddh Fatania\n\n\n";
602 | gotoxy(99,39);
603 | cout<<"Prof. Ronak Patel\n\n\n";
604 | system("pause");
605 | goto x;
606 | break;
607 |
608 | default :
609 | PlaySound("atention.wav", NULL, SND_ASYNC);
610 | cout<<"\a";break;
611 | }
612 | }while(ch!='3');
613 | return 0;
614 | }
615 | int main()
616 | {
617 | intro();
618 | mini_main();
619 | return 0;
620 | }
621 | //***************************************************************
622 | // END OF PROJECT
623 | //***************************************************************
624 |
625 |
626 |
--------------------------------------------------------------------------------