Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SY_56_PublicWelfare #18

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions DB/Script.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
create database Buffer;

use Buffer;

create table Supplier_info(S_ID int Primary key,S_name varchar(30) Not null,Shop_name varchar(30) Not null,S_city varchar(30) Not null,S_pincode int Not null,S_pass int not null);
insert into Supplier_info values(101,"Arnav J.","Apple Store","Pune",411038,123);
insert into Supplier_info values(102,"Aryan K.","Siddhivinayak Store","Pune",411021,234);
insert into Supplier_info values(103,"Soham P.","Wellness Store","Pune",411038,345);
insert into Supplier_info values(104,"Sahil P.","Jeevan Store","Pune",411028,456);
insert into Supplier_info values(105,"Arya V.","MedPlus Store","Pune",411052,567);
insert into Supplier_info values(106,"Tejas k.","Laxmi Medico","Pune",411035,678);
insert into Supplier_info values(107,"Sachin C.","Krishna Medicals","Pune",411045,789);
insert into Supplier_info values(108,"Abhiman G.","Sai Samarth medioc","Pune",411052,890);
insert into Supplier_info values(109,"Ashutosh S.","Medico Store","Pune",411021,100);
insert into Supplier_info values(110,"Arjit P.","Prime Medicals","Pune",411035,200);


create table Medicine_info(
S_ID int Not null,
M_ID int Not null,
Med_name varchar(50) Not null,
Med_type varchar(20) Not null,
Price decimal(10,2) Not null,
Quantity int Not null,
Num_Tablets int default 0,
Volume int default 0,

Foreign key(S_ID) references Supplier_info(S_ID),
Unique (S_ID,M_ID)
);

insert into Medicine_info values(101,201,"Crocin","Tablet",33.6,20,15,0);
insert into Medicine_info values(101,202,"Ondem 4" ,"Tablet",56,30,10,0);
insert into Medicine_info values(101,203,"Ondem 8","Tablet",100,30,10,0);
insert into Medicine_info values(101,204,"Ondem Syrup","Syrup",40,20,0,30);
insert into Medicine_info values(101,205,"Dolo 650","Tablet",33.6,30,15,0);
insert into Medicine_info values(101,206,"Dolo 500","Tablet",13.8,10,15,0);
insert into Medicine_info values(101,207,"Dabur Honitus Syrup","Syrup",106,30,0,100);
insert into Medicine_info values(101,208,"Dabur Honitus logenzes","Tablet",16.3,10,10,0);
insert into Medicine_info values(102,202,"Ondem 4","Tablet",56,30,10,0);
insert into Medicine_info values(102,209,"Aspirin","Tablet",60,50,10,0);
insert into Medicine_info values(102,205,"Dolo 650","Tablet",33.6,30,15,0);
insert into Medicine_info values(102,207,"Dabur Honitus Syrup","Syrup",106,20,0,100);
insert into Medicine_info values(102,201,"Crocin","Tablet",33.6,50,15,0);
insert into Medicine_info values(103,202,"Ondem 4","Tablet",56,33,10,0);
insert into Medicine_info values(103,201,"Crocin","Tablet",33.6,20,15,0);
insert into Medicine_info values(103,201,"Crocin","Tablet",33.6,20,15,0);
insert into Medicine_info values(103,210,"Aprise D3","Tablet",100,30,15,0);
insert into Medicine_info values(103,213,"Combiflam","Tablet",50,30,15,0);
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,46 @@
# Buffer-5.0
Buffer is a Data Structures and Algorithms Project Series, in which students can participate as mentees in teams of 2-4. Under Buffer 5.0, the themes on which students can create a project are:
# Team: GenCoders

## Problem Statement: A pharmaceutical digital platform connects consumers with suppliers to efficiently purchase drugs, matching them based on location and availability.

