Skip to content

Commit

Permalink
OK, I lied. THIS is ready for beta.
Browse files Browse the repository at this point in the history
  • Loading branch information
clj13001 committed Apr 7, 2017
1 parent 8c4f20b commit 7324e4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WebContent/html/webpages/ticketAdminRedirect.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int locationid = Integer.parseInt(locationidstr);
//add form was submitted
if(request.getParameter("approve") != null){
TicketQueries.acceptTicket(ticketid,deviceid,locationid);
TicketQueries.acceptTicket(ticketid,deviceid,locationid,navsso);
}
//modify form was submitted
if(request.getParameter("reject") != null){
Expand Down
4 changes: 2 additions & 2 deletions src/database/TicketQueries.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public Ticket[] getTickets() throws SQLException, ClassNotFoundException{
return tickets;
}

public static void acceptTicket(int ticketid, int deviceid, int locationid) throws SQLException, ClassNotFoundException{
public static void acceptTicket(int ticketid, int deviceid, int locationid, int sso) throws SQLException, ClassNotFoundException{
System.getenv("VCAP_SERVICES");
Class.forName("com.mysql.jdbc.Driver");
Connection connect = DriverManager.getConnection("jdbc:mysql://us-cdbr-iron-east-04.cleardb.net/ad_15a989204c2ff8a?user=b372dfe7409692&password=74f6e317", "b372dfe7409692", "74f6e317");
Statement stmt = connect.createStatement();
stmt.executeUpdate("UPDATE ticket SET Status = \"Approved\" WHERE Ticket_ID = " + ticketid);
stmt.executeUpdate("UPDATE devices SET Ticket_ID = " + ticketid + ", Status = \"Shipped\", Renter = 10, Location = " + locationid + " WHERE Device_ID = " + deviceid);
stmt.executeUpdate("UPDATE devices SET Ticket_ID = " + ticketid + ", Status = \"Shipped\", Renter = " + sso + ", Location = " + locationid + " WHERE Device_ID = " + deviceid);
stmt.close();
connect.close();
}
Expand Down

0 comments on commit 7324e4e

Please sign in to comment.