from django import forms
from django.contrib.auth.models import User
from django.forms import DateInput
from . import models

MODE_CHOICES = [
    ('0', 'Select Work'),
    ('1', 'Engine Repairering'),
    ('2', 'Painting')
]

MODE_DEMAND = [
    ('', 'Select Product'),
    ('1', 'CALTEX Delo Gold Ultra')
]


class DateInput(forms.DateInput):
    input_type = 'date'

class MyForm4(forms.Form):
    Productid = forms.IntegerField(label="Select Product", required=True, widget=forms.Select(choices=MODE_DEMAND))
    inputdate = forms.DateField(widget=DateInput)


class MyForm(forms.Form):
 customerid  = forms.IntegerField(label="Select Work To be Done", widget=forms.Select(choices=MODE_CHOICES))



class MyForm2(forms.Form):
 UserName = forms.CharField(label='User Name')
 Password = forms.CharField(label='Password', widget=forms.PasswordInput)


MODE_CHOICES2 = [
    ('-', 'Select Availability'),
    ('Yes', 'Available'),
    ('No', 'Not Available')
]

class MyForm3(forms.Form):
 StaffID = forms.CharField(label='Enter Staff ID' )
 Availability = forms.CharField(label="Select Availability", widget=forms.Select(choices=MODE_CHOICES2))


#Demand Forecast
 class RequestForm(forms.ModelForm):
     class Meta:
         model = models.PastData
         fields = ['inputdate']

 class MyFormNew(forms.Form):
     inputdate = forms.DateField(widget=DateInput)
