Skip to content
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
Binary file removed __pycache__/app.cpython-39.pyc
Binary file not shown.
7 changes: 6 additions & 1 deletion database/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ ENGINE = InnoDB;
INSERT INTO `Skiers` (`Name`, `Address`, `Phone`, `Email`, `Ability`) VALUES
('Alice Alpine', '123 Powder Lane', '5550101', 'alice@example.com', 'Expert'),
('Bob Backcountry', '456 Mogul Way', '5550202', 'bob@example.com', 'Intermediate'),
('Charlie Carver', '789 Shred St', '5550303', 'charlie@example.com', 'Beginner');
('Charlie Carver', '789 Shred St', '5550303', 'charlie@example.com', 'Beginner'),
('Diana Downhill', '321 Summit Rd', '5550404', 'diana@example.com', 'Advanced'),
('Ethan Edge', '654 Glacier Ave', '5550505', 'ethan@example.com', 'Intermediate'),
('Fiona Freestyle', '987 Aspen Dr', '5550606', 'fiona@example.com', 'Expert'),
('George Glide', '147 Snowcap Blvd', '5550707', 'george@example.com', 'Beginner'),
('Hannah Heli', '258 Powder Peak Ln', '5550808', 'hannah@example.com', 'Advanced');


-- -----------------------------------------------------
Expand Down
Binary file modified database/__pycache__/db_connector.cpython-39.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions database/db_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Database credentials
host = 'classmysql.engr.oregonstate.edu'
user = 'cs340_greemich'
passwd = 'sEXIbytwvBfr'
db = 'cs340_greemich'
user = 'cs340_alyoois'
passwd = '8857'
db = 'cs340_alyoois'

def connectDB(host = host, user = user, passwd = passwd, db = db):
'''
Expand Down
24 changes: 24 additions & 0 deletions database/sp_passes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@


-- create pass sp
DROP PROCEDURE IF EXISTS sp_CreatePass;

DELIMITER //
create procedure sp_CreatePass(
in p_type varchar(45),
in p_purchaseDate DATETIME,
in p_expirationDate DATETIME,
in p_skiers_SkierID INT,
out p_id int)
BEGIN
insert INTO Passes(Type, PurchaseDate, ExpirationDate, Skiers_SkierID)
VALUES (p_type, p_purchaseDate, p_expirationDate, p_skiers_SkierID);

-- store the pass id of the last inserted row:
select last_insert_id() into p_id;
-- then display id of the last inserted row
select last_insert_id() AS 'p_new_id';


END //
DELIMITER ;
2 changes: 1 addition & 1 deletion templates/passes.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{% endfor %}
</tbody>
</table>
-- create passes -------------------------------------------------------------

<h2>Create Passes</h2>


Expand Down