Theme: Public welfare.
Project Description:
Our module has 3 login interfaces: Customer, Supplier and Admin.
The user can login or sign up into their respective interface(all validations are provided accordingly).
The customer data is stored in a hash-table with the customer id as key and the remaining attributes as value.
Once the user has logged in as a customer he/she will be provided with the following options:
1.Order Medicines
2.Recent Orders
3.Update details
4.LogOut

Medicines will be supplied to the customer from the nearest supplier based on location(which we have considered to be the pin code of the customer).
As soon as the bill is generated for the purchased medicines the order is added to queue(pending deliveries) on the supplier side.
Supplier:-
The supplier and medicine data is stored in the database. The supplier is provided with the following options:
1.Add Medicines
2.Update Medicine Quantity
3.Delete Medicine
4.Display All Information
5.Pending Deliveries
6.Deliver Orders
7.LogOut


Admin:
The admin can access the supplier as well as the customer side by performing the following functionalities:
1.Display All Customers
2.Add Customer
3.Delete Customer
4.Search Customer

1.Display All Suppliers
2.Add Supplier
3.Delete Supplier

link to video -> https://drive.google.com/file/d/1dPj-VcT47tKX8VtPRidTC-50xyGlEGT0/view?usp=sharing

link to report 2 -> https://drive.google.com/file/d/1sCN6_qFo8gJaChjZvyvDIEFKfen8C99s/view?usp=sharing

link to report 1->https://drive.google.com/file/d/1PGv7bP0duYYs3o56u1uUgA0MwugRxKLr/view?usp=sharing

1. Public Welfare
2. Tourism
3. College level applications
4. Custom Data structure

This repository is created for all the teams to be able to upload their final project source code. While submitting, note that all the submission guidelines given are followed, and all the files are named appropiately. Also ensure that your README file contains the links of the progress reports and the drive link containing the video of the project.
Binary file added mysql-connector-java-8.0.11(1).jar
Binary file not shown.
106 changes: 106 additions & 0 deletions src/Buffer_Pharma/Admin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package Buffer_Pharma;

import java.util.*;
class Admin {
static Customer cobj=new Customer();
static Supplier sobj=new Supplier();
static Db mdb=new Db();
static Scanner sc=new Scanner(System.in);
static String username="admin";
static String password="admin123";

void Amain() {
boolean login=false;
boolean logout=false;

do {
System.out.println("=================== Admin ===================");
while(!login) {
System.out.println("Username: ");
String user=sc.next();
if(user.equals(username)) {
System.out.println("Enter Password: ");
String pass=sc.next();
if(pass.equals(password)){
System.out.println("SignIn Successful!");
login=true;
}
else {
System.out.println("Password is Incorrect");
}
}
else {
System.out.println("Username does not exist");
}
}

int ch,m;
do {
System.out.println("-----Menu-----");
System.out.println("1.Customer Side\n2.Supplier Side\n3.LogOut");
m=sc.nextInt();
switch(m) {
case 1:
do {
System.out.println("1.Display All Customers\n2.Add Customer\n3.Delete Customer\n4.Search Customer\n5.Back");
ch=sc.nextInt();
switch(ch){
case 1:
cobj.Cacc_displayall();;
break;

case 2:
cobj.Cacc_insert();
break;

case 3:
cobj.Cacc_delete();;
break;

case 4:
System.out.print("Enter Cid");
String tcid=sc.next();
CustomerAcc c=cobj.Cacc_search(tcid);
cobj.Ccurr_display(c);
break;
}
}
while(ch!=5);
break;

case 2:
do {
System.out.println("1.Display All Suppliers\n2.Add Supplier\n3.Delete Supplier\n4.Back");
ch=sc.nextInt();
switch(ch){
case 1:
sobj.Sacc_displayAll();
break;

case 2:
sobj.Sacc_insert();
break;

case 3:
sobj.Sacc_delete();
break;
}

}
while(ch!=4);
break;

case 3:
System.out.println("\nLogging out...\n");
System.out.print("\nReturning to main page...\n");
login=false;
logout=true;
break;
}
}
while(login);
}
while(!logout);
}
}

Loading