Exemplo n.º 1
0
 def get_app(self):
     schedule = db.view_user_schedule(int(slw.user_info[0]), "Employee")
     cur_time = ("{}{}{}{}".format(self.time.tm_year, self.time.tm_mon,
                                   self.time.tm_mday, self.time.tm_hour))
     if (len(schedule) != 0):
         self.appointment.text = ""
         for app in schedule:
             # run a check to see if app has passed
             temp = app[0].split("-")
             temp2 = app[1].split(":")
             app_time = 0
             if (int(temp2[0]) < 10):
                 app_time = "{}{}{}{}0".format(temp[0], temp[1], temp[2],
                                               temp2[0])
             else:
                 app_time = "{}{}{}{}".format(temp[0], temp[1], temp[2],
                                              temp2[0])
             if (int(cur_time) < int(app_time)):
                 line1 = "Date: {}".format(app[0])
                 line2 = "Time: {}".format(app[1])
                 line3 = "Description: {}".format(app[3])
                 line4 = "With: {} {}".format(app[4], app[5])
                 self.appointment.text += "{}\n {}:00\n {}\n {}\n\n".format(
                     line1, line2, line3, line4)
     else:
         self.appointment.text = "No Current Appointments."
Exemplo n.º 2
0
    def get_app(self):
        pos_x = .15
        pos_y = .65
        schedule = db.view_user_schedule(int(plw.user_info[0]), "Patient")
        row = 0
        if (len(schedule) != 0):
            self.appointment.text = ""
            for app in schedule:
                self.button = Button(
                    id=str(row),
                    text="Date: {}\nTime:{}:00\nFor A: {}".format(
                        app[0], app[1], app[3]),
                    font_size=16,
                    size_hint=(.225, .125),
                    pos_hint={
                        "x": pos_x,
                        "y": pos_y
                    })
                self.button.bind(on_release=self.delete_app)
                self.add_widget(self.button)
                self.buttons.append(self.button)
                pos_y -= .15
                row += 1

                if (pos_y <= .1):
                    pos_x += .25
                    pos_y = .65
        else:
            self.appointment.text = "No Appointments Scheduled"
Exemplo n.º 3
0
 def employee_scheduled(self, j, i, day, emp):
     dr_id = db.get_emp_id(emp)
     list = db.view_user_schedule(dr_id, "Employee")
     # build a string of format "2019-10-30-11" "yr-mon-day-strTime"
     cur_app = ("{}-{}-{}-{}".format(self.year, self.month, day, j + 8))
     # if the employee is busy
     for app in list:
         dr_schedule = ("{}-{}".format(app[0], app[1]))
         if (dr_schedule == cur_app):
             return False
     return True
Exemplo n.º 4
0
 def patient_scheduled(self, j, i, day):
     # dr_id = db.get_pat_id(pwl.user_info[0])
     list = db.view_user_schedule(plw.user_info[0], "Patient")
     # build a string of format "2019-10-30-11" "yr-mon-day-startTime"
     cur_app = ("{}-{}-{}-{}".format(self.year, self.month, day, j + 8))
     i = 0
     for app in list:
         pat_schedule = ("{}-{}".format(app[0], app[1]))
         i += 1
         if (pat_schedule == cur_app):
             return False
     return True
    def get_app(self):
        for item in self.labels:
            self.remove_widget(item)

        pos_x = .035
        pos_y = .75
        schedule = db.view_user_schedule(int(plw.user_info[0]), "Patient")
        cur_time = ("{}{}{}{}".format(self.time.tm_year, self.time.tm_mon,
                                      self.time.tm_mday, self.time.tm_hour))
        if (len(schedule) != 0):
            self.appointment.text = ""
            for app in schedule:
                temp = app[0].split("-")
                temp2 = app[1].split(":")
                app_time = 0
                if (int(temp2[0]) < 10):
                    app_time = "{}{}{}0{}".format(temp[0], temp[1], temp[2],
                                                  temp2[0])
                else:
                    app_time = "{}{}{}{}".format(temp[0], temp[1], temp[2],
                                                 temp2[0])
                if (int(app_time) >= int(cur_time)):
                    line1 = "Date: {}".format(app[0])
                    line2 = "Time: {}".format(app[1])
                    line3 = "Description: {}".format(app[3])
                    line4 = "Dr: {} {}\nHygienist: {} {}".format(
                        app[4], app[5], app[6], app[7])
                    line5 = "{}\n{}:00\n{}\n{}\n\n".format(
                        line1, line2, line3, line4)

                    lbl = Label(text=line5,
                                font_size=15,
                                pos_hint={
                                    "x": pos_x,
                                    "y": pos_y
                                },
                                size_hint=(.225, .125),
                                color=[255, 255, 255, 1])
                    self.labels.append(lbl)

                    self.add_widget(lbl)
                    pos_y -= .185
                    if ((len(self.labels)) % 3 == 0):
                        pos_x += .225
                        pos_y = .75
        else:
            self.appointment.text = "No Appointments Scheduled"
