import gspread
import time
from oauth2client.service_account import ServiceAccountCredentials

scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('OdevSistemi-fc12779d1a3c.json', scope)
client = gspread.authorize(creds)


def birASinifi(tarih):

    sheet = client.open('1-A Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    #sheet.update_acell('H6', '')
    #sheet.update_acell('B8', '')
    #sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    #sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    #sheet.update_acell('G8', '')
    #sheet.update_acell('H8', '')
    #sheet.update_acell('B12', '')
    #sheet.update_acell('C12', '')
    #sheet.update_acell('D12', '')
    #sheet.update_acell('E12', '')
    #sheet.update_acell('F12', '')
    #sheet.update_acell('G12', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("1-A Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def birBSinifi(tarih):

    sheet = client.open('1-B Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    #sheet.update_acell('H6', '')
    #sheet.update_acell('B8', '')
    #sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    #sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    #sheet.update_acell('G8', '')
    #sheet.update_acell('H8', '')
    #sheet.update_acell('B12', '')
    #sheet.update_acell('C12', '')
    #sheet.update_acell('D12', '')
    #sheet.update_acell('E12', '')
    #sheet.update_acell('F12', '')
    #sheet.update_acell('G12', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("1-B Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def ikiASinifi(tarih):

    sheet = client.open('2-A Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    #sheet.update_acell('H6', '')
    sheet.update_acell('B8', '')
    sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    sheet.update_acell('G8', '')
    #sheet.update_acell('H8', '')
    #sheet.update_acell('B12', '')
    #sheet.update_acell('C12', '')
    sheet.update_acell('D10', '')
    #sheet.update_acell('E12', '')
    sheet.update_acell('F10', '')
    sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("2-A Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def ikiBSinifi(tarih):

    sheet = client.open('2-B Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    #sheet.update_acell('H6', '')
    sheet.update_acell('B8', '')
    sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    sheet.update_acell('G8', '')
    #sheet.update_acell('H8', '')
    #sheet.update_acell('B12', '')
    #sheet.update_acell('C12', '')
    sheet.update_acell('D10', '')
    #sheet.update_acell('E12', '')
    sheet.update_acell('F10', '')
    sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("2-B Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def ucASinifi(tarih):

    sheet = client.open('3-A Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    #sheet.update_acell('H6', '')
    sheet.update_acell('B8', '')
    sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    sheet.update_acell('G8', '')
    #sheet.update_acell('H8', '')
    sheet.update_acell('B10', '')
    #sheet.update_acell('C12', '')
    sheet.update_acell('D10', '')
    #sheet.update_acell('E12', '')
    sheet.update_acell('F10', '')
    #sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("3-A Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def ucBSinifi(tarih):

    sheet = client.open('3-B Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    #sheet.update_acell('H6', '')
    sheet.update_acell('B8', '')
    sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    sheet.update_acell('G8', '')
    #sheet.update_acell('H8', '')
    sheet.update_acell('B10', '')
    #sheet.update_acell('C12', '')
    sheet.update_acell('D10', '')
    #sheet.update_acell('E12', '')
    sheet.update_acell('F10', '')
    #sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("3-B Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def ucCSinifi(tarih):

    sheet = client.open('3-C Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    sheet.update_acell('H6', '')
    sheet.update_acell('B8', '')
    sheet.update_acell('C8', '')
    sheet.update_acell('D8', '')
    sheet.update_acell('E8', '')
    sheet.update_acell('F8', '')
    sheet.update_acell('G8', '')
    sheet.update_acell('H8', '')
    sheet.update_acell('B10', '')
    sheet.update_acell('C10', '')
    sheet.update_acell('D10', '')
    #sheet.update_acell('E12', '')
    sheet.update_acell('F10', '')
    #sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("3-C Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def dortASinifi(tarih):

    sheet = client.open('4-A Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    sheet.update_acell('H6', '')
    sheet.update_acell('B9', '')
    sheet.update_acell('C9', '')
    sheet.update_acell('D9', '')
    sheet.update_acell('E9', '')
    sheet.update_acell('F9', '')
    sheet.update_acell('G9', '')
    #sheet.update_acell('H9', '')
    sheet.update_acell('B12', '')
    sheet.update_acell('C12', '')
    sheet.update_acell('D12', '')
    sheet.update_acell('E12', '')
    sheet.update_acell('F12', '')
    #sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("4-A Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def dortBSinifi(tarih):

    sheet = client.open('4-B Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    #sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    sheet.update_acell('H6', '')
    sheet.update_acell('B9', '')
    sheet.update_acell('C9', '')
    #sheet.update_acell('D9', '')
    sheet.update_acell('E9', '')
    sheet.update_acell('F9', '')
    sheet.update_acell('G9', '')
    #sheet.update_acell('H9', '')
    sheet.update_acell('B12', '')
    sheet.update_acell('C12', '')
    sheet.update_acell('D12', '')
    sheet.update_acell('E12', '')
    sheet.update_acell('F12', '')
    #sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("4-B Sınıfı Çalışma Programı Sıfırlanmıştır")
    time.sleep(20)
def dortCSinifi(tarih):

    sheet = client.open('4-C Sınıfı Haftalık Çalışma Programı').sheet1

    sheet.update_acell('H2', tarih)
    sheet.update_acell('B6','')
    sheet.update_acell('C6', '')
    sheet.update_acell('D6', '')
    sheet.update_acell('E6', '')
    sheet.update_acell('F6', '')
    sheet.update_acell('G6', '')
    sheet.update_acell('H6', '')
    sheet.update_acell('B9', '')
    sheet.update_acell('C9', '')
    sheet.update_acell('D9', '')
    sheet.update_acell('E9', '')
    sheet.update_acell('F9', '')
    sheet.update_acell('G9', '')
    #sheet.update_acell('H9', '')
    sheet.update_acell('B12', '')
    sheet.update_acell('C12', '')
    sheet.update_acell('D12', '')
    sheet.update_acell('E12', '')
    sheet.update_acell('F12', '')
    #sheet.update_acell('G10', '')
    #sheet.update_acell('H12', '')
    #sheet.update_acell('B15', '')
    #sheet.update_acell('C15', '')
    #sheet.update_acell('D15', '')
    #sheet.update_acell('E15', '')
    #sheet.update_acell('F15', '')
    #sheet.update_acell('G15', '')
    #sheet.update_acell('H15', '')
    #sheet.update_acell('H18', '')

    print("4-C Sınıfı Çalışma Programı Sıfırlanmıştır")






def sifirla():
    tarih=input("Ödev Tarihini Giriniz: \n")
    birASinifi(tarih)
    birBSinifi(tarih)
    ikiASinifi(tarih)
    ikiBSinifi(tarih)
    ucASinifi(tarih)
    ucBSinifi(tarih)
    ucCSinifi(tarih)
    dortASinifi(tarih)
    dortBSinifi(tarih)
    dortCSinifi(tarih)

    print("Tüm çalışma programı güncellemeleri bitmiştir. Lütfen kontol etmeyi ihmal etmeyiniz")

sifirla()


