GitLab now enforces expiry dates on tokens that originally had no set expiration date. Those tokens were given an expiration date of one year later. Please review your personal access tokens, project access tokens, and group access tokens to ensure you are aware of upcoming expirations. Administrators of GitLab can find more information on how to identify and mitigate interruption in our documentation.
mycursor.execute(f"SELECT SUM(KuantitasJarakMotor) FROM carbon_trace WHERE ID_Customer = {id_cred}")
defsumMotorbikeEmission(self,period):
if(period=="Weekly"):
dateBegin,dateLast=self.getRangeDate()
mycursor.execute(f"SELECT SUM(KuantitasJarakMotor) FROM carbon_trace WHERE ID_Customer = {id_cred} AND TanggalInput BETWEEN '{dateBegin}' AND '{dateLast}'")
elif(period=="Monthly"):
today=date.today()
mycursor.execute(f"SELECT SUM(KuantitasJarakMotor) FROM carbon_trace WHERE ID_Customer = {id_cred} AND MONTH(TanggalInput) = {today.month} AND YEAR(TanggalInput) = {today.year}")
val=mycursor.fetchall()
val=mycursor.fetchall()
ifval[0][0]isNone:
return0
returnval[0][0]
returnval[0][0]
defsumElectricityEmission(self):
defsumElectricityEmission(self,period):
mycursor.execute(f"SELECT SUM(KuantitasListrik) FROM carbon_trace WHERE ID_Customer = {id_cred}")
if(period=="Weekly"):
dateBegin,dateLast=self.getRangeDate()
mycursor.execute(f"SELECT SUM(KuantitasListrik) FROM carbon_trace WHERE ID_Customer = {id_cred} AND TanggalInput BETWEEN '{dateBegin}' AND '{dateLast}'")
elif(period=="Monthly"):
today=date.today()
mycursor.execute(f"SELECT SUM(KuantitasListrik) FROM carbon_trace WHERE ID_Customer = {id_cred} AND MONTH(TanggalInput) = {today.month} AND YEAR(TanggalInput) = {today.year}")