Exemplo n.º 6
0
    def get_app(self):
        global email, type

        for item in self.labels:
            self.remove_widget(item)
        pos_x = .035
        pos_y = .75
        schedule = []
        if type == "Patient":
            schedule = db.view_user_schedule(int(db.get_pat_id(email)),
                                             "Patient")

            cur_time = ("{}{}{}{}".format(self.time.tm_year, self.time.tm_mon,
                                          self.time.tm_mday,
                                          self.time.tm_hour))
            if (len(schedule) != 0):
                self.appointment.text = ""
                for app in schedule:
                    temp = app[0].split("-")
                    temp2 = app[1].split(":")
                    app_time = 0
                    if (int(temp2[0]) < 10):
                        app_time = "{}{}{}0{}".format(temp[0], temp[1],
                                                      temp[2], temp2[0])
                    else:
                        app_time = "{}{}{}{}".format(temp[0], temp[1], temp[2],
                                                     temp2[0])
                    if (int(app_time) >= int(cur_time)):
                        line1 = "Date: {}".format(app[0])
                        line2 = "Time: {}".format(app[1])
                        line3 = "Description: {}".format(app[3])
                        line4 = "Dr: {} {}\nHygienist: {} {}".format(
                            app[4], app[5], app[6], app[7])
                        line5 = "{}\n{}:00\n{}\n{}\n\n".format(
                            line1, line2, line3, line4)

                        lbl = Label(text=line5,
                                    font_size=15,
                                    pos_hint={
                                        "x": pos_x,
                                        "y": pos_y
                                    },
                                    size_hint=(.225, .125),
                                    color=[255, 255, 255, 1])
                        self.labels.append(lbl)

                        self.add_widget(lbl)
                        pos_y -= .185
                        if ((len(self.labels)) % 3 == 0):
                            pos_x += .225
                            pos_y = .75
            else:
                self.appointment.text = "No Appointments Scheduled"
        else:
            schedule = db.view_user_schedule(int(db.get_emp_id(email)),
                                             "Employee")
            cur_time = ("{}{}{}{}".format(self.time.tm_year, self.time.tm_mon,
                                          self.time.tm_mday,
                                          self.time.tm_hour))
            if (len(schedule) != 0):
                self.appointment.text = ""
                for app in schedule:
                    # run a check to see if app has passed
                    temp = app[0].split("-")
                    temp2 = app[1].split(":")
                    app_time = 0
                    if (int(temp2[0]) < 10):
                        app_time = "{}{}{}{}0".format(temp[0], temp[1],
                                                      temp[2], temp2[0])
                    else:
                        app_time = "{}{}{}{}".format(temp[0], temp[1], temp[2],
                                                     temp2[0])
                    if (int(cur_time) < int(app_time)):
                        line1 = "Date: {}".format(app[0])
                        line2 = "Time: {}".format(app[1])
                        line3 = "Description: {}".format(app[3])
                        line4 = "With: {} {}".format(app[4], app[5])
                        self.appointment.text += "{}\n {}:00\n {}\n {}\n\n".format(
                            line1, line2, line3, line4)
            else:
                self.appointment.text = "No Current Appointments."