@Override
		public void actionPerformed(ActionEvent e) {
			if(e.getSource() == btnSelectDate){
				int index = dateOfVisitcomboBox.getSelectedIndex();
				currVisit = visits.get(index);
				prescs = parent.getHandler().getVisitPrescriptions(visits.get(index).getPatUsername(), visits.get(index).getDocUsername(),
						visits.get(index).getDateOfVisit());
				model.removeAllElements();
				for(Prescription p : prescs) {
					model.addElement(p.getMedicineName());
				}
				
			}
			else if(e.getSource() == btnSelect){
				//Populate fields based off the selected date
				String medName = (String) medList.getSelectedValue();
				Prescription pres = new Prescription();
				for(Prescription p : prescs) {
					if(p.getMedicineName().equals(medName)) {
						pres = p;
						break;
					}
				}
				int duration = pres.getDuration();
				Integer monthsD = duration/30;
				Integer daysD = duration%30;
				Integer dosage = pres.getDosage();
				medNameTextField.setText(medName);
				dosageTextField.setText(dosage.toString());
				monthsTextField.setText(monthsD.toString());
				daysTextField.setText(daysD.toString());
				Doctor doc = parent.getHandler().getDoctor(currVisit.getDocUsername());
				String name = "Dr. " + doc.getfName() + " " + doc.getlName();
				consultingDoctorTextField.setText(name);

			}
			else if (e.getSource() == btnAddToCart) {
			
				int durationz = Integer.parseInt(monthsTextField.getText()) * 30 + Integer.parseInt(daysTextField.getText());
				Prescription prescription = new Prescription(username, consultingDoctorTextField.getText(), (String)dateOfVisitcomboBox.getSelectedItem() , medNameTextField.getText(), Integer.parseInt(dosageTextField.getText()), durationz, "", "No");
				cart.add(prescription);
				model2.addElement(prescription.getMedicineName());
			
			} 
			else if (e.getSource() == btnCheckout) {
				if(!cart.isEmpty()) {
					PaymentInfoPanel pip = new PaymentInfoPanel(parent, username, cart);
					parent.getContentPane().add(pip);
					CardLayout cl = (CardLayout) parent.getContentPane().getLayout();
					cl.next(parent.getContentPane());
				} else {
					JOptionPane.showMessageDialog(null, "Cart is Empty.");
				}
			}
			else if(e.getSource() == btnBack){
				//Go Back
				CardLayout cl = (CardLayout) parent.getContentPane().getLayout();
				parent.getContentPane().remove(parent.getContentPane().getComponents().length-1);
				cl.last(parent.getContentPane());
			}
		}